mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-02 17:25:27 +02:00
Merge pull request #8796 from unknownbrackets/warnings
Minor warning fixes
This commit is contained in:
commit
cab2c29909
13 files changed
+31
-34
No files matched your search
+3
-1
@@ -60,7 +60,9 @@ const char *GetStringErrorMsg(int errCode) {
|
||||
static __thread char err_str[buff_size] = {};
|
||||
|
||||
// Thread safe (XSI-compliant)
|
||||
strerror_r(errCode, err_str, buff_size);
|
||||
if (strerror_r(errCode, err_str, buff_size) == 0) {
|
||||
return "Unknown error";
|
||||
}
|
||||
#endif
|
||||
|
||||
return err_str;
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#define new DBG_NEW
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
static const char *validationLayers[] = {
|
||||
"VK_LAYER_LUNARG_standard_validation",
|
||||
/*
|
||||
|
||||
@@ -1054,13 +1054,6 @@ int MIPSInterpret_RunUntil(u64 globalTicks)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline void DelayBranchTo(MIPSState *curMips, u32 where)
|
||||
{
|
||||
curMips->pc += 4;
|
||||
curMips->nextPC = where;
|
||||
curMips->inDelaySlot = true;
|
||||
}
|
||||
|
||||
const char *MIPSGetName(MIPSOpcode op)
|
||||
{
|
||||
static const char *noname = "unk";
|
||||
|
||||
@@ -27,7 +27,7 @@ using namespace Gen;
|
||||
|
||||
int Jit::Replace_fabsf() {
|
||||
fpr.SpillLock(0, 12);
|
||||
fpr.MapReg(0, MAP_DIRTY | MAP_NOINIT);
|
||||
fpr.MapReg(0, false, true);
|
||||
MOVSS(fpr.RX(0), fpr.R(12));
|
||||
ANDPS(fpr.RX(0), M(&ssNoSignMask));
|
||||
fpr.ReleaseSpillLocks();
|
||||
|
||||
+2
-2
@@ -53,8 +53,8 @@ public:
|
||||
|
||||
const JitOptions &GetJitOptions() { return jo; }
|
||||
|
||||
void DoState(PointerWrap &p);
|
||||
void DoDummyState(PointerWrap &p);
|
||||
void DoState(PointerWrap &p) override;
|
||||
void DoDummyState(PointerWrap &p) override;
|
||||
|
||||
// Compiled ops should ignore delay slots
|
||||
// the compiler will take care of them by itself
|
||||
|
||||
@@ -608,7 +608,7 @@ void FPURegCache::MapReg(const int i, bool doLoad, bool makeDirty) {
|
||||
if (!regs[i].away) {
|
||||
// Reg is at home in the memory register file. Let's pull it out.
|
||||
X64Reg xr = GetFreeXReg();
|
||||
_assert_msg_(JIT, xr >= 0 && xr < NUM_X_FPREGS, "WTF - FPURegCache::MapReg - invalid reg %d", (int)xr);
|
||||
_assert_msg_(JIT, xr < NUM_X_FPREGS, "WTF - FPURegCache::MapReg - invalid reg %d", (int)xr);
|
||||
xregs[xr].mipsReg = i;
|
||||
xregs[xr].dirty = makeDirty;
|
||||
OpArg newloc = ::Gen::R(xr);
|
||||
@@ -655,7 +655,7 @@ void FPURegCache::StoreFromRegister(int i) {
|
||||
|
||||
if (regs[i].away) {
|
||||
X64Reg xr = regs[i].location.GetSimpleReg();
|
||||
_assert_msg_(JIT, xr >= 0 && xr < NUM_X_FPREGS, "WTF - FPURegCache::StoreFromRegister - invalid reg: x %i (mr: %i). PC=%08x", (int)xr, i, js_->compilerPC);
|
||||
_assert_msg_(JIT, xr < NUM_X_FPREGS, "WTF - FPURegCache::StoreFromRegister - invalid reg: x %i (mr: %i). PC=%08x", (int)xr, i, js_->compilerPC);
|
||||
if (regs[i].lane != 0) {
|
||||
const int *mri = xregs[xr].mipsRegs;
|
||||
int seq = 1;
|
||||
@@ -738,7 +738,7 @@ void FPURegCache::DiscardR(int i) {
|
||||
_assert_msg_(JIT, !regs[i].location.IsImm(), "FPU can't handle imm yet.");
|
||||
if (regs[i].away) {
|
||||
X64Reg xr = regs[i].location.GetSimpleReg();
|
||||
_assert_msg_(JIT, xr >= 0 && xr < NUM_X_FPREGS, "DiscardR: MipsReg had bad X64Reg");
|
||||
_assert_msg_(JIT, xr < NUM_X_FPREGS, "DiscardR: MipsReg had bad X64Reg");
|
||||
// Note that we DO NOT write it back here. That's the whole point of Discard.
|
||||
if (regs[i].lane != 0) {
|
||||
// But we can't just discard all of them in SIMD, just the one lane.
|
||||
@@ -783,7 +783,7 @@ void FPURegCache::DiscardVS(int vreg) {
|
||||
if (vregs[vreg].away) {
|
||||
_assert_msg_(JIT, vregs[vreg].lane != 0, "VS expects a SIMD reg.");
|
||||
X64Reg xr = vregs[vreg].location.GetSimpleReg();
|
||||
_assert_msg_(JIT, xr >= 0 && xr < NUM_X_FPREGS, "DiscardR: MipsReg had bad X64Reg");
|
||||
_assert_msg_(JIT, xr < NUM_X_FPREGS, "DiscardR: MipsReg had bad X64Reg");
|
||||
// Note that we DO NOT write it back here. That's the whole point of Discard.
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
int mr = xregs[xr].mipsRegs[i];
|
||||
|
||||
@@ -367,6 +367,9 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
|
||||
case ReplacedTextureFormat::F_8888_BGRA:
|
||||
ConvertBGRA8888ToRGBA8888(saveBuf.data(), (const u32 *)data, (pitch * h) / sizeof(u32));
|
||||
break;
|
||||
case ReplacedTextureFormat::F_8888:
|
||||
// Impossible. Just so we can get warnings on other missed formats.
|
||||
break;
|
||||
}
|
||||
|
||||
data = saveBuf.data();
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "GPU/GLES/Framebuffer.h"
|
||||
|
||||
static const int leftColumnWidth = 200;
|
||||
static const float orgRatio = 1.764706;
|
||||
static const float orgRatio = 1.764706f;
|
||||
|
||||
// Ugly hackery, need to rework some stuff to get around this
|
||||
static float local_dp_xres;
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "util/text/utf8.h"
|
||||
#include "Windows/W32Util/ShellUtil.h"
|
||||
#include "Windows/W32Util/Misc.h"
|
||||
using namespace std;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -729,7 +728,7 @@ UI::EventReturn GameSettingsScreen::OnSavePathMydoc(UI::EventParams &e) {
|
||||
g_Config.memStickDirectory = PPSSPPpath + "memstick/";
|
||||
}
|
||||
else {
|
||||
ofstream myfile;
|
||||
std::ofstream myfile;
|
||||
myfile.open(PPSSPPpath + "installed.txt");
|
||||
if (myfile.is_open()){
|
||||
myfile.close();
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#ifdef _WIN32
|
||||
#pragma warning(disable:4244)
|
||||
#pragma warning(disable:4996)
|
||||
#pragma warning(disable:4305) // truncation from double to float
|
||||
#endif
|
||||
|
||||
#define DISALLOW_COPY_AND_ASSIGN(t) \
|
||||
|
||||
@@ -62,12 +62,12 @@ int ChunkFile::readInt() {
|
||||
return *(int *)(data + pos - 4);
|
||||
else {
|
||||
int i;
|
||||
fread(&i, 1, 4, file);
|
||||
return i;
|
||||
if (fread(&i, 1, 4, file) == 4) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ChunkFile::writeInt(int i) {
|
||||
@@ -166,18 +166,23 @@ void ChunkFile::ascend() {
|
||||
|
||||
//read a block
|
||||
void ChunkFile::readData(void *what, int count) {
|
||||
if (fastMode)
|
||||
if (fastMode) {
|
||||
memcpy(what, data + pos, count);
|
||||
else
|
||||
fread(what, 1, count, file);
|
||||
} else {
|
||||
if (fread(what, 1, count, file) != count) {
|
||||
ELOG("Failed to read complete %d bytes", count);
|
||||
}
|
||||
}
|
||||
|
||||
pos+=count;
|
||||
char temp[4]; //discarded
|
||||
count &= 3;
|
||||
if (count) {
|
||||
count=4-count;
|
||||
if (!fastMode)
|
||||
fread(temp, 1, count, file); // could just as well seek
|
||||
if (!fastMode) {
|
||||
if (fseek(file, count, SEEK_CUR) != 0) {
|
||||
ELOG("Missing padding");
|
||||
}
|
||||
}
|
||||
pos+=count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#pragma optimize("", off)
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define NOMINMAX
|
||||
|
||||
@@ -202,7 +202,7 @@ void fcs2(float theta, float &outsine, float &outcosine) {
|
||||
|
||||
float x = 2 * gamma - gamma * fabs(gamma);
|
||||
float y = 2 * theta - theta * fabs(theta);
|
||||
const float P = 0.225;
|
||||
const float P = 0.225f;
|
||||
outsine = P * (y * fabsf(y) - y) + y; // Q * y + P * y * abs(y)
|
||||
outcosine = P * (x * fabsf(x) - x) + x; // Q * y + P * y * abs(y)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user