From dce3569681698ca70edfa306e39dc94a1b1c1025 Mon Sep 17 00:00:00 2001 From: Ahmad Salim Al-Sibahi Date: Tue, 19 Nov 2013 17:11:08 +0000 Subject: [PATCH] Remove C warnings when compiling with a proper compiler --- rts/idris_opts.c | 7 +++---- rts/idris_rts.c | 4 ++-- rts/idris_rts.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/rts/idris_opts.c b/rts/idris_opts.c index 2253a1ef7..97fd65b73 100644 --- a/rts/idris_opts.c +++ b/rts/idris_opts.c @@ -6,18 +6,17 @@ #include -char usage[] = - "\n" \ +#define USAGE "\n" \ "Usage: [+RTS -RTS] \n\n" \ "Options:\n\n" \ " -? Print this message and exits.\n" \ " -s Summary GC statistics.\n" \ " -H Initial heap size. Egs: -H4M, -H500K, -H1G\n" \ " -K Sets the maximum stack size. Egs: -K8M\n" \ - "\n"; + "\n" void print_usage(FILE * s) { - fprintf(s, usage); + fprintf(s, USAGE); } int read_size(char * str) { diff --git a/rts/idris_rts.c b/rts/idris_rts.c index 627ecccc7..3bdad7958 100644 --- a/rts/idris_rts.c +++ b/rts/idris_rts.c @@ -161,7 +161,7 @@ VAL MKSTR(VM* vm, const char* str) { return cl; } -VAL MKPTR(VM* vm, const void* ptr) { +VAL MKPTR(VM* vm, void* ptr) { Closure* cl = allocate(vm, sizeof(Closure), 0); SETTY(cl, PTR); cl -> info.ptr = ptr; @@ -452,7 +452,7 @@ void* runThread(void* arg) { free(td); - Stats stats = terminate(vm); + // Stats stats = terminate(vm); // aggregate_stats(&(td->vm->stats), &stats); return NULL; } diff --git a/rts/idris_rts.h b/rts/idris_rts.h index 1b941e683..bac9d3a8c 100644 --- a/rts/idris_rts.h +++ b/rts/idris_rts.h @@ -143,7 +143,7 @@ typedef intptr_t i_int; // Creating new values (each value placed at the top of the stack) VAL MKFLOAT(VM* vm, double val); VAL MKSTR(VM* vm, const char* str); -VAL MKPTR(VM* vm, const void* ptr); +VAL MKPTR(VM* vm, void* ptr); VAL MKB8(VM* vm, uint8_t b); VAL MKB16(VM* vm, uint16_t b); VAL MKB32(VM* vm, uint32_t b);