summaryrefslogtreecommitdiff
path: root/port
diff options
context:
space:
mode:
authorcostan <costan@google.com>2019-03-26 08:56:12 -0700
committerChris Mumford <cmumford@google.com>2019-03-29 11:22:22 -0700
commitbd24b963060861518c6648925f9708178562c992 (patch)
tree030eba6e03f5ccf4a8f093d4fa099e14ec89e3b8 /port
parent6188a54ce95b47cc6bd398d7f2eb45d061857e45 (diff)
downloadleveldb-bd24b963060861518c6648925f9708178562c992.tar.gz
leveldb: Silence unused argument warnings in MSVC.
This CL uses a well-known workaround for silencing arguments that may be unused, depending on the build configuration. The silenced warnings were responsible for a large amount of noise in the MSVC build on Windows. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=240357359
Diffstat (limited to 'port')
-rw-r--r--port/port_stdcxx.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/port/port_stdcxx.h b/port/port_stdcxx.h
index e21fa70..d0609a8 100644
--- a/port/port_stdcxx.h
+++ b/port/port_stdcxx.h
@@ -91,6 +91,9 @@ inline bool Snappy_Compress(const char* input, size_t length,
snappy::RawCompress(input, length, &(*output)[0], &outlen);
output->resize(outlen);
return true;
+#else
+ // Silence compiler warnings about unused arguments.
+ (void)input; (void)length; (void)output;
#endif // HAVE_SNAPPY
return false;
@@ -101,6 +104,8 @@ inline bool Snappy_GetUncompressedLength(const char* input, size_t length,
#if HAVE_SNAPPY
return snappy::GetUncompressedLength(input, length, result);
#else
+ // Silence compiler warnings about unused arguments.
+ (void)input; (void)length; (void)result;
return false;
#endif // HAVE_SNAPPY
}
@@ -109,11 +114,15 @@ inline bool Snappy_Uncompress(const char* input, size_t length, char* output) {
#if HAVE_SNAPPY
return snappy::RawUncompress(input, length, output);
#else
+ // Silence compiler warnings about unused arguments.
+ (void)input; (void)length; (void)output;
return false;
#endif // HAVE_SNAPPY
}
inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
+ // Silence compiler warnings about unused arguments.
+ (void)func; (void)arg;
return false;
}
@@ -121,6 +130,8 @@ inline uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size) {
#if HAVE_CRC32C
return ::crc32c::Extend(crc, reinterpret_cast<const uint8_t*>(buf), size);
#else
+ // Silence compiler warnings about unused arguments.
+ (void)crc; (void)buf; (void)size;
return 0;
#endif // HAVE_CRC32C
}