From f988d801393c830af154cf70b9ab223e05a21610 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 7 Nov 2022 17:56:05 -0800 Subject: [PATCH] gvc: squash -Wconversion warnings in 'gvevent_button_press' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Squashes the following compiler warnings. We know these are false positives due to the switch cases in which this code appears. gvevent.c:373:23: warning: conversion from ‘int’ to ‘unsigned char’ may change value [-Wconversion] 373 | job->button = button; | ^~~~~~ gvevent.c:378:23: warning: conversion from ‘int’ to ‘unsigned char’ may change value [-Wconversion] 378 | job->button = button; | ^~~~~~ gvevent.c:384:23: warning: conversion from ‘int’ to ‘unsigned char’ may change value [-Wconversion] 384 | job->button = button; | ^~~~~~ --- lib/gvc/gvevent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gvc/gvevent.c b/lib/gvc/gvevent.c index 61236c458..1288dc4cd 100644 --- a/lib/gvc/gvevent.c +++ b/lib/gvc/gvevent.c @@ -370,18 +370,18 @@ static void gvevent_button_press(GVJ_t * job, int button, pointf pointer) gvevent_find_current_obj(job, pointer); gvevent_select_current_obj(job); job->click = true; - job->button = button; + job->button = (unsigned char)button; job->needs_refresh = true; break; case 2: /* pan */ job->click = true; - job->button = button; + job->button = (unsigned char)button; job->needs_refresh = true; break; case 3: /* insert node or edge */ gvevent_find_current_obj(job, pointer); job->click = true; - job->button = button; + job->button = (unsigned char)button; job->needs_refresh = true; break; case 4: -- 2.40.0