Package: hotkeys Version: 0.5.7.4-0.1 Severity: wishlist Tags: patch hotkeys has a lot of compiler warnings, which makes hacking on the source annoying. This patch cleans them all up.
This patch assumes that my alsa and backlight patches have been applied, and fixes a couple of compile warnings from those patches, too. -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.21-2-686 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages hotkeys depends on: ii libasound2 1.0.14a-2 ALSA library ii libatk1.0-0 1.18.0-2 The ATK accessibility toolkit ii libc6 2.6-2 GNU C Library: Shared libraries ii libcairo2 1.4.10-1 The Cairo 2D vector graphics libra ii libdb4.5 4.5.20-5 Berkeley v4.5 Database Libraries [ ii libfontconfig1 2.4.2-1.2 generic font configuration library ii libglib2.0-0 2.12.13-1 The GLib library of C routines ii libgtk2.0-0 2.10.13-1 The GTK+ graphical user interface ii libpango1.0-0 1.16.4-3 Layout and rendering of internatio ii libx11-6 2:1.0.3-7 X11 client-side library ii libxcursor1 1:1.1.8-2 X cursor management library ii libxext6 1:1.0.3-2 X11 miscellaneous extension librar ii libxfixes3 1:4.0.3-2 X11 miscellaneous 'fixes' extensio ii libxi6 2:1.1.1-1 X11 Input extension library ii libxinerama1 1:1.0.2-1 X11 Xinerama extension library ii libxml2 2.6.29.dfsg-1 GNOME XML library ii libxmu6 1:1.0.3-1 X11 miscellaneous utility library ii libxosd2 2.2.14-1.3 X On-Screen Display library - runt ii libxrandr2 2:1.2.1-1 X11 RandR extension library ii libxrender1 1:0.9.2-1 X Rendering Extension client libra hotkeys recommends no packages. -- no debconf information -- see shy jo
diff -ur hotkeys.old/src/conf.c hotkeys-0.5.7.4/src/conf.c --- hotkeys.old/src/conf.c 2007-07-27 12:02:13.000000000 -0400 +++ hotkeys-0.5.7.4/src/conf.c 2007-07-28 16:40:21.000000000 -0400 @@ -30,6 +30,7 @@ #include <sys/param.h> #include "conf.h" +#include "hotkeys.h" char* conf_keys[] = { diff -ur hotkeys.old/src/conf.h hotkeys-0.5.7.4/src/conf.h --- hotkeys.old/src/conf.h 2001-03-14 12:33:53.000000000 -0500 +++ hotkeys-0.5.7.4/src/conf.h 2007-07-28 16:21:38.000000000 -0400 @@ -29,5 +29,6 @@ char* getConfig(char* key); int setConfig(char* key, char* value, u_int32_t flags); +void readConfigFile(void); #endif /* __CONF_H */ diff -ur hotkeys.old/src/fixVMware.c hotkeys-0.5.7.4/src/fixVMware.c --- hotkeys.old/src/fixVMware.c 2004-12-24 10:03:55.000000000 -0500 +++ hotkeys-0.5.7.4/src/fixVMware.c 2007-07-28 16:41:16.000000000 -0400 @@ -22,6 +22,8 @@ #include <signal.h> #include <unistd.h> #include <pthread.h> +#include <strings.h> +#include <stdlib.h> #include "hotkeys.h" @@ -71,5 +73,5 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); - pthread_create( &tp, &attr, startFixVMwareThread, NULL ); + pthread_create( &tp, &attr, (void *) startFixVMwareThread, NULL ); } diff -ur hotkeys.old/src/hotkeys.c hotkeys-0.5.7.4/src/hotkeys.c --- hotkeys.old/src/hotkeys.c 2007-07-28 16:00:56.000000000 -0400 +++ hotkeys-0.5.7.4/src/hotkeys.c 2007-07-28 16:38:33.000000000 -0400 @@ -70,6 +70,7 @@ /* APM (suspend/standby) support */ #include "apm.h" #if HAVE_GTK + #include <gtk-2.0/gtk/gtk.h> #include "splash.h" #endif @@ -78,6 +79,7 @@ #include "amixer.h" #include "xbacklight.h" +#include <X11/Xmu/Xmu.h> #include <X11/Xmu/Error.h> #define lowbit(x) ((x) & (-(x))) @@ -209,7 +211,7 @@ strcat( homedir, "/.hotkeys" ); if ( ( dir = opendir(homedir) ) != NULL ) { - while ( ent = readdir(dir) ) + while ( (ent = readdir(dir)) ) { len = NLENGTH(ent); /* Show all files that ends with ".def" */ @@ -235,7 +237,7 @@ /* Read the default location: SHAREDIR */ if ( ( dir = opendir(SHAREDIR) ) != NULL ) { - while ( ent = readdir(dir) ) + while ( (ent = readdir(dir)) ) { len = NLENGTH(ent); /* Show all files that ends with ".def" in SHAREDIR */ @@ -261,7 +263,7 @@ } -static Bool +Bool setKbdType(const char* prog, const char* type) { char* defname; @@ -313,9 +315,10 @@ } } } + + XFREE( defname ); } - XFREE( defname ); return ret; } @@ -345,7 +348,7 @@ close (fd); } -static void +void setLoglevel(int level) { /* Map the supplied level to the one defined in syslog.h */ @@ -394,11 +397,10 @@ /***====================================================================***/ -static Bool +Bool parseArgs(int argc, char *argv[]) { - int c, i; - int digit_optind = 0; + int c; const char *flags = "hbt:d:lz:vL:F:" #ifdef HAVE_LIBXOSD @@ -409,7 +411,6 @@ #endif ; #ifdef HAVE_GETOPT_LONG - int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { @@ -526,7 +527,7 @@ } /* Copied from xkbevd */ -static Display * +Display * GetDisplay(char* program, char* dpyName, int* opcodeRtrn, int* evBaseRtrn) { int mjr,mnr,error; @@ -593,7 +594,7 @@ int sign = adj > 0 ? 1 : -1; if ( adj == 0 ) - return; + return 0; if ( multiplier == 0 ) { @@ -632,7 +633,7 @@ adjustVol(int adj) { int mixer_fd = -1, cdrom_fd = -1; - int master_vol, cd_vol; + int master_vol; struct cdrom_volctrl cdrom_vol; int left, right; static struct timeval last_time; @@ -643,7 +644,7 @@ int sign = adj > 0 ? 1 : -1; if ( adj == 0 ) - return; + return ret; if ( multiplier == 0 ) { @@ -793,14 +794,14 @@ /* * Mute or un-mute the /dev/mixer master volume and CDROM drive's volume */ -static int +int doMute(void) { static Bool muted = False; - static int last_mixer_vol, last_cd_vol; + static int last_mixer_vol; static struct cdrom_volctrl last_cdrom_vol; - int vol, cd_vol; + int vol; struct cdrom_volctrl cdrom_vol; int mixer_fd = -1, cdrom_fd = -1; @@ -848,8 +849,8 @@ #ifdef HAVE_LIBXOSD if (osd) { - int left = last_mixer_vol & 0xFF, - right = (last_mixer_vol >> 8) & 0xFF; +// int left = last_mixer_vol & 0xFF; +// int right = (last_mixer_vol >> 8) & 0xFF; xosd_display(osd, 0, XOSD_string, "Unmute"); // xosd_display(osd, 1, XOSD_percentage, (((left+right)/2)*100/MAXLEVEL)); } @@ -956,13 +957,13 @@ return ret; } -static int +void ejectDisc(void) { int fd, status; if ( cdromDevice == NULL ) - return 0; + return; /* the idea of this code is from xine's vcd plugin, mostly linux specific FIXME */ @@ -1006,17 +1007,16 @@ break; } close(fd); - return 0; + return; } else { SYSLOG(LOG_NOTICE, "CDROM_DRIVE_STATUS failed: %s\n", strerror(errno)); - return -1; } } -static int +int launchApp(int keycode) { int pid; @@ -1124,6 +1124,8 @@ } apm_close(fd); #endif /* USE_APMD */ + + return 0; } @@ -1268,7 +1270,7 @@ } /***====================================================================***/ -static int dummy() { /* grin */ } +static int dummy() { return 0; /* grin */ } #include <X11/Xlibint.h> static int @@ -1365,7 +1367,7 @@ /* Construct the Message Action struct */ xma.type = XkbSA_ActionMessage; xma.flags = XkbSA_MessageOnPress; - strcpy(xma.message," "); + strcpy((char *) xma.message," "); #if 0 #ifdef DEBUG @@ -1488,7 +1490,7 @@ { i--; /* need to redo this round, as the action message was not assigned to this keysym */ - dummyErrFlag == False; + dummyErrFlag = False; } } @@ -1534,7 +1536,6 @@ fork2(void) { pid_t pid; - int rc; int status; if (!(pid = fork())) @@ -1565,7 +1566,6 @@ main(int argc, char *argv[]) { XkbEvent ev; - int i, k; errorFile = stderr; openlog( PACKAGE, LOG_CONS | LOG_PID, LOG_USER ); @@ -1654,7 +1654,7 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED); - pthread_create (&tp, &attr, ejectDisc, NULL); + pthread_create (&tp, &attr, (void *)ejectDisc, NULL); } else if ( ev.message.keycode == (kbd.defCmds)[volUpKey].key ) { adjustVol(volUpAdj); diff -ur hotkeys.old/src/hotkeys.h hotkeys-0.5.7.4/src/hotkeys.h --- hotkeys.old/src/hotkeys.h 2007-07-28 15:52:31.000000000 -0400 +++ hotkeys-0.5.7.4/src/hotkeys.h 2007-07-28 16:38:28.000000000 -0400 @@ -34,18 +34,15 @@ void initializeX(char* prg); void usage(int argc, char* argv[]); void showKbdList(int argc, char *argv[]); -static Bool setKbdType(const char* prog, const char* type); void setCDROMDevice(char* optarg); -static void setLoglevel(int level); -static Bool parseArgs(int argc, char* argv[]); -static Display* GetDisplay(char* program, char* dpyName, int* opcodeRtrn, int* evBaseRtrn); +Bool setKbdType(const char* prog, const char* type); +void setLoglevel(int level); +Bool parseArgs(int argc, char* argv[]); +Display* GetDisplay(char* program, char* dpyName, int* opcodeRtrn, int* evBaseRtrn); void bailout(void); -static int adjust_vol(int adj); -static int doMute(void); -static int ejectDisc(void); -static int closeTray(void); -static int launchApp(int keycode); -static void printXkbActionMessage(FILE* file,XkbEvent* xkbev); +int doMute(void); +void ejectDisc(void); +int launchApp(int keycode); void uError(char* s,...); void uInfo(char* s,...); void uInternalError(char* s,...); @@ -63,6 +60,9 @@ extern int backlightUpAdj; extern int backlightDownAdj; +void fixVMware(char* time); +int fork2(void); + #ifdef HAVE_XOSD extern xosd* osd; #endif diff -ur hotkeys.old/src/kbddef.c hotkeys-0.5.7.4/src/kbddef.c --- hotkeys.old/src/kbddef.c 2007-07-28 15:48:34.000000000 -0400 +++ hotkeys-0.5.7.4/src/kbddef.c 2007-07-28 16:36:22.000000000 -0400 @@ -105,13 +105,13 @@ char* t_command; char* tc; - t_keycode = xmlGetProp( cur, "keycode" ); + t_keycode = (char *) xmlGetProp( cur, (const xmlChar *) "keycode" ); if ( t_keycode == NULL ) { uInfo("keycode not found, entry ignored\n"); return; } - t_command = xmlGetProp( cur, "command" ); + t_command = (char *) xmlGetProp( cur, (const xmlChar *) "command" ); if ( t_command == NULL ) { uInfo("command not found, entry ignored"); return; @@ -130,7 +130,7 @@ XFREE(t_command); kbd.customCmds[kbd.noOfCustomCmds].keysym = curKeySym; - tc = xmlNodeListGetString( doc, cur->xmlChildrenNode, 1 ); + tc = (char *) xmlNodeListGetString( doc, cur->xmlChildrenNode, 1 ); if ( tc != NULL && tc[0] != '\0' ) { kbd.customCmds[kbd.noOfCustomCmds].desc= xstrdup(tc); @@ -153,7 +153,7 @@ { char* tc; - tc = xmlGetProp( cur, "adj" ); + tc = (char *) xmlGetProp( cur, (const xmlChar *) "adj" ); if ( tc != NULL ) { int v = atoi(tc); @@ -176,7 +176,7 @@ { char* tc; - tc = xmlGetProp( cur, "adj" ); + tc = (char *) xmlGetProp( cur, (const xmlChar *) "adj" ); if ( tc != NULL ) { int v = atoi(tc); @@ -200,9 +200,9 @@ do { /* if the name in definition file matches one of the * predefined name */ - if ( MatchName( cur, defStr[i].name ) ) + if ( MatchName( (char *) cur, defStr[i].name ) ) { - tc = xmlGetProp( cur, "keycode" ); + tc = (char *) xmlGetProp( cur, (const xmlChar *) "keycode" ); if ( tc == NULL ) { uInfo("keycode not found, entry ignored\n"); @@ -241,7 +241,6 @@ readDefFile(const char* filename) { xmlDocPtr doc; - xmlNsPtr ns; xmlNodePtr cur; char* tc; KeySym curKeySym = 0x1008FFA0; /* The keysym assigned to custom commands. @@ -267,17 +266,17 @@ } /* search till 'config' is found */ - while ( ! MatchName( cur, "config" ) ) + while ( ! MatchName( (char *) cur, "config" ) ) { cur = cur->next; if ( cur == NULL ) parseError(filename); } - if ( MatchName( cur, "config" ) ) + if ( MatchName( (char *) cur, "config" ) ) { /* Get the model name */ - tc = xmlGetProp( cur, "model" ); + tc = (char *) xmlGetProp( cur, (const xmlChar *) "model" ); if ( tc == NULL ) { uInfo("Model name missing in %s, skipping it...\n", filename); @@ -292,17 +291,17 @@ cur = cur->xmlChildrenNode; while ( cur != NULL ) { - if ( MatchName( cur, "comment" ) ) + if ( MatchName( (char *) cur, "comment" ) ) { cur = cur->next; continue; /* A comment! Continue to the next one */ } - else if ( MatchName( cur, "userdef" ) ) + else if ( MatchName( (char *) cur, "userdef" ) ) { parseUserDef( doc, cur, curKeySym ); curKeySym++; } - else if ( ! MatchName( cur, "text" ) ) + else if ( ! MatchName( (char *) cur, "text" ) ) { parseStd( doc, cur ); } @@ -319,7 +318,7 @@ return True; } -static void +void parseError(const char* filename) { uInfo("Error while parsing %s\n", filename); diff -ur hotkeys.old/src/kbddef.h hotkeys-0.5.7.4/src/kbddef.h --- hotkeys.old/src/kbddef.h 2007-07-28 15:50:06.000000000 -0400 +++ hotkeys-0.5.7.4/src/kbddef.h 2007-07-28 16:34:58.000000000 -0400 @@ -26,8 +26,7 @@ /* Function prototypes */ Bool readDefFile(const char* filename); -static Bool parseDefFile(const char* filebuf); -static void parseError(const char* filename); +void parseError(const char* filename); extern Display * dpy; diff -ur hotkeys.old/src/splash.c hotkeys-0.5.7.4/src/splash.c --- hotkeys.old/src/splash.c 2002-12-03 13:13:14.000000000 -0500 +++ hotkeys-0.5.7.4/src/splash.c 2007-07-28 16:43:37.000000000 -0400 @@ -21,6 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <unistd.h> +#include <stdlib.h> + #if HAVE_CONFIG_H # include <config.h> #endif @@ -35,9 +38,6 @@ static GtkWidget *win_initstatus = NULL; -static GtkWidget *label1 = NULL; -static GtkWidget *label2 = NULL; -static GtkWidget *progress = NULL; void @@ -45,7 +45,7 @@ { GtkWidget *vbox; GdkPixbuf *pixbuf = NULL; - GdkAtom atom; +// GdkAtom atom; win_initstatus = gtk_window_new (GTK_WINDOW_TOPLEVEL); #if 0 diff -ur hotkeys.old/src/xmalloc.c hotkeys-0.5.7.4/src/xmalloc.c --- hotkeys.old/src/xmalloc.c 2001-01-17 12:14:33.000000000 -0500 +++ hotkeys-0.5.7.4/src/xmalloc.c 2007-07-28 16:41:39.000000000 -0400 @@ -19,6 +19,7 @@ # include <config.h> #endif #include "common.h" +#include "hotkeys.h" #include <sys/types.h>
signature.asc
Description: Digital signature