diff options
| author | Paul Eggert | 2016-09-15 15:25:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-09-15 15:55:30 -0700 |
| commit | 0bbf00c7f3de9c75372100afc3039d7f5c8a7587 (patch) | |
| tree | 79fccec02fc3a9ceb9e04c16ae2117f725910276 /src/image.c | |
| parent | 8f4b6a20bfec96086845b2f7161e121b1e41b4ad (diff) | |
| download | emacs-0bbf00c7f3de9c75372100afc3039d7f5c8a7587.tar.gz emacs-0bbf00c7f3de9c75372100afc3039d7f5c8a7587.zip | |
Prefer now-standard int width macros
* src/data.c (ULL_WIDTH):
* src/lisp.h (EMACS_INT_WIDTH, BITS_PER_BITS_WORD):
* src/lread.c (read_integer):
* src/term.c (produce_glyphless_glyph):
* src/xterm.c (x_send_scroll_bar_event):
Use *_WIDTH macros instead of CHAR_BIT * sizeof.
* src/data.c (ULL_WIDTH): Rename from BITS_PER_ULL for consistency
with the *_WIDTH standard macros. All uses changed.
* src/gmalloc.c (INT_BIT): Remove. All uses replaced with INT_WIDTH.
* src/lisp.h (EMACS_INT_WIDTH): Rename from BITS_PER_EMACS_INT
for consistency with the *_WIDTH standard macros. All uses changed.
(BITS_PER_CHAR): Remove; all uses replaced by CHAR_BIT. This must
be the same as CHAR_WIDTH and avoids confusion with Elisp
char-width, which counts columns not bits.
(BITS_PER_SHORT): Remove; all uses replaced by SHRT_WIDTH.
(BITS_PER_LONG): Remove; all uses replaced by LONG_WIDTH.
* src/lread.c: Do not include limits.h since CHAR_BIT is no longer
used directly.
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c index f15c2788967..53ec3873632 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2525,7 +2525,7 @@ xbm_image_p (Lisp_Object object) | |||
| 2525 | if (STRINGP (elt)) | 2525 | if (STRINGP (elt)) |
| 2526 | { | 2526 | { |
| 2527 | if (SCHARS (elt) | 2527 | if (SCHARS (elt) |
| 2528 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) | 2528 | < (width + CHAR_BIT - 1) / CHAR_BIT) |
| 2529 | return 0; | 2529 | return 0; |
| 2530 | } | 2530 | } |
| 2531 | else if (BOOL_VECTOR_P (elt)) | 2531 | else if (BOOL_VECTOR_P (elt)) |
| @@ -2540,7 +2540,7 @@ xbm_image_p (Lisp_Object object) | |||
| 2540 | else if (STRINGP (data)) | 2540 | else if (STRINGP (data)) |
| 2541 | { | 2541 | { |
| 2542 | if (SCHARS (data) | 2542 | if (SCHARS (data) |
| 2543 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) | 2543 | < (width + CHAR_BIT - 1) / CHAR_BIT * height) |
| 2544 | return 0; | 2544 | return 0; |
| 2545 | } | 2545 | } |
| 2546 | else if (BOOL_VECTOR_P (data)) | 2546 | else if (BOOL_VECTOR_P (data)) |
| @@ -3089,7 +3089,7 @@ xbm_load (struct frame *f, struct image *img) | |||
| 3089 | { | 3089 | { |
| 3090 | int i; | 3090 | int i; |
| 3091 | char *p; | 3091 | char *p; |
| 3092 | int nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR; | 3092 | int nbytes = (img->width + CHAR_BIT - 1) / CHAR_BIT; |
| 3093 | 3093 | ||
| 3094 | SAFE_NALLOCA (bits, nbytes, img->height); | 3094 | SAFE_NALLOCA (bits, nbytes, img->height); |
| 3095 | p = bits; | 3095 | p = bits; |
| @@ -3113,7 +3113,7 @@ xbm_load (struct frame *f, struct image *img) | |||
| 3113 | int nbytes, i; | 3113 | int nbytes, i; |
| 3114 | /* Windows mono bitmaps are reversed compared with X. */ | 3114 | /* Windows mono bitmaps are reversed compared with X. */ |
| 3115 | invertedBits = bits; | 3115 | invertedBits = bits; |
| 3116 | nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR; | 3116 | nbytes = (img->width + CHAR_BIT - 1) / CHAR_BIT; |
| 3117 | SAFE_NALLOCA (bits, nbytes, img->height); | 3117 | SAFE_NALLOCA (bits, nbytes, img->height); |
| 3118 | for (i = 0; i < nbytes; i++) | 3118 | for (i = 0; i < nbytes; i++) |
| 3119 | bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]); | 3119 | bits[i] = XBM_BIT_SHUFFLE (invertedBits[i]); |