Remove progname variable

The error message shouldn't specify the name of the binary, that's
supposed to be known by the caller.

Update test reference outputs.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-04-08 18:10:14 +01:00
parent 77546e9c58
commit 3d8396b86f
12 changed files with 11 additions and 29 deletions

View File

@@ -20,8 +20,6 @@ int cldefines_index;
int cldefines_size; int cldefines_size;
char **cldefines; char **cldefines;
char *progname;
clock_t nStartClock, nEndClock; clock_t nStartClock, nEndClock;
SLONG nLineNo; SLONG nLineNo;
ULONG nTotalLines, nPass, nPC, nIFDepth, nErrors; ULONG nTotalLines, nPass, nPC, nIFDepth, nErrors;
@@ -301,8 +299,6 @@ main(int argc, char *argv[])
if (argc == 1) if (argc == 1)
usage(); usage();
progname = "rgbasm";
/* yydebug=1; */ /* yydebug=1; */
DefaultOptions.gbgfx[0] = '0'; DefaultOptions.gbgfx[0] = '0';

10
src/extern/err.c vendored
View File

@@ -26,11 +26,9 @@
#include <stdlib.h> #include <stdlib.h>
#include "extern/err.h" #include "extern/err.h"
extern char *progname;
void rgbds_vwarn(const char *fmt, va_list ap) void rgbds_vwarn(const char *fmt, va_list ap)
{ {
fprintf (stderr, "%s: warning", progname); fprintf (stderr, "warning");
if (fmt) { if (fmt) {
fputs (": ", stderr); fputs (": ", stderr);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
@@ -41,7 +39,7 @@ void rgbds_vwarn(const char *fmt, va_list ap)
void rgbds_vwarnx(const char *fmt, va_list ap) void rgbds_vwarnx(const char *fmt, va_list ap)
{ {
fprintf (stderr, "%s: warning", progname); fprintf (stderr, "warning");
if (fmt) { if (fmt) {
fputs (": ", stderr); fputs (": ", stderr);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
@@ -51,7 +49,7 @@ void rgbds_vwarnx(const char *fmt, va_list ap)
noreturn void rgbds_verr(int status, const char *fmt, va_list ap) noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
{ {
fprintf (stderr, "%s: error", progname); fprintf (stderr, "error");
if (fmt) { if (fmt) {
fputs (": ", stderr); fputs (": ", stderr);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
@@ -62,7 +60,7 @@ noreturn void rgbds_verr(int status, const char *fmt, va_list ap)
noreturn void rgbds_verrx(int status, const char *fmt, va_list ap) noreturn void rgbds_verrx(int status, const char *fmt, va_list ap)
{ {
fprintf (stderr, "%s: error", progname); fprintf (stderr, "error");
if (fmt) { if (fmt) {
fputs (": ", stderr); fputs (": ", stderr);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);

View File

@@ -23,8 +23,6 @@
#include "extern/err.h" #include "extern/err.h"
char *progname;
static void static void
usage(void) usage(void)
{ {
@@ -71,8 +69,6 @@ main(int argc, char *argv[])
int version; /* mask ROM version number */ int version; /* mask ROM version number */
int padvalue; /* to pad the rom with if it changes size */ int padvalue; /* to pad the rom with if it changes size */
progname = "rgbfix";
while ((ch = getopt(argc, argv, "Cci:jk:l:m:n:p:sr:t:v")) != -1) { while ((ch = getopt(argc, argv, "Cci:jk:l:m:n:p:sr:t:v")) != -1) {
switch (ch) { switch (ch) {
case 'C': case 'C':

View File

@@ -19,8 +19,6 @@
#include <string.h> #include <string.h>
#include "gfx/main.h" #include "gfx/main.h"
char *progname;
static void static void
usage(void) usage(void)
{ {
@@ -41,8 +39,6 @@ main(int argc, char *argv[])
char *ext; char *ext;
const char *errmsg = "Warning: The PNG's %s setting is not the same as the setting defined on the command line."; const char *errmsg = "Warning: The PNG's %s setting is not the same as the setting defined on the command line.";
progname = "rgbgfx";
if (argc == 1) { if (argc == 1) {
usage(); usage();
} }

View File

@@ -24,8 +24,6 @@ SLONG options = 0;
SLONG fillchar = 0; SLONG fillchar = 0;
char *smartlinkstartsymbol; char *smartlinkstartsymbol;
char *progname;
/* /*
* Print the usagescreen * Print the usagescreen
* *
@@ -54,8 +52,6 @@ main(int argc, char *argv[])
if (argc == 1) if (argc == 1)
usage(); usage();
progname = "rgblink";
while ((ch = getopt(argc, argv, "l:m:n:o:O:p:s:tw")) != -1) { while ((ch = getopt(argc, argv, "l:m:n:o:O:p:s:tw")) != -1) {
switch (ch) { switch (ch) {
case 'l': case 'l':

View File

@@ -1,3 +1,3 @@
ERROR: undefined-dot.asm(3): ERROR: undefined-dot.asm(3):
'.' not defined '.' not defined
rgbasm: error: Assembly aborted in pass 2 (1 errors)! error: Assembly aborted in pass 2 (1 errors)!

View File

@@ -1 +1 @@
rgblink: error: Unable to place 'r0b' (ROM0 section) anywhere error: Unable to place 'r0b' (ROM0 section) anywhere

View File

@@ -1 +1 @@
rgblink: error: ROMX sections can't be used with option -t. error: ROMX sections can't be used with option -t.

View File

@@ -1 +1 @@
rgblink: error: VRAM bank 1 can't be used with option -w. error: VRAM bank 1 can't be used with option -w.

View File

@@ -1 +1 @@
rgblink: error: Unable to place 'v1' (VRAM section) in any bank error: Unable to place 'v1' (VRAM section) in any bank

View File

@@ -1 +1 @@
rgblink: error: Unable to place 'w0b' (WRAM0 section) anywhere error: Unable to place 'w0b' (WRAM0 section) anywhere

View File

@@ -1 +1 @@
rgblink: error: WRAMX sections can't be used with option -w. error: WRAMX sections can't be used with option -w.