From fb22edc06af0e60a617b58dbc88b8658f47b20d9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 7 Feb 2012 13:02:06 +0100 Subject: [PATCH] software: enable -Wmissing-prototypes --- software/bios/isr.c | 1 + software/include.mak | 3 +-- software/libbase/divsi3.c | 2 ++ software/libbase/softfloat-glue.c | 30 +++++++++++++++++++++++------- software/libbase/softfloat.h | 15 ++++++++------- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/software/bios/isr.c b/software/bios/isr.c index 21c480aae..4257d878b 100644 --- a/software/bios/isr.c +++ b/software/bios/isr.c @@ -20,6 +20,7 @@ #include #include +void isr(void); void isr(void) { unsigned int irqs; diff --git a/software/include.mak b/software/include.mak index 9eba9ec15..227ba3afd 100644 --- a/software/include.mak +++ b/software/include.mak @@ -38,9 +38,8 @@ endif INCLUDES_NOLIBC ?= -nostdinc -I$(M2DIR)/software/include/base INCLUDES = $(INCLUDES_NOLIBC) -I$(M2DIR)/software/include -I$(M2DIR)/tools ASFLAGS = $(INCLUDES) -nostdinc -# later: -Wmissing-prototypes CFLAGS = -O9 -Wall -Wstrict-prototypes -Wold-style-definition -Wshadow \ - -fsigned-char $(INCLUDES) + -Wmissing-prototypes -fsigned-char $(INCLUDES) LDFLAGS = -nostdlib -nodefaultlibs # compile and generate dependencies, based on diff --git a/software/libbase/divsi3.c b/software/libbase/divsi3.c index 35d171e77..0e98556b4 100644 --- a/software/libbase/divsi3.c +++ b/software/libbase/divsi3.c @@ -19,6 +19,7 @@ #define exitdiv(sign, res) if (sign) { res = - res;} return res; +long __divsi3 (long numerator, long denominator); long __divsi3 (long numerator, long denominator) { int sign; @@ -30,6 +31,7 @@ long __divsi3 (long numerator, long denominator) exitdiv(sign, dividend); } +long __modsi3 (long numerator, long denominator); long __modsi3 (long numerator, long denominator) { int sign; diff --git a/software/libbase/softfloat-glue.c b/software/libbase/softfloat-glue.c index bb2259e21..2efa5011b 100644 --- a/software/libbase/softfloat-glue.c +++ b/software/libbase/softfloat-glue.c @@ -15,13 +15,15 @@ * along with this program. If not, see . */ +#include "milieu.h" #include "softfloat.h" /* * 'Equal' wrapper. This returns 0 if the numbers are equal, or (1 | -1) * otherwise. So we need to invert the output. */ -int __eqsf2(float32 a, float32 b) +flag __eqsf2(float32 a, float32 b); +flag __eqsf2(float32 a, float32 b) { return !float32_eq(a, b); } @@ -32,7 +34,8 @@ int __eqsf2(float32 a, float32 b) * to use an 'equal' call and invert the result. The result is already * inverted though! Confusing?! */ -int __nesf2(float32 a, float32 b) +flag __nesf2(float32 a, float32 b); +flag __nesf2(float32 a, float32 b) { return !float32_eq(a, b); } @@ -44,7 +47,8 @@ int __nesf2(float32 a, float32 b) * make up our mind. This means that we can call 'less than or equal' and * invert the result. */ -int __gtsf2(float32 a, float32 b) +flag __gtsf2(float32 a, float32 b); +flag __gtsf2(float32 a, float32 b) { return !float32_le(a, b); } @@ -53,7 +57,8 @@ int __gtsf2(float32 a, float32 b) * 'Greater Than or Equal' wrapper. We emulate this by inverting the result * of a 'less than' call. */ -int __gesf2(float32 a, float32 b) +flag __gesf2(float32 a, float32 b); +flag __gesf2(float32 a, float32 b) { return !float32_lt(a, b); } @@ -61,7 +66,8 @@ int __gesf2(float32 a, float32 b) /* * 'Less Than' wrapper. */ -int __ltsf2(float32 a, float32 b) +flag __ltsf2(float32 a, float32 b); +flag __ltsf2(float32 a, float32 b) { return float32_lt(a, b); } @@ -69,7 +75,8 @@ int __ltsf2(float32 a, float32 b) /* * 'Less Than or Equal' wrapper. A 0 must turn into a 1, and a 1 into a 0. */ -int __lesf2(float32 a, float32 b) +flag __lesf2(float32 a, float32 b); +flag __lesf2(float32 a, float32 b) { return !float32_le(a, b); } @@ -80,6 +87,7 @@ int __lesf2(float32 a, float32 b) * position in the registers of arguments, the double precision version can * go here too ;-) */ +float32 __negsf2(float32 x); float32 __negsf2(float32 x) { return x ^ 0x80000000; @@ -88,42 +96,50 @@ float32 __negsf2(float32 x) /* * 32-bit operations. */ +float32 __addsf3(float32 a, float32 b); float32 __addsf3(float32 a, float32 b) { return float32_add(a, b); } +float32 __subsf3(float32 a, float32 b); float32 __subsf3(float32 a, float32 b) { return float32_sub(a, b); } +float32 __mulsf3(float32 a, float32 b); float32 __mulsf3(float32 a, float32 b) { return float32_mul(a, b); } +float32 __divsf3(float32 a, float32 b); float32 __divsf3(float32 a, float32 b) { return float32_div(a, b); } +float32 __floatsisf(int x); float32 __floatsisf(int x) { return int32_to_float32(x); } +int __fixsfsi(float32 x); int __fixsfsi(float32 x) { return float32_to_int32_round_to_zero(x); } +unsigned int __fixunssfsi(float32 x); unsigned int __fixunssfsi(float32 x) { return float32_to_int32_round_to_zero(x); // XXX } -int __unordsf2(float32 a, float32 b) +flag __unordsf2(float32 a, float32 b); +flag __unordsf2(float32 a, float32 b) { /* * The comparison is unordered if either input is a NaN. diff --git a/software/libbase/softfloat.h b/software/libbase/softfloat.h index 29454c0ee..c987d5630 100644 --- a/software/libbase/softfloat.h +++ b/software/libbase/softfloat.h @@ -109,11 +109,12 @@ float32 float32_mul( float32, float32 ); float32 float32_div( float32, float32 ); float32 float32_rem( float32, float32 ); float32 float32_sqrt( float32 ); -int float32_eq( float32, float32 ); -int float32_le( float32, float32 ); -int float32_lt( float32, float32 ); -int float32_eq_signaling( float32, float32 ); -int float32_le_quiet( float32, float32 ); -int float32_lt_quiet( float32, float32 ); -int float32_is_signaling_nan( float32 ); +flag float32_eq( float32, float32 ); +flag float32_le( float32, float32 ); +flag float32_lt( float32, float32 ); +flag float32_eq_signaling( float32, float32 ); +flag float32_le_quiet( float32, float32 ); +flag float32_lt_quiet( float32, float32 ); +flag float32_is_nan( float32 a ); +flag float32_is_signaling_nan( float32 );