Merge pull request #413 from xsacha/master

Warnings: Fix several warnings.
This commit is contained in:
B1ackDaemon 2014-07-10 22:26:57 +03:00
commit 313af89d36
18 changed files with 41 additions and 40 deletions

View File

@ -9,10 +9,9 @@ if (CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7.0)
message(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old.") message(FATAL_ERROR "GCC ${CMAKE_CXX_COMPILER_VERSION} is too old.")
endif() endif()
#add_definitions(-D__WXGTK__) # Warnings
#add_definitions(-Wfatal-errors) add_definitions(-Wno-attributes -Wno-enum-compare)
add_definitions(-w) # TODO: remove me set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
add_definitions(-fpermissive) # TODO: remove me
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# TODO: stdlib? # TODO: stdlib?
endif() endif()

View File

@ -318,7 +318,7 @@ class SPUThread : public PPCThread
public: public:
SPU_GPR_hdr GPR[128]; //General-Purpose Register SPU_GPR_hdr GPR[128]; //General-Purpose Register
SPU_SPR_hdr SPR[128]; //Special-Purpose Registers SPU_SPR_hdr SPR[128]; //Special-Purpose Registers
FPSCR FPSCR; // FPSCR fpscr; //Unused
SPU_SNRConfig_hdr cfg; //Signal Notification Registers Configuration (OR-mode enabled: 0x1 for SNR1, 0x2 for SNR2) SPU_SNRConfig_hdr cfg; //Signal Notification Registers Configuration (OR-mode enabled: 0x1 for SNR1, 0x2 for SNR2)
EventPort SPUPs[64]; // SPU Thread Event Ports EventPort SPUPs[64]; // SPU Thread Event Ports

View File

@ -67,11 +67,11 @@ void GLBufferObject::SetData(const void* data, u32 size, u32 usage)
SetData(m_type, data, size, usage); SetData(m_type, data, size, usage);
} }
void GLBufferObject::SetAttribPointer(int location, int size, int type, int pointer, int stride, bool normalized) void GLBufferObject::SetAttribPointer(int location, int size, int type, GLvoid* pointer, int stride, bool normalized)
{ {
if(location < 0) return; if(location < 0) return;
glVertexAttribPointer(location, size, type, normalized ? GL_TRUE : GL_FALSE, stride, (const GLvoid*)pointer); glVertexAttribPointer(location, size, type, normalized ? GL_TRUE : GL_FALSE, stride, pointer);
glEnableVertexAttribArray(location); glEnableVertexAttribArray(location);
} }

View File

@ -21,7 +21,7 @@ public:
void UnBind(); void UnBind();
void SetData(u32 type, const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW); void SetData(u32 type, const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW);
void SetData(const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW); void SetData(const void* data, u32 size, u32 usage = GL_DYNAMIC_DRAW);
void SetAttribPointer(int location, int size, int type, int pointer, int stride, bool normalized = false); void SetAttribPointer(int location, int size, int type, GLvoid* pointer, int stride, bool normalized = false);
bool IsCreated() const; bool IsCreated() const;
}; };

View File

@ -54,7 +54,7 @@ GLGSRender::GLGSRender()
GLGSRender::~GLGSRender() GLGSRender::~GLGSRender()
{ {
m_frame->Close(); m_frame->Close();
delete m_context; // delete m_context; // This won't do anything (deleting void* instead of wglContext*)
} }
void GLGSRender::Enable(bool enable, const u32 cap) void GLGSRender::Enable(bool enable, const u32 cap)
@ -249,7 +249,7 @@ void GLGSRender::EnableVertexData(bool indexed_draw)
glEnableVertexAttribArray(i); glEnableVertexAttribArray(i);
checkForGlError("glEnableVertexAttribArray"); checkForGlError("glEnableVertexAttribArray");
glVertexAttribPointer(i, m_vertex_data[i].size, gltype, normalized, 0, (void*)offset_list[i]); glVertexAttribPointer(i, m_vertex_data[i].size, gltype, normalized, 0, reinterpret_cast<void*>(offset_list[i]));
checkForGlError("glVertexAttribPointer"); checkForGlError("glVertexAttribPointer");
} }
} }

