A bunch of trivial changes to fix clang warnings.

This commit is contained in:
comex 2013-08-29 01:33:24 -04:00
parent d41eb76378
commit fd7cf5bb71
26 changed files with 20 additions and 37 deletions

View File

@ -14,8 +14,12 @@
#include <string.h> #include <string.h>
#include "DPL2Decoder.h" #include "DPL2Decoder.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif
#ifndef M_SQRT1_2
#define M_SQRT1_2 0.70710678118654752440 #define M_SQRT1_2 0.70710678118654752440
#endif
int olddelay = -1; int olddelay = -1;
unsigned int oldfreq = 0; unsigned int oldfreq = 0;

View File

@ -210,7 +210,7 @@ unsigned int CMixer::GetNumSamples()
u32 numSamples = ((Common::AtomicLoad(m_indexW) - Common::AtomicLoad(m_indexR)) & INDEX_MASK) / 2; u32 numSamples = ((Common::AtomicLoad(m_indexW) - Common::AtomicLoad(m_indexR)) & INDEX_MASK) / 2;
if (AudioInterface::GetAIDSampleRate() == m_sampleRate) if (AudioInterface::GetAIDSampleRate() == m_sampleRate)
numSamples = numSamples; // 1:1 ; //numSamples = numSamples; // 1:1
else if (m_sampleRate == 48000 && AudioInterface::GetAIDSampleRate() == 32000) else if (m_sampleRate == 48000 && AudioInterface::GetAIDSampleRate() == 32000)
numSamples = numSamples * 3 / 2 - 2; // most common case numSamples = numSamples * 3 / 2 - 2; // most common case
else else

View File

@ -45,7 +45,7 @@ const std::string SettingsHandler::GetValue(const std::string key)
else else
{ {
toFind = key + "="; toFind = key + "=";
size_t found = decoded.find(toFind); found = decoded.find(toFind);
if (found == 0) if (found == 0)
{ {
size_t delimFound = decoded.find(delim, found + toFind.length()); size_t delimFound = decoded.find(delim, found + toFind.length());

View File

@ -39,10 +39,6 @@ Timer::Timer()
: m_LastTime(0), m_StartTime(0), m_Running(false) : m_LastTime(0), m_StartTime(0), m_Running(false)
{ {
Update(); Update();
#ifdef _WIN32
QueryPerformanceFrequency((LARGE_INTEGER*)&m_frequency);
#endif
} }
// Write the starting time // Write the starting time

View File

@ -38,7 +38,6 @@ public:
private: private:
u64 m_LastTime; u64 m_LastTime;
u64 m_StartTime; u64 m_StartTime;
u64 m_frequency;
bool m_Running; bool m_Running;
}; };

View File

@ -27,7 +27,6 @@ private:
Elf32_Phdr *segments; Elf32_Phdr *segments;
Elf32_Shdr *sections; Elf32_Shdr *sections;
u32 *sectionOffsets;
u32 *sectionAddrs; u32 *sectionAddrs;
bool bRelocate; bool bRelocate;
u32 entryPoint; u32 entryPoint;

View File

@ -9,8 +9,7 @@
#include "FileUtil.h" #include "FileUtil.h"
CDump::CDump(const char* _szFilename) : CDump::CDump(const char* _szFilename) :
m_pData(NULL), m_pData(NULL)
m_bInit(false)
{ {
File::IOFile pStream(_szFilename, "rb"); File::IOFile pStream(_szFilename, "rb");
if (pStream) if (pStream)

View File

@ -32,7 +32,6 @@ private:
u8 *m_pData; u8 *m_pData;
bool m_bInit;
size_t m_size; size_t m_size;
u32 Read32(u32 _pos); u32 Read32(u32 _pos);

View File

@ -103,6 +103,7 @@ bool WritePB(u32 addr, const PB_TYPE& pb)
return true; return true;
} }
#if 0
// Dump the value of a PB for debugging // Dump the value of a PB for debugging
#define DUMP_U16(field) WARN_LOG(DSPHLE, " %04x (%s)", pb.field, #field) #define DUMP_U16(field) WARN_LOG(DSPHLE, " %04x (%s)", pb.field, #field)
#define DUMP_U32(field) WARN_LOG(DSPHLE, " %08x (%s)", HILO_TO_32(pb.field), #field) #define DUMP_U32(field) WARN_LOG(DSPHLE, " %08x (%s)", HILO_TO_32(pb.field), #field)
@ -122,6 +123,7 @@ void DumpPB(const PB_TYPE& pb)
// TODO: complete as needed // TODO: complete as needed
} }
#endif
// Simulated accelerator state. // Simulated accelerator state.
static u32 acc_loop_addr, acc_end_addr; static u32 acc_loop_addr, acc_end_addr;

View File

