all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: martin rudalics <rudalics@gmx.at>
Cc: 46509@debbugs.gnu.org
Subject: bug#46509: 28.0.50; Unused static function in xfns.c with GTK2
Date: Sun, 14 Feb 2021 17:44:29 +0000	[thread overview]
Message-ID: <87a6s6tugy.fsf@tcd.ie> (raw)
In-Reply-To: <b1b47883-79d6-7195-7d7a-fc382344f82e@gmx.at> (martin rudalics's message of "Sun, 14 Feb 2021 18:17:00 +0100")

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

martin rudalics <rudalics@gmx.at> 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-unused-function-warning-in-xfns.c-with-GTK2.patch --]
[-- Type: text/x-diff, Size: 1755 bytes --]

From a1761d8afff8b9fd7143fd8e311c6572e1639fbc Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
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


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


Thanks,

-- 
Basil

  reply	other threads:[~2021-02-14 17:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 13:34 bug#46509: 28.0.50; Unused static function in xfns.c with GTK2 Basil L. Contovounesios
2021-02-14 16:04 ` Eli Zaretskii
2021-02-14 17:17   ` martin rudalics
2021-02-14 17:44     ` Basil L. Contovounesios [this message]
2021-02-15  8:15       ` martin rudalics
2021-02-15  9:15         ` Basil L. Contovounesios
2021-02-15 10:05           ` martin rudalics
2021-02-15 10:24             ` Robert Pluim
2021-02-15 11:42               ` Basil L. Contovounesios
2021-02-16  9:29                 ` martin rudalics
2021-02-16 16:51                   ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6s6tugy.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=46509@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.