include/ctype.h: fix MISRA R10.2 violation

The value returned by __toupper is used in arithmetic operations causing
MISRA C 10.2 violations. Cast to plain char in the toupper macro. Also
do the same in tolower for consistency.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Stefano Stabellini authored and Stefano Stabellini committed 2024-05-16 18:03:27 -07:00
1 parent 53dc37829c
commit 21611c6870
1 file changed
+2 -2
+2 -2
View File
@@ -48,7 +48,7 @@ static inline unsigned char __toupper(unsigned char c)
return c;
}
#define tolower(c) __tolower(c)
#define toupper(c) __toupper(c)
#define tolower(c) ((char)__tolower(c))
#define toupper(c) ((char)__toupper(c))
#endif
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.