Fossil SCM

A few additions of "const" keyword, reducing the number of compiler warnings when compiling with -Wwrite-strings

jan.nijtmans 2014-06-06 07:19 trunk
Commit 0a754750ef9534859bb155b6353aee7ef6509146
3 files changed +1 -1 +2 -2 +1 -1
+1 -1
--- src/content.c
+++ src/content.c
@@ -1019,11 +1019,11 @@
10191019
db_reset(&q);
10201020
if( rc ){
10211021
const char *zCFType = "control artifact";
10221022
char *zSrc;
10231023
char *zDate;
1024
- char *zErrType = "MISSING";
1024
+ const char *zErrType = "MISSING";
10251025
if( db_exists("SELECT 1 FROM shun WHERE uuid=%Q", zUuid) ){
10261026
if( flags & MISSING_SHUNNED ) return 0;
10271027
zErrType = "SHUNNED";
10281028
}
10291029
switch( p->type ){
10301030
--- 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 @@
379379
int isDeleted = db_column_int(&q, 1);
380380
int isChnged = db_column_int(&q,2);
381381
int isNew = db_column_int(&q,3);
382382
int srcid = db_column_int(&q, 4);
383383
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;
386386
int showDiff = 1;
387387
if( isDeleted ){
388388
fossil_print("DELETED %s\n", zPathname);
389389
if( !asNewFile ){ showDiff = 0; zFullName = NULL_DEVICE; }
390390
}else if( file_access(zFullName, F_OK) ){
391391
--- 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 @@
3939
** This routine makes no effort to free the memory space it uses, which
4040
** currently consists of a blob object and its contents.
4141
*/
4242
char *glob_expr(const char *zVal, const char *zGlobList){
4343
Blob expr;
44
- char *zSep = "(";
44
+ const char *zSep = "(";
4545
int nTerm = 0;
4646
int i;
4747
int cTerm;
4848
4949
if( zGlobList==0 || zGlobList[0]==0 ) return "0";
5050
--- 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

Keyboard Shortcuts

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