mirror of https://github.com/google/snappy.git
Clean up unused function warnings in snappy.
This commit is contained in:
parent
8b60aac4fd
commit
ed3b7b242b
|
@ -170,11 +170,6 @@ enum {
|
||||||
};
|
};
|
||||||
static const int kMaximumTagLength = 5; // COPY_4_BYTE_OFFSET plus the actual offset.
|
static const int kMaximumTagLength = 5; // COPY_4_BYTE_OFFSET plus the actual offset.
|
||||||
|
|
||||||
// Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits
|
|
||||||
static const uint32 wordmask[] = {
|
|
||||||
0u, 0xffu, 0xffffu, 0xffffffu, 0xffffffffu
|
|
||||||
};
|
|
||||||
|
|
||||||
// Data stored per entry in lookup table:
|
// Data stored per entry in lookup table:
|
||||||
// Range Bits-used Description
|
// Range Bits-used Description
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
|
|
|
@ -126,10 +126,6 @@ extern "C" {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
namespace File {
|
|
||||||
void Init() { }
|
|
||||||
} // namespace File
|
|
||||||
|
|
||||||
namespace file {
|
namespace file {
|
||||||
int Defaults() { return 0; }
|
int Defaults() { return 0; }
|
||||||
|
|
||||||
|
@ -162,9 +158,8 @@ namespace file {
|
||||||
return DummyStatus();
|
return DummyStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
DummyStatus SetContents(const std::string& filename,
|
inline DummyStatus SetContents(
|
||||||
const std::string& str,
|
const std::string& filename, const std::string& str, int unused) {
|
||||||
int unused) {
|
|
||||||
FILE* fp = fopen(filename.c_str(), "wb");
|
FILE* fp = fopen(filename.c_str(), "wb");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
perror(filename.c_str());
|
perror(filename.c_str());
|
||||||
|
@ -468,7 +463,7 @@ class ZLib {
|
||||||
|
|
||||||
DECLARE_bool(run_microbenchmarks);
|
DECLARE_bool(run_microbenchmarks);
|
||||||
|
|
||||||
static void RunSpecifiedBenchmarks() {
|
static inline void RunSpecifiedBenchmarks() {
|
||||||
if (!FLAGS_run_microbenchmarks) {
|
if (!FLAGS_run_microbenchmarks) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -516,10 +511,6 @@ static inline int RUN_ALL_TESTS() {
|
||||||
// For main().
|
// For main().
|
||||||
namespace snappy {
|
namespace snappy {
|
||||||
|
|
||||||
static void CompressFile(const char* fname);
|
|
||||||
static void UncompressFile(const char* fname);
|
|
||||||
static void MeasureFile(const char* fname);
|
|
||||||
|
|
||||||
// Logging.
|
// Logging.
|
||||||
|
|
||||||
#define LOG(level) LogMessage()
|
#define LOG(level) LogMessage()
|
||||||
|
@ -591,10 +582,6 @@ class LogMessageVoidify {
|
||||||
#define CHECK_GT(a, b) CRASH_UNLESS((a) > (b))
|
#define CHECK_GT(a, b) CRASH_UNLESS((a) > (b))
|
||||||
#define CHECK_OK(cond) (cond).CheckSuccess()
|
#define CHECK_OK(cond) (cond).CheckSuccess()
|
||||||
|
|
||||||
} // namespace
|
} // namespace snappy
|
||||||
|
|
||||||
using snappy::CompressFile;
|
|
||||||
using snappy::UncompressFile;
|
|
||||||
using snappy::MeasureFile;
|
|
||||||
|
|
||||||
#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
|
#endif // THIRD_PARTY_SNAPPY_OPENSOURCE_SNAPPY_TEST_H_
|
||||||
|
|
|
@ -47,7 +47,6 @@ using internal::COPY_2_BYTE_OFFSET;
|
||||||
using internal::LITERAL;
|
using internal::LITERAL;
|
||||||
using internal::char_table;
|
using internal::char_table;
|
||||||
using internal::kMaximumTagLength;
|
using internal::kMaximumTagLength;
|
||||||
using internal::wordmask;
|
|
||||||
|
|
||||||
// Any hash function will produce a valid compressed bitstream, but a good
|
// Any hash function will produce a valid compressed bitstream, but a good
|
||||||
// hash function reduces the number of collisions and thus yields better
|
// hash function reduces the number of collisions and thus yields better
|
||||||
|
@ -575,6 +574,14 @@ static inline void Report(const char *algorithm, size_t compressed_size,
|
||||||
// bool TryFastAppend(const char* ip, size_t available, size_t length);
|
// bool TryFastAppend(const char* ip, size_t available, size_t length);
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
namespace internal {
|
||||||
|
|
||||||
|
// Mapping from i in range [0,4] to a mask to extract the bottom 8*i bits
|
||||||
|
static const uint32 wordmask[] = {
|
||||||
|
0u, 0xffu, 0xffffu, 0xffffffu, 0xffffffffu
|
||||||
|
};
|
||||||
|
|
||||||
|
} // end namespace internal
|
||||||
|
|
||||||
// Helper class for decompression
|
// Helper class for decompression
|
||||||
class SnappyDecompressor {
|
class SnappyDecompressor {
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "snappy.h"
|
#include "snappy.h"
|
||||||
|
@ -69,7 +70,6 @@ DEFINE_bool(snappy_dump_decompression_table, false,
|
||||||
|
|
||||||
namespace snappy {
|
namespace snappy {
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_FUNC_MMAP
|
#ifdef HAVE_FUNC_MMAP
|
||||||
|
|
||||||
// To test against code that reads beyond its input, this class copies a
|
// To test against code that reads beyond its input, this class copies a
|
||||||
|
@ -1197,7 +1197,6 @@ TEST(Snappy, VerifyCharTable) {
|
||||||
using snappy::internal::COPY_2_BYTE_OFFSET;
|
using snappy::internal::COPY_2_BYTE_OFFSET;
|
||||||
using snappy::internal::COPY_4_BYTE_OFFSET;
|
using snappy::internal::COPY_4_BYTE_OFFSET;
|
||||||
using snappy::internal::char_table;
|
using snappy::internal::char_table;
|
||||||
using snappy::internal::wordmask;
|
|
||||||
|
|
||||||
uint16 dst[256];
|
uint16 dst[256];
|
||||||
|
|
||||||
|
@ -1509,7 +1508,6 @@ BENCHMARK(BM_ZFlat)->DenseRange(0, ARRAYSIZE(files) - 1);
|
||||||
|
|
||||||
} // namespace snappy
|
} // namespace snappy
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
InitGoogle(argv[0], &argc, &argv, true);
|
InitGoogle(argv[0], &argc, &argv, true);
|
||||||
RunSpecifiedBenchmarks();
|
RunSpecifiedBenchmarks();
|
||||||
|
@ -1517,11 +1515,11 @@ int main(int argc, char** argv) {
|
||||||
if (argc >= 2) {
|
if (argc >= 2) {
|
||||||
for (int arg = 1; arg < argc; arg++) {
|
for (int arg = 1; arg < argc; arg++) {
|
||||||
if (FLAGS_write_compressed) {
|
if (FLAGS_write_compressed) {
|
||||||
CompressFile(argv[arg]);
|
snappy::CompressFile(argv[arg]);
|
||||||
} else if (FLAGS_write_uncompressed) {
|
} else if (FLAGS_write_uncompressed) {
|
||||||
UncompressFile(argv[arg]);
|
snappy::UncompressFile(argv[arg]);
|
||||||
} else {
|
} else {
|
||||||
MeasureFile(argv[arg]);
|
snappy::MeasureFile(argv[arg]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue