mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 17:49:29 +01:00
Merge pull request #15283 from unknownbrackets/warnings
UI: Fix some sign/size comparison warnings
This commit is contained in:
6 files changed
+8
-8
No files matched your search
@@ -175,7 +175,7 @@ void SingleControlMapper::MappedCallback(KeyDef kdf) {
|
||||
bool success = KeyMap::ReplaceSingleKeyMapping(pspKey_, actionIndex_, kdf);
|
||||
if (!success) {
|
||||
replaceAllButton_->SetFocus(); // Last got removed as a duplicate
|
||||
} else if (actionIndex_ < rows_.size()) {
|
||||
} else if (actionIndex_ < (int)rows_.size()) {
|
||||
rows_[actionIndex_]->SetFocus();
|
||||
} else {
|
||||
SetFocus();
|
||||
@@ -223,7 +223,7 @@ UI::EventReturn SingleControlMapper::OnDelete(UI::EventParams ¶ms) {
|
||||
KeyMap::g_controllerMap[pspKey_].erase(KeyMap::g_controllerMap[pspKey_].begin() + index);
|
||||
KeyMap::g_controllerMapGeneration++;
|
||||
|
||||
if (index + 1 < rows_.size())
|
||||
if (index + 1 < (int)rows_.size())
|
||||
rows_[index]->SetFocus();
|
||||
else
|
||||
SetFocus();
|
||||
|
||||
@@ -358,7 +358,7 @@ bool CwCheatScreen::RebuildCheatFile(int index) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
for (size_t i = 0; i < lines.size(); ++i) {
|
||||
fprintf(out, "%s", lines[i].c_str());
|
||||
if (i != lines.size() - 1)
|
||||
fputc('\n', out);
|
||||
|
||||
@@ -349,7 +349,7 @@ void GameSettingsScreen::CreateViews() {
|
||||
graphicsSettings->Add(new ItemHeader(gr->T("Postprocessing effect")));
|
||||
|
||||
std::set<std::string> alreadyAddedShader;
|
||||
for (int i = 0; i < g_Config.vPostShaderNames.size() + 1 && i < ARRAY_SIZE(shaderNames_); ++i) {
|
||||
for (int i = 0; i < (int)g_Config.vPostShaderNames.size() + 1 && i < ARRAY_SIZE(shaderNames_); ++i) {
|
||||
// Vector element pointer get invalidated on resize, cache name to have always a valid reference in the rendering thread
|
||||
shaderNames_[i] = i == g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[i];
|
||||
postProcChoice_ = graphicsSettings->Add(new ChoiceWithValueDisplay(&shaderNames_[i], StringFromFormat("%s #%d", gr->T("Postprocessing Shader"), i + 1), &PostShaderTranslateName));
|
||||
|
||||
+2
-2
@@ -525,7 +525,7 @@ void PostProcScreen::CreateViews() {
|
||||
shaders_ = GetAllPostShaderInfo();
|
||||
std::vector<std::string> items;
|
||||
int selected = -1;
|
||||
const std::string selectedName = id_ >= g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[id_];
|
||||
const std::string selectedName = id_ >= (int)g_Config.vPostShaderNames.size() ? "Off" : g_Config.vPostShaderNames[id_];
|
||||
for (int i = 0; i < (int)shaders_.size(); i++) {
|
||||
if (!shaders_[i].visible)
|
||||
continue;
|
||||
@@ -541,7 +541,7 @@ void PostProcScreen::OnCompleted(DialogResult result) {
|
||||
if (result != DR_OK)
|
||||
return;
|
||||
const std::string &value = shaders_[listView_->GetSelected()].section;
|
||||
if (id_ < g_Config.vPostShaderNames.size())
|
||||
if (id_ < (int)g_Config.vPostShaderNames.size())
|
||||
g_Config.vPostShaderNames[id_] = value;
|
||||
else
|
||||
g_Config.vPostShaderNames.push_back(value);
|
||||
|
||||
@@ -121,7 +121,7 @@ void CMemoryDlg::searchBoxRedraw(std::vector<u32> results) {
|
||||
wchar_t temp[256]{};
|
||||
SendMessage(srcListHdl, WM_SETREDRAW, FALSE, 0);
|
||||
ListBox_ResetContent(srcListHdl);
|
||||
for (int i = 0; i < results.size(); i++) {
|
||||
for (size_t i = 0; i < results.size(); i++) {
|
||||
wsprintf(temp, L"0x%08X", results[i]);
|
||||
int index = (int)ListBox_AddString(srcListHdl, temp);
|
||||
ListBox_SetItemData(srcListHdl, index, results[i]);
|
||||
|
||||
@@ -671,7 +671,7 @@ protected:
|
||||
float MeasureWidth(const char *str, size_t bytes) override {
|
||||
// Simple case for unit testing.
|
||||
int w = 0;
|
||||
for (UTF8 utf(str); !utf.end() && utf.byteIndex() < bytes; ) {
|
||||
for (UTF8 utf(str); !utf.end() && (size_t)utf.byteIndex() < bytes; ) {
|
||||
uint32_t c = utf.next();
|
||||
switch (c) {
|
||||
case ' ':
|
||||
|
||||
Reference in new issue
Block a user