8 changes: 4 additions & 4 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp
Expand Up @@ -1467,9 +1467,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkPolicy(u8* _Input)
DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pLinkPolicy->con_handle);
DEBUG_LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", pLinkPolicy->settings);

hci_write_link_policy_settings_rp Reply;
Reply.status = 0x00;
Reply.con_handle = pLinkPolicy->con_handle;
//hci_write_link_policy_settings_rp Reply;
//Reply.status = 0x00;
//Reply.con_handle = pLinkPolicy->con_handle;

SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS);

Expand Down Expand Up @@ -1878,4 +1878,4 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey)
, _pLinkKey[0], _pLinkKey[1], _pLinkKey[2], _pLinkKey[3], _pLinkKey[4], _pLinkKey[5], _pLinkKey[6], _pLinkKey[7]
, _pLinkKey[8], _pLinkKey[9], _pLinkKey[10], _pLinkKey[11], _pLinkKey[12], _pLinkKey[13], _pLinkKey[14], _pLinkKey[15]);

}
}
6 changes: 3 additions & 3 deletions Source/Core/Core/Src/Movie.cpp
Expand Up @@ -663,19 +663,19 @@ void ReadHeader()
}

videoBackend.resize(ARRAYSIZE(tmpHeader.videoBackend));
for (int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++)
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++)
{
videoBackend[i] = tmpHeader.videoBackend[i];
}

g_discChange.resize(ARRAYSIZE(tmpHeader.discChange));
for (int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++)
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++)
{
g_discChange[i] = tmpHeader.discChange[i];
}

