From unknown Wed Jun 18 00:25:51 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#22409 <22409@debbugs.gnu.org> To: bug#22409 <22409@debbugs.gnu.org> Subject: Status: [PATCH] Fix compilation erorr when --enable-gcc-warnings passed Reply-To: bug#22409 <22409@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:25:51 +0000 retitle 22409 [PATCH] Fix compilation erorr when --enable-gcc-warnings pass= ed reassign 22409 emacs submitter 22409 Alexander Kuleshov severity 22409 normal tag 22409 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 19 12:58:17 2016 Received: (at submit) by debbugs.gnu.org; 19 Jan 2016 17:58:17 +0000 Received: from localhost ([127.0.0.1]:53971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLaXp-00061R-Fs for submit@debbugs.gnu.org; Tue, 19 Jan 2016 12:58:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58502) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLUt5-0002Il-0k for submit@debbugs.gnu.org; Tue, 19 Jan 2016 06:55:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLUsy-0004GD-GD for submit@debbugs.gnu.org; Tue, 19 Jan 2016 06:55:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUsy-0004G9-DB for submit@debbugs.gnu.org; Tue, 19 Jan 2016 06:55:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUsx-00021q-0H for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 06:55:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLUst-0004F2-PC for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 06:55:42 -0500 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:34920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUst-0004Ep-CX for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 06:55:39 -0500 Received: by mail-lb0-x232.google.com with SMTP id bc4so361035912lbc.2 for ; Tue, 19 Jan 2016 03:55:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=b62MDNV+HOXvmWCIaXCHGUVXniFZsehcZZma0UcpgVQ=; b=C063ncQM5WxwbHb83etMceq6DeACLFhXPgllTYeESbvBXxV/nl+d8ysasWkf/cNMod YcxIrFYX8QoPfE9iicq3/kUZ9S+l+dV5FgO+BjpVcOWA+GF2IRO4w6VgXPSv358C19vc xmdzUZuQq47xkFZrxpRrpjEM4aAIAyDUTTFFiokUDonhr4g0JEddWvxxH1pZ/enIEvU+ DOYWz/HxFRXgyujkGrclWUDV6XF2Y4q80FCI+I28wgNTNzVL0MXDYu9ssaYCHnM26Kcr ACOIpt/EiTZxk4mLAD6ylx7wk4sqmZd+/vSrUW0HTksWSP80zJhqiq29Tmf5mWL23YK1 GxNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=b62MDNV+HOXvmWCIaXCHGUVXniFZsehcZZma0UcpgVQ=; b=WtwP12W9jFUdmwV6LdAoYUJZeziVwap/ZR6AtdwFzYkkdk6b6iD2I8yVXVCJ4pjWzQ r/j2+8k9lOoXeRA4milNE5Jd7HD2OvgqGOQthNopm55Nlio9U2x8m6GnHPU//8I0byYl pyP5E5xUJXHlBhn+CEhd5vRJ1eZ5BwNk1yLs8JQF/po9gb0fRYNR68U7Dnh0kEdpyqia 2BF51IJs+ocgVnYOJk6wCm9Nws08Nll1R8Vp6tfseZA2UEBsnNvFD3NhnuNgXk6WYDDg 13o50Vf9dKfH18uTTz54ekRBUT2LDWQqCiAZw3C9dXQ425uEdqcmpbJkMcmrY2k0weUU l9SQ== X-Gm-Message-State: ALoCoQnMVNO4gZPX82zPq6iYj/ryhInRvrb31wnIxRC+yrnsPDI6GRtSdLhQ3hQFZkuZSj62dd4zfIPkavTX+UVsjiPe2Q39Sw== X-Received: by 10.112.205.196 with SMTP id li4mr10814400lbc.143.1453204538121; Tue, 19 Jan 2016 03:55:38 -0800 (PST) Received: from localhost.localhost ([37.151.232.254]) by smtp.gmail.com with ESMTPSA id f74sm3995487lfi.17.2016.01.19.03.55.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jan 2016 03:55:37 -0800 (PST) From: Alexander Kuleshov To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix compilation erorr when --enable-gcc-warnings passed Date: Tue, 19 Jan 2016 17:52:07 +0600 Message-Id: <1453204327-4046-1-git-send-email-kuleshovmail@gmail.com> X-Mailer: git-send-email 2.7.0.25.gfc10eb5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 19 Jan 2016 12:58:17 -0500 Cc: Alexander Kuleshov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This patch does not provide functional changes, but contains fixes for compilation errors if GNU Emacs was configured with the --enable-gcc-warnings option. Mostly "defined but not used" fixed. --- src/gtkutil.c | 2 +- src/image.c | 46 +++++++++++++++++++++++++++++----------------- src/xterm.c | 6 +++--- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 768df34..bf7a067 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -4096,7 +4096,7 @@ xg_get_page_setup (void) orientation_symbol = Qlandscape; else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT) orientation_symbol = Qreverse_portrait; - else if (orientation == GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE) + else orientation_symbol = Qreverse_landscape; return listn (CONSTYPE_HEAP, 7, diff --git a/src/image.c b/src/image.c index 8bb5ff7..03b4489 100644 --- a/src/image.c +++ b/src/image.c @@ -75,7 +75,9 @@ typedef struct x_bitmap_record Bitmap_Record; #endif /* W32_TODO : Color tables on W32. */ +#ifdef COLOR_TABLE_SUPPORT #undef COLOR_TABLE_SUPPORT +#endif typedef struct w32_bitmap_record Bitmap_Record; #define GET_PIXEL(ximg, x, y) GetPixel (ximg, x, y) @@ -90,11 +92,16 @@ typedef struct w32_bitmap_record Bitmap_Record; #endif /* HAVE_NTGUI */ #ifdef USE_CAIRO +#ifdef COLOR_TABLE_SUPPORT #undef COLOR_TABLE_SUPPORT #endif +#endif #ifdef HAVE_NS + +#ifdef COLOR_TABLE_SUPPORT #undef COLOR_TABLE_SUPPORT +#endif typedef struct ns_bitmap_record Bitmap_Record; @@ -4615,16 +4622,15 @@ colors_in_color_table (int *n) static unsigned long lookup_rgb_color (struct frame *f, int r, int g, int b) { - unsigned long pixel; - #ifdef HAVE_NTGUI - pixel = PALETTERGB (r >> 8, g >> 8, b >> 8); + return PALETTERGB (r >> 8, g >> 8, b >> 8); #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - pixel = RGB_TO_ULONG (r >> 8, g >> 8, b >> 8); + return RGB_TO_ULONG (r >> 8, g >> 8, b >> 8); #endif /* HAVE_NS */ - return pixel; + + return 0; } static void @@ -7328,10 +7334,10 @@ tiff_load (struct frame *f, struct image *img) for (x = 0; x < width; ++x) { uint32 abgr = row[x]; - int r = TIFFGetR (abgr); - int g = TIFFGetG (abgr); - int b = TIFFGetB (abgr); - int a = TIFFGetA (abgr); + r = TIFFGetR (abgr); + g = TIFFGetG (abgr); + b = TIFFGetB (abgr); + a = TIFFGetA (abgr); *dataptr++ = (a << 24) | (r << 16) | (g << 8) | b; } } @@ -7634,13 +7640,11 @@ gif_load (struct frame *f, struct image *img) { int rc, width, height, x, y, i, j; ColorMapObject *gif_color_map; - unsigned long pixel_colors[256]; GifFileType *gif; gif_memory_source memsrc; Lisp_Object specified_bg = image_spec_value (img->spec, QCbackground, NULL); Lisp_Object specified_file = image_spec_value (img->spec, QCfile, NULL); Lisp_Object specified_data = image_spec_value (img->spec, QCdata, NULL); - unsigned long bgcolor = 0; EMACS_INT idx; int gif_err; @@ -7648,6 +7652,8 @@ gif_load (struct frame *f, struct image *img) unsigned char *data = 0; #else XImagePtr ximg; + unsigned long pixel_colors[256]; + unsigned long bgcolor = 0; #endif if (NILP (specified_data)) @@ -7834,8 +7840,12 @@ gif_load (struct frame *f, struct image *img) init_color_table (); if (STRINGP (specified_bg)) +#ifndef USE_CAIRO bgcolor = x_alloc_image_color (f, img, specified_bg, - FRAME_BACKGROUND_PIXEL (f)); + FRAME_BACKGROUND_PIXEL (f)); +#else + x_alloc_image_color (f, img, specified_bg, FRAME_BACKGROUND_PIXEL (f)); +#endif for (j = 0; j <= idx; ++j) { /* We use a local variable `raster' here because RasterBits is a @@ -9182,11 +9192,13 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. * int height; const guint8 *pixels; int rowstride; - XImagePtr ximg; - Lisp_Object specified_bg; - XColor background; +#ifndef USE_CAIRO int x; int y; + XColor background; + XImagePtr ximg; + Lisp_Object specified_bg; +#endif #if ! GLIB_CHECK_VERSION (2, 36, 0) /* g_type_init is a glib function that must be called prior to @@ -9597,8 +9609,6 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f) 0, 0, img->width, img->height, ~0, ZPixmap); if (ximg) { - int x, y; - /* Initialize the color table. */ init_color_table (); @@ -9606,6 +9616,8 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f) color table. After having done so, the color table will contain an entry for each color used by the image. */ #ifdef COLOR_TABLE_SUPPORT + int x, y; + for (y = 0; y < img->height; ++y) for (x = 0; x < img->width; ++x) { diff --git a/src/xterm.c b/src/xterm.c index 5a6d643..530c918 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1312,7 +1312,6 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring { struct frame *f = XFRAME (WINDOW_FRAME (w)); Display *display = FRAME_X_DISPLAY (f); - Window window = FRAME_X_WINDOW (f); GC gc = f->output_data.x->normal_gc; struct face *face = p->face; @@ -1359,6 +1358,7 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring Pixmap pixmap, clipmask = (Pixmap) 0; int depth = DefaultDepthOfScreen (FRAME_X_SCREEN (f)); XGCValues gcv; + Window window = FRAME_X_WINDOW (f); if (p->wd > 8) bits = (char *) (p->bits + p->dh); @@ -3749,7 +3749,7 @@ x_delete_glyphs (struct frame *f, register int n) emacs_abort (); } - +#if !defined USE_CAIRO || !defined USE_TOOLKIT_SCROLL_BARS /* Like XClearArea, but check that WIDTH and HEIGHT are reasonable. If they are <= 0, this is probably an error. */ @@ -3760,7 +3760,7 @@ x_clear_area1 (Display *dpy, Window window, eassert (width > 0 && height > 0); XClearArea (dpy, window, x, y, width, height, exposures); } - +#endif void x_clear_area (struct frame *f, int x, int y, int width, int height) -- 2.7.0.25.gfc10eb5 From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 04:14:30 2016 Received: (at 22409-done) by debbugs.gnu.org; 23 Jan 2016 09:14:30 +0000 Received: from localhost ([127.0.0.1]:58298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMuH8-0003RW-LF for submit@debbugs.gnu.org; Sat, 23 Jan 2016 04:14:30 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39553) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMuH6-0003RI-So for 22409-done@debbugs.gnu.org; Sat, 23 Jan 2016 04:14:29 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 96913160E73 for <22409-done@debbugs.gnu.org>; Sat, 23 Jan 2016 01:14:23 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id v2GLznD0ET8i for <22409-done@debbugs.gnu.org>; Sat, 23 Jan 2016 01:14:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9E7AE160E74 for <22409-done@debbugs.gnu.org>; Sat, 23 Jan 2016 01:14:22 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yHMnMcqNlzMK for <22409-done@debbugs.gnu.org>; Sat, 23 Jan 2016 01:14:22 -0800 (PST) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 55069160E73 for <22409-done@debbugs.gnu.org>; Sat, 23 Jan 2016 01:14:22 -0800 (PST) To: 22409-done@debbugs.gnu.org From: Paul Eggert Subject: Re: [PATCH] Fix compilation erorr when --enable-gcc-warnings passed Organization: UCLA Computer Science Department Message-ID: <56A3446D.6060603@cs.ucla.edu> Date: Sat, 23 Jan 2016 01:14:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22409-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) emacs-25 commit c07bddd69dab6252ce1e8a283a023d693b7d7ad6 should fix this, so I am closing the bug repor. From unknown Wed Jun 18 00:25:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Feb 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator