Skip to content

Commit

Permalink
Merge pull request #1770 from np511/gcc-cleanup
Browse files Browse the repository at this point in the history
Cleanup GCC warnings - still needs some work
  • Loading branch information
gregory38 committed Jan 30, 2017
2 parents 72d54d3 + e5e601e commit bccc3ef
Show file tree
Hide file tree
Showing 29 changed files with 72 additions and 1,667 deletions.
2 changes: 1 addition & 1 deletion common/include/PS2Edefs.h
Expand Up @@ -126,7 +126,7 @@ extern "C" {

u32 CALLBACK PS2EgetLibType(void);
u32 CALLBACK PS2EgetLibVersion2(u32 type);
char *CALLBACK PS2EgetLibName(void);
const char *CALLBACK PS2EgetLibName(void);

#ifdef __cplusplus
}
Expand Down
1 change: 0 additions & 1 deletion pcsx2/Gif.cpp
Expand Up @@ -486,7 +486,6 @@ static u16 QWCinGIFMFIFO(u32 DrainADDR)
gifstate |= GIF_STATE_EMPTY;

GIF_LOG("%x Available of the %x requested", ret, gifch.qwc);
pxAssert(ret >= 0);
return ret;
}

Expand Down
27 changes: 17 additions & 10 deletions pcsx2/IopGte.cpp
Expand Up @@ -425,8 +425,9 @@ __inline s32 FNC_OVERFLOW4(s64 x) {
}

#define _LIMX(negv, posv, flagb) { \
if (x < (negv)) { x = (negv); gteFLAG |= (1<<(flagb)); } else \
if (x > (posv)) { x = (posv); gteFLAG |= (1<<(flagb)); } return (x); \
if (x < (negv)) { x = (negv); gteFLAG |= (1<<(flagb)); } \
else if (x > (posv)) { x = (posv); gteFLAG |= (1<<(flagb)); } \
return (x); \
}

__inline double limA1S(double x) { _LIMX(-32768.0, 32767.0, 24); }
Expand All @@ -450,7 +451,9 @@ __inline double limG1(double x) {

if (x > 1023.0) { x = 1023.0; gteFLAG |= (1 << 14); }
else
if (x < -1024.0) { x = -1024.0; gteFLAG |= (1 << 14); } return (x);
if (x < -1024.0) { x = -1024.0; gteFLAG |= (1 << 14); }

return (x);
}

