Convert Config.c & GtkGui.c to cpp. And remove a gcc 4.3 specific flag from my last commit.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@271 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2008-11-02 10:08:47 +00:00 committed by Gregory Hainaut
parent ee09798ade
commit 91f11550c0
7 changed files with 52 additions and 36 deletions

View File

@ -22,7 +22,9 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
extern "C" {
#include "Linux.h" #include "Linux.h"
}
#define GetValue(name, var) \ #define GetValue(name, var) \
tmp = strstr(data, name); \ tmp = strstr(data, name); \

View File

@ -17,8 +17,6 @@
*/ */
#include "GtkGui.h" #include "GtkGui.h"
#include "R3000A.h"
#include "PsxMem.h"
void StartGui() { void StartGui() {
GtkWidget *Menu; GtkWidget *Menu;
@ -607,7 +605,7 @@ void SetActiveComboItem(GtkComboBox *widget,char plist[255][255], GList *list, c
while (temp) while (temp)
{ {
if (!strcmp(plist[pindex],temp->data)) if (!strcmp(plist[pindex],(char*)temp->data))
item = i; item = i;
temp = temp->next; temp = temp->next;
@ -678,7 +676,7 @@ void OnConfConf_Cancel(GtkButton *button, gpointer user_data) {
getcwd(file, ARRAYSIZE(file)); /* store current dir */ \ getcwd(file, ARRAYSIZE(file)); /* store current dir */ \
chdir(Config.PluginsDir); /* change dirs so that plugins can find their config file*/ \ chdir(Config.PluginsDir); /* change dirs so that plugins can find their config file*/ \
if (drv == NULL) return; \ if (drv == NULL) return; \
conf = (src) SysLoadSym(drv, name); \ conf = (src) SysLoadSym(drv, (char*)name); \
if (SysLibError() == NULL) conf(); \ if (SysLibError() == NULL) conf(); \
chdir(file); /* change back*/ \ chdir(file); /* change back*/ \
SysCloseLibrary(drv); SysCloseLibrary(drv);
@ -693,7 +691,7 @@ void OnConfConf_Cancel(GtkButton *button, gpointer user_data) {
strcat(file, plugin); \ strcat(file, plugin); \
drv = SysLoadLibrary(file); \ drv = SysLoadLibrary(file); \
if (drv == NULL) return; \ if (drv == NULL) return; \
conf = (src) SysLoadSym(drv, name); \ conf = (src) SysLoadSym(drv, (char*)name); \
if (SysLibError() == NULL) { \ if (SysLibError() == NULL) { \
ret = conf(); \ ret = conf(); \
if (ret == 0) \ if (ret == 0) \
@ -812,7 +810,7 @@ void SetComboToGList(GtkComboBox *widget, GList *list)
temp = list; temp = list;
while (temp != NULL) while (temp != NULL)
{ {
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), temp->data); gtk_combo_box_append_text(GTK_COMBO_BOX (widget), (char*)temp->data);
temp = temp->next; temp = temp->next;
} }
@ -915,7 +913,7 @@ void UpdateDebugger() {
mem = (u32*)PSXM(pc); mem = (u32*)PSXM(pc);
} }
else else
mem = PSM(pc); mem = (u32*)PSM(pc);
if (mem == NULL) { if (mem == NULL) {
sprintf(nullAddr, "%8.8lX:\tNULL MEMORY", pc); sprintf(nullAddr, "%8.8lX:\tNULL MEMORY", pc);
@ -1047,10 +1045,10 @@ void OnDumpC_Ok(GtkButton *button, gpointer user_data) {
u32 *mem; u32 *mem;
if (DebugMode) { if (DebugMode) {
mem = PSXM(addrf); mem = (u32*)PSXM(addrf);
} }
else { else {
mem = PSM(addrf); mem = (u32*)PSM(addrf);
} }
if (mem == NULL) { if (mem == NULL) {
@ -1104,9 +1102,9 @@ void OnDumpR_Ok(GtkButton *button, gpointer user_data) {
u32 out; u32 out;
if (DebugMode) { if (DebugMode) {
mem = PSXM(addrf); mem = (u32*)PSXM(addrf);
} else { } else {
mem = PSM(addrf); mem = (u32*)PSM(addrf);
} }
if (mem == NULL) out = 0; if (mem == NULL) out = 0;
else out = *mem; else out = *mem;

View File

@ -19,10 +19,21 @@
#ifndef __GTKGUI_H__ #ifndef __GTKGUI_H__
#define __GTKGUI_H__ #define __GTKGUI_H__
#include "Linux.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "support.h" #include "support.h"
#include "callbacks.h" #include "callbacks.h"
#include "interface.h" #include "interface.h"
#include "Linux.h"
#include "R3000A.h"
#include "PsxMem.h"
#ifdef __cplusplus
}
#endif
bool applychanges = FALSE; bool applychanges = FALSE;
bool configuringplug = FALSE; bool configuringplug = FALSE;

View File

@ -43,13 +43,37 @@
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#include <gtk/gtkdialog.h> #include <gtk/gtkdialog.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "../Paths.h" #include "../Paths.h"
#include "Common.h" #include "Common.h"
/* Misc.c */
extern void vu0Shutdown();
extern void vu1Shutdown();
extern void SaveConfig();
extern bool UseGui; extern bool UseGui;
extern bool needReset; extern bool needReset;
extern bool RunExe; extern bool RunExe;
extern int g_SaveGSStream;
extern int g_ZeroGSOptions;
/* LnxMain */
extern void InitLanguages();
extern char *GetLanguageNext();
extern void CloseLanguages();
extern void ChangeLanguage(char *lang);
extern void StartGui();
extern void RunGui();
extern int Pcsx2Configure();
#ifdef __cplusplus
}
#endif
extern GtkWidget *CpuDlg; extern GtkWidget *CpuDlg;
@ -58,22 +82,8 @@ extern int LoadConfig();
extern void SaveConfig(); extern void SaveConfig();
/* GtkGui */ /* GtkGui */
extern void StartGui();
extern void RunGui();
extern int Pcsx2Configure();
extern void ChangeLanguage(char *lang);
extern void init_widgets(); extern void init_widgets();
/* LnxMain */
extern void InitLanguages();
extern char *GetLanguageNext();
extern void CloseLanguages();
extern void ChangeLanguage(char *lang);
/* Misc.c */
extern void vu0Shutdown();
extern void vu1Shutdown();
extern void SaveConfig();
typedef struct { typedef struct {
char lang[256]; char lang[256];
@ -100,9 +110,6 @@ GtkWidget *radio_normal_limit, *radio_limit_limit, *radio_fs_limit, *radio_vuski
_langs *langs; _langs *langs;
unsigned int langsMax; unsigned int langsMax;
extern int g_SaveGSStream;
extern int g_ZeroGSOptions;
char cfgfile[256]; char cfgfile[256];
/* Hacks */ /* Hacks */

View File

@ -431,7 +431,6 @@ void SysPrintf(const char *fmt, ...) {
#endif #endif
#endif #endif
} }
void *SysLoadLibrary(char *lib) { void *SysLoadLibrary(char *lib) {
return dlopen(lib, RTLD_NOW); return dlopen(lib, RTLD_NOW);
} }
@ -564,5 +563,4 @@ int SysMapUserPhysicalPages(void* Addr, uptr NumPages, PSMEMORYBLOCK* pblock, in
return 1; return 1;
} }
#endif #endif

View File

@ -3,7 +3,7 @@ INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../
bin_PROGRAMS = pcsx2 bin_PROGRAMS = pcsx2
# the application source, library search path, and link libraries # the application source, library search path, and link libraries
pcsx2_SOURCES = Config.c interface.c GtkGui.c LnxMain.c support.c pcsx2_SOURCES = Config.cpp interface.c GtkGui.cpp LnxMain.c support.c
pcsx2_LDFLAGS = pcsx2_LDFLAGS =

View File

@ -17,9 +17,9 @@ CXXFLAGS=
CCASFLAGS= CCASFLAGS=
WARNING_FLAGS="-Wall -Wno-format -Wno-unused-value" WARNING_FLAGS="-Wall -Wno-format -Wno-unused-value"
dnl EXTRA_FLAGS = " -Xlinker -zmuldefs -fpermissive "-ansi dnl EXTRA_FLAGS = " -Xlinker -fpermissive -march=native"
NORMAL_FLAGS="-march=native -pipe -O3 -fomit-frame-pointer ${WARNING_FLAGS}" NORMAL_FLAGS=" -pipe -O3 -Xlinker -zmuldefs -fomit-frame-pointer ${WARNING_FLAGS}"
DEBUG_FLAGS=" -g ${WARNING_FLAGS}" DEBUG_FLAGS=" -g -Xlinker -zmuldefs ${WARNING_FLAGS}"
dnl Check for debug build dnl Check for debug build
AC_MSG_CHECKING(debug build) AC_MSG_CHECKING(debug build)