diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-08-14 10:45:25 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-08-14 10:45:25 -0700 |
commit | f5d9e83a70335308d5c6d18d62a7ac94f4bd431c (patch) | |
tree | fc8adfdc499d17f2cc5afba12a70a157d7463258 /lib-src/make-docfile.c | |
parent | 4abcdac823a757bffc204f5eb074eb09ad69e58a (diff) |
Use bool for Emacs Lisp booleans.
This is more natural, and on my platform (GCC 4.7.1 x86-64) it
makes Emacs's text size .03% smaller and presumably a bit faster.
* admin/merge-gnulib (GNULIB_MODULES): Add stdbool. This documents a
new direct dependency; stdbool was already being used indirectly
via other gnulib modules.
* lib-src/make-docfile.c (enum global_type): Sort values roughly in
decreasing alignment, except put functions last.
(compare_globals): Use this new property of enum global_type.
(write_globals): Use bool, not int, for booleans.
* src/lisp.h: Include <stdbool.h>.
(struct Lisp_Boolfwd, defvar_bool):
* src/lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
* src/regex.c [!emacs]: Include <stdbool.h>.
(false, true): Remove; <stdbool.h> does this for us now.
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r-- | lib-src/make-docfile.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index dafb7c0afd..2654387fb3 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -545,14 +545,15 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) putc (')', out); } -/* The types of globals. */ +/* The types of globals. These are sorted roughly in decreasing alignment + order to avoid allocation gaps, except that functions are last. */ enum global_type { - FUNCTION, + INVALID, + LISP_OBJECT, EMACS_INTEGER, BOOLEAN, - LISP_OBJECT, - INVALID + FUNCTION, }; /* A single global. */ @@ -601,13 +602,8 @@ compare_globals (const void *a, const void *b) const struct global *ga = a; const struct global *gb = b; - if (ga->type == FUNCTION) - { - if (gb->type != FUNCTION) - return 1; - } - else if (gb->type == FUNCTION) - return -1; + if (ga->type != gb->type) + return ga->type - gb->type; return strcmp (ga->name, gb->name); } @@ -634,7 +630,7 @@ write_globals (void) type = "EMACS_INT"; break; case BOOLEAN: - type = "int"; + type = "bool"; break; case LISP_OBJECT: type = "Lisp_Object"; |