author.resize(ARRAYSIZE(tmpHeader.author));
for (int i = 0; i < ARRAYSIZE(tmpHeader.author);i++)
for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.author);i++)
{
author[i] = tmpHeader.author[i];
}
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp
Expand Up @@ -1097,7 +1097,7 @@ void Jit64::mulli(UGeckoInstruction inst)
gpr.BindToRegister(d, (d == a), true);
if (imm == 0)
XOR(32, gpr.R(d), gpr.R(d));
else if(imm == -1)
else if(imm == (u32)-1)
{
if (d != a)
MOV(32, gpr.R(d), gpr.R(a));
Expand Down Expand Up @@ -1147,7 +1147,7 @@ void Jit64::mullwx(UGeckoInstruction inst)
int src = gpr.R(a).IsImm() ? b : a;
if (imm == 0)
XOR(32, gpr.R(d), gpr.R(d));
else if(imm == -1)
else if(imm == (u32)-1)
{
if (d != src)
MOV(32, gpr.R(d), gpr.R(src));
Expand Down Expand Up @@ -1263,7 +1263,7 @@ void Jit64::divwux(UGeckoInstruction inst)
while(!(divisor & (1 << shift)))
shift--;

if (divisor == (1 << shift))
if (divisor == (u32)(1 << shift))
{
gpr.Lock(a, b, d);
gpr.BindToRegister(d, d == a, true);
Expand Down Expand Up @@ -1387,7 +1387,7 @@ void Jit64::divwx(UGeckoInstruction inst)
if (gpr.R(a).IsImm() && gpr.R(b).IsImm())
{
s32 i = (s32)gpr.R(a).offset, j = (s32)gpr.R(b).offset;
if( j == 0 || i == 0x80000000 && j == -1)
if( j == 0 || (i == (s32)0x80000000 && j == -1))
{
gpr.SetImmediate32(d, (i >> 31) ^ j);
if (inst.OE)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp
Expand Up @@ -472,10 +472,10 @@ static OpArg regBuildMemAddress(RegInfo& RI, InstLoc I, InstLoc AI,
#else
// 64-bit
if (Profiled) {
RI.Jit->LEA(32, EAX, M((void*)addr));
RI.Jit->LEA(32, EAX, M((void*)(u64)addr));
return MComplex(RBX, EAX, SCALE_1, 0);
}
return M((void*)addr);
return M((void*)(u64)addr);
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/State.cpp
Expand Up @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent;
static std::thread g_save_thread;

// Don't forget to increase this after doing changes on the savestate system
static const int STATE_VERSION = 10;
static const u32 STATE_VERSION = 10;

struct StateHeader
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp
Expand Up @@ -319,7 +319,7 @@ void CCodeWindow::UpdateLists()
{
int idx = callers->Append(wxString::FromAscii(StringFromFormat
("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str()));
callers->SetClientData(idx, (void*)caller_addr);
callers->SetClientData(idx, (void*)(u64)caller_addr);
}
}

Expand All @@ -332,7 +332,7 @@ void CCodeWindow::UpdateLists()
{
int idx = calls->Append(wxString::FromAscii(StringFromFormat
("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str()));
calls->SetClientData(idx, (void*)call_addr);
calls->SetClientData(idx, (void*)(u64)call_addr);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp
Expand Up @@ -624,7 +624,6 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event)
int cmd = *objectdata++;
int stream_size = Common::swap16(objectdata);
objectdata += 2;
int vertex_size = (objectdata_end - objectdata) / stream_size;
wxString newLabel = wxString::Format(wxT("%08X: %02X %04X "), obj_offset, cmd, stream_size);
if ((objectdata_end - objectdata) % stream_size) newLabel += _("NOTE: Stream size doesn't match actual data length\n");
while (objectdata < objectdata_end)
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -1320,9 +1320,8 @@ void CFrame::StatusBarMessage(const char * Text, ...)
const int MAX_BYTES = 1024*10;
char Str[MAX_BYTES];
va_list ArgPtr;
int Cnt;
va_start(ArgPtr, Text);
Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
va_end(ArgPtr);

if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxString::FromAscii(Str),0);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/GameListCtrl.cpp
Expand Up @@ -652,7 +652,7 @@ void CGameListCtrl::ScanForISOs()

for (std::vector<std::string>::const_iterator iter = drives.begin(); iter != drives.end(); ++iter)
{
std::auto_ptr<GameListItem> gli(new GameListItem(*iter));
std::unique_ptr<GameListItem> gli(new GameListItem(*iter));

if (gli->IsValid())
m_ISOFiles.push_back(gli.release());
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/ISOFile.cpp
Expand Up @@ -285,7 +285,7 @@ bool GameListItem::GetName(std::wstring& wName, int index) const
index++;
if ((index >=0) && (index < 10))
{
if (m_wNames.size() > index)
if (m_wNames.size() > (size_t)index)
{
wName = m_wNames[index];
return true;
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/DolphinWX/Src/ISOProperties.cpp
Expand Up @@ -687,14 +687,13 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event))
void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolder, const int partitionNum)
{
char exportName[512];
u32 index[2] = {0, 0}, offsetShift = 0;
u32 index[2] = {0, 0};
std::vector<const DiscIO::SFileInfo *> fst;
DiscIO::IFileSystem *FS = 0;

if (DiscIO::IsVolumeWiiDisc(OpenISO))
{
FS = WiiDisc.at(partitionNum).FileSystem;
offsetShift = 2;
}
else
FS = pFileSystem;
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/DolphinWX/Src/Main.cpp
Expand Up @@ -105,7 +105,7 @@ bool DolphinApp::OnInit()
bool UseDebugger = false;
bool UseLogger = false;
bool selectVideoBackend = false;
bool selectAudioEmulation = false;
//bool selectAudioEmulation = false;

wxString videoBackendName;
wxString audioEmulationName;
Expand Down Expand Up @@ -167,8 +167,8 @@ bool DolphinApp::OnInit()
selectVideoBackend = parser.Found(wxT("video_backend"),
&videoBackendName);
// TODO: This currently has no effect. Implement or delete.
selectAudioEmulation = parser.Found(wxT("audio_emulation"),
&audioEmulationName);
//selectAudioEmulation = parser.Found(wxT("audio_emulation"),
// &audioEmulationName);
#endif // wxUSE_CMDLINE_PARSER

#if defined _DEBUG && defined _WIN32
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/X11Utils.cpp
Expand Up @@ -225,7 +225,7 @@ void XRRConfiguration::Update()
}
else
sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(),
"%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);
"%m[^:]: %ux%u", &output_name, &fullWidth, &fullHeight);

for (int i = 0; i < screenResources->noutput; i++)
{
Expand Down
@@ -1,5 +1,7 @@
#include "Xlib.h"

#include <X11/XKBlib.h>

namespace ciface
{
namespace Xlib
Expand Down Expand Up @@ -93,7 +95,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key
KeySym keysym = 0;
do
{
keysym = XKeycodeToKeysym(m_display, keycode, i);
keysym = XkbKeycodeToKeysym(m_display, keycode, i, 0);
i++;
}
while (keysym == NoSymbol && i < 8);
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/VideoCommon/Src/DLCache.cpp
Expand Up @@ -361,9 +361,9 @@ u32 AnalyzeAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
(cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT,
numVertices);
num_draw_call++;
const int tc[12] = {
const u32 tc[12] = {
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
};
for(int i = 0; i < 12; i++)
{
Expand Down Expand Up @@ -563,9 +563,9 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
dl->InsertRegion(NewRegion);
memcpy(NewRegion->start_address, StartAddress, Vdatasize);
emitter.ABI_CallFunctionCCCP((void *)&VertexLoaderManager::RunCompiledVertices, cmd_byte & GX_VAT_MASK, (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices, NewRegion->start_address);
const int tc[12] = {
const u32 tc[12] = {
g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord,
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
};
for(int i = 0; i < 12; i++)
{
Expand Down
5 changes: 3 additions & 2 deletions Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Expand Up @@ -131,6 +131,8 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo

for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i)
{
// TODO: This is all wrong. i in the else clause will always be out of range as a
// subscript for xfregs.texMtxInfo. NeoBrain??
if (18+i < 32)
uid->values[0] |= xfregs.texMtxInfo[i].projection << (18+i); // 1
else
Expand Down Expand Up @@ -158,7 +160,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo
}

u32* ptr = &uid->values[2];
for (unsigned int i = 0; i < bpmem.genMode.numtevstages+1; ++i)
for (int i = 0; i < bpmem.genMode.numtevstages+1; ++i)
{
StageHash(i, ptr);
ptr += 4; // max: ptr = &uid->values[66]
Expand Down Expand Up @@ -626,7 +628,6 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
}
WRITE(p, " ) {\n");

char* pmainstart = p;
int Pretest = AlphaPreTest();
if(Pretest >= 0 && !DepthTextureEnable)
{
Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/Src/PixelShaderManager.cpp
Expand Up @@ -302,6 +302,7 @@ void PixelShaderManager::SetConstants()
float GC_ALIGNED16(material[4]);
float NormalizationCoef = 1 / 255.0f;

// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
for (int i = 0; i < 4; ++i)
{
if (nMaterialsChanged & (1 << i))
Expand Down
10 changes: 5 additions & 5 deletions Source/Core/VideoCommon/Src/VertexLoader.cpp
Expand Up @@ -224,14 +224,14 @@ void VertexLoader::CompileVertexTranslator()
#endif

// Colors
const int col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
const u32 col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
// TextureCoord
// Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
// If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
// 01 become 00, and 10/11 become 01
const int tc[8] = {
const u32 tc[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const int)((m_VtxDesc.Hex >> 31) & 3)
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const u32)((m_VtxDesc.Hex >> 31) & 3)
};

// Reset pipeline
Expand Down Expand Up @@ -770,15 +770,15 @@ void VertexLoader::AppendToString(std::string *dest) const
dest->append(StringFromFormat("Nrm: %i %s-%s ",
m_VtxAttr.NormalElements, posMode[m_VtxDesc.Normal], posFormats[m_VtxAttr.NormalFormat]));
}
int color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
u32 color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1};
for (int i = 0; i < 2; i++)
{
if (color_mode[i])
{
dest->append(StringFromFormat("C%i: %i %s-%s ", i, m_VtxAttr.color[i].Elements, posMode[color_mode[i]], colorFormat[m_VtxAttr.color[i].Comp]));
}
}
int tex_mode[8] = {
u32 tex_mode[8] = {
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord
};
Expand Down
9 changes: 5 additions & 4 deletions Source/Core/VideoCommon/Src/VertexLoaderManager.cpp
Expand Up @@ -20,8 +20,8 @@
#include <hash_map>
using stdext::hash_map;
#else
#include <ext/hash_map>
using __gnu_cxx::hash_map;
#include <unordered_map>
using std::unordered_map;
#endif
#include <map>
#include <vector>
Expand All @@ -44,20 +44,21 @@ namespace stdext {
return uid.GetHash();
}
}
typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
#else
namespace __gnu_cxx {
namespace std {
template<> struct hash<VertexLoaderUID> {
size_t operator()(const VertexLoaderUID& uid) const {
return uid.GetHash();
}
};
}
typedef unordered_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
#endif

namespace VertexLoaderManager
{

typedef hash_map<VertexLoaderUID, VertexLoader*> VertexLoaderMap;
static VertexLoaderMap g_VertexLoaderMap;
// TODO - change into array of pointers. Keep a map of all seen so far.

Expand Down
1 change: 1 addition & 0 deletions Source/Core/VideoCommon/Src/VertexShaderManager.cpp
Expand Up @@ -251,6 +251,7 @@ void VertexShaderManager::SetConstants()
float GC_ALIGNED16(material[4]);
float NormalizationCoef = 1 / 255.0f;

// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
for (int i = 0; i < 4; ++i)
{
if (nMaterialsChanged & (1 << i))
Expand Down
14 changes: 7 additions & 7 deletions Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp
Expand Up @@ -72,27 +72,27 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType)
tcScale[7] = 1.0f / float(1 << m_CurrentVat->g2.Tex7Frac);

//TexMtx
const int tmDesc[8] = {
const u32 tmDesc[8] = {
g_VtxDesc.Tex0MatIdx, g_VtxDesc.Tex1MatIdx, g_VtxDesc.Tex2MatIdx, g_VtxDesc.Tex3MatIdx,
g_VtxDesc.Tex4MatIdx, g_VtxDesc.Tex5MatIdx, g_VtxDesc.Tex6MatIdx, g_VtxDesc.Tex7MatIdx
};
// Colors
const int colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1};
const u32 colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1};
colElements[0] = m_CurrentVat->g0.Color0Elements;
colElements[1] = m_CurrentVat->g0.Color1Elements;
const int colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp};
const u32 colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp};
// TextureCoord
const int tcDesc[8] = {
const u32 tcDesc[8] = {
g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord, g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord,
g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3)
g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3)
};
const int tcElements[8] = {
const u32 tcElements[8] = {
m_CurrentVat->g0.Tex0CoordElements, m_CurrentVat->g1.Tex1CoordElements, m_CurrentVat->g1.Tex2CoordElements,
m_CurrentVat->g1.Tex3CoordElements, m_CurrentVat->g1.Tex4CoordElements, m_CurrentVat->g2.Tex5CoordElements,
m_CurrentVat->g2.Tex6CoordElements, m_CurrentVat->g2.Tex7CoordElements
};

const int tcFormat[8] = {
const u32 tcFormat[8] = {
m_CurrentVat->g0.Tex0CoordFormat, m_CurrentVat->g1.Tex1CoordFormat, m_CurrentVat->g1.Tex2CoordFormat,
m_CurrentVat->g1.Tex3CoordFormat, m_CurrentVat->g1.Tex4CoordFormat, m_CurrentVat->g2.Tex5CoordFormat,
m_CurrentVat->g2.Tex6CoordFormat, m_CurrentVat->g2.Tex7CoordFormat
Expand Down