Fix / suppress new unused warnings for mingw+clang

Bug: 69933068
Test: mmma system/core
Change-Id: I089166a979d3d8c5ada38a7745d507b555048499
This commit is contained in:
Dan Willemsen 2017-11-29 18:06:11 -08:00
parent 70fda27eb2
commit 528f144e77
9 changed files with 18 additions and 10 deletions

View file

@ -129,6 +129,7 @@ cc_test {
},
windows: {
srcs: ["utf8_test.cpp"],
cflags: ["-Wno-unused-parameter"],
enabled: true,
},
},

View file

@ -192,6 +192,7 @@ TEST(logging, WOULD_LOG_VERBOSE_enabled) {
#undef CHECK_WOULD_LOG_ENABLED
#if !defined(_WIN32)
static std::string make_log_pattern(android::base::LogSeverity severity,
const char* message) {
static const char log_characters[] = "VDIWEFF";
@ -203,6 +204,7 @@ static std::string make_log_pattern(android::base::LogSeverity severity,
"%c \\d+-\\d+ \\d+:\\d+:\\d+ \\s*\\d+ \\s*\\d+ %s:\\d+] %s",
log_char, basename(&holder[0]), message);
}
#endif
static void CheckMessage(const CapturedStderr& cap,
android::base::LogSeverity severity, const char* expected) {

View file

@ -195,7 +195,7 @@ FILE* fopen(const char* name, const char* mode) {
return _wfopen(name_utf16.c_str(), mode_utf16.c_str());
}
int mkdir(const char* name, mode_t mode) {
int mkdir(const char* name, mode_t) {
std::wstring name_utf16;
if (!UTF8PathToWindowsLongPath(name, &name_utf16)) {
return -1;

View file

@ -27,7 +27,7 @@ using android::base::StringPrintf;
using android::base::unique_fd;
#ifdef WIN32
static int exec_e2fs_cmd(const char* path, char* const argv[]) {
static int exec_e2fs_cmd(const char* /*path*/, char* const argv[]) {
std::string cmd;
int i = 0;
while (argv[i] != nullptr) {

View file

@ -85,6 +85,6 @@ ssize_t socket_send_buffers(cutils_socket_t sock,
return -1;
}
int android_get_control_socket(const char* name) {
int android_get_control_socket(const char*) {
return -1;
}

View file

@ -84,7 +84,7 @@ void* thread_store_get( thread_store_t* store )
void thread_store_set( thread_store_t* store,
void* value,
thread_store_destruct_t destroy )
thread_store_destruct_t /*destroy*/ )
{
/* XXX: can't use destructor on thread exit */
if (!store->lock_init) {

View file

@ -136,9 +136,12 @@ cc_library {
cflags: ["-Wno-unused-parameter"],
},
// Under MinGW, ctype.h doesn't need multi-byte support
windows: {
cflags: ["-DMB_CUR_MAX=1"],
cflags: [
// Under MinGW, ctype.h doesn't need multi-byte support
"-DMB_CUR_MAX=1",
"-Wno-unused-private-field",
],
enabled: true,
},

View file

@ -348,7 +348,7 @@ Mutex::Mutex()
mState = (void*) hMutex;
}
Mutex::Mutex(const char* name)
Mutex::Mutex(const char* /*name*/)
{
// XXX: name not used for now
HANDLE hMutex;
@ -359,7 +359,7 @@ Mutex::Mutex(const char* name)
mState = (void*) hMutex;
}
Mutex::Mutex(int type, const char* name)
Mutex::Mutex(int /*type*/, const char* /*name*/)
{
// XXX: type and name not used for now
HANDLE hMutex;

View file

@ -44,8 +44,8 @@ static pthread_mutex_t gSyspropMutex = PTHREAD_MUTEX_INITIALIZER;
static Vector<sysprop_change_callback_info>* gSyspropList = NULL;
#endif
void add_sysprop_change_callback(sysprop_change_callback cb, int priority) {
#if !defined(_WIN32)
void add_sysprop_change_callback(sysprop_change_callback cb, int priority) {
pthread_mutex_lock(&gSyspropMutex);
if (gSyspropList == NULL) {
gSyspropList = new Vector<sysprop_change_callback_info>();
@ -65,8 +65,10 @@ void add_sysprop_change_callback(sysprop_change_callback cb, int priority) {
gSyspropList->add(info);
}
pthread_mutex_unlock(&gSyspropMutex);
#endif
}
#else
void add_sysprop_change_callback(sysprop_change_callback, int) {}
#endif
#if defined(__ANDROID__)
void (*get_report_sysprop_change_func())() {