All: Clean up some warnings

This commit is contained in:
Vicki Pfau 2022-06-24 17:48:52 -07:00
parent f3209e1942
commit e8a39fea95
5 changed files with 17 additions and 5 deletions

View File

@ -21,7 +21,7 @@ extern const int GBASIOCyclesPerTransfer[4][MAX_GBAS];
mLOG_DECLARE_CATEGORY(GBA_SIO); mLOG_DECLARE_CATEGORY(GBA_SIO);
enum { enum {
RCNT_INITIAL = 0x8000 RCNT_INITIAL = -0x8000
}; };
enum { enum {

View File

@ -242,7 +242,7 @@ void mCoreConfigDirectory(char* out, size_t outLength) {
CreateDirectoryW(wpath, NULL); CreateDirectoryW(wpath, NULL);
if (PATH_SEP[0] != '\\') { if (PATH_SEP[0] != '\\') {
WCHAR* pathSep; WCHAR* pathSep;
for (pathSep = wpath; pathSep = wcschr(pathSep, L'\\');) { for (pathSep = wpath; (pathSep = wcschr(pathSep, L'\\'));) {
pathSep[0] = PATH_SEP[0]; pathSep[0] = PATH_SEP[0];
} }
} }
@ -284,7 +284,7 @@ void mCoreConfigPortablePath(char* out, size_t outLength) {
PathRemoveFileSpecW(wpath); PathRemoveFileSpecW(wpath);
if (PATH_SEP[0] != '\\') { if (PATH_SEP[0] != '\\') {
WCHAR* pathSep; WCHAR* pathSep;
for (pathSep = wpath; pathSep = wcschr(pathSep, L'\\');) { for (pathSep = wpath; (pathSep = wcschr(pathSep, L'\\'));) {
pathSep[0] = PATH_SEP[0]; pathSep[0] = PATH_SEP[0];
} }
} }

View File

@ -1584,6 +1584,9 @@ IOViewer::IOViewer(std::shared_ptr<CoreController> controller, QWidget* parent)
m_width = 1; m_width = 1;
break; break;
#endif #endif
case mPLATFORM_NONE:
maxRegs = 0;
break;
} }
for (unsigned i = 0; i < maxRegs; ++i) { for (unsigned i = 0; i < maxRegs; ++i) {

View File

@ -473,7 +473,7 @@ void Window::parseCard() {
QString("oh"), QMessageBox::Ok); QString("oh"), QMessageBox::Ok);
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);
auto status = std::make_shared<QPair<int, int>>(0, filenames.size()); auto status = std::make_shared<QPair<int, int>>(0, filenames.size());
GBAApp::app()->submitWorkerJob([filenames, dialog, status]() { GBAApp::app()->submitWorkerJob([filenames, status]() {
int success = 0; int success = 0;
for (QString filename : filenames) { for (QString filename : filenames) {
if (filename.isEmpty()) { if (filename.isEmpty()) {
@ -507,6 +507,9 @@ void Window::parseCard() {
} }
status->first = success; status->first = success;
}, [dialog, status]() { }, [dialog, status]() {
if (status->second == 0) {
return;
}
dialog->setText(tr("%1 of %2 e-Reader cards converted successfully.").arg(status->first).arg(status->second)); dialog->setText(tr("%1 of %2 e-Reader cards converted successfully.").arg(status->first).arg(status->second));
dialog->show(); dialog->show();
}); });

View File

@ -360,13 +360,17 @@ uint32_t _hashScalar(const struct mScriptValue* val) {
*T = input->value.s32; \ *T = input->value.s32; \
} else if (input->type->size == 8) { \ } else if (input->type->size == 8) { \
*T = input->value.s64; \ *T = input->value.s64; \
} \ } else { \
return false; \
}\
break; \ break; \
case mSCRIPT_TYPE_UINT: \ case mSCRIPT_TYPE_UINT: \
if (input->type->size <= 4) { \ if (input->type->size <= 4) { \
*T = input->value.u32; \ *T = input->value.u32; \
} else if (input->type->size == 8) { \ } else if (input->type->size == 8) { \
*T = input->value.u64; \ *T = input->value.u64; \
} else { \
return false; \
} \ } \
break; \ break; \
case mSCRIPT_TYPE_FLOAT: \ case mSCRIPT_TYPE_FLOAT: \
@ -374,6 +378,8 @@ uint32_t _hashScalar(const struct mScriptValue* val) {
*T = input->value.f32; \ *T = input->value.f32; \
} else if (input->type->size == 8) { \ } else if (input->type->size == 8) { \
*T = input->value.f64; \ *T = input->value.f64; \
} else { \
return false; \
} \ } \
break; \ break; \
default: \ default: \