diff --git a/deps/microprofile/microprofileui.h b/deps/microprofile/microprofileui.h index e63fc241..14eb2422 100644 --- a/deps/microprofile/microprofileui.h +++ b/deps/microprofile/microprofileui.h @@ -140,6 +140,8 @@ MICROPROFILEUI_API void MicroProfileDumpTimers(); #ifdef _WIN32 #define snprintf _snprintf #endif +#include +#include #include #include #include @@ -647,7 +649,7 @@ void MicroProfileDebugDumpRange() const char* pBegin = type == MP_LOG_LEAVE ? "END" : (type == MP_LOG_ENTER ? "BEGIN" : "META"); - snprintf(buffer, 255, "DUMP 0x%p: %s :: %llx: %s\n", pStart, pBegin, nTick, pTimerName); + snprintf(buffer, 255, "DUMP 0x%p: %s :: %" PRIx64 ": %s\n", pStart, pBegin, nTick, pTimerName); #ifdef _WIN32 OutputDebugString(buffer); #else @@ -896,7 +898,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, int64_t nBaseTicks = bGpu ? nBaseTicksGpu : nBaseTicksCpu; char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16]; uint64_t nThreadId = pLog->nThreadId; - snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s", nThreadId, &pLog->ThreadName[0] ); + snprintf(ThreadName, sizeof(ThreadName)-1, "%04" PRIx64 ": %s", nThreadId, &pLog->ThreadName[0] ); nY += 3; uint32_t nThreadColor = -1; if(pLog->nThreadId == nContextSwitchHoverThreadAfter || pLog->nThreadId == nContextSwitchHoverThreadBefore) @@ -1088,7 +1090,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY, char ThreadName[MicroProfileThreadLog::THREAD_MAX_LEN + 16]; const char* cLocal = MicroProfileIsLocalThread(nThreadId) ? "*": " "; - int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx:%s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); + int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04" PRIx64 ":%s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); uint32_t nThreadColor = -1; if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore) nThreadColor = UI.nHoverColorShared|0x906060; @@ -1447,7 +1449,7 @@ uint32_t MicroProfileDrawBarMetaCount(int32_t nX, int32_t nY, uint64_t* pCounter MicroProfileLoopActiveGroupsDraw(nX, nY, pName, [=](uint32_t nTimer, uint32_t nIdx, uint64_t nGroupMask, uint32_t nX, uint32_t nY){ char sBuffer[SBUF_MAX]; - int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5llu", pCounters[nTimer]); + int nLen = snprintf(sBuffer, SBUF_MAX-1, "%5" PRIu64, pCounters[nTimer]); MicroProfileDrawText(nX + nTextWidth - nLen * (MICROPROFILE_TEXT_WIDTH+1), nY, (uint32_t)-1, sBuffer, nLen); }); MicroProfileDrawHeader(nX, 5 + nTextWidth, pName); @@ -1780,7 +1782,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) uint32_t nX = 0; uint32_t nY = 0; - bool bMouseOver = UI.nMouseY < MICROPROFILE_TEXT_HEIGHT + 1; + // bool bMouseOver = UI.nMouseY < MICROPROFILE_TEXT_HEIGHT + 1; #define SBUF_SIZE 256 char buffer[256]; MicroProfileDrawBox(nX, nY, nX + nWidth, nY + (MICROPROFILE_TEXT_HEIGHT+1)+1, 0xff000000|g_nMicroProfileBackColors[1]); @@ -2271,7 +2273,7 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) const char* pString = CB(i, bSelected); if(UI.nMouseY >= nY && UI.nMouseY < nY + MICROPROFILE_TEXT_HEIGHT + 1) { - bMouseOver = true; + // bMouseOver = true; if(UI.nMouseLeft || UI.nMouseRight) { CBClick[nMenu](i); diff --git a/src/core/core.h b/src/core/core.h index 0463afe5..5d1fdbfc 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -1,6 +1,7 @@ #ifndef DREAVM_CORE_H #define DREAVM_CORE_H +#include #include #include "core/arena.h" #include "core/hash.h" diff --git a/src/core/intrusive_list.h b/src/core/intrusive_list.h index 770b1709..80d1ca07 100644 --- a/src/core/intrusive_list.h +++ b/src/core/intrusive_list.h @@ -71,7 +71,7 @@ class IntrusiveList { self_type &operator--() { // if we're at the sentinel node, the previous node is the list's tail if (node_ == reinterpret_cast(sentinel_end)) { - node_ = node_ = is_reverse_iterator ? list_->head() : list_->tail(); + node_ = is_reverse_iterator ? list_->head() : list_->tail(); } else { node_ = is_reverse_iterator ? node_->next() : node_->prev(); } diff --git a/src/cpu/frontend/sh4/sh4_emit.cc b/src/cpu/frontend/sh4/sh4_emit.cc index 8a13b0de..c2fce2a8 100644 --- a/src/cpu/frontend/sh4/sh4_emit.cc +++ b/src/cpu/frontend/sh4/sh4_emit.cc @@ -1141,12 +1141,12 @@ EMITTER(LDCRBANK) { b.BranchTrue(b.And(b.LoadSR(), b.AllocConstant(RB)), rb1); // rb0 block - b.StoreContext(offsetof(SH4Context, rbnk[1][reg]), rm); + b.StoreContext(offsetof(SH4Context, rbnk[1]) + reg, rm); b.Branch(end_block); // rb1 block b.SetCurrentBlock(rb1); - b.StoreContext(offsetof(SH4Context, rbnk[0][reg]), rm); + b.StoreContext(offsetof(SH4Context, rbnk[0]) + reg, rm); b.Branch(end_block); b.SetCurrentBlock(end_block); @@ -1213,12 +1213,12 @@ EMITTER(LDCMRBANK) { b.BranchTrue(b.And(b.LoadSR(), b.AllocConstant(RB)), rb1); // rb0 block - b.StoreContext(offsetof(SH4Context, rbnk[1][reg]), v); + b.StoreContext(offsetof(SH4Context, rbnk[1]) + reg, v); b.Branch(end_block); // rb1 block b.SetCurrentBlock(rb1); - b.StoreContext(offsetof(SH4Context, rbnk[0][reg]), v); + b.StoreContext(offsetof(SH4Context, rbnk[0]) + reg, v); b.Branch(end_block); b.SetCurrentBlock(end_block); @@ -1397,13 +1397,13 @@ EMITTER(STCRBANK) { // rb0 block b.StoreRegister(i.Rn, - b.LoadContext(offsetof(SH4Context, rbnk[1][reg]), VALUE_I32)); + b.LoadContext(offsetof(SH4Context, rbnk[1]) + reg, VALUE_I32)); b.Branch(end_block); // rb1 block b.SetCurrentBlock(rb1); b.StoreRegister(i.Rn, - b.LoadContext(offsetof(SH4Context, rbnk[0][reg]), VALUE_I32)); + b.LoadContext(offsetof(SH4Context, rbnk[0]) + reg, VALUE_I32)); b.Branch(end_block); b.SetCurrentBlock(end_block); @@ -1477,12 +1477,12 @@ EMITTER(STCMRBANK) { b.BranchTrue(b.And(b.LoadSR(), b.AllocConstant(RB)), rb1); // rb0 block - b.Store(addr, b.LoadContext(offsetof(SH4Context, rbnk[1][reg]), VALUE_I32)); + b.Store(addr, b.LoadContext(offsetof(SH4Context, rbnk[1]) + reg, VALUE_I32)); b.Branch(end_block); // rb1 block b.SetCurrentBlock(rb1); - b.Store(addr, b.LoadContext(offsetof(SH4Context, rbnk[0][reg]), VALUE_I32)); + b.Store(addr, b.LoadContext(offsetof(SH4Context, rbnk[0]) + reg, VALUE_I32)); b.Branch(end_block); b.SetCurrentBlock(end_block); diff --git a/src/cpu/ir/ir_builder.cc b/src/cpu/ir/ir_builder.cc index 3eaa9128..57346c51 100644 --- a/src/cpu/ir/ir_builder.cc +++ b/src/cpu/ir/ir_builder.cc @@ -40,6 +40,7 @@ uint64_t Value::GetZExtValue() const { case VALUE_BLOCK: return reinterpret_cast(block_); } + return 0; } void Value::AddRef(ValueRef *ref) { refs_.Append(ref); } diff --git a/src/cpu/ir/ir_builder.h b/src/cpu/ir/ir_builder.h index 95afea18..66503504 100644 --- a/src/cpu/ir/ir_builder.h +++ b/src/cpu/ir/ir_builder.h @@ -110,6 +110,7 @@ static inline int SizeForType(ValueTy type) { case VALUE_BLOCK: return 4; } + return 0; } class Value { diff --git a/src/cpu/ir/passes/constant_propagation_pass.cc b/src/cpu/ir/passes/constant_propagation_pass.cc index bb6cfd3f..3eb7a3c3 100644 --- a/src/cpu/ir/passes/constant_propagation_pass.cc +++ b/src/cpu/ir/passes/constant_propagation_pass.cc @@ -53,9 +53,9 @@ int fold_masks[NUM_OPCODES]; static FoldFn GetFoldFn(Instr *instr) { auto it = fold_cbs.find(CALLBACK_IDX( - instr->op(), instr->result() ? instr->result()->type() : VALUE_V, - instr->arg0() ? instr->arg0()->type() : VALUE_V, - instr->arg1() ? instr->arg1()->type() : VALUE_V)); + instr->op(), instr->result() ? (int)instr->result()->type() : VALUE_V, + instr->arg0() ? (int)instr->arg0()->type() : VALUE_V, + instr->arg1() ? (int)instr->arg1()->type() : VALUE_V)); if (it == fold_cbs.end()) { return nullptr; } diff --git a/src/holly/gdrom.h b/src/holly/gdrom.h index b687102a..4ac01fc5 100644 --- a/src/holly/gdrom.h +++ b/src/holly/gdrom.h @@ -1,6 +1,7 @@ #ifndef GDROM_H #define GDROM_H +#include #include "emu/disc.h" #include "emu/memory.h" diff --git a/src/holly/maple_controller.cc b/src/holly/maple_controller.cc index 2e708e8f..bb35449b 100644 --- a/src/holly/maple_controller.cc +++ b/src/holly/maple_controller.cc @@ -1,4 +1,3 @@ -#include #include #include #include diff --git a/src/main.cc b/src/main.cc index 1c4b3c5d..0cde4392 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,4 @@ #include -#include #include "system/system.h" #include "emu/emulator.h" diff --git a/src/renderer/gl_backend.cc b/src/renderer/gl_backend.cc index 6accedb8..c7f78c82 100644 --- a/src/renderer/gl_backend.cc +++ b/src/renderer/gl_backend.cc @@ -1,3 +1,4 @@ +#include #include "core/core.h" #include "renderer/gl_backend.h" diff --git a/test/sh4_test.h b/test/sh4_test.h index fcf9c199..2bdf8d31 100644 --- a/test/sh4_test.h +++ b/test/sh4_test.h @@ -1,7 +1,7 @@ #ifndef SH4_TEST_H #define SH4_TEST_H -#include +#include enum { #define SH4CTX(name, member, type) SH4CTX_##name, @@ -21,8 +21,8 @@ extern SH4CTXReg sh4ctx_reg[NUM_SH4CTX_REGS]; struct SH4Test { uint8_t *buffer; size_t buffer_size; - std::unordered_map r_in; - std::unordered_map r_out; + std::map r_in; + std::map r_out; }; #endif