Merge pull request #8888 from unknownbrackets/warnings

Warning fixes
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2016-08-06 10:59:06 +02:00
commit ea6b72d4c9
22 files changed
+36 -27

No files matched your search

+1 -1
View File
@@ -163,7 +163,7 @@ typedef std::map<u32, StreamInfo> StreamInfoMap;
// Internal structure
struct MpegContext {
MpegContext() : mediaengine(nullptr), ringbufferNeedsReverse(false) {
MpegContext() : ringbufferNeedsReverse(false), mediaengine(nullptr) {
memcpy(mpegheader, defaultMpegheader, 2048);
}
~MpegContext() {
+1 -1
View File
@@ -712,7 +712,7 @@ int sceNetAdhocPollSocket(u32 socketStructAddr, int count, int timeout, int nonb
if (timeout == 0) timeout = 1;
int affectedsockets = 0;
if (count > FD_SETSIZE) count = FD_SETSIZE; // return affectedsockets;
if (count > (int)FD_SETSIZE) count = FD_SETSIZE; // return affectedsockets;
// Acquire Network Lock
//acquireNetworkLock();
+1 -1
View File
@@ -834,7 +834,7 @@ static u32 scePsmfGetCurrentStreamType(u32 psmfStruct, u32 typeAddr, u32 channel
if (!psmf) {
return hleLogError(ME, ERROR_PSMF_NOT_INITIALIZED, "invalid psmf");
}
if (psmf->currentStreamNum == ERROR_PSMF_NOT_INITIALIZED) {
if (psmf->currentStreamNum == (int)ERROR_PSMF_NOT_INITIALIZED) {
return hleLogError(ME, ERROR_PSMF_NOT_INITIALIZED, "no stream set");
}
if (!Memory::IsValidAddress(typeAddr) || !Memory::IsValidAddress(channelAddr)) {
+1 -1
View File
@@ -27,7 +27,7 @@
using namespace ArmGen;
using namespace ArmJitConstants;
ArmRegCacheFPU::ArmRegCacheFPU(MIPSState *mips, MIPSComp::JitState *js, MIPSComp::JitOptions *jo) : mips_(mips), vr(mr + 32), js_(js), jo_(jo), initialReady(false) {
ArmRegCacheFPU::ArmRegCacheFPU(MIPSState *mips, MIPSComp::JitState *js, MIPSComp::JitOptions *jo) : mips_(mips), js_(js), jo_(jo), vr(mr + 32), initialReady(false) {
if (cpu_info.bNEON) {
numARMFpuReg_ = 32;
} else {
+1 -1
View File
@@ -371,7 +371,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, const u32 *constPool, int c
break;
case IROp::FCmovVfpuCC:
if (((mips->vfpuCtrl[VFPU_CTRL_CC] >> (inst->src2 & 0xf)) & 1) == (inst->src2 >> 7)) {
if (((mips->vfpuCtrl[VFPU_CTRL_CC] >> (inst->src2 & 0xf)) & 1) == ((u32)inst->src2 >> 7)) {
mips->f[inst->dest] = mips->f[inst->src1];
}
break;
+1 -1
View File
@@ -37,7 +37,7 @@
namespace MIPSComp {
IRJit::IRJit(MIPSState *mips) : mips_(mips), frontend_(mips->HasDefaultPrefix()) {
IRJit::IRJit(MIPSState *mips) : frontend_(mips->HasDefaultPrefix()), mips_(mips) {
u32 size = 128 * 1024;
// blTrampolines_ = kernelMemory.Alloc(size, true, "trampoline");
InitIR();
+1 -1
View File
@@ -38,7 +38,7 @@ namespace MIPSComp {
class IRBlock {
public:
IRBlock() : instr_(nullptr), const_(nullptr), numInstructions_(0), numConstants_(0), origAddr_(0), origSize_(0) {}
IRBlock(u32 emAddr) : instr_(nullptr), const_(nullptr), origAddr_(emAddr), origSize_(0), numInstructions_(0) {}
IRBlock(u32 emAddr) : instr_(nullptr), const_(nullptr), numInstructions_(0), numConstants_(0), origAddr_(emAddr), origSize_(0) {}
IRBlock(IRBlock &&b) {
instr_ = b.instr_;
const_ = b.const_;
+1 -1
View File
@@ -88,7 +88,7 @@ struct ReplacementAliasKey {
};
};
ReplacementAliasKey(u64 c, u32 h, u32 l) : cachekey(c), hash(h), level(l) {
ReplacementAliasKey(u64 c, u32 h, u32 l) : cachekey(c), level(l), hash(h) {
}
bool operator ==(const ReplacementAliasKey &k) const {
+3
View File
@@ -185,6 +185,9 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
}
}
// Not used below, but useful for logging.
(void)skinning;
SetCC(CC_AL);
PUSH(6, R4, R5, R6, R7, R8, R_LR);
+3
View File
@@ -165,6 +165,9 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
}
}
// Not used below, but useful for logging.
(void)skinning;
// if (skinning) log = true;
BitSet32 regs_to_save(Arm64Gen::ALL_CALLEE_SAVED);
+1 -1
View File
@@ -244,8 +244,8 @@ FramebufferManager::FramebufferManager() :
postShaderProgram_(nullptr),
stencilUploadProgram_(nullptr),
timeLoc_(-1),
deltaLoc_(-1),
pixelDeltaLoc_(-1),
deltaLoc_(-1),
textureCache_(nullptr),
shaderManager_(nullptr),
resized_(false),
+2 -2
View File
@@ -64,11 +64,11 @@ bool GPU_Init(GraphicsContext *ctx, Thin3DContext *thin3d) {
break;
case GPUCORE_DIRECTX11:
return false;
#ifndef NO_VULKAN
case GPUCORE_VULKAN:
#ifndef NO_VULKAN
SetGPU(new GPU_Vulkan(ctx));
break;
#endif
break;
}
return gpu != NULL;
+4
View File
@@ -56,6 +56,10 @@ public:
raw_bytes_per_frame_ = temp & 0xFFFF;
Nothing = temp >> 16;
// Not currently used, but part of the format.
(void)avgBytesPerSec;
(void)Nothing;
if (codec == PSP_CODEC_AT3) {
// The first two bytes are actually not a useful part of the extradata.
// We already read 16 bytes, so make sure there's enough left.
+1 -1
View File
@@ -56,7 +56,7 @@ void CwCheatScreen::CreateCodeList() {
std::size_t lslash = gamePath_.find_last_of("/");
std::size_t lastdot = gamePath_.find_last_of(".");
std::string extension = gamePath_.substr(lastdot + 1);
for (int i = 0; i < extension.size(); i++) {
for (size_t i = 0; i < extension.size(); i++) {
extension[i] = tolower(extension[i]);
}
if ((extension != "iso" && extension != "cso" && extension != "pbp") || gameTitle == "") {
+3 -5
View File
@@ -68,7 +68,7 @@ extern bool targetIsJailbroken;
#endif
GameSettingsScreen::GameSettingsScreen(std::string gamePath, std::string gameID, bool editThenRestore)
: UIDialogScreenWithGameBackground(gamePath), gameID_(gameID), enableReports_(false), bEditThenRestore(editThenRestore) {
: UIDialogScreenWithGameBackground(gamePath), gameID_(gameID), enableReports_(false), editThenRestore_(editThenRestore) {
lastVertical_ = UseVerticalLayout();
}
@@ -79,8 +79,7 @@ bool GameSettingsScreen::UseVerticalLayout() const {
void GameSettingsScreen::CreateViews() {
GameInfo *info = g_gameInfoCache->GetInfo(NULL, gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
if (bEditThenRestore)
{
if (editThenRestore_) {
g_Config.loadGameConfig(gameID_);
}
@@ -871,8 +870,7 @@ void GameSettingsScreen::onFinish(DialogResult result) {
Reporting::Enable(enableReports_, "report.ppsspp.org");
Reporting::UpdateConfig();
g_Config.Save();
if (bEditThenRestore)
{
if (editThenRestore_) {
g_Config.unloadGameConfig();
}
+3 -2
View File
@@ -40,8 +40,6 @@ protected:
private:
std::string gameID_;
//edit the game-specific settings and restore the global settings after exiting
bool bEditThenRestore;
bool lastVertical_;
UI::CheckBox *enableReportsCheckbox_;
UI::Choice *layoutEditorChoice_;
@@ -107,6 +105,9 @@ private:
int iAlternateSpeedPercent_;
bool enableReports_;
//edit the game-specific settings and restore the global settings after exiting
bool editThenRestore_;
// Cached booleans
bool vtxCacheEnable_;
bool postProcEnable_;
+1 -1
View File
@@ -179,7 +179,7 @@ private:
std::string screenshotFilename_;
};
SaveSlotView::SaveSlotView(const std::string &gameFilename, int slot, UI::LayoutParams *layoutParams) : UI::LinearLayout(UI::ORIENT_HORIZONTAL, layoutParams), gamePath_(gameFilename), slot_(slot) {
SaveSlotView::SaveSlotView(const std::string &gameFilename, int slot, UI::LayoutParams *layoutParams) : UI::LinearLayout(UI::ORIENT_HORIZONTAL, layoutParams), slot_(slot), gamePath_(gameFilename) {
using namespace UI;
screenshotFilename_ = SaveState::GenerateSaveSlotFilename(gamePath_, slot, SaveState::SCREENSHOT_EXTENSION);
+1 -1
View File
@@ -36,8 +36,8 @@ private:
void Refresh();
UI::EventReturn SavedataButtonClick(UI::EventParams &e);
std::string path_;
UI::ViewGroup *gameList_;
std::string path_;
};
class SavedataScreen : public UIDialogScreenWithGameBackground {
+1 -1
View File
@@ -169,7 +169,7 @@ void ChunkFile::readData(void *what, int count) {
if (fastMode) {
memcpy(what, data + pos, count);
} else {
if (fread(what, 1, count, file) != count) {
if (fread(what, 1, count, file) != (size_t)count) {
ELOG("Failed to read complete %d bytes", count);
}
}
+1 -1
View File
@@ -347,7 +347,7 @@ protected:
float AtlasWordWrapper::MeasureWidth(const char *str, size_t bytes) {
float w = 0.0f;
for (UTF8 utf(str); utf.byteIndex() < bytes; ) {
for (UTF8 utf(str); utf.byteIndex() < (int)bytes; ) {
const AtlasChar *ch = atlasfont_.getChar(utf.next());
if (!ch)
ch = atlasfont_.getChar('?');
+3 -3
View File
@@ -268,13 +268,13 @@ bool OutputSink::Printf(const char *fmt, ...) {
bool success = true;
int result = vsnprintf(buf_ + write_, avail, fmt, args);
if (result >= avail) {
if (result >= (int)avail) {
// There wasn't enough space. Let's use a buffer instead.
// This could be caused by wraparound.
char temp[BUFFER_SIZE];
result = vsnprintf(temp, BUFFER_SIZE, fmt, args);
if (result < BUFFER_SIZE && result > 0) {
if ((size_t)result < BUFFER_SIZE && result > 0) {
// In case it did return the null terminator.
if (temp[result - 1] == '\0') {
result--;
@@ -289,7 +289,7 @@ bool OutputSink::Printf(const char *fmt, ...) {
va_end(backup);
// Okay, did we actually write?
if (result >= avail) {
if (result >= (int)avail) {
// This means the result string was too big for the buffer.
ELOG("Not enough space to format output.");
return false;
+1 -1
View File
@@ -626,7 +626,7 @@ void SliderFloatPopupScreen::OnCompleted(DialogResult result) {
}
PopupTextInputChoice::PopupTextInputChoice(std::string *value, const std::string &title, const std::string &placeholder, int maxLen, ScreenManager *screenManager, LayoutParams *layoutParams)
: Choice(title, "", false, layoutParams), value_(value), placeHolder_(placeholder), screenManager_(screenManager), maxLen_(maxLen) {
: Choice(title, "", false, layoutParams), screenManager_(screenManager), value_(value), placeHolder_(placeholder), maxLen_(maxLen) {
OnClick.Handle(this, &PopupTextInputChoice::HandleClick);
}