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#46509: 28.0.50; Unused static function in xfns.c with GTK2 Date: Sun, 14 Feb 2021 17:44:29 +0000 Message-ID: <87a6s6tugy.fsf@tcd.ie> References: <87y2fqu616.fsf@tcd.ie> <83im6ubppx.fsf@gnu.org> 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="14613"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46509@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 14 18:45:33 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 1lBLSe-0003fe-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Feb 2021 18:45:33 +0100 Original-Received: from localhost ([::1]:48924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBLSe-0006zf-0P for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Feb 2021 12:45:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBLS9-0006yd-Ti for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 12:45:01 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBLS9-0002LO-La for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 12:45:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lBLS9-0008Rw-JD for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2021 12:45:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2021 17:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46509 X-GNU-PR-Package: emacs Original-Received: via spool by 46509-submit@debbugs.gnu.org id=B46509.161332468132438 (code B ref 46509); Sun, 14 Feb 2021 17:45:01 +0000 Original-Received: (at 46509) by debbugs.gnu.org; 14 Feb 2021 17:44:41 +0000 Original-Received: from localhost ([127.0.0.1]:36643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBLRo-0008R6-G6 for submit@debbugs.gnu.org; Sun, 14 Feb 2021 12:44:40 -0500 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:35425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBLRl-0008Qs-Ld for 46509@debbugs.gnu.org; Sun, 14 Feb 2021 12:44:38 -0500 Original-Received: by mail-wm1-f50.google.com with SMTP id n10so5822906wmq.0 for <46509@debbugs.gnu.org>; Sun, 14 Feb 2021 09:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=rGF3yDBxjwQlUkaYOwefZpum+GafQ6k5ADlWMguTp7s=; b=JgM4hXfoaE62YAJECxavTWr70mMJjDGPGzjP6tS7OhyN7uamHtEyVBR+EihaAj0kLv QcpALfARWvRRX58HQSiRgGgCVXg3cdUBv9kSiQHxlxDqVd0ESqiV7JwvBIGgnQp5UO90 88OMbLt0/X8/7Umum/VoWjaNWDBZTcFpZuOVlaonONexXSl5mqasZ7RbmqM8amCnjAQk eO2GfRwVKl6ihWd7j0ySkNvE7JO637T/FHJEb1N5Ittn8IH9VCJNx5RFq2naG9xhDkRr VMYOy7Xb0NpiHMgQd2tfK0FZiiu74iWM5B8DcC3AfCD7/hLMTc+fvidHyCBz7Rp8dN3Y T9kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=rGF3yDBxjwQlUkaYOwefZpum+GafQ6k5ADlWMguTp7s=; b=Nz5Y7XyK+nbUgeCgZcegOf6PKxUf4XF6yWfKwgkIcQi0EYMKLng09C6EPAZ8kQtxtK xkZ12rAbwbiv4BbkJJ2s2dUyTdGvFx7g+nqyUWFg3LRGCB5zRgPGBXWoMg+TgWhsB42K fImgs3OI66EkJZ0fZYiJi19HUWfqEQoB1zQBhPGqqd2Xt97cXt/LGASMdiKz85fJ2VYI UXBL14JCjEvTgTwtJm7Tv570eH7DO1FiDRMB7pgPA0JdWNPZBneX0wCYU/A3+VXJAEFL heEagH9N0cEMzjK2HYANfFyIVPcmV3pOULDurvEycL6pM1KabOp+QirK/IQX7IgB4/f9 FYGQ== X-Gm-Message-State: AOAM533y2Hft9RFWwxP8IsMdBr7/7VbiY/nle2xlz/j1ny5h+b912wru LOi9j2FJsUuZyNVjdLdjqKQcDQ== X-Google-Smtp-Source: ABdhPJySf2PtsOH06ASrKdBKnk+GjWI5M5FpR6L8FZxKl9mbamXWG2luheMGKPSgEqh59agk6rpOvg== X-Received: by 2002:a1c:ba44:: with SMTP id k65mr10592119wmf.25.1613324671583; Sun, 14 Feb 2021 09:44:31 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id j40sm20184397wmp.47.2021.02.14.09.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Feb 2021 09:44:30 -0800 (PST) In-Reply-To: (martin rudalics's message of "Sun, 14 Feb 2021 18:17:00 +0100") 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:200020 Archived-At: --=-=-= Content-Type: text/plain martin rudalics writes: >>> Its definition is conditional on !USE_GTK || !HAVE_GTK3, but its use >>> only on !USE_GTK. Which one is right? >> >> The !USE_GTK one, I think. > > It's a tad more complicated. You have to do something like the below. > > martin > > diff --git a/src/xfns.c b/src/xfns.c > index 481ee0e225..82424ae080 100644 > --- a/src/xfns.c > +++ b/src/xfns.c > @@ -4663,6 +4663,9 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) > return result; > } > > +#endif /* !defined USE_GTK || !defined HAVE_GTK3 */ > +#if !defined USE_GTK > + > /* Return monitor number where F is "most" or closest to. */ > static int > x_get_monitor_for_frame (struct frame *f, What about this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-unused-function-warning-in-xfns.c-with-GTK2.patch >From a1761d8afff8b9fd7143fd8e311c6572e1639fbc Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 14 Feb 2021 16:58:06 +0000 Subject: [PATCH] Fix unused function warning in xfns.c with GTK2 * src/xfns.c (x_get_net_workarea): Define only when using GTK other than GTK3, to match its use in Fx_display_monitor_attributes_list. (x_get_monitor_for_frame, x_make_monitor_attribute_list) (x_get_monitor_attributes_fallback, x_get_monitor_attributes_xrandr) (x_get_monitor_attributes_xinerama, x_get_monitor_attributes): Condition definitions on !USE_GTK, to match their use in Fx_display_monitor_attributes_list (bug#46509). (x_get_monitor_attributes_xrandr): Undefine RANDR13_LIBRARY after it's been used. --- src/xfns.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xfns.c b/src/xfns.c index 481ee0e225..f572982ca1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4599,7 +4599,7 @@ DEFUN ("x-display-save-under", Fx_display_save_under, return Qnil; } -#if !defined USE_GTK || !defined HAVE_GTK3 +#if defined USE_GTK && !defined HAVE_GTK3 /* Store the geometry of the workarea on display DPYINFO into *RECT. Return false if and only if the workarea information cannot be @@ -4662,6 +4662,9 @@ x_get_net_workarea (struct x_display_info *dpyinfo, XRectangle *rect) return result; } +#endif /* USE_GTK && !HAVE_GTK3 */ + +#ifndef USE_GTK /* Return monitor number where F is "most" or closest to. */ static int @@ -4877,6 +4880,8 @@ #define RANDR13_LIBRARY \ pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window); #endif +#undef RANDR13_LIBRARY + for (i = 0; i < n_monitors; ++i) { XRROutputInfo *info = XRRGetOutputInfo (dpy, resources, -- 2.30.0 --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=--