Fixed warnings when compiling the gtk-glade port.

(this is first patch in 2157019 by riccardom)
This commit is contained in:
yabause 2008-10-13 19:12:00 +00:00
parent c4c16fcfd4
commit dcc710a630
15 changed files with 57 additions and 59 deletions

View File

@ -32,7 +32,7 @@ gboolean ScreenInvert=FALSE;
/* ******** Savestate menu items handling ******** */
void set_menuitem_label(GtkWidget * w, char * text )
static void set_menuitem_label(GtkWidget * w, char * text )
{
GtkLabel * child;
@ -43,7 +43,7 @@ void set_menuitem_label(GtkWidget * w, char * text )
}
}
void clear_savestate_menu(const char * cb_name, u8 num)
static void clear_savestate_menu(const char * cb_name, u8 num)
{
GtkWidget * w;
char cb[40];
@ -55,7 +55,7 @@ void clear_savestate_menu(const char * cb_name, u8 num)
set_menuitem_label( w, text );
}
void update_savestate_menu(const char * cb_name, u8 num)
static void update_savestate_menu(const char * cb_name, u8 num)
{
GtkWidget * w;
char cb[40];
@ -65,11 +65,9 @@ void update_savestate_menu(const char * cb_name, u8 num)
set_menuitem_label( w, savestates[num-1].date );
}
void update_savestates_menu()
static void update_savestates_menu()
{
char cb[15];
u8 i;
GtkWidget * w;
for( i = 1; i <= NB_STATES; i++ )
{
@ -86,7 +84,7 @@ void update_savestates_menu()
}
}
void update_savestate(u8 num)
static void update_savestate(u8 num)
{
desmume_pause();
savestate_slot(num);
@ -112,7 +110,7 @@ void enable_rom_features() {
SET_SENSITIVE("wgt_Reset", TRUE);
}
void MAINWINDOW_RESIZE() {
static void MAINWINDOW_RESIZE() {
GtkWidget * spacer1 = glade_xml_get_widget(xml, "misc_sep3");
GtkWidget * spacer2 = glade_xml_get_widget(xml, "misc_sep4");
int dim1,dim2;
@ -155,7 +153,7 @@ void inline ADD_FILTER(GtkWidget * filech, const char * pattern, const char * na
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filech), pFilter);
}
void file_open() {
static void file_open() {
desmume_pause();
GtkWidget *pFileSelection;
@ -255,7 +253,7 @@ void on_fsXX_activate (GtkMenuItem *menuitem,gpointer user_data) {
/* SUBMENU SIZE ***** ***** ***** ***** */
void gtk_table_reattach(GtkTable * table, GtkWidget * w,
static void gtk_table_reattach(GtkTable * table, GtkWidget * w,
guint left_attach, guint right_attach, guint top_attach, guint bottom_attach,
GtkAttachOptions xoptions, GtkAttachOptions yoptions,
guint xpadding, guint ypadding) {
@ -282,7 +280,7 @@ void gtk_table_reattach(GtkTable * table, GtkWidget * w,
}
}
void rightscreen(BOOL apply) {
static void rightscreen(BOOL apply) {
GtkWidget *chk = glade_xml_get_widget(xml, "wvb_2_Sub");
GtkTable *table = (GtkTable *)glade_xml_get_widget(xml, "table_layout");
@ -471,7 +469,7 @@ void on_wgt_Exec_toggled (GtkToggleToolButton *toggletoolbutton, gpointer user
/* LAYERS ***** ***** ***** ***** */
void change_bgx_layer(int layer, gboolean state, NDS_Screen scr) {
static void change_bgx_layer(int layer, gboolean state, NDS_Screen scr) {
//if(!desmume_running()) return;
if(state==TRUE) {
GPU_addBack(scr.gpu, layer);

View File

@ -204,9 +204,11 @@ gboolean on_wDrawScreen_scroll_event (GtkWidget *widget, GdkEvent *event, gpoin
// separate zoom factors not supported yet
scr = 0;
resize_incremental(scr,(GdkEventScroll*)event);
return TRUE;
}
void set_touch_pos (int x, int y) {
static void set_touch_pos (int x, int y) {
s32 EmuX, EmuY;
x /= ScreenCoeff_Size[1];
y /= ScreenCoeff_Size[1];
@ -283,13 +285,13 @@ gboolean on_wDrawScreen_motion_notify_event (GtkWidget *widget, GdkEventMotion
u16 Keypad_Temp[NB_KEYS];
guint temp_Key=0;
void init_labels() {
static void init_labels() {
int i;
char text[50], bname[20];
GtkButton *b;
for (i=0; i<NB_KEYS; i++) {
sprintf(text,"%s : %s\0\0",key_names[i],KEYNAME(keyboard_cfg[i]));
sprintf(bname,"button_%s\0\0",key_names[i]);
snprintf(text, 50, "%s : %s", key_names[i],KEYNAME(keyboard_cfg[i]));
snprintf(bname, 20, "button_%s", key_names[i]);
b = (GtkButton*)glade_xml_get_widget(xml, bname);
gtk_button_set_label(b,text);
}
@ -302,8 +304,8 @@ void init_joy_labels() {
GtkButton *b;
for (i=0; i<NB_KEYS; i++) {
if( joypad_cfg[i] == (u16)(-1) ) continue; /* Key not configured */
sprintf(text,"%s : %d\0\0",key_names[i],joypad_cfg[i]);
sprintf(bname,"button_joy_%s\0\0",key_names[i]);
snprintf(text, 50, "%s : %d",key_names[i],joypad_cfg[i]);
snprintf(bname, 30, "button_joy_%s",key_names[i]);
b = (GtkButton*)glade_xml_get_widget(xml, bname);
gtk_button_set_label(b,text);
}
@ -335,7 +337,7 @@ gboolean on_wKeyDlg_key_press_event (GtkWidget *widget, GdkEventKey *event, gpo
return TRUE;
}
void ask(GtkButton*b, int key) {
static void ask(GtkButton*b, int key) {
char text[50];
GtkDialog * dlg = (GtkDialog*)glade_xml_get_widget(xml, "wKeyDlg");
key--; /* key = bit position, start with 1 */
@ -345,7 +347,7 @@ void ask(GtkButton*b, int key) {
{
case GTK_RESPONSE_OK:
Keypad_Temp[key]=temp_Key;
sprintf(text,"%s : %s\0\0",key_names[key],KEYNAME(temp_Key));
snprintf(text, 50, "%s : %s",key_names[key],KEYNAME(temp_Key));
gtk_button_set_label(b,text);
break;
case GTK_RESPONSE_CANCEL:
@ -356,7 +358,7 @@ void ask(GtkButton*b, int key) {
}
/* Joystick configuration / Key definition */
void ask_joy_key(GtkButton*b, int key)
static void ask_joy_key(GtkButton*b, int key)
{
char text[50];
u16 joykey;
@ -368,25 +370,24 @@ void ask_joy_key(GtkButton*b, int key)
/* Need to force event processing. Otherwise, popup won't show up. */
while ( gtk_events_pending() ) gtk_main_iteration();
joykey = get_set_joy_key(key);
sprintf(text,"%s : %d\0\0",key_names[key],joykey);
snprintf(text, 50, "%s : %d",key_names[key],joykey);
gtk_button_set_label(b,text);
gtk_widget_hide((GtkWidget*)dlg);
}
/* Joystick configuration / Key definition */
void ask_joy_axis(u8 key, u8 opposite_key)
static void ask_joy_axis(u8 key, u8 opposite_key)
{
char text[50];
char current_button[50], opposite_button[50];
u16 joykey;
GtkWidget * dlg;
GtkButton * btn;
key--; /* remove 1 to get index */
opposite_key--;
sprintf(current_button,"button_joy_%s\0\0",key_names[key]);
sprintf(opposite_button,"button_joy_%s\0\0",key_names[opposite_key]);
snprintf(current_button, 50, "button_joy_%s",key_names[key]);
snprintf(opposite_button, 50, "button_joy_%s",key_names[opposite_key]);
dlg = (GtkWidget*)glade_xml_get_widget(xml, "wJoyDlg");
gtk_widget_show(dlg);
@ -394,11 +395,11 @@ void ask_joy_axis(u8 key, u8 opposite_key)
while ( gtk_events_pending() ) gtk_main_iteration();
get_set_joy_axis(key, opposite_key);
sprintf(text,"%s : %d\0\0",key_names[key],joypad_cfg[key]);
snprintf(text, 50, "%s : %d",key_names[key],joypad_cfg[key]);
btn = (GtkButton*)glade_xml_get_widget(xml, current_button);
gtk_button_set_label(btn,text);
sprintf(text,"%s : %d\0\0",key_names[opposite_key],joypad_cfg[opposite_key]);
snprintf(text, 50, "%s : %d",key_names[opposite_key],joypad_cfg[opposite_key]);
btn = (GtkButton*)glade_xml_get_widget(xml, opposite_button);
gtk_button_set_label(btn,text);

View File

@ -21,6 +21,7 @@
*/
#include "globals.h"
#include "gdk_gl.h"
extern "C" {

View File

@ -131,6 +131,7 @@ gboolean on_wtools_1_draw_button_release_event(GtkWidget *widget, GdkEventButton
// clear the red marks :)
if (event->button==1)
update_regs();
return TRUE;
}
gboolean on_wtools_1_draw_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) {
update_regs();

View File

@ -32,7 +32,8 @@ enum SHOW {
static BOOL init=FALSE;
static enum SHOW packmode=Bit8;
static u32 address=0, tmpaddr=0, bpl=0; int cpu=0;
static u32 address=0, tmpaddr=0;
int cpu=0;
static char patt[512];
static u8 mem[0x100];
static dTools_dsp dsp;
@ -88,7 +89,7 @@ static void wtools_2_update() {
for (j=0; j<16; j+=4, addr+=4,mem32++) {
m32 = *mem32; *mem32 = MMU_read32(cpu, addr);
if (m32 != *mem32) {
sprintf(txt, " %08X", *mem32);
sprintf(txt, " %08lX", *mem32);
dTools_display_clear_char(&dsp, 12+3*j, i, 12);
dTools_display_draw_text(&dsp, 12+3*j, i, txt);
}
@ -102,6 +103,8 @@ gboolean on_wtools_2_draw_button_release_event(GtkWidget *widget, GdkEventButton
// clear the red marks :)
if (event->button==1)
refresh();
return TRUE;
}
@ -197,7 +200,6 @@ static void initialize() {
GtkWidget * combo;
GtkWidget * wPaint;
GtkAdjustment *adj;
int i,j;
if (init) return;
combo = glade_xml_get_widget(xml_tools, "wtools_2_cpu");
@ -269,7 +271,7 @@ static void refresh() {
break;
case Bit32:
for (j=0; j<16; j+=4,ptxt+=12, mem32++)
sprintf(ptxt, " %08X ", *mem32);
sprintf(ptxt, " %08lX ", *mem32);
break;
}
sprintf(ptxt, "| "); ptxt +=2;

View File

@ -111,7 +111,6 @@ static void wtools_3_update() {
static void refresh() {
int x,y,X,Y; u16 * addr = base_addr[palindex];
COLOR c; COLOR32 c32;
gdkGC = gdk_gc_new(wPaint->window);
if (addr) {
@ -154,6 +153,7 @@ gboolean on_wtools_3_PalView_close (GtkWidget *widget, ...) {
gboolean on_wtools_3_draw_expose_event (GtkWidget * widget, GdkEventExpose *event, gpointer user_data) {
refresh();
return TRUE;
}
void on_wtools_3_palette_changed (GtkComboBox *combo, gpointer user_data) {
palindex = gtk_combo_box_get_active(combo);

View File

@ -20,6 +20,7 @@
*/
#include "callbacks_dtools.h"
#include "../gdk_gl.h"
void init_combo_memory(GtkComboBox *combo, u8 ** addresses) {
GtkTreeIter iter;
@ -81,13 +82,6 @@ static int gl_context_num=0;
#define TILE_NUM_MAX 1024
#define TILE_W_SZ 8
#define TILE_H_SZ 8
static u16 tiles[TILE_NUM_MAX][TILE_H_SZ*TILE_W_SZ];
static COLOR c;
static COLOR32 c32;
static GdkGC * gdkGC;
static void wtools_4_update() {
@ -101,7 +95,6 @@ static void refresh() {
u8 * index16, * index256, * indexBMP;
u16 * pal;
int tile_n, index;
int i,j;
guint Textures;
if (!init) return;
@ -159,7 +152,8 @@ static void refresh() {
}
break;
case 1: //256c
if (pal = pal_addr[palindex]) {
pal = pal_addr[palindex];
if (pal) {
pal += palnum*256;
for (tile_n=0; tile_n<1024; tile_n++) {
for (index=0; index<64; index++) {
@ -174,7 +168,8 @@ static void refresh() {
}
break;
case 2: //16c
if (pal = pal_addr[palindex]) {
pal = pal_addr[palindex];
if (pal) {
pal += palnum*16;
for (tile_n=0; tile_n<1024; tile_n++) {
for (index=0; index<64; index++) {

View File

@ -44,6 +44,7 @@ static GdkGLContext *glcontext = NULL;
static GdkGLDrawable *gldrawable;
#if 0 /* not used */
static void
print_gl_config_attrib (GdkGLConfig *glconfig,
const gchar *attrib_str,
@ -124,6 +125,7 @@ examine_gl_config_attrib (GdkGLConfig *glconfig)
g_print ("\n");
}
#endif
static bool

View File

@ -48,8 +48,8 @@ static int gtk_glade_use_software_colour_convert;
#undef _DUP2
/* FIXME: Purpose of this code? */
BOOL _fun_gl_Begin (int screen) { return FALSE; }
void _fun_gl_End (int screen) { }
static BOOL _fun_gl_Begin (int screen) { return FALSE; }
static void _fun_gl_End (int screen) { }
fun_gl_Begin Open_GL_beg = _fun_gl_Begin;
fun_gl_End Open_GL_end = _fun_gl_End;
@ -97,11 +97,12 @@ void my_gl_DrawBeautifulQuad( void) {
glColor3ub(255,255,255);
}
void my_gl_DrawLogo() {
#if 0 /* not used */
static void my_gl_DrawLogo() {
}
#endif
void my_gl_Clear(int screen) {
@ -222,7 +223,7 @@ void reshape (GtkWidget * widget, int screen) {
/* TEXTURING */
/************************************************/
void my_gl_Texture2D() {
static void my_gl_Texture2D() {
glBindTexture(GL_TEXTURE_2D, Textures[0]);
#define MyFILTER GL_LINEAR
//#define MyFILTER GL_NEAREST
@ -256,7 +257,7 @@ my_gl_ScreenTex( int software_convert) {
}
}
void my_gl_ScreenTexApply(int screen) {
static void my_gl_ScreenTexApply(int screen) {
float off = (screen)?0.375:0;
glBegin(GL_QUADS);
// texcoords 0.375 means 192, 1 means 256

View File

@ -34,11 +34,11 @@ BOOL my_gl_Begin (int screen);
void my_gl_End (int screen);
void my_gl_Clear(int screen);
void my_gl_DrawBeautifulQuad( void);
void my_gl_Identity( void);
void init_GL_capabilities( int use_software_convert);
void init_GL(GtkWidget * widget, int screen, int share_num);
int init_GL_free_s(GtkWidget * widget, int share_num);
int init_GL_free(GtkWidget * widget);
void register_gl_fun(fun_gl_Begin beg,fun_gl_End end);
void reshape (GtkWidget * widget, int screen);
gboolean screen (GtkWidget * widget, int off);

View File

@ -96,7 +96,6 @@ typedef union _callback_arg{
#include "../saves.h"
#include "../render3D.h"
#include "desmume.h"
#include "gdk_gl.h"
// autoconnect with strings as user_data

View File

@ -22,7 +22,7 @@
#include "keyval_names.h"
/* see <gdk/gdkkeysyms.h> */
char * unknown="(unknown)";
const char * unknown="(unknown)";
const char * KEYVAL_NAMES[0x10000];
const char * KEYNAME(int k) {

View File

@ -21,7 +21,7 @@
#include "globals.h"
extern char * unknown;
extern const char * unknown;
extern const char * KEYVAL_NAMES[0x10000];
void KEYVAL(int k, const char * name);

View File

@ -217,7 +217,7 @@ void unregister_Tool(VoidFunPtr fun) {
tools_to_update = g_list_remove(tools_to_update, (void *) fun);
}
void notify_Tool (VoidFunPtr fun, gpointer func_data) {
static void notify_Tool (VoidFunPtr fun, gpointer func_data) {
fun();
}
@ -249,7 +249,7 @@ gchar * get_ui_file (const char *filename)
/* ***** ***** CONFIG FILE ***** ***** */
char * CONFIG_FILE;
int Read_ConfigFile()
static int Read_ConfigFile()
{
int i, tmp;
GKeyFile * keyfile = g_key_file_new();
@ -259,8 +259,6 @@ int Read_ConfigFile()
g_key_file_load_from_file(keyfile, CONFIG_FILE, G_KEY_FILE_NONE, 0);
const char *c;
/* Load keypad keys */
for(i = 0; i < NB_KEYS; i++)
{
@ -290,7 +288,7 @@ int Read_ConfigFile()
return 0;
}
int Write_ConfigFile()
static int Write_ConfigFile()
{
int i;
GKeyFile * keyfile;

View File

@ -85,7 +85,7 @@ int WriteBMP(const char *filename,u16 *bmp){
fwrite( &imageheader.r4, sizeof(imageheader.r4), 1, fichier);
fwrite( &imageheader.r5, sizeof(imageheader.r5), 1, fichier);
fwrite( &imageheader.r6, sizeof(imageheader.r6), 1, fichier);
int i,j,k;
int i,j;
for(j=0;j<192*2;j++)for(i=0;i<256;i++){
u8 r,g,b;
u16 pixel = bmp[i+(192*2-j)*256];