changeset 3452:551c008d3777

[xemacs-hg @ 2006-06-14 06:10:08 by aidan] Fix snprintf problems with the Win32 build.
author aidan
date Wed, 14 Jun 2006 06:10:10 +0000
parents 2a674bf63a86
children bb29309e0e62
files src/ChangeLog src/mule-ccl.c src/unicode.c
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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  <kehoea@parhasard.net>
+
+	* 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  <kehoea@parhasard.net>
 
 	* charset.h:
--- 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.  */
--- 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