register a static, add nul terminator, fix imperative update of byte strings
svn: r1173
This commit is contained in:
parent
b2eb9b8e03
commit
ddd7b66b61
|
@ -10,7 +10,10 @@ BSTR schemeToBSTR (Scheme_Object * obj);
|
||||||
static
|
static
|
||||||
LPWSTR schemeUCS4ToUTF16 (const mzchar * buffer, int nchars, long * result_length)
|
LPWSTR schemeUCS4ToUTF16 (const mzchar * buffer, int nchars, long * result_length)
|
||||||
{
|
{
|
||||||
return scheme_ucs4_to_utf16 (buffer, 0, nchars, NULL, 0, result_length, 0);
|
LPWSTR s;
|
||||||
|
s = scheme_ucs4_to_utf16 (buffer, 0, nchars, NULL, 0, result_length, 1);
|
||||||
|
s[*result_length] = 0;
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -33,11 +36,9 @@ LPWSTR schemeByteStringToWideChar (Scheme_Object * obj, long * result_length)
|
||||||
static
|
static
|
||||||
LPWSTR schemeCharStringToWideChar (Scheme_Object * obj, long * result_length)
|
LPWSTR schemeCharStringToWideChar (Scheme_Object * obj, long * result_length)
|
||||||
{
|
{
|
||||||
return
|
return schemeUCS4ToUTF16(SCHEME_CHAR_STR_VAL (obj),
|
||||||
scheme_ucs4_to_utf16 (SCHEME_CHAR_STR_VAL (obj),
|
SCHEME_CHAR_STRLEN_VAL (obj),
|
||||||
0, SCHEME_CHAR_STRLEN_VAL (obj),
|
result_length);
|
||||||
NULL, 0,
|
|
||||||
result_length, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -190,7 +191,9 @@ void updateSchemeByteStringFromBSTR (Scheme_Object * obj, BSTR bstr)
|
||||||
scheme_signal_error ("String updated with longer string");
|
scheme_signal_error ("String updated with longer string");
|
||||||
|
|
||||||
long ncodes;
|
long ncodes;
|
||||||
scheme_utf8_encode_to_buffer_len (string, nchars, NULL, 0, &ncodes);
|
scheme_utf8_encode_to_buffer_len (string, nchars,
|
||||||
|
SCHEME_BYTE_STR_VAL(obj), SCHEME_BYTE_STRLEN_VAL(obj),
|
||||||
|
&ncodes);
|
||||||
SCHEME_BYTE_STRLEN_VAL(obj) = ncodes;
|
SCHEME_BYTE_STRLEN_VAL(obj) = ncodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ HANDLE eventSinkMutex;
|
||||||
const CLSID emptyClsId;
|
const CLSID emptyClsId;
|
||||||
|
|
||||||
static Scheme_Object *mx_omit_obj; /* omitted argument placeholder */
|
static Scheme_Object *mx_omit_obj; /* omitted argument placeholder */
|
||||||
static Scheme_Object *mx_name; /* module name */
|
|
||||||
|
|
||||||
/* Normally false, but when true, mysterx will marshal any scheme */
|
/* Normally false, but when true, mysterx will marshal any scheme */
|
||||||
/* object it would otherwise fail to marshal by simply sticking */
|
/* object it would otherwise fail to marshal by simply sticking */
|
||||||
|
@ -4847,8 +4846,10 @@ Scheme_Object *scheme_initialize (Scheme_Env *env)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
Scheme_Object *mx_fun;
|
Scheme_Object *mx_fun;
|
||||||
int i;
|
int i;
|
||||||
|
Scheme_Object *mx_name;
|
||||||
|
|
||||||
scheme_register_extension_global (&mx_omit_obj, sizeof (mx_omit_obj));
|
scheme_register_extension_global (&mx_omit_obj, sizeof (mx_omit_obj));
|
||||||
|
scheme_register_extension_global (&scheme_date_type, sizeof (scheme_date_type));
|
||||||
|
|
||||||
// should not be necessary, but sometimes
|
// should not be necessary, but sometimes
|
||||||
// this variable is not 0'd out - bug in VC++ or MzScheme?
|
// this variable is not 0'd out - bug in VC++ or MzScheme?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user