all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#29567: [PATCH] src/xterm.c: use 'thickness' only in a case of !USE_CAIRO
@ 2017-12-04 18:11 Alexander Kuleshov
  2017-12-04 20:05 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kuleshov @ 2017-12-04 18:11 UTC (permalink / raw)
  To: 29567

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

Hello,

I've attached simple patch with moving of the `thickness` var
(from the x_draw_underwave() src/xterm.c) a little bit below, to get rid of:

xterm.c:3520:61: error: unused variable 'thickness' [-Werror,-Wunused-variable]
  int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;

as this variable is used only in a case of !USE_CAIRO

Thank you.

[-- Attachment #2: 0001-Move-thickness-assignment-where-it-is-used.patch --]
[-- Type: text/x-patch, Size: 1092 bytes --]

From d11a651a5d4b61a18794fd29b6fab6722a885c06 Mon Sep 17 00:00:00 2001
From: Alexander Kuleshov <kuleshovmail@gmail.com>
Date: Mon, 4 Dec 2017 23:58:00 +0600
Subject: [PATCH] Move thickness assignment where it is used

* src/xterm.c (x_draw_underwave): assign a value to 'thickness'
variable only in a case of !USE_CAIRO
---
 src/xterm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index 1b45cf1b0b..b8ae64c6df 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3517,7 +3517,7 @@ x_draw_underwave (struct glyph_string *s)
 
   x_get_scale_factor (s->display, &scale_x, &scale_y);
 
-  int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;
+  int wave_height = 3 * scale_y, wave_length = 2 * scale_x;
 
 #ifdef USE_CAIRO
   x_draw_horizontal_wave (s->f, s->gc, s->x, s->ybase - wave_height + 3,
@@ -3527,6 +3527,7 @@ x_draw_underwave (struct glyph_string *s)
   bool odd;
   XRectangle wave_clip, string_clip, final_clip;
 
+  thickness = scale_y;
   dx = wave_length;
   dy = wave_height - 1;
   x0 = s->x;
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#29567: [PATCH] src/xterm.c: use 'thickness' only in a case of !USE_CAIRO
  2017-12-04 18:11 bug#29567: [PATCH] src/xterm.c: use 'thickness' only in a case of !USE_CAIRO Alexander Kuleshov
@ 2017-12-04 20:05 ` Eli Zaretskii
  2017-12-05  6:53   ` Alexander Kuleshov
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2017-12-04 20:05 UTC (permalink / raw)
  To: Alexander Kuleshov; +Cc: 29567-done

> From: Alexander Kuleshov <kuleshovmail@gmail.com>
> Date: Tue, 5 Dec 2017 00:11:47 +0600
> 
> I've attached simple patch with moving of the `thickness` var
> (from the x_draw_underwave() src/xterm.c) a little bit below, to get rid of:
> 
> xterm.c:3520:61: error: unused variable 'thickness' [-Werror,-Wunused-variable]
>   int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;
> 
> as this variable is used only in a case of !USE_CAIRO

Thanks.  Did the patched source compile for you in the !USE_CAIRO
case?  Because 'thickness' needs to be declared as 'int' before it can
be used.

So I installed a slightly different change to avoid the warning.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29567: [PATCH] src/xterm.c: use 'thickness' only in a case of !USE_CAIRO
  2017-12-04 20:05 ` Eli Zaretskii
@ 2017-12-05  6:53   ` Alexander Kuleshov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Kuleshov @ 2017-12-05  6:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 29567-done

On Tue, Dec 5, 2017 at 2:05 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Alexander Kuleshov <kuleshovmail@gmail.com>
>> Date: Tue, 5 Dec 2017 00:11:47 +0600
>>
>> I've attached simple patch with moving of the `thickness` var
>> (from the x_draw_underwave() src/xterm.c) a little bit below, to get rid of:
>>
>> xterm.c:3520:61: error: unused variable 'thickness' [-Werror,-Wunused-variable]
>>   int wave_height = 3 * scale_y, wave_length = 2 * scale_x, thickness = scale_y;
>>
>> as this variable is used only in a case of !USE_CAIRO
>
> Thanks.  Did the patched source compile for you in the !USE_CAIRO
> case?  Because 'thickness' needs to be declared as 'int' before it can
> be used.
>
> So I installed a slightly different change to avoid the warning.

Ah yes, yes, it should be defined before.

Thank you.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-05  6:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-04 18:11 bug#29567: [PATCH] src/xterm.c: use 'thickness' only in a case of !USE_CAIRO Alexander Kuleshov
2017-12-04 20:05 ` Eli Zaretskii
2017-12-05  6:53   ` Alexander Kuleshov

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.