Fossil SCM
Eliminate two unneeded type-casts and a compiler warning (signed<>unsigned compare)
Commit
17f7b650afe14ebfd69e18f7a9ff11d57cb72696
Parent
dce90fe35eee6c2…
1 file changed
+4
-4
+4
-4
| --- src/th_lang.c | ||
| +++ src/th_lang.c | ||
| @@ -425,11 +425,11 @@ | ||
| 425 | 425 | int argc, |
| 426 | 426 | const char **argv, |
| 427 | 427 | int *argl |
| 428 | 428 | ){ |
| 429 | 429 | int rc; |
| 430 | - char *zName; | |
| 430 | + const char *zName; | |
| 431 | 431 | |
| 432 | 432 | ProcDefn *p; |
| 433 | 433 | int nByte; |
| 434 | 434 | int i; |
| 435 | 435 | char *zSpace; |
| @@ -521,11 +521,11 @@ | ||
| 521 | 521 | } |
| 522 | 522 | p->zUsage = zUsage; |
| 523 | 523 | p->nUsage = nUsage; |
| 524 | 524 | |
| 525 | 525 | /* Register the new command with the th1 interpreter. */ |
| 526 | - zName = (char *)argv[1]; | |
| 526 | + zName = argv[1]; | |
| 527 | 527 | rc = Th_CreateCommand(interp, zName, proc_call1, (void *)p, proc_del); |
| 528 | 528 | if( rc==TH_OK ){ |
| 529 | 529 | Th_SetResult(interp, 0, 0); |
| 530 | 530 | } |
| 531 | 531 | |
| @@ -892,11 +892,11 @@ | ||
| 892 | 892 | const Th_SubCommand *aSub |
| 893 | 893 | ){ |
| 894 | 894 | if( argc>1 ){ |
| 895 | 895 | int i; |
| 896 | 896 | for(i=0; aSub[i].zName; i++){ |
| 897 | - char *zName = (char *)aSub[i].zName; | |
| 897 | + const char *zName = aSub[i].zName; | |
| 898 | 898 | if( th_strlen(zName)==argl[1] && 0==memcmp(zName, argv[1], argl[1]) ){ |
| 899 | 899 | return aSub[i].xProc(interp, ctx, argc, argv, argl); |
| 900 | 900 | } |
| 901 | 901 | } |
| 902 | 902 | } |
| @@ -1097,11 +1097,11 @@ | ||
| 1097 | 1097 | {"continue", simple_command, (void *)TH_CONTINUE}, |
| 1098 | 1098 | {"error", simple_command, (void *)TH_ERROR}, |
| 1099 | 1099 | |
| 1100 | 1100 | {0, 0, 0} |
| 1101 | 1101 | }; |
| 1102 | - int i; | |
| 1102 | + size_t i; | |
| 1103 | 1103 | |
| 1104 | 1104 | /* Add the language commands. */ |
| 1105 | 1105 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 1106 | 1106 | void *ctx; |
| 1107 | 1107 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1108 | 1108 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -425,11 +425,11 @@ | |
| 425 | int argc, |
| 426 | const char **argv, |
| 427 | int *argl |
| 428 | ){ |
| 429 | int rc; |
| 430 | char *zName; |
| 431 | |
| 432 | ProcDefn *p; |
| 433 | int nByte; |
| 434 | int i; |
| 435 | char *zSpace; |
| @@ -521,11 +521,11 @@ | |
| 521 | } |
| 522 | p->zUsage = zUsage; |
| 523 | p->nUsage = nUsage; |
| 524 | |
| 525 | /* Register the new command with the th1 interpreter. */ |
| 526 | zName = (char *)argv[1]; |
| 527 | rc = Th_CreateCommand(interp, zName, proc_call1, (void *)p, proc_del); |
| 528 | if( rc==TH_OK ){ |
| 529 | Th_SetResult(interp, 0, 0); |
| 530 | } |
| 531 | |
| @@ -892,11 +892,11 @@ | |
| 892 | const Th_SubCommand *aSub |
| 893 | ){ |
| 894 | if( argc>1 ){ |
| 895 | int i; |
| 896 | for(i=0; aSub[i].zName; i++){ |
| 897 | char *zName = (char *)aSub[i].zName; |
| 898 | if( th_strlen(zName)==argl[1] && 0==memcmp(zName, argv[1], argl[1]) ){ |
| 899 | return aSub[i].xProc(interp, ctx, argc, argv, argl); |
| 900 | } |
| 901 | } |
| 902 | } |
| @@ -1097,11 +1097,11 @@ | |
| 1097 | {"continue", simple_command, (void *)TH_CONTINUE}, |
| 1098 | {"error", simple_command, (void *)TH_ERROR}, |
| 1099 | |
| 1100 | {0, 0, 0} |
| 1101 | }; |
| 1102 | int i; |
| 1103 | |
| 1104 | /* Add the language commands. */ |
| 1105 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 1106 | void *ctx; |
| 1107 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1108 |
| --- src/th_lang.c | |
| +++ src/th_lang.c | |
| @@ -425,11 +425,11 @@ | |
| 425 | int argc, |
| 426 | const char **argv, |
| 427 | int *argl |
| 428 | ){ |
| 429 | int rc; |
| 430 | const char *zName; |
| 431 | |
| 432 | ProcDefn *p; |
| 433 | int nByte; |
| 434 | int i; |
| 435 | char *zSpace; |
| @@ -521,11 +521,11 @@ | |
| 521 | } |
| 522 | p->zUsage = zUsage; |
| 523 | p->nUsage = nUsage; |
| 524 | |
| 525 | /* Register the new command with the th1 interpreter. */ |
| 526 | zName = argv[1]; |
| 527 | rc = Th_CreateCommand(interp, zName, proc_call1, (void *)p, proc_del); |
| 528 | if( rc==TH_OK ){ |
| 529 | Th_SetResult(interp, 0, 0); |
| 530 | } |
| 531 | |
| @@ -892,11 +892,11 @@ | |
| 892 | const Th_SubCommand *aSub |
| 893 | ){ |
| 894 | if( argc>1 ){ |
| 895 | int i; |
| 896 | for(i=0; aSub[i].zName; i++){ |
| 897 | const char *zName = aSub[i].zName; |
| 898 | if( th_strlen(zName)==argl[1] && 0==memcmp(zName, argv[1], argl[1]) ){ |
| 899 | return aSub[i].xProc(interp, ctx, argc, argv, argl); |
| 900 | } |
| 901 | } |
| 902 | } |
| @@ -1097,11 +1097,11 @@ | |
| 1097 | {"continue", simple_command, (void *)TH_CONTINUE}, |
| 1098 | {"error", simple_command, (void *)TH_ERROR}, |
| 1099 | |
| 1100 | {0, 0, 0} |
| 1101 | }; |
| 1102 | size_t i; |
| 1103 | |
| 1104 | /* Add the language commands. */ |
| 1105 | for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){ |
| 1106 | void *ctx; |
| 1107 | if ( !aCommand[i].zName || !aCommand[i].xProc ) continue; |
| 1108 |