gcc compilation fixes

This commit is contained in:
Anthony Pesch 2015-07-31 01:31:38 -07:00
parent 1be34cd13c
commit 0238f4f439
12 changed files with 28 additions and 23 deletions

View File

@ -140,6 +140,8 @@ MICROPROFILEUI_API void MicroProfileDumpTimers();
#ifdef _WIN32
#define snprintf _snprintf
#endif
#include <inttypes.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
@ -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);

View File

@ -1,6 +1,7 @@
#ifndef DREAVM_CORE_H
#define DREAVM_CORE_H
#include <gflags/gflags.h>
#include <glog/logging.h>
#include "core/arena.h"
#include "core/hash.h"

View File

@ -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<T *>(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();
}

View File

@ -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);

View File

@ -40,6 +40,7 @@ uint64_t Value::GetZExtValue() const {
case VALUE_BLOCK:
return reinterpret_cast<intptr_t>(block_);
}
return 0;
}
void Value::AddRef(ValueRef *ref) { refs_.Append(ref); }

View File

@ -110,6 +110,7 @@ static inline int SizeForType(ValueTy type) {
case VALUE_BLOCK:
return 4;
}
return 0;
}
class Value {

View File

@ -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;
}

View File

@ -1,6 +1,7 @@
#ifndef GDROM_H
#define GDROM_H
#include <memory>
#include "emu/disc.h"
#include "emu/memory.h"

View File

@ -1,4 +1,3 @@
#include <gflags/gflags.h>
#include <json11.hpp>
#include <fstream>
#include <sstream>

View File

@ -1,5 +1,4 @@
#include <stdio.h>
#include <gflags/gflags.h>
#include "system/system.h"
#include "emu/emulator.h"

View File

@ -1,3 +1,4 @@
#include <memory>
#include "core/core.h"
#include "renderer/gl_backend.h"

View File

@ -1,7 +1,7 @@
#ifndef SH4_TEST_H
#define SH4_TEST_H
#include <unordered_map>
#include <map>
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<int, uint64_t> r_in;
std::unordered_map<int, uint64_t> r_out;
std::map<int, uint64_t> r_in;
std::map<int, uint64_t> r_out;
};
#endif