From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#46491: [feature/pgtk] Unused macro warning in image.c without ImageMagick Date: Sat, 13 Feb 2021 16:34:22 +0000 Message-ID: <871rdksz8x.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6384"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yuuki harano To: 46491@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 13 17:35:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAxt3-0001XU-VZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 17:35:14 +0100 Original-Received: from localhost ([::1]:39998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAxt2-0003Z4-Hc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Feb 2021 11:35:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAxst-0003Yr-9w for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAxst-0007EY-2e for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:35:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lAxsr-0007Hh-PH; Sat, 13 Feb 2021 11:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: masm+emacs@masm11.me, bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Feb 2021 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: yuuki harano Original-Received: via spool by submit@debbugs.gnu.org id=B.161323407627963 (code B ref -1); Sat, 13 Feb 2021 16:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Feb 2021 16:34:36 +0000 Original-Received: from localhost ([127.0.0.1]:34932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAxsQ-0007Gw-9G for submit@debbugs.gnu.org; Sat, 13 Feb 2021 11:34:36 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lAxsL-0007Gl-Ko for submit@debbugs.gnu.org; Sat, 13 Feb 2021 11:34:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAxsL-0003YM-69 for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:34:29 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:39378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAxsI-00074M-Sk for bug-gnu-emacs@gnu.org; Sat, 13 Feb 2021 11:34:29 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id u14so2981009wmq.4 for ; Sat, 13 Feb 2021 08:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:subject:date:message-id:mime-version; bh=jCSfRiE2Odulk1sUmHdHh5aKeySxKly7pzsgQLESOKI=; b=gxEBnLPz1SlbrXcYrQqji6y7mB5zcR/63NZSS1UCd9LxlV6kP3PodcCWTtrSoS8SJc FjCvzoWwU2v4rOUhP2WV7YLrEqoLz5OKJCmLsCaMz3BFpzkPFQegjsxbldbh2z0KTc8S xnFuY4vv5cpyQVqHqpzKy/Zt3n5OWY987pPDRQFCO39AvamGv5E1uNFNZ+PF/JKvEefI mZSFmnNw3Z7MIalDV5ShYOf4RahipWii12cNBbH5wWmwyx7keZhALsU0HxSXpudQSUXX SLd6Scq9rwVGwLvt1T/nH7LWCrcFoCxYoJUJTARLFkRZ5gzwiRPdGbNKKblOBfj4Lf4q /x8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=jCSfRiE2Odulk1sUmHdHh5aKeySxKly7pzsgQLESOKI=; b=N/OLNcgItZHjKUiDj7m9SzwCUdbei5qZUPeVwk155dLyBjtBbIrQ24tyEHC8Waxj9j 3L4xw7T0dAfxf9jlrWuIiUjrwa1aY667gR+/fydA2ba1eblzmueBUOLoOe5o+oKyJGrE Is2OoMEZS9puL/+3bReCQ5kpCiVbZ/g1R7xJyDr8haxKYgNGr7raMt1BogCyLw59wIwM UlZ1FuswPz5uo7J0i9r31Ejeayz0f59DJwjzrF6A/kX0oWiv8Ue08A2KLRf+9KyUIzBX zV5MSboUc6IGyPery/WfO1IcyZHprMBMUOusLw/LbpY5OVHTXFMPV/JuzqTft0XVjhDi BOjw== X-Gm-Message-State: AOAM530m80JN6PK5fEdhrVauDmRJyVAPYFttyXDTrhm1wLwb4Kagz/hI IWtKTXoSqD8uQBhG2aziHvM5KddvhQtWneGZ X-Google-Smtp-Source: ABdhPJzBQoKwtij+VaxllwpI4MKf2DUyN1bQ1Kk9IiD58vra5/tW2bClNQqew74isIkRHXLQ1BBQ8A== X-Received: by 2002:a1c:5f82:: with SMTP id t124mr7035763wmb.55.1613234064245; Sat, 13 Feb 2021 08:34:24 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id j4sm16987176wrx.23.2021.02.13.08.34.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Feb 2021 08:34:23 -0800 (PST) Received-SPF: none client-ip=2a00:1450:4864:20::32a; envelope-from=contovob@tcd.ie; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199936 Archived-At: --=-=-= Content-Type: text/plain X-Debbugs-Cc: Yuuki Harano Severity: minor Tags: patch The following is the only build warning I currently get on feature/pgtk: image.c:110: warning: macro "DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE" is not used [-Wunused-macros] 110 | # define DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE Is the attached patch the right fix? If so, I can push it after adding the bug#number to it. Thanks, -- Basil In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0) of 2021-02-13 built on tia Repository revision: 175ebb010477ff0e174fe5145154397f43dee2d2 Repository branch: feature/pgtk Windowing system distributor 'System Description: Debian GNU/Linux bullseye/sid Configured using: 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache --prefix=/home/blc/.local --program-suffix=-pgtk --enable-checking=structs --with-file-notification=yes --with-pgtk --with-xwidgets' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM XWIDGETS GTK3 ZLIB Important settings: value of $LANG: en_IE.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-unused-macro-build-warning-in-image.c.patch >From d60bc973c8ac840e02297931f86ebb05b50b20e6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sat, 13 Feb 2021 14:51:48 +0000 Subject: [PATCH] Fix unused macro build warning in image.c * src/image.c [HAVE_PGTK] (DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE): Define only if HAVE_IMAGEMAGICK is also defined, as it is otherwise unused. (image_set_transform): Reduce nesting of preprocessor conditionals. --- src/image.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/image.c b/src/image.c index cc97ca4d7c..09370fa833 100644 --- a/src/image.c +++ b/src/image.c @@ -99,7 +99,7 @@ #define BLUE16_FROM_ULONG(color) (BLUE_FROM_ULONG (color) * 0x101) Lisp_Object, unsigned long); #endif /* USE_CAIRO */ -#ifdef HAVE_PGTK +#if defined HAVE_PGTK && defined HAVE_IMAGEMAGICK /* On pgtk, we don't want to create scaled image. * If we create scaled image on scale=2.0 environment, * the created image is half size and Gdk scales it back, @@ -2307,12 +2307,11 @@ compute_image_rotation (struct image *img, double *rotation) static void image_set_transform (struct frame *f, struct image *img) { -# ifdef HAVE_IMAGEMAGICK -# ifndef DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE +# if (defined HAVE_IMAGEMAGICK \ + && !defined DONT_CREATE_TRANSFORMED_IMAGEMAGICK_IMAGE) /* ImageMagick images already have the correct transform. */ if (EQ (image_spec_value (img->spec, QCtype, NULL), Qimagemagick)) return; -# endif # endif # if !defined USE_CAIRO && defined HAVE_XRENDER -- 2.30.0 --=-=-=--