mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Make this work on systems where size_t == unsigned and where they are not
the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
445cdd3aad
commit
5c3fa1ec79
@ -36,8 +36,8 @@ static int getdata(char*& buffer, size_t &size,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getdata(char*& buffer, unsigned &size,
|
static int getdata_uns(char*& buffer, unsigned &size,
|
||||||
llvm::Compressor::OutputDataCallback* cb, void* context) {
|
llvm::Compressor::OutputDataCallback* cb, void* context) {
|
||||||
size_t SizeOut;
|
size_t SizeOut;
|
||||||
int Res = getdata(buffer, SizeOut, cb, context);
|
int Res = getdata(buffer, SizeOut, cb, context);
|
||||||
size = SizeOut;
|
size = SizeOut;
|
||||||
@ -290,7 +290,7 @@ size_t Compressor::compress(const char* in, size_t size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a block of memory
|
// Get a block of memory
|
||||||
if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
if (0 != getdata_uns(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
||||||
BZ2_bzCompressEnd(&bzdata);
|
BZ2_bzCompressEnd(&bzdata);
|
||||||
throw std::string("Can't allocate output buffer");
|
throw std::string("Can't allocate output buffer");
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ size_t Compressor::compress(const char* in, size_t size,
|
|||||||
// Compress it
|
// Compress it
|
||||||
int bzerr = BZ_FINISH_OK;
|
int bzerr = BZ_FINISH_OK;
|
||||||
while (BZ_FINISH_OK == (bzerr = BZ2_bzCompress(&bzdata, BZ_FINISH))) {
|
while (BZ_FINISH_OK == (bzerr = BZ2_bzCompress(&bzdata, BZ_FINISH))) {
|
||||||
if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
if (0 != getdata_uns(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
||||||
BZ2_bzCompressEnd(&bzdata);
|
BZ2_bzCompressEnd(&bzdata);
|
||||||
throw std::string("Can't allocate output buffer");
|
throw std::string("Can't allocate output buffer");
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ size_t Compressor::decompress(const char *in, size_t size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a block of memory
|
// Get a block of memory
|
||||||
if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
if (0 != getdata_uns(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
||||||
BZ2_bzDecompressEnd(&bzdata);
|
BZ2_bzDecompressEnd(&bzdata);
|
||||||
throw std::string("Can't allocate output buffer");
|
throw std::string("Can't allocate output buffer");
|
||||||
}
|
}
|
||||||
@ -408,7 +408,7 @@ size_t Compressor::decompress(const char *in, size_t size,
|
|||||||
// Decompress it
|
// Decompress it
|
||||||
int bzerr = BZ_OK;
|
int bzerr = BZ_OK;
|
||||||
while (BZ_OK == (bzerr = BZ2_bzDecompress(&bzdata))) {
|
while (BZ_OK == (bzerr = BZ2_bzDecompress(&bzdata))) {
|
||||||
if (0 != getdata(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
if (0 != getdata_uns(bzdata.next_out, bzdata.avail_out,cb,context)) {
|
||||||
BZ2_bzDecompressEnd(&bzdata);
|
BZ2_bzDecompressEnd(&bzdata);
|
||||||
throw std::string("Can't allocate output buffer");
|
throw std::string("Can't allocate output buffer");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user