package: lebiniou
severity: serious
tags: patch
version: 3.15-1

lebiniou FTBFS on armel, armhf, powerpc, s390 and s390x with the following error.

make[6]: Entering directory `/build/buildd-lebiniou_3.15-1-armhf-gOcAq_/lebiniou-3.15/plugins/stable/main/speaker'
CC speaker_so-speaker.o
speaker.c: In function 'run':
speaker.c:108:3: error: comparison is always false due to limited range of data type [-Werror=type-limits]
cc1: all warnings being treated as errors

The common thing about these architectures is they have char unsigned by default.

Anyway I found the offending variable of type char called volume. I fixed the issue by changing the types of the variable and the typecast (from float) used to set the variable to "signed char". I believe this is a correct fix from looking at the code but I do not have any experience with the package.

Patch and series file are attatched, just create debian/patches and drop them in (the package uses 3.0 (quilt) but currently has no patches)
Description: fix error on systems with signed char
 The code this patch changes was causing a "comparison is always false" error
 on systems where char defaults to unsigned.
Author: Peter Green <plugw...@p10link.net>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- lebiniou-3.15.orig/plugins/stable/main/speaker/speaker.c
+++ lebiniou-3.15/plugins/stable/main/speaker/speaker.c
@@ -96,12 +96,12 @@ destroy(__attribute__ ((unused)) Context
 void
 run(Context_t *ctx)
 {
-  char volume;
+  signed char volume;
 
   if (ctx->input == NULL)
     return;
 
-  volume = (char)(Input_get_volume(ctx->input) * 10);
+  volume = (signed char)(Input_get_volume(ctx->input) * 10);
 
   if (volume >= NB_FCT)
     volume = NB_FCT-1;
fix-char-signdness.patch

Reply via email to