@ -31,7 +31,6 @@ public:
private: private:
Buttons* m_buttons; Buttons* m_buttons;
MixedTriggers* m_triggers;
AnalogStick* m_stick; AnalogStick* m_stick;
Triggers *m_effect_dial; Triggers *m_effect_dial;
Slider *m_left_table, *m_right_table, *m_crossfade; Slider *m_left_table, *m_right_table, *m_crossfade;

View File

@ -472,7 +472,8 @@ bool CWII_IPC_HLE_Device_net_wd_command::IOCtlV(u32 CommandAddress)
case IOCTLV_WD_SCAN: case IOCTLV_WD_SCAN:
{ {
// Gives parameters detailing type of scan and what to match // Gives parameters detailing type of scan and what to match
ScanInfo *scan = (ScanInfo *)Memory::GetPointer(CommandBuffer.InBuffer.at(0).m_Address); // XXX - unused
// ScanInfo *scan = (ScanInfo *)Memory::GetPointer(CommandBuffer.InBuffer.at(0).m_Address);
u16 *results = (u16 *)Memory::GetPointer(CommandBuffer.PayloadBuffer.at(0).m_Address); u16 *results = (u16 *)Memory::GetPointer(CommandBuffer.PayloadBuffer.at(0).m_Address);
// first u16 indicates number of BSSInfo following // first u16 indicates number of BSSInfo following

View File

@ -475,9 +475,7 @@ public:
{ {
u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C); u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C);
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10); u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18); u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
u32 result = 0; u32 result = 0;
u32 common_result = 0; u32 common_result = 0;

View File

@ -1174,7 +1174,7 @@ void GetSettings()
u8 tmp[21]; u8 tmp[21];
for (int i = 0; i < 20; ++i) for (int i = 0; i < 20; ++i)
{ {
sscanf(SCM_REV_STR + 2 * i, "%02hhx", &tmp[i]); sscanf(&SCM_REV_STR[2 * i], "%02hhx", &tmp[i]);
revision[i] = tmp[i]; revision[i] = tmp[i];
} }
} }

View File

@ -31,7 +31,6 @@ private:
bool IsOK() {return file_ != 0;} bool IsOK() {return file_ != 0;}
#endif #endif
s64 size; s64 size;
u64 *block_pointers;
public: public:
static DriveReader *Create(const char *drive); static DriveReader *Create(const char *drive);

View File

@ -34,7 +34,6 @@ public:
private: private:
IBlobReader* m_pReader; IBlobReader* m_pReader;
u64 m_titleID;
u32 OpeningBnrOffset, hdr_size, cert_size, tick_size, tmd_size, data_size; u32 OpeningBnrOffset, hdr_size, cert_size, tick_size, tmd_size, data_size;
u8 m_Country; u8 m_Country;
}; };

View File

@ -57,10 +57,7 @@ CCodeView::CCodeView(DebugInterface* debuginterface, SymbolDB *symboldb,
rowHeight(13), rowHeight(13),
selection(0), selection(0),
oldSelection(0), oldSelection(0),
selectionChanged(false),
selecting(false), selecting(false),
hasFocus(false),
showHex(false),
lx(-1), lx(-1),
ly(-1) ly(-1)
{ {

View File

@ -73,10 +73,7 @@ private:
u32 selection; u32 selection;
u32 oldSelection; u32 oldSelection;
bool selectionChanged;
bool selecting; bool selecting;
bool hasFocus;
bool showHex;
int lx, ly; int lx, ly;
void _MoveTo(int x, int y) {lx = x; ly = y;} void _MoveTo(int x, int y) {lx = x; ly = y;}

View File

@ -811,7 +811,7 @@ bool TASInputHasFocus()
{ {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
if (main_frame->g_TASInputDlg[i]->HasFocus()) if (main_frame->g_TASInputDlg[i]->TASHasFocus())
return true; return true;
} }
return false; return false;

View File

@ -58,7 +58,7 @@ bool cInterfaceAGL::Create(void *&window_handle)
initWithAttributes: attr]; initWithAttributes: attr];
if (fmt == nil) { if (fmt == nil) {
ERROR_LOG(VIDEO, "failed to create pixel format"); ERROR_LOG(VIDEO, "failed to create pixel format");
return NULL; return false;
} }
GLWin.cocoaCtx = [[NSOpenGLContext alloc] GLWin.cocoaCtx = [[NSOpenGLContext alloc]
@ -66,12 +66,12 @@ bool cInterfaceAGL::Create(void *&window_handle)
[fmt release]; [fmt release];
if (GLWin.cocoaCtx == nil) { if (GLWin.cocoaCtx == nil) {
ERROR_LOG(VIDEO, "failed to create context"); ERROR_LOG(VIDEO, "failed to create context");
return NULL; return false;
} }
if (GLWin.cocoaWin == nil) { if (GLWin.cocoaWin == nil) {
ERROR_LOG(VIDEO, "failed to create window"); ERROR_LOG(VIDEO, "failed to create window");
return NULL; return false;
} }
[window makeFirstResponder:GLWin.cocoaWin]; [window makeFirstResponder:GLWin.cocoaWin];

View File

@ -83,7 +83,6 @@ private:
bool m_Valid; bool m_Valid;
bool m_BlobCompressed; bool m_BlobCompressed;
std::vector<u8> m_pImage; std::vector<u8> m_pImage;
u32 m_ImageSize;
bool m_IsDiscTwo; bool m_IsDiscTwo;
bool LoadFromCache(); bool LoadFromCache();

View File

@ -697,7 +697,7 @@ void TASInputDlg::OnCloseWindow(wxCloseEvent& event)
} }
} }
bool TASInputDlg::HasFocus() bool TASInputDlg::TASHasFocus()
{ {
//allows numbers to be used as hotkeys //allows numbers to be used as hotkeys
if(TextBoxHasFocus()) if(TextBoxHasFocus())

View File

@ -34,7 +34,7 @@ class TASInputDlg : public wxDialog
void GetKeyBoardInput(SPADStatus *PadStatus); void GetKeyBoardInput(SPADStatus *PadStatus);
bool TextBoxHasFocus(); bool TextBoxHasFocus();
void SetLandRTriggers(); void SetLandRTriggers();
bool HasFocus(); bool TASHasFocus();
wxBitmap CreateStickBitmap(int x, int y); wxBitmap CreateStickBitmap(int x, int y);

View File

@ -68,7 +68,6 @@ private:
void Cancel(wxCommandEvent& event); void Cancel(wxCommandEvent& event);
InputPlugin& m_plugin; InputPlugin& m_plugin;
wxNotebook* m_pad_notebook;
std::map<wxWindowID, unsigned int> m_wiimote_index_from_ctrl_id; std::map<wxWindowID, unsigned int> m_wiimote_index_from_ctrl_id;
unsigned int m_orig_wiimote_sources[MAX_BBMOTES]; unsigned int m_orig_wiimote_sources[MAX_BBMOTES];

View File

@ -26,7 +26,7 @@ private:
public: public:
std::string GetName() const; std::string GetName() const;
bool IsDetectable() { return false; } bool IsDetectable() { return false; }
Cursor(u8 index, const float& axis, const bool positive) : m_index(index), m_axis(axis), m_positive(positive) {} Cursor(u8 index, const float& axis, const bool positive) : m_axis(axis), m_index(index), m_positive(positive) {}
ControlState GetState() const; ControlState GetState() const;
private: private:
const float& m_axis; const float& m_axis;
@ -37,7 +37,7 @@ private:
{ {
public: public:
std::string GetName() const; std::string GetName() const;
Button(u8 index, const unsigned char& button) : m_index(index), m_button(button) {} Button(u8 index, const unsigned char& button) : m_button(button), m_index(index) {}
ControlState GetState() const; ControlState GetState() const;
private: private:
const unsigned char& m_button; const unsigned char& m_button;
@ -63,7 +63,6 @@ private:
const IOHIDDeviceRef m_device; const IOHIDDeviceRef m_device;
const std::string m_device_name; const std::string m_device_name;
int m_index; int m_index;
void *m_window;
uint32_t m_windowid; uint32_t m_windowid;
unsigned char m_mousebuttons[3]; unsigned char m_mousebuttons[3];
}; };

View File

@ -16,7 +16,6 @@ Keyboard::Keyboard(IOHIDDeviceRef device, std::string name, int index, void *win
: m_device(device) : m_device(device)
, m_device_name(name) , m_device_name(name)
, m_index(index) , m_index(index)
, m_window(window)
{ {
// This class should only recieve Keyboard or Keypad devices // This class should only recieve Keyboard or Keypad devices
// Now, filter on just the buttons we can handle sanely // Now, filter on just the buttons we can handle sanely

View File

@ -40,7 +40,6 @@ class Tev
s16 *m_ColorInputLUT[16][3]; s16 *m_ColorInputLUT[16][3];
s16 *m_AlphaInputLUT[8]; // values must point to ABGR color s16 *m_AlphaInputLUT[8]; // values must point to ABGR color
s16 *m_KonstLUT[32][4]; s16 *m_KonstLUT[32][4];
u8 *m_RasColorLUT[8];
s16 m_BiasLUT[4]; s16 m_BiasLUT[4];
u8 m_ScaleLShiftLUT[4]; u8 m_ScaleLShiftLUT[4];
u8 m_ScaleRShiftLUT[4]; u8 m_ScaleRShiftLUT[4];