Commit Graph

15 Commits

Author SHA1 Message Date
Sami Kerola b1557fe981 misc: fix ggc-7 fallthrough warnings
(Original patch and commit message edited by Rudi.)

gcc-7 adds -Wimplicit-fallthrough=3 to our default flag -Wextra.
This warning can be silenced by using comment /* fallthrough */
which is also recognized by other tools like coverity. There are
also other valid comments (see man gcc-7) but we consolidate this
style now.

We could have also used __attribute__((fallthrough)) but the comment
looks nice and does not need to be ifdef'ed for compatibility.

Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652
Reference: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
Reviewed-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Suggested-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-06-14 11:48:22 +02:00
Sami Kerola 74ce680a3e
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-07-21 21:14:33 +01:00
Natanael Copa 7235e70391 hexdump: use 'll' format modifier instead of the non-standard 'q'.
The printf(3) man page says about 'q':
("quad". 4.4BSD and Linux libc5 only. Don't use.) This is a synonym for ll.

This fixes hexdump with musl libc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2014-10-31 10:39:18 +01:00
HUANG Wei 82233c2a0a hexdump: Fix parse format of "byte count without repetition count" 2014-08-06 12:20:18 +08:00
Karel Zak 58ce71e63e hexdump: use new colors API
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-13 12:09:03 +02:00
Ondrej Oprala 3bf7ede997 hexdump: color unit may now be longer than the corresponding format unit
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-03-04 12:48:59 +01:00
Ondrej Oprala 098ab0778f hexdump: add highlighting support
[kzak@redhat.com: - fix coding style,
                  - use xalloc in all code,
		  - fix strtol usage]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-02-10 16:01:37 +01:00
Ondrej Oprala 1f77e9c3ad hexdump: Create struct hexdump containing previously global variables.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:24 +01:00
Ondrej Oprala 1be6ed6ade hexdump: add __attribute__ ((__noreturn__)) to bad*() functions
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:24 +01:00
Ondrej Oprala bb8ae572ef hexdump: rename struct _fs to struct hexdump_fs and remove its typedef
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:23 +01:00
Ondrej Oprala 046921da22 hexdump: rename struct _fu to struct hexdump_fu and remove its typedef
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:22 +01:00
Ondrej Oprala 4c73d29c06 hexdump: Rename struct _pr to struct hexdump_pr and remove it's typedef
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:21 +01:00
Ondrej Oprala 9f399910f2 hexdump: rename rewrite to rewrite_rules
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:21 +01:00
Ondrej Oprala 9fa53cebe4 hexdump: rename add to add_fmt
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:20 +01:00
Ondrej Oprala af324b1f72 hexdump: add the prefix 'hexdump-' to {conv,display,parse}.c
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-12-02 13:44:17 +01:00