diff src/fileio.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 3c3c1d139863
children 788c38f20376
line wrap: on
line diff
--- a/src/fileio.c	Sat Feb 06 04:27:47 2010 -0600
+++ b/src/fileio.c	Sun Feb 07 05:21:40 2010 -0600
@@ -618,7 +618,7 @@
 */
        (prefix))
 {
-  static const char tbl[64] =
+  static const Ascbyte tbl[64] =
   {
     'A','B','C','D','E','F','G','H',
     'I','J','K','L','M','N','O','P',
@@ -1803,7 +1803,7 @@
 {
   /* This function can call Lisp.  GC checked 2000-07-28 ben */
   int ifd, ofd, n;
-  char buf[16 * 1024];
+  Rawbyte buf[16 * 1024];
   struct stat st, out_st;
   Lisp_Object handler;
   int speccount = specpdl_depth ();
@@ -3045,7 +3045,7 @@
 			     !NILP (visit) ? INSDEL_NO_LOCKING : 0);
       else
 	{
-	  char buffer[1 << 14];
+	  Rawbyte buffer[1 << 14];
 	  Charbpos same_at_start = BUF_BEGV (buf);
 	  Charbpos same_at_end = BUF_ZV (buf);
 	  int overlap;
@@ -3743,7 +3743,7 @@
 {
   Lisp_Object tem;
   int nextpos;
-  unsigned char largebuf[A_WRITE_BATCH_SIZE];
+  Ibyte largebuf[A_WRITE_BATCH_SIZE];
   Lstream *instr = XLSTREAM (instream);
   Lstream *outstr = XLSTREAM (outstream);