# HG changeset patch # User aidan # Date 1150265410 0 # Node ID 551c008d37772f1e44287e6b6229de4d8491d34e # Parent 2a674bf63a86ff08ad2d8a1554a624d0829b5d2f [xemacs-hg @ 2006-06-14 06:10:08 by aidan] Fix snprintf problems with the Win32 build. diff -r 2a674bf63a86 -r 551c008d3777 src/ChangeLog --- a/src/ChangeLog Tue Jun 13 21:50:52 2006 +0000 +++ b/src/ChangeLog Wed Jun 14 06:10:10 2006 +0000 @@ -1,3 +1,12 @@ +2006-06-14 Aidan Kehoe + + * mule-ccl.c: + Don't declare ccl-program as a symbol here, leave that to + general-slots.h. + * unicode.c (unicode_to_ichar): + Use qxesprintf, not snprintf, change some types to allow + complilation on Win32. + 2006-06-03 Aidan Kehoe * charset.h: diff -r 2a674bf63a86 -r 551c008d3777 src/mule-ccl.c --- a/src/mule-ccl.c Tue Jun 13 21:50:52 2006 +0000 +++ b/src/mule-ccl.c Wed Jun 14 06:10:10 2006 +0000 @@ -39,8 +39,9 @@ Lisp_Object Vfont_ccl_encoder_alist; /* This symbol is a property which associates with ccl program vector. - Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */ -Lisp_Object Qccl_program; + Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. + Moved to general-slots.h. */ +/* Lisp_Object Qccl_program; */ /* These symbols are properties which associate with code conversion map and their ID respectively. */ diff -r 2a674bf63a86 -r 551c008d3777 src/unicode.c --- a/src/unicode.c Tue Jun 13 21:50:52 2006 +0000 +++ b/src/unicode.c Wed Jun 14 06:10:10 2006 +0000 @@ -1112,7 +1112,7 @@ if (NILP (Vcurrent_jit_charset) || (-1 == (i = get_free_codepoint(Vcurrent_jit_charset)))) { - Ascbyte setname[32]; + Ibyte setname[32]; Lisp_Object charset_descr = build_string ("Mule charset for otherwise unknown Unicode code points."); Lisp_Object charset_regr = build_string("iso10646-1"); @@ -1125,8 +1125,12 @@ last_jit_charset_final = 0x30; } - snprintf(setname, sizeof(setname), - "jit-ucs-charset-%d", number_of_jit_charsets++); + /* Assertion added partly because our Win32 layer doesn't + support snprintf; with this, we're sure it won't overflow + the buffer. */ + assert(100 > number_of_jit_charsets); + + qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets++); /* Aside: GCPROing here would be overkill according to the FSF's philosophy. make-charset cannot currently GC, but is intended @@ -1136,7 +1140,7 @@ GCPRO2 (charset_descr, charset_regr); Vcurrent_jit_charset = Fmake_charset - (intern(setname), charset_descr, + (intern((const CIbyte *)setname), charset_descr, /* Set encode-as-utf-8 to t, to have this character set written using UTF-8 escapes in escape-quoted and ctext. This sidesteps the fact that our internal character -> Unicode