libc/Android.bp: more cleanup.
These files were segregated because they were lacking a little cleanup.
Unfortunately that means this change has to do some of the cleanup, but
that's probably for the best.
Test: treehugger
Change-Id: I2dd33504787fc3313995de99e0745a0df22915b3
diff --git a/libc/stdio/vfscanf.cpp b/libc/stdio/vfscanf.cpp
index 3607995..92ff541 100644
--- a/libc/stdio/vfscanf.cpp
+++ b/libc/stdio/vfscanf.cpp
@@ -629,10 +629,10 @@
* as `[-+]0`.
*/
if (flags & NDIGITS) {
- if (p > buf) (void)ungetc(*(u_char*)--p, fp);
+ if (p > buf) ungetc(*reinterpret_cast<u_char*>(--p), fp);
goto match_failure;
}
- c = ((u_char*)p)[-1];
+ c = reinterpret_cast<u_char*>(p)[-1];
if ((base == 2 && (c == 'b' || c == 'B')) || c == 'x' || c == 'X') {
--p;
(void)ungetc(c, fp);
@@ -647,7 +647,7 @@
res = strtoimax(buf, nullptr, base);
}
if (flags & POINTER) {
- *va_arg(ap, void**) = (void*)(uintptr_t)res;
+ *va_arg(ap, void**) = reinterpret_cast<void*>(res);
} else if (flags & MAXINT) {
*va_arg(ap, intmax_t*) = res;
} else if (flags & LLONG) {
@@ -685,7 +685,7 @@
float res = strtof(buf, &p);
*va_arg(ap, float*) = res;
}
- if ((size_t)(p - buf) != width) abort();
+ if (static_cast<size_t>(p - buf) != width) abort();
nassigned++;
}
nread += width;