summaryrefslogtreecommitdiffstats
path: root/courgette/streams.cc
diff options
context:
space:
mode:
authorsra@google.com <sra@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-18 03:28:40 +0000
committersra@google.com <sra@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-18 03:28:40 +0000
commit54f1b829fe53c48b82440e7c8482e2b6ca397995 (patch)
tree5600358a8d8fac77ea4a7730fca9c4b6cbe09108 /courgette/streams.cc
parent4efe77c3fd39df0dc03b0d73ca0ba24c6e66ff28 (diff)
downloadchromium_src-54f1b829fe53c48b82440e7c8482e2b6ca397995.zip
chromium_src-54f1b829fe53c48b82440e7c8482e2b6ca397995.tar.gz
chromium_src-54f1b829fe53c48b82440e7c8482e2b6ca397995.tar.bz2
Code changes to get the code to compile under GCC.
Courgette still only knows how to compress Windows x86 executables. But now you can compress them on linux. BUG=none TEST=none Review URL: http://codereview.chromium.org/149597 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/streams.cc')
-rw-r--r--courgette/streams.cc24
1 files changed, 1 insertions, 23 deletions
diff --git a/courgette/streams.cc b/courgette/streams.cc
index 365a416..fec16fa 100644
--- a/courgette/streams.cc
+++ b/courgette/streams.cc
@@ -18,7 +18,6 @@
#include "courgette/streams.h"
-#include <io.h>
#include <memory.h>
#include "base/basictypes.h"
@@ -255,7 +254,7 @@ bool SourceStreamSet::Init(const void* source, size_t byte_count) {
}
// Remaining bytes should add up to sum of lengths.
- if (end - finger != accumulated_length)
+ if (static_cast<size_t>(end - finger) != accumulated_length)
return false;
accumulated_length = finger - start;
@@ -335,27 +334,6 @@ bool SinkStreamSet::CopyTo(SinkStream *combined_stream) {
return true;
}
-namespace {
-bool Write(int file_descriptor, SinkStream* sink) {
- size_t length = sink->Length();
- const void *buffer = sink->Buffer();
- int bytes_written = _write(file_descriptor, buffer, length);
- return bytes_written == length;
-}
-}
-
-bool SinkStreamSet::CopyToFileDescriptor(int file_descriptor) {
- SinkStream header;
- CopyHeaderTo(&header);
- if (!Write(file_descriptor, &header))
- return false;
- for (size_t i = 0; i < count_; ++i) {
- if (!Write(file_descriptor, stream(i)))
- return false;
- }
- return true;
-}
-
bool SinkStreamSet::WriteSet(SinkStreamSet* set) {
uint32 lengths[kMaxStreams];
// 'stream_count' includes all non-empty streams and all empty stream numbered