mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2026-08-23 11:24:34 -05:00
Avoid using streams in ELFIO to massively reduce the binary size
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
struct membuf : std::streambuf {
|
||||
membuf(char *begin, char *end) {
|
||||
this->setg(begin, begin, end);
|
||||
}
|
||||
|
||||
pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which = std::ios_base::in) override {
|
||||
if (dir == std::ios_base::cur)
|
||||
gbump(off);
|
||||
else if (dir == std::ios_base::end)
|
||||
setg(eback(), egptr() + off, egptr());
|
||||
else if (dir == std::ios_base::beg)
|
||||
setg(eback(), eback() + off, egptr());
|
||||
return gptr() - eback();
|
||||
}
|
||||
|
||||
pos_type seekpos(pos_type sp, std::ios_base::openmode which) override {
|
||||
return seekoff(sp - pos_type(off_type(0)), std::ios_base::beg, which);
|
||||
}
|
||||
};
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
}
|
||||
|
||||
int z_ret;
|
||||
z_stream s = {nullptr};
|
||||
z_stream s = {};
|
||||
|
||||
s.zalloc = Z_NULL;
|
||||
s.zfree = Z_NULL;
|
||||
@@ -66,8 +66,8 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int z_ret = 0;
|
||||
z_stream s = {nullptr};
|
||||
int z_ret;
|
||||
z_stream s = {};
|
||||
|
||||
s.zalloc = Z_NULL;
|
||||
s.zfree = Z_NULL;
|
||||
|
||||
Reference in New Issue
Block a user