* alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
[bpt/emacs.git] / src / bytecode.c
index 74cf401..b6ac6c5 100644 (file)
@@ -433,9 +433,9 @@ If the third argument is incorrect, Emacs may crash.  */)
 
 Lisp_Object
 exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
-               Lisp_Object args_template, int nargs, Lisp_Object *args)
+               Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args)
 {
-  int count = SPECPDL_INDEX ();
+  ptrdiff_t count = SPECPDL_INDEX ();
 #ifdef BYTE_CODE_METER
   int this_op = 0;
   int prev_op;
@@ -444,7 +444,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
   /* Lisp_Object v1, v2; */
   Lisp_Object *vectorp;
 #ifdef BYTE_CODE_SAFE
-  int const_length;
+  ptrdiff_t const_length;
   Lisp_Object *stacke;
   int bytestr_length;
 #endif
@@ -464,7 +464,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 
   CHECK_STRING (bytestr);
   CHECK_VECTOR (vector);
-  CHECK_NUMBER (maxdepth);
+  CHECK_NATNUM (maxdepth);
 
 #ifdef BYTE_CODE_SAFE
   const_length = ASIZE (vector);
@@ -502,14 +502,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 
   if (INTEGERP (args_template))
     {
-      int at = XINT (args_template);
+      EMACS_INT at = XINT (args_template);
       int rest = at & 128;
       int mandatory = at & 127;
-      int nonrest = at >> 8;
+      EMACS_INT nonrest = at >> 8;
       eassert (mandatory <= nonrest);
       if (nargs <= nonrest)
        {
-         int i;
+         EMACS_INT i;
          for (i = 0 ; i < nargs; i++, args++)
            PUSH (*args);
          if (nargs < mandatory)
@@ -528,7 +528,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
        }
       else if (rest)
        {
-         int i;
+         ptrdiff_t i;
          for (i = 0 ; i < nonrest; i++, args++)
            PUSH (*args);
          PUSH (Flist (nargs - nonrest, args));
@@ -941,7 +941,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 
        case Bsave_window_excursion: /* Obsolete since 24.1.  */
          {
-           register int count1 = SPECPDL_INDEX ();
+           register ptrdiff_t count1 = SPECPDL_INDEX ();
            record_unwind_protect (Fset_window_configuration,
                                   Fcurrent_window_configuration (Qnil));
            BEFORE_POTENTIAL_GC ();
@@ -1005,13 +1005,14 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
        case Bnth:
          {
            Lisp_Object v1, v2;
+           EMACS_INT n;
            BEFORE_POTENTIAL_GC ();
            v1 = POP;
            v2 = TOP;
            CHECK_NUMBER (v2);
-           op = XINT (v2);
+           n = XINT (v2);
            immediate_quit = 1;
-           while (--op >= 0 && CONSP (v1))
+           while (--n >= 0 && CONSP (v1))
              v1 = XCDR (v1);
            immediate_quit = 0;
            TOP = CAR (v1);
@@ -1638,14 +1639,15 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
            if (CONSP (TOP))
              {
                /* Exchange args and then do nth.  */
+               EMACS_INT n;
                BEFORE_POTENTIAL_GC ();
                v2 = POP;
                v1 = TOP;
                CHECK_NUMBER (v2);
                AFTER_POTENTIAL_GC ();
-               op = XINT (v2);
+               n = XINT (v2);
                immediate_quit = 1;
-               while (--op >= 0 && CONSP (v1))
+               while (--n >= 0 && CONSP (v1))
                  v1 = XCDR (v1);
                immediate_quit = 0;
                TOP = CAR (v1);
@@ -1838,8 +1840,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
 void
 syms_of_bytecode (void)
 {
-  Qbytecode = intern_c_string ("byte-code");
-  staticpro (&Qbytecode);
+  DEFSYM (Qbytecode, "byte-code");
 
   defsubr (&Sbyte_code);
 
@@ -1861,8 +1862,7 @@ integer, it is incremented each time that symbol's function is called.  */);
 
   byte_metering_on = 0;
   Vbyte_code_meter = Fmake_vector (make_number (256), make_number (0));
-  Qbyte_code_meter = intern_c_string ("byte-code-meter");
-  staticpro (&Qbyte_code_meter);
+  DEFSYM (Qbyte_code_meter, "byte-code-meter");
   {
     int i = 256;
     while (i--)