Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: remoting/client/plugin/compression.cc

Issue 2800004: Fix broken build. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/compression.cc
===================================================================
--- remoting/client/plugin/compression.cc (revision 49842)
+++ remoting/client/plugin/compression.cc (working copy)
@@ -29,8 +29,13 @@
stream_.avail_out = kZLIB_CHUNK;
stream_.next_out = reinterpret_cast<Bytef*>(&buffer_[last_size]);
int ret = deflate(&stream_, flush);
- assert(ret != Z_STREAM_ERROR);
+ // Check ret before the assert so that we don't get an unused variable
+ // warning in release builds.
+ if (ret == Z_STREAM_ERROR) {
+ assert(ret != Z_STREAM_ERROR);
Sergey Ulanov 2010/06/15 22:50:03 This should be replaced with DCHECK. I think, it w
+ }
+
// Shrink the size of the vector. It doesn't alter the capacity.
int compressed = kZLIB_CHUNK - stream_.avail_out;
buffer_.resize(last_size + compressed);
@@ -81,8 +86,13 @@
stream_.avail_out = kZLIB_CHUNK;
stream_.next_out = reinterpret_cast<Bytef*>(&buffer_[last_size]);
int ret = inflate(&stream_, flush);
- assert(ret != Z_STREAM_ERROR);
+ // Check ret before the assert so that we don't get an unused variable
+ // warning in release builds.
+ if (ret == Z_STREAM_ERROR) {
+ assert(ret != Z_STREAM_ERROR);
+ }
+
// Shrink the size of the vector. It doesn't alter the capacity.
int decompressed = kZLIB_CHUNK - stream_.avail_out;
buffer_.resize(last_size + decompressed);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698