Date: Wed, 4 Mar 2020 16:53:49 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358622 - head/usr.bin/elfctl Message-ID: <202003041653.024GrnN2069612@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Wed Mar 4 16:53:49 2020 New Revision: 358622 URL: https://svnweb.freebsd.org/changeset/base/358622 Log: elfctl: style(9): use C99 uintX_t types Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/elfctl/elfctl.c Modified: head/usr.bin/elfctl/elfctl.c ============================================================================== --- head/usr.bin/elfctl/elfctl.c Wed Mar 4 16:41:25 2020 (r358621) +++ head/usr.bin/elfctl/elfctl.c Wed Mar 4 16:53:49 2020 (r358622) @@ -48,9 +48,9 @@ __FBSDID("$FreeBSD$"); -static bool convert_to_feature_val(char *, u_int32_t *); +static bool convert_to_feature_val(char *, uint32_t *); static bool edit_file_features(Elf *, int, int, char *); -static bool get_file_features(Elf *, int, int, u_int32_t *, u_int64_t *); +static bool get_file_features(Elf *, int, int, uint32_t *, uint64_t *); static void print_features(void); static bool print_file_features(Elf *, int, int, char *); static void usage(void); @@ -206,11 +206,11 @@ usage(void) } static bool -convert_to_feature_val(char *feature_str, u_int32_t *feature_val) +convert_to_feature_val(char *feature_str, uint32_t *feature_val) { char *feature; int i, len; - u_int32_t input; + uint32_t input; char operation; input = 0; @@ -247,8 +247,8 @@ convert_to_feature_val(char *feature_str, u_int32_t *f static bool edit_file_features(Elf *elf, int phcount, int fd, char *val) { - u_int32_t features; - u_int64_t off; + uint32_t features; + uint64_t off; if (!get_file_features(elf, phcount, fd, &features, &off)) { warnx("NT_FREEBSD_FEATURE_CTL note not found"); @@ -281,7 +281,7 @@ print_features(void) static bool print_file_features(Elf *elf, int phcount, int fd, char *filename) { - u_int32_t features; + uint32_t features; unsigned long i; if (!get_file_features(elf, phcount, fd, &features, NULL)) { @@ -302,8 +302,8 @@ print_file_features(Elf *elf, int phcount, int fd, cha } static bool -get_file_features(Elf *elf, int phcount, int fd, u_int32_t *features, - u_int64_t *off) +get_file_features(Elf *elf, int phcount, int fd, uint32_t *features, + uint64_t *off) { GElf_Phdr phdr; Elf_Note note; @@ -367,7 +367,7 @@ get_file_features(Elf *elf, int phcount, int fd, u_int continue; } - if (note.n_descsz < sizeof(u_int32_t)) { + if (note.n_descsz < sizeof(uint32_t)) { warnx("Feature descriptor can't " "be less than 4 bytes"); free(name); @@ -378,9 +378,9 @@ get_file_features(Elf *elf, int phcount, int fd, u_int * XXX: For now we look at only 4 bytes of the * descriptor. This should respect descsz. */ - if (note.n_descsz > sizeof(u_int32_t)) + if (note.n_descsz > sizeof(uint32_t)) warnx("Feature note is bigger than expected"); - read(fd, features, sizeof(u_int32_t)); + read(fd, features, sizeof(uint32_t)); if (off != NULL) *off = phdr.p_offset + read_total; free(name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003041653.024GrnN2069612>