Browse files

milkymist: use -Wold-style-definition

  • Loading branch information...
1 parent ad11623 commit f043b4c72b52974682dff9e36d7151a86f7e43c9 @wpwrak wpwrak committed with sbourdeauducq Dec 12, 2011
View
2 software/include.mak
@@ -38,7 +38,7 @@ INCLUDES_NOLIBC ?= -nostdinc -I$(MMDIR)/software/include/base
INCLUDES = $(INCLUDES_NOLIBC) -I$(MMDIR)/software/include -I$(MMDIR)/tools
ASFLAGS = $(INCLUDES) -nostdinc
# later: -Wmissing-prototypes
-CFLAGS = -O9 -Wall -Wstrict-prototypes \
+CFLAGS = -O9 -Wall -Wstrict-prototypes -Wold-style-definition \
-mbarrel-shift-enabled -mmultiply-enabled -mdivide-enabled \
-msign-extend-enabled -fno-builtin -fsigned-char \
-fsingle-precision-constant $(INCLUDES)
View
2 software/libbase/blockdev.c
@@ -263,7 +263,7 @@ int bd_readblock(unsigned int block, void *buffer)
return memcard_readblock(block, buffer);
}
-void bd_done()
+void bd_done(void)
{
}
View
4 software/libbase/board.c
@@ -39,12 +39,12 @@ const struct board_desc *get_board_desc_id(unsigned short int id)
return NULL;
}
-const struct board_desc *get_board_desc()
+const struct board_desc *get_board_desc(void)
{
return get_board_desc_id(CSR_SYSTEM_ID & 0xffff);
}
-int get_pcb_revision()
+int get_pcb_revision(void)
{
int r;
unsigned int io;
View
4 software/libbase/console.c
@@ -44,7 +44,7 @@ static void writechar(char c)
write_hook(c);
}
-char readchar()
+char readchar(void)
{
while(1) {
if(uart_read_nonblock())
@@ -54,7 +54,7 @@ char readchar()
}
}
-int readchar_nonblock()
+int readchar_nonblock(void)
{
return (uart_read_nonblock()
|| ((read_nonblock_hook != NULL) && read_nonblock_hook()));
View
2 software/libbase/fatfs.c
@@ -434,7 +434,7 @@ int fatfs_load(const char *filename, char *buffer, int size, int *realsize)
return n*cluster_size;
}
-void fatfs_done()
+void fatfs_done(void)
{
bd_done();
}
View
4 software/libbase/libc.c
@@ -564,13 +564,13 @@ int sprintf(char * buf, const char *fmt, ...)
*/
static unsigned int seed;
-unsigned int rand()
+unsigned int rand(void)
{
seed = 129 * seed + 907633385;
return seed;
}
-void abort()
+void abort(void)
{
printf("Aborted.");
while(1);
View
10 software/libbase/system.c
@@ -22,7 +22,7 @@
#include <system.h>
-void flush_cpu_icache()
+void flush_cpu_icache(void)
{
asm volatile(
"wcsr ICC, r0\n"
@@ -33,15 +33,15 @@ void flush_cpu_icache()
);
}
-void flush_cpu_dcache()
+void flush_cpu_dcache(void)
{
asm volatile(
"wcsr DCC, r0\n"
"nop\n"
);
}
-void flush_bridge_cache()
+void flush_bridge_cache(void)
{
volatile char *flushbase = (char *)FMLBRG_FLUSH_BASE;
int i, offset;
@@ -53,7 +53,7 @@ void flush_bridge_cache()
}
}
-__attribute__((noreturn)) void reboot()
+__attribute__((noreturn)) void reboot(void)
{
uart_force_sync(1); /* flush UART buffers */
irq_setmask(0);
@@ -70,7 +70,7 @@ static void icap_write(int val, unsigned int w)
CSR_ICAP = w;
}
-__attribute__((noreturn)) void reconf()
+__attribute__((noreturn)) void reconf(void)
{
uart_force_sync(1); /* flush UART buffers */
irq_setmask(0);
View
8 software/libbase/uart.c
@@ -45,7 +45,7 @@ static volatile int tx_cts;
static int force_sync;
-void uart_isr()
+void uart_isr(void)
{
unsigned int stat = CSR_UART_STAT;
@@ -67,7 +67,7 @@ void uart_isr()
}
/* Do not use in interrupt handlers! */
-char uart_read()
+char uart_read(void)
{
char c;
@@ -77,7 +77,7 @@ char uart_read()
return c;
}
-int uart_read_nonblock()
+int uart_read_nonblock(void)
{
return (rx_consume != rx_produce);
}
@@ -104,7 +104,7 @@ void uart_write(char c)
irq_setmask(oldmask);
}
-void uart_init()
+void uart_init(void)
{
unsigned int mask;
View
2 software/libhal/brd.c
@@ -48,7 +48,7 @@ static void display_capabilities(void)
display_capability("Memtester ", cap & CAP_MEMTEST);
}
-void brd_init()
+void brd_init(void)
{
int rev;
char soc_version[13];
View
2 software/libhal/dmx.c
@@ -20,7 +20,7 @@
#include <hal/dmx.h>
-void dmx_init()
+void dmx_init(void)
{
int i;
View
2 software/libhal/mem.c
@@ -29,7 +29,7 @@ struct malloc_bank banks[1] = {
}
};
-void mem_init()
+void mem_init(void)
{
int i, n;
View
4 software/libhal/pfpu.c
@@ -32,7 +32,7 @@ static unsigned int consume;
static unsigned int level;
static int cts;
-void pfpu_init()
+void pfpu_init(void)
{
unsigned int mask;
@@ -98,7 +98,7 @@ static void pfpu_start(struct pfpu_td *td)
CSR_PFPU_CTL = PFPU_CTL_START;
}
-void pfpu_isr()
+void pfpu_isr(void)
{
if(queue[consume]->update)
update_registers(queue[consume]->registers);
View
22 software/libhal/snd.c
@@ -38,7 +38,7 @@
static volatile int snd_cr_request;
static volatile int snd_cr_reply;
-void snd_init()
+void snd_init(void)
{
unsigned int codec_id;
unsigned int mask;
@@ -86,13 +86,13 @@ void snd_init()
printf("SND: initialization complete\n");
}
-void snd_isr_crrequest()
+void snd_isr_crrequest(void)
{
snd_cr_request = 1;
irq_ack(IRQ_AC97CRREQUEST);
}
-void snd_isr_crreply()
+void snd_isr_crreply(void)
{
snd_cr_reply = 1;
irq_ack(IRQ_AC97CRREPLY);
@@ -140,7 +140,7 @@ static void play_start(short *buffer)
CSR_AC97_DCTL = AC97_SCTL_EN;
}
-void snd_isr_dmar()
+void snd_isr_dmar(void)
{
/* NB. the callback can give us buffers by calling snd_play_refill() */
play_callback(play_queue[play_consume], play_user);
@@ -158,7 +158,7 @@ void snd_isr_dmar()
}
}
-void snd_play_empty()
+void snd_play_empty(void)
{
play_produce = 0;
play_consume = 0;
@@ -212,7 +212,7 @@ void snd_play_start(snd_callback callback, unsigned int nsamples, void *user)
}
}
-void snd_play_stop()
+void snd_play_stop(void)
{
unsigned int oldmask;
@@ -224,7 +224,7 @@ void snd_play_stop()
irq_setmask(oldmask);
}
-int snd_play_active()
+int snd_play_active(void)
{
return(CSR_AC97_DCTL & AC97_SCTL_EN);
}
@@ -254,7 +254,7 @@ static void record_start(short *buffer)
CSR_AC97_UCTL = AC97_SCTL_EN;
}
-void snd_isr_dmaw()
+void snd_isr_dmaw(void)
{
flush_cpu_dcache();
@@ -277,7 +277,7 @@ void snd_isr_dmaw()
record_overrun = 1;
}
-void snd_record_empty()
+void snd_record_empty(void)
{
record_produce = 0;
record_consume = 0;
@@ -329,7 +329,7 @@ void snd_record_start(snd_callback callback, unsigned int nsamples, void *user)
record_overrun = 1;
}
-void snd_record_stop()
+void snd_record_stop(void)
{
unsigned int oldmask;
@@ -341,7 +341,7 @@ void snd_record_stop()
irq_setmask(oldmask);
}
-int snd_record_active()
+int snd_record_active(void)
{
return(CSR_AC97_UCTL & AC97_SCTL_EN);
}
View
4 software/libhal/tmu.c
@@ -37,7 +37,7 @@ static unsigned int consume;
static unsigned int level;
static int cts;
-void tmu_init()
+void tmu_init(void)
{
unsigned int mask;
@@ -90,7 +90,7 @@ static void tmu_start(struct tmu_td *td)
CSR_TMU_CTL = td->flags|TMU_CTL_START;
}
-void tmu_isr()
+void tmu_isr(void)
{
if(queue[consume]->callback)
queue[consume]->callback(queue[consume]);
View
2 software/libhal/ukb.c
@@ -133,7 +133,7 @@ static void keyboard_cb(unsigned char modifiers, unsigned char key)
}
}
-void ukb_init()
+void ukb_init(void)
{
rx_produce = 0;
rx_consume = 0;

0 comments on commit f043b4c

Please sign in to comment.