comparison tools/gfxconv.c @ 2492:1bd7387984ed

Add few comments to the -R sub-option parsing and remove dead code.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Apr 2020 19:26:04 +0300
parents ed2f56abda22
children ec036e88a0c2
comparison
equal deleted inserted replaced
2491:ed2f56abda22 2492:1bd7387984ed
988 } 988 }
989 } 989 }
990 break; 990 break;
991 991
992 case 42: 992 case 42:
993 // Check if any flags/sub-options are specified
993 if ((tmpStr = strchr(optArg, '+')) != NULL) 994 if ((tmpStr = strchr(optArg, '+')) != NULL)
994 { 995 {
995 *tmpStr++ = 0; 996 *tmpStr++ = 0;
996 do 997 do
997 { 998 {
998 char sep, *topt; 999 // Parse one sub-option
999 topt = dmParseValWithSep(&tmpStr, &sep, NULL, "+"); 1000 char sep, *topt = dmParseValWithSep(&tmpStr, &sep, NULL, "+");
1000 1001
1002 // Check what option we have
1001 if (strcasecmp(topt, "remove") == 0) 1003 if (strcasecmp(topt, "remove") == 0)
1002 optRemapRemove = TRUE; 1004 optRemapRemove = TRUE;
1003 else 1005 else
1004 if (strcasecmp(topt, "alpha") == 0) 1006 if (strcasecmp(topt, "alpha") == 0)
1005 optRemapMatchAlpha = TRUE; 1007 optRemapMatchAlpha = TRUE;
1042 return FALSE; 1044 return FALSE;
1043 } 1045 }
1044 } while (*tmpStr != 0); 1046 } while (*tmpStr != 0);
1045 } 1047 }
1046 1048
1049 // Check which remap mode is being requested
1047 if (strcasecmp(optArg, "auto") == 0) 1050 if (strcasecmp(optArg, "auto") == 0)
1048 { 1051 {
1049 if (optRemapMode != REMAP_NONE && optRemapMode != REMAP_AUTO) 1052 if (optRemapMode != REMAP_NONE && optRemapMode != REMAP_AUTO)
1050 { 1053 {
1051 dmErrorMsg("Remap mode already set to something else than 'auto'. You can only have one remapping mode.\n"); 1054 dmErrorMsg("Remap mode already set to something else than 'auto'. You can only have one remapping mode.\n");
1052 return FALSE; 1055 return FALSE;
1053 }
1054
1055 // Check if we have more?
1056 if (optArg[4] == ':')
1057 {
1058 } 1056 }
1059 1057
1060 optRemapMode = REMAP_AUTO; 1058 optRemapMode = REMAP_AUTO;
1061 } 1059 }
1062 else 1060 else