Commit Graph

20 Commits

Author SHA1 Message Date
Ian Campbell
585cb1d499 Fix two warnings about implicit fallthrough.
In the first case:

    pio.c: In function ‘main’:
    pio.c:355:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
        usage(0);
        ^~~~~~~~
    pio.c:356:3: note: here
       case 'm':
       ^~~~

The fallthrough is not intended because `usage()` never returns (it calls
`exit` unconditionally). Annotate as `noreturn` so the compiler realises this.

In the second case:

    fexc.c: In function ‘main’:
    fexc.c:312:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
       filename[1] = argv[optind+1]; /* out */
       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    fexc.c:313:2: note: here
      case 1:
      ^~~~

The fallthrough appears to be intended (the two argument case is a superset of
the one argument case). Annotate with a comment which tells the compiler this
is intended.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
2018-07-09 09:16:25 +01:00
Bernhard Nortmann
610ca15715 common.h: Rename errf() to pr_error(), add pr_fatal()
Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
2016-12-07 08:15:03 +01:00
Bernhard Nortmann
b496582b3d Have a workaround for missing mmap() in fexc.c and pio.c
By defining NO_MMAP it's now possible to avoid the usage of
mmap() and munmap(). This benefits platforms that don't support
these functions, e.g. Windows.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
2016-10-26 21:37:29 +02:00
Bernhard Nortmann
569f189693 Have programs display version information in their usage help
This way we don't have to introduce new options for retrieving
version info. For those programs that do not output their usage
by default (e.g. because they would process stdin), you may pass
a "-?" option to get help - and thus version information.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
2016-10-24 14:53:02 +02:00
Bernhard Nortmann
8c50707685 fexc: Clarify intent of opt_string adjustment
This also avoids a possible compiler warning (-Wstring-plus-int).

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
2016-05-04 10:31:47 +02:00
Andrey Kosteltsev
bdc13f4b98 fixed issue #29: bad if test? 2014-08-02 18:51:32 +02:00
Alejandro Mery
987a169b75 fexc: add uboot output 2012-09-29 18:42:17 +02:00
Alejandro Mery
79ea14d4e0 Relicensed as GPLv2+ 2012-06-15 22:34:22 +02:00
Alejandro Mery
de158a9273 fexc: fix error returning (closes #2) 2012-06-14 14:11:15 +02:00
Alejandro Mery
473b30dcad fexc: allow bin inputs that aren't regular files 2012-05-11 12:46:52 +02:00
Alejandro Mery
73b18fcfc9 fexc: move bin2fex's main() in 2012-05-11 12:02:10 +02:00
Alejandro Mery
650b1dfa79 script_fex: move parser from fex2bin.c and make fexc use it 2012-05-11 10:50:41 +02:00
Alejandro Mery
02a8f0abd2 fexc: use script_bin.o 2012-05-11 10:34:51 +02:00
Alejandro Mery
c3e7cb1d51 fexc: move fex2bin's main() in 2012-05-11 10:26:36 +02:00
Alejandro Mery
a2d5f0a42e fexc: use script.o 2012-05-11 09:22:47 +02:00
Alejandro Mery
1fc1addd2d fexc: finish main() 2012-05-11 09:08:19 +02:00
Alejandro Mery
5ebef7dc14 fexc: indentify optional input and output filenames from the arguments 2012-05-11 01:14:45 +02:00
Alejandro Mery
8b85878f26 fexc: set formats for bin2fex and implement -q 2012-05-10 12:30:15 +02:00
Alejandro Mery
90e67cba62 fexc: prepare for multitool support and validate input and output format options 2012-05-10 12:05:33 +02:00
Alejandro Mery
020f001c20 fexc: add do-nothing fexc tool 2012-05-10 09:55:10 +02:00