wxGTK/28b84a1e96a3f061f4ba56d6482...

28 lines
983 B
Diff

From 28b84a1e96a3f061f4ba56d64829206dbd0628c0 Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Thu, 27 Jan 2022 15:30:22 +0100
Subject: [PATCH] Avoid gcc 12 -Warith-conversion in
wxImageHistogram::MakeKey()
Explicitly convert the operands to unsigned because we do actually want
the result to be unsigned here.
Co-Authored-By: Scott Talbert <swt@techie.net>
---
include/wx/image.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/wx/image.h b/include/wx/image.h
index 682e952f69be..35fd263e201d 100644
--- a/include/wx/image.h
+++ b/include/wx/image.h
@@ -210,7 +210,7 @@ class wxImageHistogram : public wxImageHistogramBase
unsigned char g,
unsigned char b)
{
- return (r << 16) | (g << 8) | b;
+ return ((unsigned)r << 16) | ((unsigned)g << 8) | (unsigned)b;
}
// find first colour that is not used in the image and has higher