Kaynağa Gözat

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
naive_version
costan 5 yıl önce
işlemeyi yapan: Chris Mumford
ebeveyn
işleme
bd24b96306
1 değiştirilmiş dosya ile 11 ekleme ve 0 silme
  1. +11
    -0
      port/port_stdcxx.h

+ 11
- 0
port/port_stdcxx.h Dosyayı Görüntüle

@ -91,6 +91,9 @@ inline bool Snappy_Compress(const char* input, size_t length,
snappy::RawCompress(input, length, &(*output)[0], &outlen); snappy::RawCompress(input, length, &(*output)[0], &outlen);
output->resize(outlen); output->resize(outlen);
return true; return true;
#else
// Silence compiler warnings about unused arguments.
(void)input; (void)length; (void)output;
#endif // HAVE_SNAPPY #endif // HAVE_SNAPPY
return false; return false;
@ -101,6 +104,8 @@ inline bool Snappy_GetUncompressedLength(const char* input, size_t length,
#if HAVE_SNAPPY #if HAVE_SNAPPY
return snappy::GetUncompressedLength(input, length, result); return snappy::GetUncompressedLength(input, length, result);
#else #else
// Silence compiler warnings about unused arguments.
(void)input; (void)length; (void)result;
return false; return false;
#endif // HAVE_SNAPPY #endif // HAVE_SNAPPY
} }
@ -109,11 +114,15 @@ inline bool Snappy_Uncompress(const char* input, size_t length, char* output) {
#if HAVE_SNAPPY #if HAVE_SNAPPY
return snappy::RawUncompress(input, length, output); return snappy::RawUncompress(input, length, output);
#else #else
// Silence compiler warnings about unused arguments.
(void)input; (void)length; (void)output;
return false; return false;
#endif // HAVE_SNAPPY #endif // HAVE_SNAPPY
} }
inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) { inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
// Silence compiler warnings about unused arguments.
(void)func; (void)arg;
return false; return false;
} }
@ -121,6 +130,8 @@ inline uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size) {
#if HAVE_CRC32C #if HAVE_CRC32C
return ::crc32c::Extend(crc, reinterpret_cast<const uint8_t*>(buf), size); return ::crc32c::Extend(crc, reinterpret_cast<const uint8_t*>(buf), size);
#else #else
// Silence compiler warnings about unused arguments.
(void)crc; (void)buf; (void)size;
return 0; return 0;
#endif // HAVE_CRC32C #endif // HAVE_CRC32C
} }

Yükleniyor…
İptal
Kaydet