__inline double limG2(double x) {
Expand All @@ -460,7 +463,9 @@ __inline double limG2(double x) {

if (x > 1023.0) { x = 1023.0; gteFLAG |= (1 << 13); }
else
if (x < -1024.0) { x = -1024.0; gteFLAG |= (1 << 13); } return (x);
if (x < -1024.0) { x = -1024.0; gteFLAG |= (1 << 13); }

return (x);
}

__inline s32 F12limA1S(s64 x) { _LIMX(-32768 << 12, 32767 << 12, 24); }
Expand All @@ -487,12 +492,12 @@ __inline s32 FlimE(s32 x) { _LIMX(0, 65535, 12); }

__inline s32 FlimG1(s64 x) {
if (x > 2147483647) { gteFLAG |= (1 << 16); }
else
if (x < (s64)0xffffffff80000000) { gteFLAG |= (1 << 15); }

else if (x < (s64)0xffffffff80000000) { gteFLAG |= (1 << 15); }

if (x > 1023) { x = 1023; gteFLAG |= (1 << 14); }
else
if (x < -1024) { x = -1024; gteFLAG |= (1 << 14); } return (x);
else if (x < -1024) { x = -1024; gteFLAG |= (1 << 14); }

return (x);
}

__inline s32 FlimG2(s64 x) {
Expand All @@ -502,7 +507,9 @@ __inline s32 FlimG2(s64 x) {

if (x > 1023) { x = 1023; gteFLAG |= (1 << 13); }
else
if (x < -1024) { x = -1024; gteFLAG |= (1 << 13); } return (x);
if (x < -1024) { x = -1024; gteFLAG |= (1 << 13); }

return (x);
}

#define MAC2IR() { \
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/IopMem.cpp
Expand Up @@ -499,5 +499,5 @@ std::string iopMemReadString(u32 mem, int maxlen)
while ((c = iopMemRead8(mem++)) && maxlen--)
ret.push_back(c);

return ret;
return ret;
}
2 changes: 1 addition & 1 deletion pcsx2/gui/MemoryCardFolder.cpp
Expand Up @@ -1024,7 +1024,7 @@ void FolderMemoryCard::FlushFileEntries( const u32 dirCluster, const u32 remaini
// empty files need to be explicitly created, as there will be no data cluster referencing it later
char cleanName[sizeof( entry->entry.data.name )];
memcpy( cleanName, (const char*)entry->entry.data.name, sizeof( cleanName ) );
bool filenameCleaned = FileAccessHelper::CleanMemcardFilename( cleanName );
FileAccessHelper::CleanMemcardFilename( cleanName );
const wxString filePath = dirPath + L"/" + wxString::FromAscii( (const char*)cleanName );

if ( m_performFileWrites ) {
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/x86/ix86-32/iR5900Templates.cpp
Expand Up @@ -426,8 +426,8 @@ void eeRecompileCodeConst0(R5900FNPTR constcode, R5900FNPTR_INFO constscode, R59
// rt = rs op imm16
void eeRecompileCodeConst1(R5900FNPTR constcode, R5900FNPTR_INFO noconstcode)
{
if ( ! _Rt_ )
return;
if ( ! _Rt_ )
return;

// for now, don't support xmm

Expand Down
2 changes: 1 addition & 1 deletion plugins/CDVDnull/CDVD.cpp
Expand Up @@ -27,7 +27,7 @@ const unsigned char version = PS2E_CDVD_VERSION;
const unsigned char revision = 0;
const unsigned char build = 6;

EXPORT_C_(char *)
EXPORT_C_(const char *)
PS2EgetLibName()
{
snprintf(libraryName, 255, "CDVDnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
Expand Down
2 changes: 1 addition & 1 deletion plugins/FWnull/FW.cpp
Expand Up @@ -66,7 +66,7 @@ PS2EgetLibType()
return PS2E_LT_FW;
}

EXPORT_C_(char *)
EXPORT_C_(const char *)
PS2EgetLibName()
{
snprintf(libraryName, 255, "FWnull Driver %lld%s", SVN_REV, SVN_MODS ? "m" : "");
Expand Down
7 changes: 6 additions & 1 deletion plugins/GSdx/CMakeLists.txt
Expand Up @@ -112,6 +112,7 @@ set(GSdxSources
GSWndOGL.cpp
GSWndEGL.cpp
GSdx.cpp
GSdxResources.cpp
stdafx.cpp
)

Expand Down Expand Up @@ -144,7 +145,6 @@ set(GSdxHeaders
GSDrawingEnvironment.h
GSDump.h
GSFunctionMap.h
GSLinuxLogo.h
GSLocalMemory.h
GSPerfMon.h
GSRasterizer.h
Expand Down Expand Up @@ -176,6 +176,7 @@ set(GSdxHeaders
GSWndOGL.h
GSWndEGL.h
GSdx.h
GSdxResources.h
res/glsl_source.h
stdafx.h
xbyak/xbyak.h
Expand Down Expand Up @@ -214,6 +215,10 @@ if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
endif()

# Note: trying to combine --generate-source and --generate-header doesn't work. It outputs whichever one comes last into the file named by the first
execute_process(COMMAND glib-compile-resources --sourcedir res --generate-header --c-name GSdx_res res/gsdx-res.xml --target=GSdxResources.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
execute_process(COMMAND glib-compile-resources --sourcedir res --generate-source --c-name GSdx_res res/gsdx-res.xml --target=GSdxResources.cpp WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

if(BUILTIN_GS)
add_pcsx2_lib(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}")
else()
Expand Down
9 changes: 6 additions & 3 deletions plugins/GSdx/GSLinuxDialog.cpp
Expand Up @@ -23,7 +23,7 @@
#include <gtk/gtk.h>
#include "GS.h"
#include "GSdx.h"
#include "GSLinuxLogo.h"
#include "GSdxResources.h"
#include "GSSetting.h"

static GtkWidget* s_hack_frame;
Expand Down Expand Up @@ -500,8 +500,11 @@ bool RunLinuxDialog()
GtkWidget* osd_box = gtk_vbox_new(false, 5);

// Grab a logo, to make things look nice.
GdkPixbuf* logo_pixmap = gdk_pixbuf_from_pixdata(&gsdx_ogl_logo, false, NULL);
GtkWidget* logo_image = gtk_image_new_from_pixbuf(logo_pixmap);
GResource * resources = GSdx_res_get_resource();
GInputStream * ogl_stream=g_resource_open_stream(resources,"/GSdx/res/logo-ogl.bmp",G_RESOURCE_LOOKUP_FLAGS_NONE,NULL);
GdkPixbuf * ogl_logo = gdk_pixbuf_new_from_stream(ogl_stream,NULL,NULL);
g_object_unref(ogl_stream);
GtkWidget* logo_image = gtk_image_new_from_pixbuf(ogl_logo);
gtk_box_pack_start(GTK_BOX(main_box), logo_image, true, true, 0);

GtkWidget* main_table = CreateTableInBox(main_box , NULL , 2 , 2);
Expand Down

0 comments on commit bccc3ef

Please sign in to comment.