File snappy-random-return.patch of Package snappy
---
snappy-test.h | 8 ++++++--
snappy_unittest.cc | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
Index: snappy_unittest.cc
===================================================================
--- snappy_unittest.cc.orig
+++ snappy_unittest.cc
@@ -161,6 +161,7 @@ static size_t MinimumRequiredOutputSpace
default:
LOG(FATAL) << "Unknown compression type number " << comp;
+ return -1; //make gcc happy
}
}
Index: snappy-test.h
===================================================================
--- snappy-test.h.orig
+++ snappy-test.h
@@ -132,13 +132,15 @@ namespace File {
} // namespace File
namespace file {
- int Defaults() { }
+ int Defaults() { return 0; } //make gcc happy
class DummyStatus {
public:
void CheckSuccess() { }
};
+ DummyStatus _dummy_ret;
+
DummyStatus ReadFileToString(const char* filename, string* data, int unused) {
FILE* fp = fopen(filename, "rb");
if (fp == NULL) {
@@ -158,12 +160,13 @@ namespace file {
}
fclose(fp);
+ return _dummy_ret; //make gcc happy
}
DummyStatus ReadFileToString(const string& filename,
string* data,
int unused) {
- ReadFileToString(filename.c_str(), data, unused);
+ return ReadFileToString(filename.c_str(), data, unused);
}
DummyStatus WriteStringToFile(const string& str,
@@ -182,6 +185,7 @@ namespace file {
}
fclose(fp);
+ return _dummy_ret; //make gcc happy
}
} // namespace file