mirror of
https://github.com/wiiu-env/RPXLoadingModule.git
synced 2024-11-22 09:59:17 +01:00
Fix Dockerfile, fix compiler warnings
This commit is contained in:
parent
160d5b4f3e
commit
f79ae3847e
@ -1,5 +1,6 @@
|
||||
FROM wiiuenv/devkitppc:20210101
|
||||
|
||||
COPY --from=wiiuenv/librpxloader:20210116 /artifacts $DEVKITPRO
|
||||
COPY --from=wiiuenv/libfunctionpatcher:20210109 /artifacts $DEVKITPRO
|
||||
COPY --from=wiiuenv/wiiumodulesystem:20210101 /artifacts $DEVKITPRO
|
||||
COPY --from=wiiuenv/libromfs_wiiu:20210109133626639534 /artifacts $DEVKITPRO
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "utils/StringTools.h"
|
||||
#include "utils/ini.h"
|
||||
#include <cstring>
|
||||
#include <rpxloader.h>
|
||||
|
||||
char gIconCache[65580] __attribute__((section(".data")));
|
||||
|
||||
@ -194,8 +195,8 @@ bool RL_LoadFromSDOnNextLaunch(const char *bundle_path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t RL_MountBundle(const char *name, const char *path, RomfsSource source) {
|
||||
return romfsMount(name, path, source);
|
||||
int32_t RL_MountBundle(const char *name, const char *path, BundleSource source) {
|
||||
return romfsMount(name, path, (RomfsSource) source);
|
||||
}
|
||||
|
||||
int32_t RL_UnmountBundle(const char *name) {
|
||||
@ -236,7 +237,7 @@ int32_t RL_FileClose(uint32_t handle) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t RL_FileExists(const char *name) {
|
||||
bool RL_FileExists(const char *name) {
|
||||
std::string checkgz = std::string(name) + ".gz";
|
||||
return CheckFile(name) || CheckFile(checkgz.c_str());
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
#include "FileReader.h"
|
||||
#include "logger.h"
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <cstring>
|
||||
|
||||
int FileReader::read(uint8_t *buffer, int size) {
|
||||
int FileReader::read(uint8_t *buffer, uint32_t size) {
|
||||
if (isReadFromBuffer) {
|
||||
if (input_buffer == nullptr) {
|
||||
return -1;
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
|
||||
virtual ~FileReader();
|
||||
|
||||
virtual int read(uint8_t *buffer, int size) ;
|
||||
virtual int read(uint8_t *buffer, uint32_t size) ;
|
||||
|
||||
private:
|
||||
bool isReadFromBuffer = false;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "FileReaderCompressed.h"
|
||||
|
||||
int FileReaderCompressed::read(uint8_t *buffer, int size) {
|
||||
int FileReaderCompressed::read(uint8_t *buffer, uint32_t size) {
|
||||
int startValue = this->strm.total_out;
|
||||
uint32_t newSize = 0;
|
||||
int ret = 0;
|
||||
@ -10,10 +10,11 @@ int FileReaderCompressed::read(uint8_t *buffer, int size) {
|
||||
nextOut = size;
|
||||
}
|
||||
if (this->strm.avail_in == 0) {
|
||||
this->strm.avail_in = FileReader::read(this->zlib_in_buf, BUFFER_SIZE);
|
||||
if (this->strm.avail_in == 0 || this->strm.avail_in == -1) {
|
||||
int read_res = FileReader::read(this->zlib_in_buf, BUFFER_SIZE);
|
||||
if (read_res <= 0) {
|
||||
break;
|
||||
}
|
||||
this->strm.avail_in = read_res;
|
||||
this->strm.next_in = this->zlib_in_buf;
|
||||
}
|
||||
/* run inflate() on input until output buffer not full */
|
||||
@ -34,12 +35,15 @@ int FileReaderCompressed::read(uint8_t *buffer, int size) {
|
||||
switch (ret) {
|
||||
case Z_NEED_DICT:
|
||||
DEBUG_FUNCTION_LINE("Z_NEED_DICT");
|
||||
ret = Z_DATA_ERROR; /* and fall through */
|
||||
ret = Z_DATA_ERROR;
|
||||
[[fallthrough]]; /* and fall through */
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
DEBUG_FUNCTION_LINE("Z_MEM_ERROR or Z_DATA_ERROR");
|
||||
(void) inflateEnd(&this->strm);
|
||||
return ret;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
newSize = this->strm.total_out - startValue;
|
||||
|
@ -10,14 +10,13 @@ class FileReaderCompressed : public FileReader {
|
||||
public:
|
||||
FileReaderCompressed(uint8_t *buffer, uint32_t size);
|
||||
|
||||
|
||||
explicit FileReaderCompressed(std::string &file);
|
||||
|
||||
~FileReaderCompressed() override{
|
||||
DEBUG_FUNCTION_LINE("");
|
||||
}
|
||||
|
||||
int read(uint8_t *buffer, int size) override;
|
||||
int read(uint8_t *buffer, uint32_t size) override;
|
||||
|
||||
private:
|
||||
bool initDone = false;
|
||||
|
Loading…
Reference in New Issue
Block a user