Fossil SCM

Eliminate two unneeded type-casts and a compiler warning (signed<>unsigned compare)

jan.nijtmans 2014-01-24 10:04 trunk
Commit 17f7b650afe14ebfd69e18f7a9ff11d57cb72696
1 file changed +4 -4
+4 -4
--- src/th_lang.c
+++ src/th_lang.c
@@ -425,11 +425,11 @@
425425
int argc,
426426
const char **argv,
427427
int *argl
428428
){
429429
int rc;
430
- char *zName;
430
+ const char *zName;
431431
432432
ProcDefn *p;
433433
int nByte;
434434
int i;
435435
char *zSpace;
@@ -521,11 +521,11 @@
521521
}
522522
p->zUsage = zUsage;
523523
p->nUsage = nUsage;
524524
525525
/* Register the new command with the th1 interpreter. */
526
- zName = (char *)argv[1];
526
+ zName = argv[1];
527527
rc = Th_CreateCommand(interp, zName, proc_call1, (void *)p, proc_del);
528528
if( rc==TH_OK ){
529529
Th_SetResult(interp, 0, 0);
530530
}
531531
@@ -892,11 +892,11 @@
892892
const Th_SubCommand *aSub
893893
){
894894
if( argc>1 ){
895895
int i;
896896
for(i=0; aSub[i].zName; i++){
897
- char *zName = (char *)aSub[i].zName;
897
+ const char *zName = aSub[i].zName;
898898
if( th_strlen(zName)==argl[1] && 0==memcmp(zName, argv[1], argl[1]) ){
899899
return aSub[i].xProc(interp, ctx, argc, argv, argl);
900900
}
901901
}
902902
}
@@ -1097,11 +1097,11 @@
10971097
{"continue", simple_command, (void *)TH_CONTINUE},
10981098
{"error", simple_command, (void *)TH_ERROR},
10991099
11001100
{0, 0, 0}
11011101
};
1102
- int i;
1102
+ size_t i;
11031103
11041104
/* Add the language commands. */
11051105
for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){
11061106
void *ctx;
11071107
if ( !aCommand[i].zName || !aCommand[i].xProc ) continue;
11081108
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button