diff src/fns.c @ 5000:44d7bde26046

fix compile errors, fix revert-buffer bug on binary/Latin 1 files, Mule-ize some files -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-02-07 Ben Wing <ben@xemacs.org> * emacs.c (make_argc_argv): Cast to Wexttext * to fix compile error. * nt.c (init_user_info): Cast to CIbyte * to fix compile error. * nt.c (open_unc_volume): To fix compile error, store pathname into an Extbyte * variable then write into the dest, casting to LPTSTR. * emacs.c (debug_can_access_memory): * fileio.c (Fmake_temp_name): * fileio.c (a_write): * fns.c: * fns.c (check_losing_bytecode): * fns.c (plists_differ): * fns.c (internal_equal_trapping_problems): * fns.c (base64_value_to_char): * fns.c (base64_conversion_error): * fns.c (STORE_BYTE): * fns.c (vars_of_fns): * lisp.h: * nt.c (init_user_info): * nt.c (mswindows_readdir): * nt.c (mswindows_executable_type): Replace raw `char *' or `unsigned char *' with characterized type -- Rawbyte, Binbyte, Boolbyte, Ibyte or Ascbyte. This should fix at least one real bug -- in a_write(), the "speedy insert" code that checks for an unchanged region declared the file data read in as char[] but then compared the value to an Ichar. Hence, any chars in the range 128-255 would always appear changed -- in particular, this algorithm would fail completely with binary data.
author Ben Wing <ben@xemacs.org>
date Sun, 07 Feb 2010 05:21:40 -0600
parents 48b63cd88a21
children 714d854d00e9
line wrap: on
line diff
--- a/src/fns.c	Sat Feb 06 04:27:47 2010 -0600
+++ b/src/fns.c	Sun Feb 07 05:21:40 2010 -0600
@@ -1,6 +1,6 @@
 /* Random utility Lisp functions.
    Copyright (C) 1985, 86, 87, 93, 94, 95 Free Software Foundation, Inc.
-   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing.
+   Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2010 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -218,7 +218,7 @@
 #endif /* LOSING_BYTECODE */
 
 void
-check_losing_bytecode (const char *function, Lisp_Object seq)
+check_losing_bytecode (const Ascbyte *function, Lisp_Object seq)
 {
   if (COMPILED_FUNCTIONP (seq))
     signal_ferror_with_frob
@@ -1988,7 +1988,7 @@
   int eqp = (depth == -1);	/* -1 as depth means use eq, not equal. */
   int la, lb, m, i, fill;
   Lisp_Object *keys, *vals;
-  char *flags;
+  Boolbyte *flags;
   Lisp_Object rest;
 
   if (NILP (a) && NILP (b))
@@ -2003,7 +2003,7 @@
   fill = 0;
   keys  = alloca_array (Lisp_Object, m);
   vals  = alloca_array (Lisp_Object, m);
-  flags = alloca_array (char, m);
+  flags = alloca_array (Boolbyte, m);
 
   /* First extract the pairs from A. */
   for (rest = a; !NILP (rest); rest = XCDR (XCDR (rest)))
@@ -2810,7 +2810,7 @@
 
 int
 internal_equal_trapping_problems (Lisp_Object warning_class,
-				  const char *warning_string,
+				  const Ascbyte *warning_string,
 				  int flags,
 				  struct call_trapping_problems_result *p,
 				  int retval,
@@ -3725,7 +3725,7 @@
   (IS_ASCII (Character) && base64_char_to_value[Character] >= 0)
 
 /* Table of characters coding the 64 values.  */
-static char base64_value_to_char[64] =
+static Ascbyte base64_value_to_char[64] =
 {
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',	/*  0- 9 */
   'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',	/* 10-19 */
@@ -3772,11 +3772,11 @@
    The octets are divided into 6 bit chunks, which are then encoded into
    base64 characters.  */
 
-static DECLARE_DOESNT_RETURN (base64_conversion_error (const char *,
+static DECLARE_DOESNT_RETURN (base64_conversion_error (const Ascbyte *,
 						       Lisp_Object));
 
 static DOESNT_RETURN
-base64_conversion_error (const char *reason, Lisp_Object frob)
+base64_conversion_error (const Ascbyte *reason, Lisp_Object frob)
 {
   signal_error (Qbase64_conversion_error, reason, frob);
 }
@@ -3859,7 +3859,7 @@
 } while (1)
 
 #define STORE_BYTE(pos, val, ccnt) do {					\
-  pos += set_itext_ichar (pos, (Ichar)((unsigned char)(val)));	\
+  pos += set_itext_ichar (pos, (Ichar)((Binbyte)(val)));		\
   ++ccnt;								\
 } while (0)
 
@@ -4204,7 +4204,7 @@
 The directory separator in search paths, as a string.
 */ );
   {
-    char c = SEPCHAR;
+    Ascbyte c = SEPCHAR;
     Vpath_separator = make_string ((Ibyte *) &c, 1);
   }
 }