Resolve most compiler warnings (#1053)

This commit is contained in:
David Markowitz
2023-04-12 09:48:20 -07:00
committed by GitHub
parent ce51438bc8
commit 4734996c7c
8 changed files with 23 additions and 10 deletions

View File

@@ -65,6 +65,15 @@ void RakNet::BitStream::Write<AMFValue*>(AMFValue* value) {
this->Write((AMFArrayValue*)value);
break;
}
case AMFObject:
case AMFXML:
case AMFByteArray:
case AMFVectorInt:
case AMFVectorUInt:
case AMFVectorDouble:
case AMFVectorObject:
case AMFDictionary:
break;
}
}
}

View File

@@ -111,7 +111,7 @@ static void ErrorCallback(void* data, const char* msg, int errnum) {
void GenerateDump() {
std::string cmd = "sudo gcore " + std::to_string(getpid());
system(cmd.c_str());
int ret = system(cmd.c_str()); // Saving a return just to prevent warning
}
void CatchUnhandled(int sig) {

View File

@@ -47,6 +47,10 @@ AssetManager::AssetManager(const std::filesystem::path& path) {
this->LoadPackIndex();
break;
}
case eAssetBundleType::None:
case eAssetBundleType::Unpacked: {
break;
}
}
}
@@ -111,7 +115,7 @@ bool AssetManager::GetFile(const char* name, char** data, uint32_t* len) {
*len = ftell(file);
*data = (char*)malloc(*len);
fseek(file, 0, SEEK_SET);
fread(*data, sizeof(uint8_t), *len, file);
int32_t readInData = fread(*data, sizeof(uint8_t), *len, file);
fclose(file);
return true;

View File

@@ -77,7 +77,7 @@ bool Pack::ReadFileFromPack(uint32_t crc, char** data, uint32_t* len) {
if (!isCompressed) {
char* tempData = (char*)malloc(pkRecord.m_UncompressedSize);
fread(tempData, sizeof(uint8_t), pkRecord.m_UncompressedSize, file);
int32_t readInData = fread(tempData, sizeof(uint8_t), pkRecord.m_UncompressedSize, file);
*data = tempData;
*len = pkRecord.m_UncompressedSize;
@@ -97,11 +97,11 @@ bool Pack::ReadFileFromPack(uint32_t crc, char** data, uint32_t* len) {
if (currentReadPos >= pkRecord.m_UncompressedSize) break;
uint32_t size;
fread(&size, sizeof(uint32_t), 1, file);
int32_t readInData = fread(&size, sizeof(uint32_t), 1, file);
pos += 4; // Move pointer position 4 to the right
char* chunk = (char*)malloc(size);
fread(chunk, sizeof(int8_t), size, file);
int32_t readInData2 = fread(chunk, sizeof(int8_t), size, file);
pos += size; // Move pointer position the amount of bytes read to the right
int32_t err;