summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@wiredtiger.com>2011-12-29 13:41:51 +0000
committerKeith Bostic <keith.bostic@wiredtiger.com>2011-12-29 13:41:51 +0000
commit1aff6b0581f111e8844b8841f44acfda38bf4104 (patch)
treec36a79036dcf64ec3197fe453857022e6934a449 /ext
parentae37f01da1bc3d58db46496bb7b98b7a2e6c1d8d (diff)
downloadmongo-1aff6b0581f111e8844b8841f44acfda38bf4104.tar.gz
Minor change: if our results aren't smaller than the source (not the
destination), return that compression failed (our caller checks anyway, so this isn't a bug fix, but I think it's the right thing to do). Whitespace cleanup.
Diffstat (limited to 'ext')
-rw-r--r--ext/compressors/snappy_compress/snappy_compress.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/compressors/snappy_compress/snappy_compress.c b/ext/compressors/snappy_compress/snappy_compress.c
index 8cc8265de22..54398b606a6 100644
--- a/ext/compressors/snappy_compress/snappy_compress.c
+++ b/ext/compressors/snappy_compress/snappy_compress.c
@@ -34,7 +34,7 @@ wiredtiger_extension_init(
conn = session->connection;
return (conn->add_compressor(
- conn, "snappy_compress", &wt_snappy_compressor, NULL));
+ conn, "snappy_compress", &wt_snappy_compressor, NULL));
}
/* Snappy WT_COMPRESSOR for WT_CONNECTION::add_compressor. */
@@ -74,7 +74,7 @@ wt_snappy_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
size_t snaplen;
char *snapbuf;
- __UNUSED(compressor);
+ __UNUSED(compressor);
/*
* dst_len was computed in wt_snappy_pre_size, so we know it's big
@@ -94,10 +94,10 @@ wt_snappy_compress(WT_COMPRESSOR *compressor, WT_SESSION *session,
* preserve that value, so save snaplen at the beginning of the
* destination buffer.
*/
- if (snaplen + sizeof(size_t) < dst_len) {
+ if (snaplen + sizeof(size_t) < src_len) {
*(size_t *)dst = snaplen;
*result_lenp = snaplen + sizeof(size_t);
- *compression_failed = 0;
+ *compression_failed = 0;
} else
/* The compressor failed to produce a smaller result. */
*compression_failed = 1;
@@ -115,7 +115,7 @@ wt_snappy_decompress(WT_COMPRESSOR *compressor, WT_SESSION *session,
snappy_status snret;
size_t snaplen;
- __UNUSED(compressor);
+ __UNUSED(compressor);
/* retrieve the saved length */
snaplen = *(size_t *)src;
@@ -142,9 +142,9 @@ wt_snappy_pre_size(WT_COMPRESSOR *compressor, WT_SESSION *session,
uint8_t *src, size_t src_len,
size_t *result_lenp)
{
- __UNUSED(compressor);
- __UNUSED(session);
- __UNUSED(src);
+ __UNUSED(compressor);
+ __UNUSED(session);
+ __UNUSED(src);
/*
* Snappy requires the dest buffer be somewhat larger than the source.