Skip to content

Commit

Permalink
Syntax change to finally use a switch case somewhere :)
Browse files Browse the repository at this point in the history
  • Loading branch information
m42uko committed May 21, 2016
1 parent f304d61 commit b3171fb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,23 +485,20 @@ char* append_string(char **dest, const char *src) {

int main(int argc, char **argv)
{
int app;

printf ("model-ghdl revision %s, compiled on %s.\n", PROGRAM_REVISION, __DATE__);

app = get_application(argv[0]);

if (app == PROG_VCOM) {
switch (get_application(argv[0])) {
case PROG_VCOM:
return vcom(argc, argv);
}
else if (app == PROG_VSIM) {
case PROG_VSIM:
return vsim(argc, argv);
}
else if (app == PROG_VMAP || app == PROG_VLIB || app == PROG_VDEL) {
case PROG_VMAP:
case PROG_VLIB:
case PROG_VDEL:
return 0;
default:
return 255;
}

return 255;
}

// Detects which function to call depending on the program name in argv[0]
Expand Down

0 comments on commit b3171fb

Please sign in to comment.