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