Turn on -Wold-style-cast and fix the errors.
A couple of dodgy cases where we cast away const, but otherwise pretty boring.
Change-Id: Ibc39ebd525377792b5911464be842121c20f03b9
diff --git a/libc/bionic/sigismember.cpp b/libc/bionic/sigismember.cpp
index 16acd09..9d1fc3c 100644
--- a/libc/bionic/sigismember.cpp
+++ b/libc/bionic/sigismember.cpp
@@ -31,10 +31,10 @@
int sigismember(const sigset_t* set, int signum) {
int bit = signum - 1; // Signal numbers start at 1, but bit positions start at 0.
- const unsigned long* local_set = (const unsigned long*) set;
- if (set == NULL || bit < 0 || bit >= (int) (8*sizeof(sigset_t))) {
+ const unsigned long* local_set = reinterpret_cast<const unsigned long*>(set);
+ if (set == NULL || bit < 0 || bit >= static_cast<int>(8*sizeof(sigset_t))) {
errno = EINVAL;
return -1;
}
- return (int) ((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
+ return static_cast<int>((local_set[bit / LONG_BIT] >> (bit % LONG_BIT)) & 1);
}