scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 684e2fc31614291bc169b0c020f0f7aa6afaecad
parent 1cd7b8c1e9e3a1946ebe06f05d62e755493b8d7a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 24 Nov 2017 22:21:43 +0100

[nm] Use better names for testing functions

These more generic functions are better because they can be used
as interfaces for a multi binary format support.

Diffstat:
Mnm/main.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/nm/main.c b/nm/main.c @@ -21,7 +21,7 @@ int gflag; int uflag; static int -myrofile(char *fname, FILE *fp) +object(char *fname, FILE *fp) { char magic[MYROMAGIC_SIZ]; fpos_t pos; @@ -38,7 +38,7 @@ myrofile(char *fname, FILE *fp) } static int -arfile(char *fname, FILE *fp) +archive(char *fname, FILE *fp) { char magic[ARMAGIC_SIZ]; fpos_t pos; @@ -128,7 +128,7 @@ ar(char *fname, FILE *fp) if (hdr.size & 1) ++pos; - if (myrofile(fname, fp)) { + if (object(fname, fp)) { nm(fname, hdr.name, fp); } else { fprintf(stderr, @@ -147,9 +147,9 @@ doit(char *fname) if ((fp = fopen(fname, "rb")) == NULL) goto file_error; - if (myrofile(fname, fp)) + if (object(fname, fp)) nm(fname, fname, fp); - else if (arfile(fname, fp)) + else if (archive(fname, fp)) ar(fname, fp); else fprintf(stderr, "nm: %s: File format not recognized", fname);