emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

int/Lisp_Object mixup


From: Stefan Monnier
Subject: int/Lisp_Object mixup
Date: Fri, 21 Feb 2003 18:43:53 -0500

Maybe it's just a coincidence, but I just noticed an unusually
large number of int/Lisp_Object mixups, so people please be
careful.  I needed the following patch in order to get the
code to compile with -DENABLE_CHECKING.

BTW, even though the code compiles, it still fails to dump:

LC_ALL=C ./temacs -batch -l loadup dump
Loading loadup.el (source)...
Using load-path (/home/monnier/work/trunk-emacs/lisp)
Loading byte-run...
Loading emacs-lisp/backquote...
Loading subr...
Loading version.el (source)...
Loading widget...
Loading custom...
Loading map-ynp...
Loading env...
Loading cus-start...
Loading international/mule...
Loading international/mule-conf.el (source)...
Invalid function: 0


        Stefan


Index: src/xfaces.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v
retrieving revision 1.270
diff -u -r1.270 xfaces.c
--- src/xfaces.c        19 Feb 2003 06:14:55 -0000      1.270
+++ src/xfaces.c        21 Feb 2003 23:41:35 -0000
@@ -2463,7 +2463,7 @@
 #endif
 
   if (nfonts < 0 && CONSP (lfonts))
-    num_fonts = Flength (lfonts);
+    num_fonts = XFASTINT (Flength (lfonts));
   
   /* Make a copy of the font names we got from X, and
      split them into fields.  */
Index: src/macros.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macros.c,v
retrieving revision 1.52
diff -u -r1.52 macros.c
--- src/macros.c        12 Feb 2003 11:08:24 -0000      1.52
+++ src/macros.c        21 Feb 2003 23:41:35 -0000
@@ -119,8 +119,8 @@
        {
          Lisp_Object c;
          c = Faref (current_kboard->Vlast_kbd_macro, make_number (i));
-         if (cvt && INTEGERP (c) && (XINT (c) & 0x80))
-           c = XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
+         if (cvt && NATNUMP (c) && (XFASTINT (c) & 0x80))
+           XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
          current_kboard->kbd_macro_buffer[i] = c;
        }
 
Index: src/fns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fns.c,v
retrieving revision 1.333
diff -u -r1.333 fns.c
--- src/fns.c   17 Feb 2003 00:32:12 -0000      1.333
+++ src/fns.c   21 Feb 2003 23:41:36 -0000
@@ -3490,7 +3490,7 @@
             it is consistent with CODESET?  If not, what to do?  */
          Faset (v, make_number (i),
                 code_convert_string_norecord (val, Vlocale_coding_system,
-                                              Qnil));
+                                              0));
        }
       return v;
     }
@@ -3508,7 +3508,7 @@
          str = nl_langinfo (months[i]);
          val = make_unibyte_string (str, strlen (str));
          p->contents[i] =
-           code_convert_string_norecord (val, Vlocale_coding_system, Qnil);
+           code_convert_string_norecord (val, Vlocale_coding_system, 0);
        }
       XSETVECTOR (val, p);
       return val;
Index: src/alloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/alloc.c,v
retrieving revision 1.292
diff -u -r1.292 alloc.c
--- src/alloc.c 4 Feb 2003 14:03:11 -0000       1.292
+++ src/alloc.c 21 Feb 2003 23:41:36 -0000
@@ -4381,9 +4381,9 @@
   EMACS_GET_TIME (t2);
   EMACS_SUB_TIME (t3, t2, t1);
   if (FLOATP (Vgc_elapsed))
-    XSETFLOAT (Vgc_elapsed, make_float (XFLOAT_DATA (Vgc_elapsed) +
-                                       EMACS_SECS (t3) +
-                                       EMACS_USECS (t3) * 1.0e-6));
+    Vgc_elapsed = make_float (XFLOAT_DATA (Vgc_elapsed) +
+                             EMACS_SECS (t3) +
+                             EMACS_USECS (t3) * 1.0e-6);
   gcs_done++;
 
   return Flist (sizeof total / sizeof *total, total);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]