void-packages/srcpkgs/pbbuttonsd/patches/009-comp_warnings.patch
q66 d9cc3b4898 New package: pbbuttonsd-0.8.1a
This is a daemon that allows functionality such as keyboard
backlight and media keys in general to work on Apple PowerPC
laptops.
2020-02-09 03:10:17 +01:00

346 lines
10 KiB
Diff

Description: Fix compilation warnings
Taken directly from the latest CVS
Author: Mathieu Malaterre <malat@debian.org>
Origin: vendor
Forwarded: not-needed
--- pbbuttonsd-0.8.1a.orig/ChangeLog
+++ pbbuttonsd-0.8.1a/ChangeLog
@@ -2,6 +2,9 @@
CHANGELOG
==========
+2007-11-17 0.8.1-1
+ * fix all warnings reported by GCC 4.1 with -Wall and -Wextra
+
2007-07-27 0.8.1a (public release)
* remove hdparm option -p because the option does not do
what it is supposed to and anyway the kernel does a good
--- pbbuttonsd-0.8.1a.orig/doc/index.html
+++ pbbuttonsd-0.8.1a/doc/index.html
@@ -1,7 +1,18 @@
<html>
- <head><title>pbbuttonsd</title></head>
- <frameset frameborder="0" framespacing="0" border="0">
- <frame src="html/index.html">
- </frameset>
- <body></body>
+ <head>
+ <title>PBButtons program documentation</title>
+ <script language="JavaScript">
+ <!--
+ if(top.frames.length> 0)
+ top.location.href=self.location;
+ //-->
+ </script>
+ </head>
+ <frameset cols="220,*" frameborder="0" framespacing="0" border="0">
+ <frame src="toc.html" name="Inhalt" scrolling="no">
+ <frame src="introduction.html" name="Anzeige">
+ </frameset>
+ <body>
+ To watch these pages your browser needs support for frames.
+ </body>
</html>
--- pbbuttonsd-0.8.1a.orig/pbbcmd/pbbcmd.c
+++ pbbuttonsd-0.8.1a/pbbcmd/pbbcmd.c
@@ -496,4 +496,5 @@ int main(int argc, char *argv[])
return rc;
}
-void peep_ipc (struct tagitem *taglist) { }
+void peep_ipc (struct tagitem *taglist __attribute__ ((unused))) { }
+
--- pbbuttonsd-0.8.1a.orig/src/driver_mixer_oss.c
+++ pbbuttonsd-0.8.1a/src/driver_mixer_oss.c
@@ -292,6 +292,9 @@ ossmixer_set_volume (enum valueinc type,
case VALUE_ABS_PERCENT:
inc = volume - base->volume;
if (inc == 0) return;
+ break;
+ default:
+ return;
}
if ((ossmixer_increment_master_volume (inc)) != -1)
--- pbbuttonsd-0.8.1a.orig/src/input_manager.c
+++ pbbuttonsd-0.8.1a/src/input_manager.c
@@ -218,6 +218,8 @@ inputmanager_init ()
void
cbFreeInputSource (gpointer data, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
InputSource *src = data;
g_source_remove (src->watch);
}
@@ -435,8 +437,8 @@ register_function (int queueid, void (*f
return -1;
}
-long
-process_queue_single (int queueid, long tag, long data)
+tag_t
+process_queue_single (int queueid, tag_t tag, tag_t data)
{
struct tagitem taglist[2];
@@ -552,6 +554,8 @@ ipc_handler ()
gboolean
input_event_handler (int fd, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
struct input_event inp;
struct tagitem taglist[10];
gboolean rc = FALSE;
@@ -640,17 +644,19 @@ mice_handler (int fd, gpointer user_data
gboolean
cb_timer100 (gpointer data)
{
- struct moddata_inputmanager *base = &modbase_inputmanager;
- struct tagitem taglist[] = { { TAG_END, 0 } };
- int mod;
+ (void) data; /* avoid warning about unused parameter */
+
+ struct moddata_inputmanager *base = &modbase_inputmanager;
+ struct tagitem taglist[] = { { TAG_END, 0 } };
+ int mod;
- process_queue (T100QUEUE, taglist);
+ process_queue (T100QUEUE, taglist);
- mod = get_modifier();
- if ((mod == 0) && (base->lastkey == 0))
- process_queue (SECUREQUEUE, taglist);
+ mod = get_modifier();
+ if ((mod == 0) && (base->lastkey == 0))
+ process_queue (SECUREQUEUE, taglist);
- return TRUE;
+ return TRUE;
}
/**
@@ -665,9 +671,11 @@ cb_timer100 (gpointer data)
gboolean
cb_timer1000 (gpointer data)
{
- struct tagitem taglist[] = { { TAG_END, 0 } };
- process_queue (T1000QUEUE, taglist);
- return TRUE;
+ (void) data; /* avoid warning about unused parameter */
+
+ struct tagitem taglist[] = { { TAG_END, 0 } };
+ process_queue (T1000QUEUE, taglist);
+ return TRUE;
}
/* @} */
--- pbbuttonsd-0.8.1a.orig/src/input_manager.h
+++ pbbuttonsd-0.8.1a/src/input_manager.h
@@ -67,7 +67,7 @@ void destroyInputSource (gpointer data);
gboolean handleInputSource (GIOChannel *io, GIOCondition condition, gpointer data);
InputSource *addInputSource (int fd, int (*handler)(), gpointer user_data, gboolean close_on_exit);
int register_function (int queueid, void (*func)());
-long process_queue_single (int queueid, long tag, long data);
+tag_t process_queue_single (int queueid, tag_t tag, tag_t data);
int process_queue (int queueid, struct tagitem *taglist);
void ipc_handler ();
gboolean input_event_handler (int fd, gpointer user_data);
--- pbbuttonsd-0.8.1a.orig/src/module_acpi.c
+++ pbbuttonsd-0.8.1a/src/module_acpi.c
@@ -87,7 +87,7 @@ int
acpi_init ()
{
struct moddata_acpi *base = &modbase_acpi;
- int val, rc;
+ int rc;
/* is ACPI available on this machine? */
if ((rc = check_devorfile (PATH_ACPI"/info", TYPE_FILE))) {
@@ -234,9 +234,11 @@ acpi_handle_tags (int cfgure, struct tag
gboolean
acpi_event_handler (int fd, gpointer user_data)
{
+ (void) user_data; /* avoid warning about unused parameter */
+
struct moddata_acpi *base = &modbase_acpi;
struct tagitem taglist[2];
- struct acpi_event acpi;
+ struct acpi_event acpi = { NULL, NULL, 0, 0 };
GString *buffer;
gboolean status;
char *cur, *next, *tmp;
@@ -337,6 +339,8 @@ out:
void
acpi_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_acpi *base = &modbase_acpi;
struct tagitem args[6];
int val;
@@ -810,6 +814,8 @@ acpi_get_file_list (char *startdir)
void
acpi_free_file (GString *file, gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
g_string_free (file, TRUE);
}
--- pbbuttonsd-0.8.1a.orig/src/module_display.c
+++ pbbuttonsd-0.8.1a/src/module_display.c
@@ -409,6 +409,8 @@ display_keyboard (struct tagitem *taglis
gboolean
display_lcdtimer (gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu = &base->lcdlight;
int preambient, postambient;
@@ -483,6 +485,8 @@ display_lcdtimer (gpointer data)
gboolean
display_kbdtimer (gpointer data)
{
+ (void) data; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu = &base->kbdlight;
@@ -571,6 +575,8 @@ display_kbdtimer (gpointer data)
void
display_ambienttimer (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_display *base = &modbase_display;
struct display_light *illu;
int ambient, ambientmax, level, pwrsource;
@@ -1027,10 +1033,10 @@ display_calc_brightness (struct display_
double a,b,x,y;
x = (double) ambient * 100 / (double) ambientmax;
+ y = 0;
switch (illu->autoadj_mode) {
case AUTOADJ_OFF:
- y = 0;
break;
case AUTOADJ_LIN:
if (x < params->ambient1)
--- pbbuttonsd-0.8.1a.orig/src/module_imac.c
+++ pbbuttonsd-0.8.1a/src/module_imac.c
@@ -82,7 +82,6 @@ int
imac_init ()
{
struct moddata_imac *base = &modbase_imac;
- int val;
#if defined(DEBUG) && SIMU_AMBIENT
base->ambient = 0;
@@ -304,7 +303,8 @@ int
getRawAmbient ()
{
FILE *fd;
- unsigned char buffer[16], *p, *buf;
+ unsigned char buffer[16];
+ char *p, *buf;
int left = -1, right = -1;
#if defined(DEBUG) && SIMU_AMBIENT
@@ -316,7 +316,7 @@ getRawAmbient ()
/* return immediately, if no ambient light sensor is available */
if (haveAmbient()) {
if ((fd = fopen(SYSFS_AMBIENT, "r"))) {
- if ((buf = fgets(buffer, sizeof(buffer), fd))) {
+ if ((buf = fgets((char *)buffer, sizeof(buffer), fd))) {
if ((p = strchr(buf, ','))) {
*p++ = '\0';
right = atoi (p);
@@ -348,13 +348,13 @@ void
setKBDIllumination (unsigned short level)
{
FILE *fd;
- unsigned char buffer[8];
+ char buffer[8];
/* return immediately, if keyboard illumination is not supported */
if (!haveKBDIllumination()) return;
if ((fd = fopen(SYSFS_KEYBLIGHT, "w"))) {
- if ((snprintf(buffer, sizeof(buffer), "%d", level)) < sizeof(buffer))
+ if ((snprintf(buffer, sizeof(buffer), "%d", level)) < (int) sizeof(buffer))
fputs(buffer, fd);
fclose(fd);
return;
@@ -365,14 +365,14 @@ setKBDIllumination (unsigned short level
buffer[0] = level & 0xFF;
buffer[1] = 0x00;
- writeSMCKey(SMC_BACKLIGHT_KEY, 2, buffer);
+ writeSMCKey(SMC_BACKLIGHT_KEY, 2, (unsigned char *)buffer);
}
/************************ Apple SMC interface *********************/
static struct timeval lasttv;
static struct timeval newtv;
-void inline ssleep(const int usec) {
+inline void ssleep(const int usec) {
gettimeofday(&lasttv, NULL);
while (1) {
gettimeofday(&newtv, NULL);
--- pbbuttonsd-0.8.1a.orig/src/module_peep.c
+++ pbbuttonsd-0.8.1a/src/module_peep.c
@@ -328,7 +328,7 @@ peep_taglist (char *source, struct tagit
mark = ' ';
printf ("%-10s: %c %-25s: ", source, mark, tt->tagname);
- if (taglist->data == -1) {
+ if (taglist->data == (unsigned int) -1) {
printf ("tag not filled");
} else if (tt->tag == TAG_SKIP) {
tt2 = findttentry (tagtab, taglist->data);
--- pbbuttonsd-0.8.1a.orig/src/module_powersave.c
+++ pbbuttonsd-0.8.1a/src/module_powersave.c
@@ -199,6 +199,8 @@ power_exit ()
void
power_mouse (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
if (base->flags.coveropen)
@@ -680,6 +682,8 @@ power_handle_tags (int cfgure, struct ta
void
power_timer (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
int n;
@@ -717,6 +721,8 @@ power_timer (struct tagitem *taglist)
void
power_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_power *base = &modbase_power;
static int cputimer = 0, nettimer = 0, beeptimer = 0;
int cpuload = 0, netload = 0;
--- pbbuttonsd-0.8.1a.orig/src/module_system.c
+++ pbbuttonsd-0.8.1a/src/module_system.c
@@ -162,6 +162,8 @@ system_handle_tags (int cfgure, struct t
void
system_timer1000 (struct tagitem *taglist)
{
+ (void) taglist; /* avoid warning about unused parameter */
+
struct moddata_system *base = &modbase_system;
if (base->autorescan) {