[mednaffe] 58/99: Initialize variables
Stephen Kitt
skitt at moszumanska.debian.org
Tue Aug 2 21:00:06 UTC 2016
This is an automated email from the git hooks/post-receive script.
skitt pushed a commit to branch master
in repository mednaffe.
commit e706e76182634067a28f881f37340e22344e211a
Author: AmatCoder <amatcoder at gmail.com>
Date: Sat May 2 05:37:30 2015 +0200
Initialize variables
---
src/input.c | 12 ++++++++----
src/joystick_linux.c | 2 ++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/input.c b/src/input.c
index a42cd0b..fa9808a 100644
--- a/src/input.c
+++ b/src/input.c
@@ -583,7 +583,10 @@ void on_input_clicked (GtkButton *button, guidata *gui)
if(!gui->joy[i].sdljoy)
{
- printf("Couldn't open Joystick %i\n", i);
+ //printf("Couldn't open Joystick %i\n", i);
+ gui->joy[i].sdl_id = 0;
+ gui->joy[i].id = 1;
+ gui->joy[i].name = NULL;
}
else
{
@@ -605,13 +608,13 @@ void on_input_clicked (GtkButton *button, guidata *gui)
CheckDuplicates(i, gui);
}
}
- for(i=0;i<9;i++)
+ /* for(i=0;i<9;i++)
{
printf("Index: %i - Instance: %i - Name: %s - ID: %016I64x\n", i,
SDL_JoystickInstanceID(gui->joy[i].sdljoy),
SDL_JoystickName(gui->joy[i].sdljoy),
gui->joy[i].id);
- }
+ }*/
/* gchar *string;
gchar *dir = g_win32_get_package_installation_directory_of_module(NULL);
@@ -769,7 +772,7 @@ void thread_watch(GPid pid, gint status, guidata *gui)
g_free(command);
g_hash_table_replace(gui->clist, fullcommand, fullcommand);
fullcommand++;
- g_hash_table_insert(gui->hash, g_strdup(fullcommand), joyc);
+ g_hash_table_insert(gui->hash, g_strdup(fullcommand), g_strdup(joyc));
fullcommand--;
gtk_cell_editable_editing_done(gui->editable);
@@ -779,6 +782,7 @@ void thread_watch(GPid pid, gint status, guidata *gui)
gui->inputedited = TRUE;
g_free(on);
+ g_free(joyc);
g_mutex_unlock (&mutex);
g_spawn_close_pid(pid);
diff --git a/src/joystick_linux.c b/src/joystick_linux.c
index a734726..a632ee8 100644
--- a/src/joystick_linux.c
+++ b/src/joystick_linux.c
@@ -98,6 +98,8 @@ gint GetJoy(guint js, guidata *gui)
unsigned char tmp;
gui->joy[js].channel= NULL;
+ gui->joy[js].name[0]= '\0';
+ gui->joy[js].id = 1;
gchar *number = g_strdup_printf("%i",js);
gchar *path = g_strconcat("/dev/input/js", number, NULL);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git
More information about the Pkg-games-commits
mailing list