From 1ccdfb683ad6c7e59793136c3a657ddf131cafd1 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 22 Sep 2015 22:27:01 +0200 Subject: Remove old-style function definitions. We already require -std=gnu99 and old-style function definitions might hide some compiler warnings. Signed-off-by: Mark Wielaard --- libasm/ChangeLog | 4 ++++ libasm/asm_abort.c | 3 +-- libasm/asm_addsleb128.c | 4 +--- libasm/asm_addstrz.c | 5 +---- libasm/asm_adduleb128.c | 4 +--- libasm/asm_align.c | 8 ++------ libasm/asm_end.c | 6 ++---- libasm/asm_error.c | 6 ++---- libasm/asm_fill.c | 5 +---- libasm/asm_getelf.c | 3 +-- libasm/asm_newabssym.c | 9 ++------- libasm/asm_newcomsym.c | 7 ++----- libasm/asm_newscn.c | 7 ++----- libasm/asm_newscn_ingrp.c | 8 ++------ libasm/asm_newscngrp.c | 7 ++----- libasm/asm_newsubscn.c | 4 +--- libasm/asm_newsym.c | 8 ++------ libasm/asm_scngrp_newsignature.c | 4 +--- 18 files changed, 30 insertions(+), 72 deletions(-) (limited to 'libasm') diff --git a/libasm/ChangeLog b/libasm/ChangeLog index 91338d09..0eb84c6c 100644 --- a/libasm/ChangeLog +++ b/libasm/ChangeLog @@ -1,3 +1,7 @@ +2015-09-22 Mark Wielaard + + * asm_*.c: Remove old-style function definitions. + 2015-09-04 Chih-Hung Hsieh * asm_addint8.c (FCT): Replace K&R function definition diff --git a/libasm/asm_abort.c b/libasm/asm_abort.c index ef55ee9b..12743dc6 100644 --- a/libasm/asm_abort.c +++ b/libasm/asm_abort.c @@ -39,8 +39,7 @@ int -asm_abort (ctx) - AsmCtx_t *ctx; +asm_abort (AsmCtx_t *ctx) { if (ctx == NULL) /* Something went wrong earlier. */ diff --git a/libasm/asm_addsleb128.c b/libasm/asm_addsleb128.c index 3692789d..dc62c951 100644 --- a/libasm/asm_addsleb128.c +++ b/libasm/asm_addsleb128.c @@ -38,9 +38,7 @@ int -asm_addsleb128 (asmscn, num) - AsmScn_t *asmscn; - int32_t num; +asm_addsleb128 (AsmScn_t *asmscn, int32_t num) { if (asmscn == NULL) return -1; diff --git a/libasm/asm_addstrz.c b/libasm/asm_addstrz.c index 87663f3a..26e06bb2 100644 --- a/libasm/asm_addstrz.c +++ b/libasm/asm_addstrz.c @@ -40,10 +40,7 @@ /* Add zero terminated string STR of size LEN to (sub)section ASMSCN. */ int -asm_addstrz (asmscn, str, len) - AsmScn_t *asmscn; - const char *str; - size_t len; +asm_addstrz (AsmScn_t *asmscn, const char *str, size_t len) { if (asmscn == NULL) return -1; diff --git a/libasm/asm_adduleb128.c b/libasm/asm_adduleb128.c index a3a85738..96438cce 100644 --- a/libasm/asm_adduleb128.c +++ b/libasm/asm_adduleb128.c @@ -38,9 +38,7 @@ int -asm_adduleb128 (asmscn, num) - AsmScn_t *asmscn; - uint32_t num; +asm_adduleb128 (AsmScn_t *asmscn, uint32_t num) { if (asmscn == NULL) return -1; diff --git a/libasm/asm_align.c b/libasm/asm_align.c index 2025b027..b7708f59 100644 --- a/libasm/asm_align.c +++ b/libasm/asm_align.c @@ -40,9 +40,7 @@ int -asm_align (asmscn, value) - AsmScn_t *asmscn; - GElf_Word value; +asm_align (AsmScn_t *asmscn, GElf_Word value) { if (asmscn == NULL) /* An earlier error. */ @@ -134,9 +132,7 @@ asm_align (asmscn, value) /* Ensure there are at least LEN bytes available in the output buffer for ASMSCN. */ int -__libasm_ensure_section_space (asmscn, len) - AsmScn_t *asmscn; - size_t len; +__libasm_ensure_section_space (AsmScn_t *asmscn, size_t len) { /* The blocks with the section content are kept in a circular single-linked list. */ diff --git a/libasm/asm_end.c b/libasm/asm_end.c index f4145a75..d629fcd8 100644 --- a/libasm/asm_end.c +++ b/libasm/asm_end.c @@ -498,8 +498,7 @@ binary_end (AsmCtx_t *ctx) int -asm_end (ctx) - AsmCtx_t *ctx; +asm_end (AsmCtx_t *ctx) { int result; @@ -555,8 +554,7 @@ free_section (AsmScn_t *scnp) void -__libasm_finictx (ctx) - AsmCtx_t *ctx; +__libasm_finictx (AsmCtx_t *ctx) { /* Iterate through section table and free individual entries. */ AsmScn_t *scn = ctx->section_list; diff --git a/libasm/asm_error.c b/libasm/asm_error.c index 300a7983..54430497 100644 --- a/libasm/asm_error.c +++ b/libasm/asm_error.c @@ -52,8 +52,7 @@ asm_errno (void) void -__libasm_seterrno (value) - int value; +__libasm_seterrno (int value) { global_error = value; } @@ -75,8 +74,7 @@ static const char *msgs[ASM_E_NUM] = }; const char * -asm_errmsg (error) - int error; +asm_errmsg (int error) { int last_error = global_error; diff --git a/libasm/asm_fill.c b/libasm/asm_fill.c index 6b92bc36..62d9d732 100644 --- a/libasm/asm_fill.c +++ b/libasm/asm_fill.c @@ -39,10 +39,7 @@ int -asm_fill (asmscn, bytes, len) - AsmScn_t *asmscn; - void *bytes; - size_t len; +asm_fill (AsmScn_t *asmscn, void *bytes, size_t len) { struct FillPattern *pattern; struct FillPattern *old_pattern; diff --git a/libasm/asm_getelf.c b/libasm/asm_getelf.c index edeff13f..2a5c37bb 100644 --- a/libasm/asm_getelf.c +++ b/libasm/asm_getelf.c @@ -37,8 +37,7 @@ Elf * -asm_getelf (ctx) - AsmCtx_t *ctx; +asm_getelf (AsmCtx_t *ctx) { return ctx != NULL ? ctx->out.elf : NULL; } diff --git a/libasm/asm_newabssym.c b/libasm/asm_newabssym.c index 4e59901a..c5b7beaa 100644 --- a/libasm/asm_newabssym.c +++ b/libasm/asm_newabssym.c @@ -52,13 +52,8 @@ static const AsmScn_t __libasm_abs_scn = AsmSym_t * -asm_newabssym (ctx, name, size, value, type, binding) - AsmCtx_t *ctx; - const char *name; - GElf_Xword size; - GElf_Addr value; - int type; - int binding; +asm_newabssym (AsmCtx_t *ctx, const char *name, GElf_Xword size, + GElf_Addr value, int type, int binding) { AsmSym_t *result; diff --git a/libasm/asm_newcomsym.c b/libasm/asm_newcomsym.c index 7a578e0c..ee5c1409 100644 --- a/libasm/asm_newcomsym.c +++ b/libasm/asm_newcomsym.c @@ -52,11 +52,8 @@ static const AsmScn_t __libasm_com_scn = AsmSym_t * -asm_newcomsym (ctx, name, size, align) - AsmCtx_t *ctx; - const char *name; - GElf_Xword size; - GElf_Addr align; +asm_newcomsym (AsmCtx_t *ctx, const char *name, GElf_Xword size, + GElf_Addr align) { AsmSym_t *result; diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c index ece7f5cb..e2367693 100644 --- a/libasm/asm_newscn.c +++ b/libasm/asm_newscn.c @@ -158,11 +158,8 @@ binary_newscn (AsmScn_t *result, GElf_Word type, GElf_Xword flags, AsmScn_t * -asm_newscn (ctx, scnname, type, flags) - AsmCtx_t *ctx; - const char *scnname; - GElf_Word type; - GElf_Xword flags; +asm_newscn (AsmCtx_t *ctx, const char *scnname, GElf_Word type, + GElf_Xword flags) { size_t scnname_len = strlen (scnname) + 1; AsmScn_t *result; diff --git a/libasm/asm_newscn_ingrp.c b/libasm/asm_newscn_ingrp.c index 6ef7cb98..fd45be62 100644 --- a/libasm/asm_newscn_ingrp.c +++ b/libasm/asm_newscn_ingrp.c @@ -37,12 +37,8 @@ AsmScn_t * -asm_newscn_ingrp (ctx, scnname, type, flags, grp) - AsmCtx_t *ctx; - const char *scnname; - GElf_Word type; - GElf_Xword flags; - AsmScnGrp_t *grp; +asm_newscn_ingrp (AsmCtx_t *ctx, const char *scnname, GElf_Word type, + GElf_Xword flags, AsmScnGrp_t *grp) { AsmScn_t *result = INTUSE (asm_newscn) (ctx, scnname, type, flags); diff --git a/libasm/asm_newscngrp.c b/libasm/asm_newscngrp.c index 2808e694..c5968c1f 100644 --- a/libasm/asm_newscngrp.c +++ b/libasm/asm_newscngrp.c @@ -41,11 +41,8 @@ AsmScnGrp_t * -asm_newscngrp (ctx, grpname, signature, flags) - AsmCtx_t *ctx; - const char *grpname; - AsmSym_t *signature; - Elf32_Word flags; +asm_newscngrp (AsmCtx_t *ctx, const char *grpname, AsmSym_t *signature, + Elf32_Word flags) { AsmScnGrp_t *result; size_t grpname_len = strlen (grpname) + 1; diff --git a/libasm/asm_newsubscn.c b/libasm/asm_newsubscn.c index a83607ac..906240ac 100644 --- a/libasm/asm_newsubscn.c +++ b/libasm/asm_newsubscn.c @@ -38,9 +38,7 @@ AsmScn_t * -asm_newsubscn (asmscn, nr) - AsmScn_t *asmscn; - unsigned int nr; +asm_newsubscn (AsmScn_t *asmscn, unsigned int nr) { AsmScn_t *runp; AsmScn_t *newp; diff --git a/libasm/asm_newsym.c b/libasm/asm_newsym.c index deca08a4..7f522910 100644 --- a/libasm/asm_newsym.c +++ b/libasm/asm_newsym.c @@ -41,12 +41,8 @@ AsmSym_t * -asm_newsym (asmscn, name, size, type, binding) - AsmScn_t *asmscn; - const char *name; - GElf_Xword size; - int type; - int binding; +asm_newsym (AsmScn_t *asmscn, const char *name, GElf_Xword size, + int type, int binding) { #define TEMPSYMLEN 10 char tempsym[TEMPSYMLEN]; diff --git a/libasm/asm_scngrp_newsignature.c b/libasm/asm_scngrp_newsignature.c index d87f4a4e..2fbb3346 100644 --- a/libasm/asm_scngrp_newsignature.c +++ b/libasm/asm_scngrp_newsignature.c @@ -35,9 +35,7 @@ int -asm_scngrp_newsignature (grp, signature) - AsmScnGrp_t *grp; - AsmSym_t *signature; +asm_scngrp_newsignature (AsmScnGrp_t *grp, AsmSym_t *signature) { if (grp == NULL || signature == NULL) return 1; -- cgit v1.2.3