[Scummvm-git-logs] scummvm master -> 4567f1b176fff46e11dafaa9622cd0222a602a5c
sev-
noreply at scummvm.org
Sun Jun 12 08:30:07 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4567f1b176 DINGUX: Only evaluate the toupper() macro argument once
Commit: 4567f1b176fff46e11dafaa9622cd0222a602a5c
https://github.com/scummvm/scummvm/commit/4567f1b176fff46e11dafaa9622cd0222a602a5c
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-06-12T10:30:04+02:00
Commit Message:
DINGUX: Only evaluate the toupper() macro argument once
toupper() callers should avoid putting a side-effect expression there, but
in practice it sometimes happen, so making the macro safer can't hurt.
This uses a GCC statement expression, but this port only uses GCC
anyway.
Changed paths:
common/scummsys.h
diff --git a/common/scummsys.h b/common/scummsys.h
index f23634a209f..78dcf122e98 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -309,7 +309,7 @@
// Very BAD hack following, used to avoid triggering an assert in uClibc dingux library
// "toupper" when pressing keyboard function keys.
#undef toupper
- #define toupper(c) (((c & 0xFF) >= 97) && ((c & 0xFF) <= 122) ? ((c & 0xFF) - 32) : (c & 0xFF))
+ #define toupper(c) __extension__ ({ auto _x = ((c) & 0xFF); (_x >= 97 && _x <= 122) ? (_x - 32) : _x; })
#elif defined(__PSP__)
More information about the Scummvm-git-logs
mailing list