Fossil SCM
A few additions of "const" keyword, reducing the number of compiler warnings when compiling with -Wwrite-strings
Commit
0a754750ef9534859bb155b6353aee7ef6509146
Parent
48f1239eb2e9098…
3 files changed
+1
-1
+2
-2
+1
-1
+1
-1
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -1019,11 +1019,11 @@ | ||
| 1019 | 1019 | db_reset(&q); |
| 1020 | 1020 | if( rc ){ |
| 1021 | 1021 | const char *zCFType = "control artifact"; |
| 1022 | 1022 | char *zSrc; |
| 1023 | 1023 | char *zDate; |
| 1024 | - char *zErrType = "MISSING"; | |
| 1024 | + const char *zErrType = "MISSING"; | |
| 1025 | 1025 | if( db_exists("SELECT 1 FROM shun WHERE uuid=%Q", zUuid) ){ |
| 1026 | 1026 | if( flags & MISSING_SHUNNED ) return 0; |
| 1027 | 1027 | zErrType = "SHUNNED"; |
| 1028 | 1028 | } |
| 1029 | 1029 | switch( p->type ){ |
| 1030 | 1030 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -1019,11 +1019,11 @@ | |
| 1019 | db_reset(&q); |
| 1020 | if( rc ){ |
| 1021 | const char *zCFType = "control artifact"; |
| 1022 | char *zSrc; |
| 1023 | char *zDate; |
| 1024 | char *zErrType = "MISSING"; |
| 1025 | if( db_exists("SELECT 1 FROM shun WHERE uuid=%Q", zUuid) ){ |
| 1026 | if( flags & MISSING_SHUNNED ) return 0; |
| 1027 | zErrType = "SHUNNED"; |
| 1028 | } |
| 1029 | switch( p->type ){ |
| 1030 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -1019,11 +1019,11 @@ | |
| 1019 | db_reset(&q); |
| 1020 | if( rc ){ |
| 1021 | const char *zCFType = "control artifact"; |
| 1022 | char *zSrc; |
| 1023 | char *zDate; |
| 1024 | const char *zErrType = "MISSING"; |
| 1025 | if( db_exists("SELECT 1 FROM shun WHERE uuid=%Q", zUuid) ){ |
| 1026 | if( flags & MISSING_SHUNNED ) return 0; |
| 1027 | zErrType = "SHUNNED"; |
| 1028 | } |
| 1029 | switch( p->type ){ |
| 1030 |
+2
-2
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -379,12 +379,12 @@ | ||
| 379 | 379 | int isDeleted = db_column_int(&q, 1); |
| 380 | 380 | int isChnged = db_column_int(&q,2); |
| 381 | 381 | int isNew = db_column_int(&q,3); |
| 382 | 382 | int srcid = db_column_int(&q, 4); |
| 383 | 383 | int isLink = db_column_int(&q, 5); |
| 384 | - char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); | |
| 385 | - char *zToFree = zFullName; | |
| 384 | + char *zToFree = mprintf("%s%s", g.zLocalRoot, zPathname); | |
| 385 | + const char *zFullName = zToFree; | |
| 386 | 386 | int showDiff = 1; |
| 387 | 387 | if( isDeleted ){ |
| 388 | 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | 390 | }else if( file_access(zFullName, F_OK) ){ |
| 391 | 391 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -379,12 +379,12 @@ | |
| 379 | int isDeleted = db_column_int(&q, 1); |
| 380 | int isChnged = db_column_int(&q,2); |
| 381 | int isNew = db_column_int(&q,3); |
| 382 | int srcid = db_column_int(&q, 4); |
| 383 | int isLink = db_column_int(&q, 5); |
| 384 | char *zFullName = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 385 | char *zToFree = zFullName; |
| 386 | int showDiff = 1; |
| 387 | if( isDeleted ){ |
| 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | }else if( file_access(zFullName, F_OK) ){ |
| 391 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -379,12 +379,12 @@ | |
| 379 | int isDeleted = db_column_int(&q, 1); |
| 380 | int isChnged = db_column_int(&q,2); |
| 381 | int isNew = db_column_int(&q,3); |
| 382 | int srcid = db_column_int(&q, 4); |
| 383 | int isLink = db_column_int(&q, 5); |
| 384 | char *zToFree = mprintf("%s%s", g.zLocalRoot, zPathname); |
| 385 | const char *zFullName = zToFree; |
| 386 | int showDiff = 1; |
| 387 | if( isDeleted ){ |
| 388 | fossil_print("DELETED %s\n", zPathname); |
| 389 | if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; } |
| 390 | }else if( file_access(zFullName, F_OK) ){ |
| 391 |
+1
-1
| --- src/glob.c | ||
| +++ src/glob.c | ||
| @@ -39,11 +39,11 @@ | ||
| 39 | 39 | ** This routine makes no effort to free the memory space it uses, which |
| 40 | 40 | ** currently consists of a blob object and its contents. |
| 41 | 41 | */ |
| 42 | 42 | char *glob_expr(const char *zVal, const char *zGlobList){ |
| 43 | 43 | Blob expr; |
| 44 | - char *zSep = "("; | |
| 44 | + const char *zSep = "("; | |
| 45 | 45 | int nTerm = 0; |
| 46 | 46 | int i; |
| 47 | 47 | int cTerm; |
| 48 | 48 | |
| 49 | 49 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 50 | 50 |
| --- src/glob.c | |
| +++ src/glob.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | ** This routine makes no effort to free the memory space it uses, which |
| 40 | ** currently consists of a blob object and its contents. |
| 41 | */ |
| 42 | char *glob_expr(const char *zVal, const char *zGlobList){ |
| 43 | Blob expr; |
| 44 | char *zSep = "("; |
| 45 | int nTerm = 0; |
| 46 | int i; |
| 47 | int cTerm; |
| 48 | |
| 49 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 50 |
| --- src/glob.c | |
| +++ src/glob.c | |
| @@ -39,11 +39,11 @@ | |
| 39 | ** This routine makes no effort to free the memory space it uses, which |
| 40 | ** currently consists of a blob object and its contents. |
| 41 | */ |
| 42 | char *glob_expr(const char *zVal, const char *zGlobList){ |
| 43 | Blob expr; |
| 44 | const char *zSep = "("; |
| 45 | int nTerm = 0; |
| 46 | int i; |
| 47 | int cTerm; |
| 48 | |
| 49 | if( zGlobList==0 || zGlobList[0]==0 ) return "0"; |
| 50 |