MinGW: Fixed compilation errors/warnings

This commit is contained in:
Sour 2019-07-03 00:44:45 -04:00
parent 88f66a8b59
commit a70a746df1
10 changed files with 20 additions and 18 deletions

View file

@ -92,7 +92,7 @@ void BaseControlDevice::SetTextState(string textState)
try {
pos.X = (int16_t)std::stol(data[0]);
pos.Y = (int16_t)std::stol(data[1]);
} catch(std::exception ex) {
} catch(std::exception &ex) {
pos.X = -1;
pos.Y = -1;
}

View file

@ -1,13 +1,13 @@
#include "stdafx.h"
#include "DefaultVideoFilter.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include "DebugHud.h"
#include "Console.h"
#include "EmuSettings.h"
#include "SettingTypes.h"
const static double PI = 3.14159265358979323846;
DefaultVideoFilter::DefaultVideoFilter(shared_ptr<Console> console) : BaseVideoFilter(console)
{
InitLookupTable();
@ -15,7 +15,7 @@ DefaultVideoFilter::DefaultVideoFilter(shared_ptr<Console> console) : BaseVideoF
void DefaultVideoFilter::InitConversionMatrix(double hueShift, double saturationShift)
{
double hue = hueShift * M_PI;
double hue = hueShift * PI;
double sat = saturationShift + 1;
double baseValues[6] = { 0.956f, 0.621f, -0.272f, -0.647f, -1.105f, 1.702f };

View file

@ -93,7 +93,7 @@ uint32_t Disassembler::BuildCache(AddressInfo &addrInfo, uint8_t cpuFlags, CpuTy
int returnSize = 0;
int32_t address = addrInfo.Address;
while(address >= 0 && address < cache->size()) {
while(address >= 0 && address < (int32_t)cache->size()) {
DisassemblyInfo &disInfo = (*cache)[address];
if(!disInfo.IsInitialized() || !disInfo.IsValid(cpuFlags)) {
disInfo.Initialize(source+address, cpuFlags, type);

View file

@ -529,7 +529,7 @@ int32_t ExpressionEvaluator::Evaluate(string expression, DebugState &state, Eval
if(success) {
return result;
}
} catch(std::exception e) {
} catch(std::exception &e) {
}
resultType = EvalResultType::Invalid;
return 0;
@ -544,7 +544,7 @@ bool ExpressionEvaluator::Validate(string expression)
bool success;
PrivateEvaluate(expression, state, type, operationInfo, success);
return success;
} catch(std::exception e) {
} catch(std::exception &e) {
return false;
}
}

View file

@ -235,7 +235,7 @@ void SaveStateManager::LoadRecentGame(string filename, bool resetGame)
SaveStateManager::LoadState(stateStream, false);
}
}
} catch(std::exception ex) {
} catch(std::exception &ex) {
_console->Stop(true);
}
_console->Unlock();

View file

@ -103,9 +103,9 @@ void ScriptingContext::UnregisterMemoryCallback(CallbackType type, int startAddr
endAddr = 0xFFFFFF;
}
for(int i = 0; i < _callbacks[(int)type].size(); i++) {
for(size_t i = 0; i < _callbacks[(int)type].size(); i++) {
MemoryCallback &callback = _callbacks[(int)type][i];
if(callback.Reference == reference && callback.StartAddress == startAddr && callback.EndAddress == endAddr) {
if(callback.Reference == reference && (int)callback.StartAddress == startAddr && (int)callback.EndAddress == endAddr) {
_callbacks[(int)type].erase(_callbacks[(int)type].begin() + i);
break;
}

View file

@ -133,7 +133,7 @@ void TraceLogger::ParseFormatString(vector<RowPart> &rowParts, string format)
if(!match.str(4).empty()) {
try {
part.MinWidth = std::stoi(match.str(4));
} catch(std::exception) {
} catch(std::exception&) {
}
}
part.DisplayInHex = match.str(5) == "h";

View file

@ -24,11 +24,13 @@
#include "../Utilities/UTF8Util.h"
#ifdef __clang__
#define __forceinline __attribute__((always_inline))
#else
#ifdef __GNUC__
#define __forceinline
#ifndef __MINGW32__
#ifdef __clang__
#define __forceinline __attribute__((always_inline))
#else
#ifdef __GNUC__
#define __forceinline
#endif
#endif
#endif

View file

@ -32,7 +32,7 @@ VirtualFile::VirtualFile(const string & file)
if(tokens.size() > 2) {
try {
_innerFileIndex = std::stoi(tokens[2]);
} catch(std::exception) {}
} catch(std::exception &) {}
}
}
}

View file

@ -4791,7 +4791,7 @@ static void convert_samples_short(int buf_c, short **buffer, int b_offset, int d
int stb_vorbis_get_frame_short(stb_vorbis *f, int num_c, short **buffer, int num_samples)
{
float **output;
float **output = nullptr;
int len = stb_vorbis_get_frame_float(f, NULL, &output);
if (len > num_samples) len = num_samples;
if (len)