Merge pull request #12703 from unknownbrackets/warnings

Quiet some warnings
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2020-03-11 09:16:01 +01:00
commit 8c68b0e29e
9 files changed
+64 -50

No files matched your search

+1
View File
@@ -272,6 +272,7 @@ if(NOT MSVC)
# Disable some warnings
add_definitions(-Wno-multichar)
add_definitions(-Wno-deprecated-register)
add_definitions(-Wno-tautological-pointer-compare)
# Don't compile with strict aliasing, we're not 100% aliasing-safe
add_compile_options(-fno-strict-aliasing)
+1 -1
View File
@@ -2731,7 +2731,7 @@ static int IoAsyncFinish(int id) {
break;
default:
ERROR_LOG_REPORT(SCEIO, "Unknown async op %d", params.op);
ERROR_LOG_REPORT(SCEIO, "Unknown async op %d", (int)params.op);
us = 0;
break;
}
+4 -4
View File
@@ -338,10 +338,10 @@ int __v4l_startCapture(int ideal_width, int ideal_height) {
frmsize.index++;
if (frmsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
INFO_LOG(HLE, "V4L2: frame size supported: %dx%d", frmsize.discrete.width, frmsize.discrete.height);
if (frmsize.discrete.width >= ideal_width && frmsize.discrete.height >= ideal_height
&& fmt.fmt.pix.width == 0 && fmt.fmt.pix.height == 0
|| frmsize.discrete.width >= ideal_width && frmsize.discrete.height >= ideal_height
&& frmsize.discrete.width < fmt.fmt.pix.width && frmsize.discrete.height < fmt.fmt.pix.height) {
bool matchesIdeal = frmsize.discrete.width >= ideal_width && frmsize.discrete.height >= ideal_height;
bool zeroPix = fmt.fmt.pix.width == 0 && fmt.fmt.pix.height == 0;
bool pixLarger = frmsize.discrete.width < fmt.fmt.pix.width && frmsize.discrete.height < fmt.fmt.pix.height;
if (matchesIdeal && (zeroPix || pixLarger)) {
fmt.fmt.pix.width = frmsize.discrete.width;
fmt.fmt.pix.height = frmsize.discrete.height;
}
+22 -19
View File
@@ -14,7 +14,6 @@
#include <ctype.h>
#include "util/text/utf8.h"
void ChatMenu::CreatePopupContents(UI::ViewGroup *parent) {
using namespace UI;
auto n = GetI18NCategory("Networking");
@@ -34,6 +33,7 @@ void ChatMenu::CreatePopupContents(UI::ViewGroup *parent) {
}
#endif
chatEdit_->OnEnter.Handle(this, &ChatMenu::OnSubmit);
#elif PPSSPP_PLATFORM(ANDROID)
bottom->Add(new Button(n->T("Chat Here"),new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->OnClick.Handle(this, &ChatMenu::OnSubmit);
bottom->Add(new Button(n->T("Send")))->OnClick.Handle(this, &ChatMenu::OnSubmit);
@@ -84,26 +84,31 @@ void ChatMenu::CreateViews() {
case 5:
box_ = new LinearLayout(ORIENT_VERTICAL, new AnchorLayoutParams(PopupWidth(), FillVertical() ? yres - 30 : WRAP_CONTENT, NONE, 240, 280, NONE, true));
break;
default:
box_ = nullptr;
break;
}
root_->Add(box_);
box_->SetBG(UI::Drawable(0x99303030));
box_->SetHasDropShadow(false);
if (box_) {
root_->Add(box_);
box_->SetBG(UI::Drawable(0x99303030));
box_->SetHasDropShadow(false);
View *title = new PopupHeader(n->T("Chat"));
box_->Add(title);
View *title = new PopupHeader(n->T("Chat"));
box_->Add(title);
CreatePopupContents(box_);
CreatePopupContents(box_);
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
UI::EnableFocusMovement(true);
root_->SetDefaultFocusView(box_);
box_->SubviewFocused(chatEdit_);
root_->SetFocus();
UI::EnableFocusMovement(true);
root_->SetDefaultFocusView(box_);
box_->SubviewFocused(chatEdit_);
root_->SetFocus();
#else
//root_->SetDefaultFocusView(box_);
//box_->SubviewFocused(scroll_);
//root_->SetFocus();
//root_->SetDefaultFocusView(box_);
//box_->SubviewFocused(scroll_);
//root_->SetFocus();
#endif
}
chatScreenVisible = true;
newChat = 0;
@@ -129,7 +134,6 @@ UI::EventReturn ChatMenu::OnSubmit(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn ChatMenu::OnQuickChat1(UI::EventParams &e) {
sendChat(g_Config.sQuickChat0);
return UI::EVENT_DONE;
@@ -191,7 +195,7 @@ std::vector<std::string> Split(const std::string& str)
void ChatMenu::UpdateChat() {
using namespace UI;
if (chatVert_ != NULL) {
if (chatVert_ != nullptr) {
chatVert_->Clear(); //read Access violation is proadhoc.cpp use NULL_->Clear() pointer?
std::vector<std::string> chatLog = getChatLog();
for (auto i : chatLog) {
@@ -208,11 +212,10 @@ void ChatMenu::UpdateChat() {
namecolor = 0xE53935;
}
if (i[displayname.length()] != ':') {
if (i.length() <= displayname.length() || i[displayname.length()] != ':') {
TextView *v = chatVert_->Add(new TextView(i, FLAG_DYNAMIC_ASCII, true));
v->SetTextColor(0xFF000000 | infocolor);
}
else {
} else {
LinearLayout *line = chatVert_->Add(new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, FILL_PARENT)));
TextView *nameView = line->Add(new TextView(displayname, FLAG_DYNAMIC_ASCII, true));
nameView->SetTextColor(0xFF000000 | namecolor);
+14 -7
View File
@@ -1,10 +1,12 @@
#pragma once
#include "ppsspp_config.h"
#include "file/file_util.h"
#include "ui/ui_screen.h"
class ChatMenu : public PopupScreen {
public:
ChatMenu() : PopupScreen("Chat") , toBottom_(true) {}
ChatMenu(): PopupScreen("Chat") {}
~ChatMenu();
void CreatePopupContents(UI::ViewGroup *parent) override;
void CreateViews() override;
@@ -12,7 +14,9 @@ public:
bool touch(const TouchInput &touch) override;
void update() override;
void UpdateChat();
bool toBottom_;
bool toBottom_ = true;
private:
UI::EventReturn OnSubmit(UI::EventParams &e);
UI::EventReturn OnQuickChat1(UI::EventParams &e);
@@ -20,8 +24,11 @@ private:
UI::EventReturn OnQuickChat3(UI::EventParams &e);
UI::EventReturn OnQuickChat4(UI::EventParams &e);
UI::EventReturn OnQuickChat5(UI::EventParams &e);
UI::TextEdit *chatEdit_;
UI::ScrollView *scroll_;
UI::LinearLayout *chatVert_;
UI::ViewGroup *box_;
};
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
UI::TextEdit *chatEdit_ = nullptr;
#endif
UI::ScrollView *scroll_ = nullptr;
UI::LinearLayout *chatVert_ = nullptr;
UI::ViewGroup *box_ = nullptr;
};
+17 -17
View File
@@ -1043,32 +1043,32 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J
return false;
}
retry:
auto tryInit = [&]() {
if (graphicsContext->InitFromRenderThread(wnd, desiredBackbufferSizeX, desiredBackbufferSizeY, backbuffer_format, androidVersion)) {
return true;
}
bool vulkan = g_Config.iGPUBackend == (int)GPUBackend::VULKAN;
int tries = 0;
if (!graphicsContext->InitFromRenderThread(wnd, desiredBackbufferSizeX, desiredBackbufferSizeY, backbuffer_format, androidVersion)) {
ELOG("Failed to initialize graphics context.");
return false;
};
if (!exitRenderLoop && (vulkan && tries < 2)) {
bool initSuccess = tryInit();
if (!initSuccess) {
if (!exitRenderLoop && g_Config.iGPUBackend == (int)GPUBackend::VULKAN) {
ILOG("Trying again, this time with OpenGL.");
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
SetGPUBackend((GPUBackend)g_Config.iGPUBackend);
// If we were still supporting EGL for GL:
// tries++;
// goto retry;
SetGPUBackend(GPUBackend::OPENGL);
g_Config.iGPUBackend = (int)GetGPUBackend();
// If we were still supporting EGL for GL, we'd retry here:
//initSuccess = tryInit();
}
if (!initSuccess) {
delete graphicsContext;
graphicsContext = nullptr;
renderLoopRunning = false;
return false;
}
delete graphicsContext;
graphicsContext = nullptr;
renderLoopRunning = false;
return false;
}
if (!exitRenderLoop) {
-2
View File
@@ -30,7 +30,6 @@ void RotateRectToDisplayImpl(DisplayRect<T> &rect, T curRTWidth, T curRTHeight)
// Note that curRTWidth_ and curRTHeight_ are "swapped"!
T origX = rect.x;
T origY = rect.y;
T rtw = curRTHeight;
T rth = curRTWidth;
rect.x = clamp_value(rth - rect.h - origY, T{}, curRTHeight);
rect.y = origX;
@@ -43,7 +42,6 @@ void RotateRectToDisplayImpl(DisplayRect<T> &rect, T curRTWidth, T curRTHeight)
T origX = rect.x;
T origY = rect.y;
T rtw = curRTHeight;
T rth = curRTWidth;
rect.x = origY;
rect.y = clamp_value(rtw - rect.w - origX, T{}, curRTWidth);
T temp = rect.w;
+1
View File
@@ -24,6 +24,7 @@ int JsonGet::numChildren() const {
int count = 0;
if (value_.getTag() == JSON_OBJECT || value_.getTag() == JSON_ARRAY) {
for (auto it : value_) {
(void)it;
count++;
}
}
+4
View File
@@ -569,9 +569,13 @@ void GLQueueRunner::RunSteps(const std::vector<GLRStep *> &steps, bool skipGLCal
}
}
break;
default:
break;
}
}
break;
default:
break;
}
delete steps[i];
}