commit 04355cb50485f109aabb8e9a815412fbb0d1e750 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Thu Dec 1 00:32:54 2016 -0800 * src/lisp.h (LISP_INITIALLY_ZERO): Remove. All uses replaced by LISPSYM_INITIALLY. diff --git a/src/ftfont.c b/src/ftfont.c index 1ae3f88..17fe668 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -508,7 +508,7 @@ static int ftfont_variation_glyphs (struct font *, int c, struct font_driver ftfont_driver = { - LISP_INITIALLY_ZERO, /* Qfreetype */ + LISPSYM_INITIALLY (Qfreetype), 0, /* case insensitive */ ftfont_get_cache, ftfont_list, @@ -2799,6 +2799,5 @@ syms_of_ftfont (void) staticpro (&ft_face_cache); ft_face_cache = Qnil; - ftfont_driver.type = Qfreetype; register_font_driver (&ftfont_driver, NULL); } diff --git a/src/lisp.h b/src/lisp.h index 6fbedd3..b6c4668 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -551,8 +551,6 @@ typedef EMACS_INT Lisp_Object; #define LISP_INITIALLY(i) (i) enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = false }; #endif /* CHECK_LISP_OBJECT_TYPE */ - -#define LISP_INITIALLY_ZERO LISP_INITIALLY (0) /* Forward declarations. */ diff --git a/src/macfont.m b/src/macfont.m index 3af9edc..b3a2fb8 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -1665,7 +1665,7 @@ static int macfont_variation_glyphs (struct font *, int c, static struct font_driver macfont_driver = { - LISP_INITIALLY_ZERO, /* Qmac_ct */ + LISPSYM_INITIALLY (Qmac_ct), 0, /* case insensitive */ macfont_get_cache, macfont_list, @@ -4059,7 +4059,6 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no { /* Core Text, for macOS. */ DEFSYM (Qmac_ct, "mac-ct"); - macfont_driver.type = Qmac_ct; register_font_driver (&macfont_driver, NULL); /* The font property key specifying the font design destination. The diff --git a/src/nsfont.m b/src/nsfont.m index 389d0ed..c4c3c8d 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -626,7 +626,7 @@ static int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, struct font_driver nsfont_driver = { - 0, /* Qns */ + LISPSYM_INITIALLY (Qns), 1, /* case sensitive */ nsfont_get_cache, nsfont_list, @@ -1524,7 +1524,6 @@ - (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val void syms_of_nsfont (void) { - nsfont_driver.type = Qns; register_font_driver (&nsfont_driver, NULL); DEFSYM (Qcondensed, "condensed"); DEFSYM (Qexpanded, "expanded"); diff --git a/src/w32font.c b/src/w32font.c index 4d15cff..e966024 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -2535,7 +2535,7 @@ w32font_filter_properties (Lisp_Object font, Lisp_Object alist) struct font_driver w32font_driver = { - LISP_INITIALLY_ZERO, /* Qgdi */ + LISPSYM_INITIALLY (Qgdi), false, /* case insensitive */ w32font_get_cache, w32font_list, @@ -2746,7 +2746,6 @@ versions of Windows) characters. */); defsubr (&Sx_select_font); - w32font_driver.type = Qgdi; register_font_driver (&w32font_driver, NULL); } diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 5f91b50..960ee06 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -1135,7 +1135,7 @@ otf_features (HDC context, const char *table) struct font_driver uniscribe_font_driver = { - LISP_INITIALLY_ZERO, /* Quniscribe */ + LISPSYM_INITIALLY (Quniscribe), 0, /* case insensitive */ w32font_get_cache, uniscribe_list, @@ -1182,7 +1182,6 @@ syms_of_w32uniscribe (void) if (!uniscribe) return; - uniscribe_font_driver.type = Quniscribe; uniscribe_available = 1; register_font_driver (&uniscribe_font_driver, NULL); diff --git a/src/xfont.c b/src/xfont.c index c2b7317..ccb8f07 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -129,7 +129,7 @@ static int xfont_check (struct frame *, struct font *); struct font_driver xfont_driver = { - LISP_INITIALLY_ZERO, /* Qx */ + LISPSYM_INITIALLY (Qx), false, /* case insensitive */ xfont_get_cache, xfont_list, @@ -1120,6 +1120,5 @@ syms_of_xfont (void) xfont_scripts_cache = CALLN (Fmake_hash_table, QCtest, Qequal); staticpro (&xfont_scratch_props); xfont_scratch_props = Fmake_vector (make_number (8), Qnil); - xfont_driver.type = Qx; register_font_driver (&xfont_driver, NULL); } commit fccd7d3c0606080c047e16d94490d83fc68dabde Author: Paul Eggert Date: Thu Dec 1 00:17:20 2016 -0800 Make Cairo safer for --enable-gcc-warnings * src/image.c (xcolor_to_argb32, pbm_load, jpeg_load_body, gif_load): Avoid overflow warnings about ‘0xff << 24’. (xpm_load, gif_load): Avoid unnecessary casts. (gif_load): Fewer ifdefs. diff --git a/src/image.c b/src/image.c index 5614f39..b5b713c 100644 --- a/src/image.c +++ b/src/image.c @@ -1096,8 +1096,8 @@ image_ascent (struct image *img, struct face *face, struct glyph_slice *slice) static uint32_t xcolor_to_argb32 (XColor xc) { - return (0xff << 24) | ((xc.red / 256) << 16) - | ((xc.green / 256) << 8) | (xc.blue / 256); + return ((0xffu << 24) | ((xc.red / 256) << 16) + | ((xc.green / 256) << 8) | (xc.blue / 256)); } static uint32_t @@ -3726,10 +3726,10 @@ xpm_load (struct frame *f, struct image *img) { int width = img->ximg->width; int height = img->ximg->height; - unsigned char *data = (unsigned char *) xmalloc (width*height*4); + void *data = xmalloc (width * height * 4); int i; - uint32_t *od = (uint32_t *)data; - uint32_t *id = (uint32_t *)img->ximg->data; + uint32_t *od = data; + uint32_t *id = (uint32_t *) img->ximg->data; char *mid = img->mask_img ? img->mask_img->data : 0; uint32_t bgcolor = get_spec_bg_or_alpha_as_argb (img, f); @@ -5364,7 +5364,7 @@ pbm_load (struct frame *f, struct image *img) height = pbm_scan_number (&p, end); #ifdef USE_CAIRO - uint32_t *data = xmalloc (width * height * 4); + void *data = xmalloc (width * height * 4); uint32_t *dataptr = data; #endif @@ -5540,7 +5540,7 @@ pbm_load (struct frame *f, struct image *img) r = (double) r * 255 / max_color_idx; g = (double) g * 255 / max_color_idx; b = (double) b * 255 / max_color_idx; - *dataptr++ = (0xff << 24) | (r << 16) | (g << 8) | b; + *dataptr++ = (0xffu << 24) | (r << 16) | (g << 8) | b; #else /* RGB values are now in the range 0..max_color_idx. Scale this to the range 0..0xffff supported by X. */ @@ -6835,7 +6835,7 @@ jpeg_load_body (struct frame *f, struct image *img, r = mgr->cinfo.colormap[ir][i]; g = mgr->cinfo.colormap[ig][i]; b = mgr->cinfo.colormap[ib][i]; - *dataptr++ = (0xff << 24) | (r << 16) | (g << 8) | b; + *dataptr++ = (0xffu << 24) | (r << 16) | (g << 8) | b; } } @@ -7628,14 +7628,6 @@ gif_load (struct frame *f, struct image *img) EMACS_INT idx; int gif_err; -#ifdef USE_CAIRO - unsigned char *data = 0; -#else - unsigned long pixel_colors[256]; - unsigned long bgcolor = 0; - XImagePtr ximg; -#endif - if (NILP (specified_data)) { Lisp_Object file = x_find_image_file (specified_file); @@ -7766,24 +7758,26 @@ gif_load (struct frame *f, struct image *img) #ifdef USE_CAIRO /* xzalloc so data is zero => transparent */ - data = (unsigned char *) xzalloc (width * height * 4); + void *data = xzalloc (width * height * 4); + uint32_t *data32 = data; if (STRINGP (specified_bg)) { XColor color; if (x_defined_color (f, SSDATA (specified_bg), &color, 0)) { - uint32_t *dataptr = (uint32_t *)data; + uint32_t *dataptr = data32; int r = color.red/256; int g = color.green/256; int b = color.blue/256; for (y = 0; y < height; ++y) for (x = 0; x < width; ++x) - *dataptr++ = (0xff << 24) | (r << 16) | (g << 8) | b; + *dataptr++ = (0xffu << 24) | (r << 16) | (g << 8) | b; } } #else /* Create the X image and pixmap. */ + XImagePtr ximg; if (!image_create_x_image_and_pixmap (f, img, width, height, 0, &ximg, 0)) { gif_close (gif, NULL); @@ -7821,6 +7815,7 @@ gif_load (struct frame *f, struct image *img) init_color_table (); #ifndef USE_CAIRO + unsigned long bgcolor; if (STRINGP (specified_bg)) bgcolor = x_alloc_image_color (f, img, specified_bg, FRAME_BACKGROUND_PIXEL (f)); @@ -7874,7 +7869,7 @@ gif_load (struct frame *f, struct image *img) #ifndef USE_CAIRO /* Allocate subimage colors. */ - memset (pixel_colors, 0, sizeof pixel_colors); + unsigned long pixel_colors[256] = { 0, }; if (gif_color_map) for (i = 0; i < gif_color_map->ColorCount; ++i) @@ -7911,14 +7906,14 @@ gif_load (struct frame *f, struct image *img) { #ifdef USE_CAIRO uint32_t *dataptr = - ((uint32_t*)data + ((row + subimg_top) * subimg_width - + x + subimg_left)); + (data32 + ((row + subimg_top) * subimg_width + + x + subimg_left)); int r = gif_color_map->Colors[c].Red; int g = gif_color_map->Colors[c].Green; int b = gif_color_map->Colors[c].Blue; if (transparency_color_index != c) - *dataptr = (0xff << 24) | (r << 16) | (g << 8) | b; + *dataptr = (0xffu << 24) | (r << 16) | (g << 8) | b; #else XPutPixel (ximg, x + subimg_left, row + subimg_top, pixel_colors[c]); @@ -7937,13 +7932,13 @@ gif_load (struct frame *f, struct image *img) { #ifdef USE_CAIRO uint32_t *dataptr = - ((uint32_t*)data + ((y + subimg_top) * subimg_width - + x + subimg_left)); + (data32 + ((y + subimg_top) * subimg_width + + x + subimg_left)); int r = gif_color_map->Colors[c].Red; int g = gif_color_map->Colors[c].Green; int b = gif_color_map->Colors[c].Blue; if (transparency_color_index != c) - *dataptr = (0xff << 24) | (r << 16) | (g << 8) | b; + *dataptr = (0xffu << 24) | (r << 16) | (g << 8) | b; #else XPutPixel (ximg, x + subimg_left, y + subimg_top, pixel_colors[c]); commit 319bafc9b28bd5bffb92a97a8ab53b9a3b97e6fd Author: Thierry Volpiatto Date: Wed Nov 30 21:22:04 2016 +0100 Fix Condition in kbd_buffer_store_buffered_event (bug#19547). * src/keyboard.c (kbd_buffer_store_buffered_event): Should be NILP and not !NILP. diff --git a/src/keyboard.c b/src/keyboard.c index e70140c..01b9b3c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3583,7 +3583,7 @@ kbd_buffer_store_buffered_event (union buffered_input_event *event, /* If we're inside while-no-input, and this event qualifies as input, set quit-flag to cause an interrupt. */ if (!NILP (Vthrow_on_input) - && !NILP (Fmemq (ignore_event, Vwhile_no_input_ignore_events))) + && NILP (Fmemq (ignore_event, Vwhile_no_input_ignore_events))) { Vquit_flag = Vthrow_on_input; /* If we're inside a function that wants immediate quits,