diff options
| author | Stefan Monnier | 2022-04-19 08:25:19 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-04-19 08:25:19 -0400 |
| commit | 71005decb4fb447635d7b2367104dd18bdfa64ac (patch) | |
| tree | fc7e4a31bfaab4fa9a4fc269b0a2d027704b8773 /src | |
| parent | 4478f915374a497ec20b51f873ed1b65f22c27dc (diff) | |
| download | emacs-71005decb4fb447635d7b2367104dd18bdfa64ac.tar.gz emacs-71005decb4fb447635d7b2367104dd18bdfa64ac.zip | |
Fix GCC warnings when CHECK_LISP_OBJECT_TYPE
* src/lisp.h (lisp_h_Qni): New macro.
(DEFUN): Use it.
* src/alloc.c (syms_of_alloc): Use it.
* src/bytecode.c (Fbyte_code): Fix Lisp_Object/int mixup.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/bytecode.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 14 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/alloc.c b/src/alloc.c index 4fc40445874..b9712859c38 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -7837,14 +7837,14 @@ N should be nonnegative. */); | |||
| 7837 | static union Aligned_Lisp_Subr Swatch_gc_cons_threshold = | 7837 | static union Aligned_Lisp_Subr Swatch_gc_cons_threshold = |
| 7838 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, | 7838 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, |
| 7839 | { .a4 = watch_gc_cons_threshold }, | 7839 | { .a4 = watch_gc_cons_threshold }, |
| 7840 | 4, 4, "watch_gc_cons_threshold", {0}, 0}}; | 7840 | 4, 4, "watch_gc_cons_threshold", {0}, lisp_h_Qnil}}; |
| 7841 | XSETSUBR (watcher, &Swatch_gc_cons_threshold.s); | 7841 | XSETSUBR (watcher, &Swatch_gc_cons_threshold.s); |
| 7842 | Fadd_variable_watcher (Qgc_cons_threshold, watcher); | 7842 | Fadd_variable_watcher (Qgc_cons_threshold, watcher); |
| 7843 | 7843 | ||
| 7844 | static union Aligned_Lisp_Subr Swatch_gc_cons_percentage = | 7844 | static union Aligned_Lisp_Subr Swatch_gc_cons_percentage = |
| 7845 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, | 7845 | {{{ PSEUDOVECTOR_FLAG | (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) }, |
| 7846 | { .a4 = watch_gc_cons_percentage }, | 7846 | { .a4 = watch_gc_cons_percentage }, |
| 7847 | 4, 4, "watch_gc_cons_percentage", {0}, 0}}; | 7847 | 4, 4, "watch_gc_cons_percentage", {0}, lisp_h_Qnil}}; |
| 7848 | XSETSUBR (watcher, &Swatch_gc_cons_percentage.s); | 7848 | XSETSUBR (watcher, &Swatch_gc_cons_percentage.s); |
| 7849 | Fadd_variable_watcher (Qgc_cons_percentage, watcher); | 7849 | Fadd_variable_watcher (Qgc_cons_percentage, watcher); |
| 7850 | } | 7850 | } |
diff --git a/src/bytecode.c b/src/bytecode.c index 62464986160..74b7d16affd 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -325,7 +325,7 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 325 | the original unibyte form. */ | 325 | the original unibyte form. */ |
| 326 | bytestr = Fstring_as_unibyte (bytestr); | 326 | bytestr = Fstring_as_unibyte (bytestr); |
| 327 | } | 327 | } |
| 328 | Lisp_Object fun = CALLN (Fmake_byte_code, 0, bytestr, vector, maxdepth); | 328 | Lisp_Object fun = CALLN (Fmake_byte_code, Qnil, bytestr, vector, maxdepth); |
| 329 | return exec_byte_code (fun, 0, 0, NULL); | 329 | return exec_byte_code (fun, 0, 0, NULL); |
| 330 | } | 330 | } |
| 331 | 331 | ||
diff --git a/src/lisp.h b/src/lisp.h index fb43bfa791b..75f369f5245 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -342,6 +342,7 @@ typedef EMACS_INT Lisp_Word; | |||
| 342 | # define lisp_h_XIL(i) (i) | 342 | # define lisp_h_XIL(i) (i) |
| 343 | # define lisp_h_XLP(o) ((void *) (uintptr_t) (o)) | 343 | # define lisp_h_XLP(o) ((void *) (uintptr_t) (o)) |
| 344 | # endif | 344 | # endif |
| 345 | # define lisp_h_Qnil 0 | ||
| 345 | #else | 346 | #else |
| 346 | # if LISP_WORDS_ARE_POINTERS | 347 | # if LISP_WORDS_ARE_POINTERS |
| 347 | # define lisp_h_XLI(o) ((EMACS_INT) (o).i) | 348 | # define lisp_h_XLI(o) ((EMACS_INT) (o).i) |
| @@ -352,6 +353,7 @@ typedef EMACS_INT Lisp_Word; | |||
| 352 | # define lisp_h_XIL(i) ((Lisp_Object) {i}) | 353 | # define lisp_h_XIL(i) ((Lisp_Object) {i}) |
| 353 | # define lisp_h_XLP(o) ((void *) (uintptr_t) (o).i) | 354 | # define lisp_h_XLP(o) ((void *) (uintptr_t) (o).i) |
| 354 | # endif | 355 | # endif |
| 356 | # define lisp_h_Qnil {0} | ||
| 355 | #endif | 357 | #endif |
| 356 | 358 | ||
| 357 | #define lisp_h_PSEUDOVECTORP(a,code) \ | 359 | #define lisp_h_PSEUDOVECTORP(a,code) \ |
| @@ -3173,12 +3175,12 @@ CHECK_SUBR (Lisp_Object x) | |||
| 3173 | 3175 | ||
| 3174 | /* This version of DEFUN declares a function prototype with the right | 3176 | /* This version of DEFUN declares a function prototype with the right |
| 3175 | arguments, so we can catch errors with maxargs at compile-time. */ | 3177 | arguments, so we can catch errors with maxargs at compile-time. */ |
| 3176 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ | 3178 | #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ |
| 3177 | SUBR_SECTION_ATTRIBUTE \ | 3179 | SUBR_SECTION_ATTRIBUTE \ |
| 3178 | static union Aligned_Lisp_Subr sname = \ | 3180 | static union Aligned_Lisp_Subr sname = \ |
| 3179 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ | 3181 | {{{ PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ |
| 3180 | { .a ## maxargs = fnname }, \ | 3182 | { .a ## maxargs = fnname }, \ |
| 3181 | minargs, maxargs, lname, {intspec}, 0}}; \ | 3183 | minargs, maxargs, lname, {intspec}, lisp_h_Qnil}}; \ |
| 3182 | Lisp_Object fnname | 3184 | Lisp_Object fnname |
| 3183 | 3185 | ||
| 3184 | /* defsubr (Sname); | 3186 | /* defsubr (Sname); |