1
0
mirror of https://github.com/cclassic/model-ghdl synced 2024-11-21 08:25:05 +01:00

Syntax change to finally use a switch case somewhere :)

This commit is contained in:
Markus Koch 2016-05-21 22:17:55 +02:00
parent f304d611a8
commit b3171fbbb7

19
main.c
View File

@ -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]