diff options
| author | Paul Eggert | 2014-04-05 12:30:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-04-05 12:30:36 -0700 |
| commit | faa521749378dbfd97f49a0e5c48f6da2ce1ddba (patch) | |
| tree | d470dbfa3328aaeffe5cba065103e237238a13be /src/font.c | |
| parent | 1b058e42524353c9ff133ea330876ed2d39b6515 (diff) | |
| download | emacs-faa521749378dbfd97f49a0e5c48f6da2ce1ddba.tar.gz emacs-faa521749378dbfd97f49a0e5c48f6da2ce1ddba.zip | |
Prefer 'ARRAYELTS (x)' to 'sizeof x / sizeof *x'.
* alloc.c (memory_full):
* charset.c (syms_of_charset):
* doc.c (Fsnarf_documentation):
* emacs.c (main):
* font.c (BUILD_STYLE_TABLE):
* keyboard.c (make_lispy_event):
* profiler.c (setup_cpu_timer):
* xgselect.c (xg_select):
* xterm.c (record_event, STORE_KEYSYM_FOR_DEBUG):
Use ARRAYELTS.
* font.c (FONT_PROPERTY_TABLE_SIZE): Remove.
Replace the only use with ARRAYELTS (font_property_table).
* xfaces.c (DIM): Remove. All uses replaced by ARRAYELTS.
Diffstat (limited to 'src/font.c')
| -rw-r--r-- | src/font.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/font.c b/src/font.c index e99141bfe5c..5faf477fa90 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -662,10 +662,6 @@ static const struct | |||
| 662 | { &QCotf, font_prop_validate_otf } | 662 | { &QCotf, font_prop_validate_otf } |
| 663 | }; | 663 | }; |
| 664 | 664 | ||
| 665 | /* Size (number of elements) of the above table. */ | ||
| 666 | #define FONT_PROPERTY_TABLE_SIZE \ | ||
| 667 | ((sizeof font_property_table) / (sizeof *font_property_table)) | ||
| 668 | |||
| 669 | /* Return an index number of font property KEY or -1 if KEY is not an | 665 | /* Return an index number of font property KEY or -1 if KEY is not an |
| 670 | already known property. */ | 666 | already known property. */ |
| 671 | 667 | ||
| @@ -674,7 +670,7 @@ get_font_prop_index (Lisp_Object key) | |||
| 674 | { | 670 | { |
| 675 | int i; | 671 | int i; |
| 676 | 672 | ||
| 677 | for (i = 0; i < FONT_PROPERTY_TABLE_SIZE; i++) | 673 | for (i = 0; i < ARRAYELTS (font_property_table); i++) |
| 678 | if (EQ (key, *font_property_table[i].key)) | 674 | if (EQ (key, *font_property_table[i].key)) |
| 679 | return i; | 675 | return i; |
| 680 | return -1; | 676 | return -1; |
| @@ -4935,8 +4931,7 @@ If the named font is not yet loaded, return nil. */) | |||
| 4935 | #endif | 4931 | #endif |
| 4936 | 4932 | ||
| 4937 | 4933 | ||
| 4938 | #define BUILD_STYLE_TABLE(TBL) \ | 4934 | #define BUILD_STYLE_TABLE(TBL) build_style_table (TBL, ARRAYELTS (TBL)) |
| 4939 | build_style_table ((TBL), sizeof TBL / sizeof (struct table_entry)) | ||
| 4940 | 4935 | ||
| 4941 | static Lisp_Object | 4936 | static Lisp_Object |
| 4942 | build_style_table (const struct table_entry *entry, int nelement) | 4937 | build_style_table (const struct table_entry *entry, int nelement) |