aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/data.c b/src/data.c
index 76a54547a5d..211a64661ac 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1075,18 +1075,18 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1075{ 1075{
1076 struct specbinding *p; 1076 struct specbinding *p;
1077 1077
1078 for (p = specpdl_ptr - 1; p >= specpdl; p--) 1078 for (p = specpdl_ptr; p > specpdl; )
1079 if (p->func == NULL 1079 if ((--p)->func == NULL
1080 && CONSP (p->symbol)) 1080 && CONSP (p->symbol))
1081 { 1081 {
1082 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol)); 1082 struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol));
1083 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS); 1083 eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
1084 if (symbol == let_bound_symbol 1084 if (symbol == let_bound_symbol
1085 && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer) 1085 && XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer)
1086 break; 1086 return 1;
1087 } 1087 }
1088 1088
1089 return p >= specpdl; 1089 return 0;
1090} 1090}
1091 1091
1092static int 1092static int
@@ -1094,11 +1094,11 @@ let_shadows_global_binding_p (Lisp_Object symbol)
1094{ 1094{
1095 struct specbinding *p; 1095 struct specbinding *p;
1096 1096
1097 for (p = specpdl_ptr - 1; p >= specpdl; p--) 1097 for (p = specpdl_ptr; p > specpdl; p)
1098 if (p->func == NULL && EQ (p->symbol, symbol)) 1098 if ((--p)->func == NULL && EQ (p->symbol, symbol))
1099 break; 1099 return 1;
1100 1100
1101 return p >= specpdl; 1101 return 0;
1102} 1102}
1103 1103
1104/* Store the value NEWVAL into SYMBOL. 1104/* Store the value NEWVAL into SYMBOL.
@@ -2064,7 +2064,7 @@ or a byte-code object. IDX starts at 0. */)
2064 if (STRINGP (array)) 2064 if (STRINGP (array))
2065 { 2065 {
2066 int c; 2066 int c;
2067 EMACS_INT idxval_byte; 2067 ptrdiff_t idxval_byte;
2068 2068
2069 if (idxval < 0 || idxval >= SCHARS (array)) 2069 if (idxval < 0 || idxval >= SCHARS (array))
2070 args_out_of_range (array, idx); 2070 args_out_of_range (array, idx);
@@ -2156,7 +2156,8 @@ bool-vector. IDX starts at 0. */)
2156 2156
2157 if (STRING_MULTIBYTE (array)) 2157 if (STRING_MULTIBYTE (array))
2158 { 2158 {
2159 EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes; 2159 ptrdiff_t idxval_byte, nbytes;
2160 int prev_bytes, new_bytes;
2160 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; 2161 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
2161 2162
2162 nbytes = SBYTES (array); 2163 nbytes = SBYTES (array);
@@ -2167,7 +2168,7 @@ bool-vector. IDX starts at 0. */)
2167 if (prev_bytes != new_bytes) 2168 if (prev_bytes != new_bytes)
2168 { 2169 {
2169 /* We must relocate the string data. */ 2170 /* We must relocate the string data. */
2170 EMACS_INT nchars = SCHARS (array); 2171 ptrdiff_t nchars = SCHARS (array);
2171 unsigned char *str; 2172 unsigned char *str;
2172 USE_SAFE_ALLOCA; 2173 USE_SAFE_ALLOCA;
2173 2174
@@ -2474,9 +2475,9 @@ If the base used is not 10, STRING is always parsed as integer. */)
2474 else 2475 else
2475 { 2476 {
2476 CHECK_NUMBER (base); 2477 CHECK_NUMBER (base);
2477 b = XINT (base); 2478 if (! (2 <= XINT (base) && XINT (base) <= 16))
2478 if (b < 2 || b > 16)
2479 xsignal1 (Qargs_out_of_range, base); 2479 xsignal1 (Qargs_out_of_range, base);
2480 b = XINT (base);
2480 } 2481 }
2481 2482
2482 p = SSDATA (string); 2483 p = SSDATA (string);
@@ -2724,7 +2725,7 @@ Both must be integers or markers. */)
2724 CHECK_NUMBER_COERCE_MARKER (x); 2725 CHECK_NUMBER_COERCE_MARKER (x);
2725 CHECK_NUMBER_COERCE_MARKER (y); 2726 CHECK_NUMBER_COERCE_MARKER (y);
2726 2727
2727 if (XFASTINT (y) == 0) 2728 if (XINT (y) == 0)
2728 xsignal0 (Qarith_error); 2729 xsignal0 (Qarith_error);
2729 2730
2730 XSETINT (val, XINT (x) % XINT (y)); 2731 XSETINT (val, XINT (x) % XINT (y));