View File

@ -21,7 +21,7 @@ extern "C"
//void cellAdec_init(); //void cellAdec_init();
//Module cellAdec(0x0006, cellAdec_init); //Module cellAdec(0x0006, cellAdec_init);
extern Module *cellAdec=nullptr; Module *cellAdec = nullptr;
int adecRawRead(void* opaque, u8* buf, int buf_size) int adecRawRead(void* opaque, u8* buf, int buf_size)
{ {

View File

@ -7,7 +7,7 @@
#include "Emu/SysCalls/Modules.h" #include "Emu/SysCalls/Modules.h"
#include "Emu/SysCalls/SysCalls.h" #include "Emu/SysCalls/SysCalls.h"
extern Module *cellAtrac = nullptr; Module *cellAtrac = nullptr;
#include "cellAtrac.h" #include "cellAtrac.h"

View File

@ -13,7 +13,7 @@
//void cellAudio_init(); //void cellAudio_init();
//Module cellAudio(0x0011, cellAudio_init); //Module cellAudio(0x0011, cellAudio_init);
extern Module *cellAudio = nullptr; Module *cellAudio = nullptr;
static std::mutex audioMutex; static std::mutex audioMutex;

View File

@ -12,7 +12,7 @@
//void cellFontFT_load(); //void cellFontFT_load();
//void cellFontFT_unload(); //void cellFontFT_unload();
//Module cellFontFT(0x001a, cellFontFT_init, cellFontFT_load, cellFontFT_unload); //Module cellFontFT(0x001a, cellFontFT_init, cellFontFT_load, cellFontFT_unload);
extern Module *cellFontFT = nullptr; Module *cellFontFT = nullptr;
struct CellFontLibraryConfigFT struct CellFontLibraryConfigFT
{ {

View File

@ -14,7 +14,7 @@
//void cellGame_init(); //void cellGame_init();
//Module cellGame(0x003e, cellGame_init); //Module cellGame(0x003e, cellGame_init);
extern Module *cellGame = nullptr; Module *cellGame = nullptr;
std::string contentInfo = ""; std::string contentInfo = "";
std::string usrdir = ""; std::string usrdir = "";

View File

@ -12,7 +12,7 @@
//void cellGcmSys_load(); //void cellGcmSys_load();
//void cellGcmSys_unload(); //void cellGcmSys_unload();
//Module cellGcmSys(0x0010, cellGcmSys_init, cellGcmSys_load, cellGcmSys_unload); //Module cellGcmSys(0x0010, cellGcmSys_init, cellGcmSys_load, cellGcmSys_unload);
extern Module *cellGcmSys = nullptr; Module *cellGcmSys = nullptr;
u32 local_size = 0; u32 local_size = 0;
u32 local_addr = 0; u32 local_addr = 0;

View File

@ -13,7 +13,7 @@
//void cellGifDec_init(); //void cellGifDec_init();
//Module cellGifDec(0xf010, cellGifDec_init); //Module cellGifDec(0xf010, cellGifDec_init);
extern Module *cellGifDec = nullptr; Module *cellGifDec = nullptr;
int cellGifDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam) int cellGifDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
{ {
@ -174,7 +174,8 @@ int cellGifDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
//Decode GIF file. (TODO: Is there any faster alternative? Can we do it without external libraries?) //Decode GIF file. (TODO: Is there any faster alternative? Can we do it without external libraries?)
int width, height, actual_components; int width, height, actual_components;
std::shared_ptr<unsigned char> image(stbi_load_from_memory(gif, fileSize, &width, &height, &actual_components, 4)); std::shared_ptr<unsigned char> image(stbi_load_from_memory(gif, fileSize, &width, &height, &actual_components, 4));
if (!image) return CELL_GIFDEC_ERROR_STREAM_FORMAT; if (!image)
return CELL_GIFDEC_ERROR_STREAM_FORMAT;
uint image_size = width * height * 4; uint image_size = width * height * 4;

View File

@ -10,7 +10,7 @@
//void cellJpgDec_init(); //void cellJpgDec_init();
//Module cellJpgDec(0x000f, cellJpgDec_init); //Module cellJpgDec(0x000f, cellJpgDec_init);
extern Module *cellJpgDec = nullptr; Module *cellJpgDec = nullptr;
int cellJpgDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam) int cellJpgDecCreate(u32 mainHandle, u32 threadInParam, u32 threadOutParam)
{ {
@ -155,7 +155,8 @@ int cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, mem8_ptr_t data, const m
int width, height, actual_components; int width, height, actual_components;
std::shared_ptr<unsigned char> image(stbi_load_from_memory(jpg, fileSize, &width, &height, &actual_components, 4)); std::shared_ptr<unsigned char> image(stbi_load_from_memory(jpg, fileSize, &width, &height, &actual_components, 4));
if (!image) return CELL_JPGDEC_ERROR_STREAM_FORMAT; if (!image)
return CELL_JPGDEC_ERROR_STREAM_FORMAT;
uint image_size = width * height; uint image_size = width * height;
switch((u32)current_outParam.outputColorSpace) switch((u32)current_outParam.outputColorSpace)

View File

@ -11,7 +11,7 @@
//void cellPngDec_init(); //void cellPngDec_init();
//Module cellPngDec(0x0018, cellPngDec_init); //Module cellPngDec(0x0018, cellPngDec_init);
extern Module *cellPngDec = nullptr; Module *cellPngDec = nullptr;
static std::map<u32, CellPngDecMainHandle *> cellPngDecMap; static std::map<u32, CellPngDecMainHandle *> cellPngDecMap;

View File

@ -456,10 +456,10 @@ void InitMembers()
{ {
s_rescInternalInstance->m_dstMode = (CellRescBufferMode)0; s_rescInternalInstance->m_dstMode = (CellRescBufferMode)0;
s_rescInternalInstance->m_interlaceElement = CELL_RESC_ELEMENT_FLOAT; s_rescInternalInstance->m_interlaceElement = CELL_RESC_ELEMENT_FLOAT;
s_rescInternalInstance->m_colorBuffersEA = NULL; s_rescInternalInstance->m_colorBuffersEA = 0;
s_rescInternalInstance->m_vertexArrayEA = NULL; s_rescInternalInstance->m_vertexArrayEA = 0;
s_rescInternalInstance->m_fragmentUcodeEA = NULL; s_rescInternalInstance->m_fragmentUcodeEA = 0;
s_rescInternalInstance->m_interlaceTableEA = NULL; s_rescInternalInstance->m_interlaceTableEA = 0;
s_rescInternalInstance->m_bufIdFront = 0; s_rescInternalInstance->m_bufIdFront = 0;
s_rescInternalInstance->m_dstWidth = 0; s_rescInternalInstance->m_dstWidth = 0;
s_rescInternalInstance->m_dstHeight = 0; s_rescInternalInstance->m_dstHeight = 0;
@ -668,7 +668,7 @@ void cellRescExit()
if (IsPalTemporal()) if (IsPalTemporal())
{ {
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_DISABLE); cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_DISABLE);
cellGcmSetVBlankHandler(NULL); cellGcmSetVBlankHandler(0);
//GcmSysTypePrefix::cellGcmSetSecondVHandler(NULL); //GcmSysTypePrefix::cellGcmSetSecondVHandler(NULL);
if (IsPalInterpolate()) if (IsPalInterpolate())
@ -756,12 +756,12 @@ void SetVBlankHandler(u32 handler)
if (IsNotPalTemporal()) if (IsNotPalTemporal())
{ {
cellGcmSetVBlankHandler(handler); cellGcmSetVBlankHandler(handler);
s_rescInternalInstance->s_applicationVBlankHandler = NULL; s_rescInternalInstance->s_applicationVBlankHandler = 0;
} }
else if (IsPal60Hsync()) else if (IsPal60Hsync())
{ {
//cellGcmSetSecondVHandler(handler); //cellGcmSetSecondVHandler(handler);
s_rescInternalInstance->s_applicationVBlankHandler = NULL; s_rescInternalInstance->s_applicationVBlankHandler = 0;
} }
else else
{ {
@ -782,7 +782,7 @@ void SetFlipHandler(u32 handler)
if (IsGcmFlip()) if (IsGcmFlip())
{ {
cellGcmSetFlipHandler(handler); cellGcmSetFlipHandler(handler);
s_rescInternalInstance->s_applicationFlipHandler = NULL; s_rescInternalInstance->s_applicationFlipHandler = 0;
} }
else else
{ {
@ -857,20 +857,20 @@ int cellRescSetDisplayMode(u32 displayMode)
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ); cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
//cellGcmSetVBlankHandler(IntrHandler50); //cellGcmSetVBlankHandler(IntrHandler50);
//cellGcmSetSecondVHandler(IntrHandler60); //cellGcmSetSecondVHandler(IntrHandler60);
cellGcmSetFlipHandler(NULL); cellGcmSetFlipHandler(0);
} }
else if (IsPalDrop()) else if (IsPalDrop())
{ {
//InitLabels(); //InitLabels();
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ); cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetVBlankHandler(NULL); cellGcmSetVBlankHandler(0);
//cellGcmSetSecondVHandler(IntrHandler60Drop); //cellGcmSetSecondVHandler(IntrHandler60Drop);
cellGcmSetFlipHandler(NULL); cellGcmSetFlipHandler(0);
} }
else if (IsPal60Hsync()) else if (IsPal60Hsync())
{ {
cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ); cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ);
cellGcmSetVBlankHandler(NULL); cellGcmSetVBlankHandler(0);
} }
if (s_rescInternalInstance->s_applicationVBlankHandler) SetVBlankHandler(s_rescInternalInstance->s_applicationVBlankHandler); if (s_rescInternalInstance->s_applicationVBlankHandler) SetVBlankHandler(s_rescInternalInstance->s_applicationVBlankHandler);
@ -1323,7 +1323,7 @@ int cellRescCreateInterlaceTable(u32 ea_addr, float srcH, CellRescTableElement d
return CELL_RESC_ERROR_NOT_INITIALIZED; return CELL_RESC_ERROR_NOT_INITIALIZED;
} }
if ((ea_addr == NULL) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0)) if ((ea_addr == 0) || (srcH <= 0.f) || (!(depth == CELL_RESC_ELEMENT_HALF || depth == CELL_RESC_ELEMENT_FLOAT)) || (length <= 0))
{ {
cellResc->Error("cellRescCreateInterlaceTable : CELL_RESC_ERROR_NOT_INITIALIZED"); cellResc->Error("cellRescCreateInterlaceTable : CELL_RESC_ERROR_NOT_INITIALIZED");
return CELL_RESC_ERROR_BAD_ARGUMENT; return CELL_RESC_ERROR_BAD_ARGUMENT;

View File

@ -20,7 +20,7 @@ typedef void (*CellHddGameStatCallback)(mem_ptr_t<CellHddGameCBResult> cbResult,
//void cellSysutil_init(); //void cellSysutil_init();
//Module cellSysutil(0x0015, cellSysutil_init); //Module cellSysutil(0x0015, cellSysutil_init);
Module *cellSysutil; Module *cellSysutil = nullptr;
int cellSysutilGetSystemParamInt(int id, mem32_t value) int cellSysutilGetSystemParamInt(int id, mem32_t value)
{ {

View File

@ -8,7 +8,7 @@
//void cellSysutilAp_init(); //void cellSysutilAp_init();
//Module cellSysutilAp(0x0039, cellSysutilAp_init); //Module cellSysutilAp(0x0039, cellSysutilAp_init);
extern Module *cellSysutilAp = nullptr; Module *cellSysutilAp = nullptr;
// Return Codes // Return Codes
enum enum

View File

@ -10,7 +10,7 @@
//void cellUserInfo_init(); //void cellUserInfo_init();
//Module cellUserInfo(0x0032, cellUserInfo_init); //Module cellUserInfo(0x0032, cellUserInfo_init);
extern Module *cellUserInfo = nullptr; Module *cellUserInfo = nullptr;
int cellUserInfoGetStat(u32 id, mem_ptr_t<CellUserInfoUserStat> stat) int cellUserInfoGetStat(u32 id, mem_ptr_t<CellUserInfoUserStat> stat)
{ {