Bug#287809: nitpic: FTBFS (amd64/gcc-4.0): default arguments are only permitted for function parameters
Package: nitpic
Severity: normal
Tags: patch
When building 'nitpic' on amd64 with gcc-4.0,
I get the following error:
c++ -g -O2 -Wall -I. -I./lib/Xt -I/usr/X11R6/include -Dlinux -D__x86_64__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -g -O2 -Wall -c -o main.o main.cc
picsim.hh:38: error: default arguments are only permitted for function parameters
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/nitpic-0.1'
make: *** [build] Error 2
With the attached patch 'nitpic' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/nitpic-0.1/16c84.cc ./16c84.cc
--- ../tmp-orig/nitpic-0.1/16c84.cc 2004-12-30 09:36:03.171497584 +0100
+++ ./16c84.cc 2004-12-30 09:35:57.526355776 +0100
@@ -441,7 +441,7 @@
if (d) {
if (Pic.reg_file[c][d].hook) {
- return Pic.reg_file[c][d].hook( &Pic.reg_file[c][d], False );
+ return Pic.reg_file[c][d].hook( &Pic.reg_file[c][d], False, 0 );
} else {
return Pic.reg_file[c][d].value & 0xff;
}
diff -urN ../tmp-orig/nitpic-0.1/instr.cc ./instr.cc
--- ../tmp-orig/nitpic-0.1/instr.cc 1994-11-12 06:02:40.000000000 +0100
+++ ./instr.cc 2004-12-30 09:35:40.444952544 +0100
@@ -76,7 +76,7 @@
lines = w_height / dv;
- top = Pic.itop + lines * (int)position / w_height;
+ top = Pic.itop + lines * (long)position / w_height;
if (top < 0)
top = 0;
else
diff -urN ../tmp-orig/nitpic-0.1/picsim.hh ./picsim.hh
--- ../tmp-orig/nitpic-0.1/picsim.hh 2004-12-30 09:36:03.172497432 +0100
+++ ./picsim.hh 2004-12-30 09:35:25.617206704 +0100
@@ -35,7 +35,7 @@
char redirect_reg;
char implemented;
char value;
- char (*hook)( struct reg *r, Boolean write, char v = 0 );
+ char (*hook)( struct reg *r, Boolean write, char v );
} reg;
typedef struct {
Reply to: