summaryrefslogtreecommitdiffstats
path: root/libraries
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-11-01 22:08:15 +0100
committerPetr Mrázek <peterix@gmail.com>2018-11-01 22:08:15 +0100
commit9eb165bfee39578e6ce82dff05e08c701d0a9c0a (patch)
treead1193f73319a25b0b275a772ca8eb35542875ff /libraries
parente4ce74e622b0c4deb40dce71c88a8cc1bc064c54 (diff)
downloadMultiMC-9eb165bfee39578e6ce82dff05e08c701d0a9c0a.tar
MultiMC-9eb165bfee39578e6ce82dff05e08c701d0a9c0a.tar.gz
MultiMC-9eb165bfee39578e6ce82dff05e08c701d0a9c0a.tar.lz
MultiMC-9eb165bfee39578e6ce82dff05e08c701d0a9c0a.tar.xz
MultiMC-9eb165bfee39578e6ce82dff05e08c701d0a9c0a.zip
iNOISSUE fix build issue with pack200 on rhel 7.6
Diffstat (limited to 'libraries')
-rw-r--r--libraries/pack200/src/unpack.h6
-rw-r--r--libraries/pack200/src/zip.cpp8
-rw-r--r--libraries/pack200/src/zip.h6
3 files changed, 12 insertions, 8 deletions
diff --git a/libraries/pack200/src/unpack.h b/libraries/pack200/src/unpack.h
index 8363740d..cc5dd60a 100644
--- a/libraries/pack200/src/unpack.h
+++ b/libraries/pack200/src/unpack.h
@@ -23,6 +23,8 @@
* questions.
*/
+#pragma once
+
// Global Structures
struct jar;
struct gunzip;
@@ -33,6 +35,8 @@ struct cpindex;
struct inner_class;
struct value_stream;
+typedef int64_t (*read_input_fn_t)(unpacker *self, void *buf, int64_t minlen, int64_t maxlen);
+
struct cpindex
{
uint32_t len;
@@ -186,8 +190,6 @@ struct unpacker
int unsized_bytes_read;
// callback to read at least one byte, up to available input
- typedef int64_t (*read_input_fn_t)(unpacker *self, void *buf, int64_t minlen,
- int64_t maxlen);
read_input_fn_t read_input_fn;
// archive header fields
diff --git a/libraries/pack200/src/zip.cpp b/libraries/pack200/src/zip.cpp
index 13b955cc..e776510b 100644
--- a/libraries/pack200/src/zip.cpp
+++ b/libraries/pack200/src/zip.cpp
@@ -444,7 +444,7 @@ static int64_t read_input_via_gzip(unpacker *u, void *buf, int64_t minlen, int64
char *bufptr = (char *)buf;
char *inbuf = u->gzin->inbuf;
size_t inbuflen = sizeof(u->gzin->inbuf);
- unpacker::read_input_fn_t read_gzin_fn = (unpacker::read_input_fn_t)u->gzin->read_input_fn;
+ read_input_fn_t read_gzin_fn = u->gzin->read_input_fn;
z_stream &zs = *(z_stream *)u->gzin->zstream;
while (numread < minlen)
{
@@ -507,7 +507,7 @@ void gunzip::init(unpacker *u_)
BYTES_OF(*this).clear();
u = u_;
assert(u->gzin == nullptr); // once only, please
- read_input_fn = (void *)u->read_input_fn;
+ read_input_fn = u->read_input_fn;
zstream = NEW(z_stream, 1);
u->gzin = this;
u->read_input_fn = read_input_via_gzip;
@@ -574,7 +574,7 @@ void gunzip::free()
{
assert(u->gzin == this);
u->gzin = nullptr;
- u->read_input_fn = (unpacker::read_input_fn_t) this->read_input_fn;
+ u->read_input_fn = this->read_input_fn;
inflateEnd((z_stream *)zstream);
::free(zstream);
zstream = nullptr;
@@ -583,7 +583,7 @@ void gunzip::free()
void gunzip::read_fixed_field(char *buf, size_t buflen)
{
- int64_t nr = ((unpacker::read_input_fn_t)read_input_fn)(u, buf, buflen, buflen);
+ int64_t nr = read_input_fn(u, buf, buflen, buflen);
if ((size_t)nr != buflen)
unpack_abort("short stream header");
}
diff --git a/libraries/pack200/src/zip.h b/libraries/pack200/src/zip.h
index 5fcbae94..ff973a86 100644
--- a/libraries/pack200/src/zip.h
+++ b/libraries/pack200/src/zip.h
@@ -22,12 +22,14 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
+#pragma once
+
#include <stdint.h>
typedef unsigned short ushort;
typedef unsigned int uint32_t;
typedef unsigned char uchar;
-struct unpacker;
+#include "unpack.h"
struct jar
{
@@ -95,7 +97,7 @@ struct gunzip
// pointer to outer unpacker, for error checks etc.
unpacker *u;
- void *read_input_fn; // underlying \bchar\b stream
+ read_input_fn_t read_input_fn; // underlying \bchar\b stream
void *zstream; // inflater state
char inbuf[1 << 14]; // input buffer