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 <unistd.h>
extern "C" {
#include "Linux.h"
}
#define GetValue(name, var) \
tmp = strstr(data, name); \

View File

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

View File

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

View File

@ -43,14 +43,38 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkdialog.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "../Paths.h"
#include "Common.h"
/* Misc.c */
extern void vu0Shutdown();
extern void vu1Shutdown();
extern void SaveConfig();
extern bool UseGui;
extern bool needReset;
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;
/* Config.c */
@ -58,22 +82,8 @@ extern int LoadConfig();
extern void SaveConfig();
/* GtkGui */
extern void StartGui();
extern void RunGui();
extern int Pcsx2Configure();
extern void ChangeLanguage(char *lang);
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 {
char lang[256];
@ -100,9 +110,6 @@ GtkWidget *radio_normal_limit, *radio_limit_limit, *radio_fs_limit, *radio_vuski
_langs *langs;
unsigned int langsMax;
extern int g_SaveGSStream;
extern int g_ZeroGSOptions;
char cfgfile[256];
/* Hacks */

View File

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

View File

@ -3,7 +3,7 @@ INCLUDES = $(shell pkg-config --cflags gtk+-2.0) -I@srcdir@/../
bin_PROGRAMS = pcsx2
# 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 =

View File

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