Fossil SCM
Fix some const-correctness warnings with gcc 15.2.
Commit
ea099022b54d22be2a85d10afc82b0db25b292240038642b578835088b8827b7
Parent
e37db2bb0dc0677…
6 files changed
+3
-3
+1
-1
+2
-2
+1
-1
+1
-1
+1
-1
+3
-3
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -836,16 +836,16 @@ | ||
| 836 | 836 | |
| 837 | 837 | /* |
| 838 | 838 | ** Return the hostname portion of an email address - the part following |
| 839 | 839 | ** the @ |
| 840 | 840 | */ |
| 841 | -char *alert_hostname(const char *zAddr){ | |
| 842 | - char *z = strchr(zAddr, '@'); | |
| 841 | +const char *alert_hostname(const char *zAddr){ | |
| 842 | + const char *z = strchr(zAddr, '@'); | |
| 843 | 843 | if( z ){ |
| 844 | 844 | z++; |
| 845 | 845 | }else{ |
| 846 | - z = (char*)zAddr; | |
| 846 | + z = zAddr; | |
| 847 | 847 | } |
| 848 | 848 | return z; |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | /* |
| 852 | 852 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -836,16 +836,16 @@ | |
| 836 | |
| 837 | /* |
| 838 | ** Return the hostname portion of an email address - the part following |
| 839 | ** the @ |
| 840 | */ |
| 841 | char *alert_hostname(const char *zAddr){ |
| 842 | char *z = strchr(zAddr, '@'); |
| 843 | if( z ){ |
| 844 | z++; |
| 845 | }else{ |
| 846 | z = (char*)zAddr; |
| 847 | } |
| 848 | return z; |
| 849 | } |
| 850 | |
| 851 | /* |
| 852 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -836,16 +836,16 @@ | |
| 836 | |
| 837 | /* |
| 838 | ** Return the hostname portion of an email address - the part following |
| 839 | ** the @ |
| 840 | */ |
| 841 | const char *alert_hostname(const char *zAddr){ |
| 842 | const char *z = strchr(zAddr, '@'); |
| 843 | if( z ){ |
| 844 | z++; |
| 845 | }else{ |
| 846 | z = zAddr; |
| 847 | } |
| 848 | return z; |
| 849 | } |
| 850 | |
| 851 | /* |
| 852 |
+1
-1
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | int i = builtin_file_index(zFilename); |
| 66 | 66 | if( i>=0 ){ |
| 67 | 67 | if( piSize ) *piSize = aBuiltinFiles[i].nByte; |
| 68 | 68 | return aBuiltinFiles[i].pData; |
| 69 | 69 | }else{ |
| 70 | - char *zV = strstr(zFilename, "-v"); | |
| 70 | + const char *zV = strstr(zFilename, "-v"); | |
| 71 | 71 | if( zV!=0 ){ |
| 72 | 72 | for(i=0; fossil_isdigit(zV[i+2]); i++){} |
| 73 | 73 | if( i>=8 && zV[i+2]=='.' ){ |
| 74 | 74 | char *zNew = mprintf("%.*s%s", (int)(zV-zFilename), zFilename, zV+i+2); |
| 75 | 75 | const unsigned char *pRes = builtin_file(zNew, piSize); |
| 76 | 76 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | int i = builtin_file_index(zFilename); |
| 66 | if( i>=0 ){ |
| 67 | if( piSize ) *piSize = aBuiltinFiles[i].nByte; |
| 68 | return aBuiltinFiles[i].pData; |
| 69 | }else{ |
| 70 | char *zV = strstr(zFilename, "-v"); |
| 71 | if( zV!=0 ){ |
| 72 | for(i=0; fossil_isdigit(zV[i+2]); i++){} |
| 73 | if( i>=8 && zV[i+2]=='.' ){ |
| 74 | char *zNew = mprintf("%.*s%s", (int)(zV-zFilename), zFilename, zV+i+2); |
| 75 | const unsigned char *pRes = builtin_file(zNew, piSize); |
| 76 |
| --- src/builtin.c | |
| +++ src/builtin.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | int i = builtin_file_index(zFilename); |
| 66 | if( i>=0 ){ |
| 67 | if( piSize ) *piSize = aBuiltinFiles[i].nByte; |
| 68 | return aBuiltinFiles[i].pData; |
| 69 | }else{ |
| 70 | const char *zV = strstr(zFilename, "-v"); |
| 71 | if( zV!=0 ){ |
| 72 | for(i=0; fossil_isdigit(zV[i+2]); i++){} |
| 73 | if( i>=8 && zV[i+2]=='.' ){ |
| 74 | char *zNew = mprintf("%.*s%s", (int)(zV-zFilename), zFilename, zV+i+2); |
| 75 | const unsigned char *pRes = builtin_file(zNew, piSize); |
| 76 |
+2
-2
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1390,11 +1390,11 @@ | ||
| 1390 | 1390 | ** |
| 1391 | 1391 | */ |
| 1392 | 1392 | void cgi_init(void){ |
| 1393 | 1393 | char *z; |
| 1394 | 1394 | const char *zType; |
| 1395 | - char *zSemi; | |
| 1395 | + const char *zSemi; | |
| 1396 | 1396 | int len; |
| 1397 | 1397 | const char *zRequestUri = cgi_parameter("REQUEST_URI",0); |
| 1398 | 1398 | const char *zScriptName = cgi_parameter("SCRIPT_NAME",0); |
| 1399 | 1399 | const char *zPathInfo = cgi_parameter("PATH_INFO",0); |
| 1400 | 1400 | const char *zContentLength = 0; |
| @@ -1412,11 +1412,11 @@ | ||
| 1412 | 1412 | ** to compute it from REQUEST_URI and PATH_INFO. */ |
| 1413 | 1413 | if( zScriptName==0 ){ |
| 1414 | 1414 | if( zRequestUri==0 || zPathInfo==0 ){ |
| 1415 | 1415 | malformed_request("missing SCRIPT_NAME"); /* Does not return */ |
| 1416 | 1416 | } |
| 1417 | - z = strstr(zRequestUri,zPathInfo); | |
| 1417 | + z = (char*)strstr(zRequestUri,zPathInfo); | |
| 1418 | 1418 | if( z==0 ){ |
| 1419 | 1419 | malformed_request("PATH_INFO not found in REQUEST_URI"); |
| 1420 | 1420 | } |
| 1421 | 1421 | zScriptName = fossil_strndup(zRequestUri,(int)(z-zRequestUri)); |
| 1422 | 1422 | cgi_set_parameter("SCRIPT_NAME", zScriptName); |
| 1423 | 1423 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1390,11 +1390,11 @@ | |
| 1390 | ** |
| 1391 | */ |
| 1392 | void cgi_init(void){ |
| 1393 | char *z; |
| 1394 | const char *zType; |
| 1395 | char *zSemi; |
| 1396 | int len; |
| 1397 | const char *zRequestUri = cgi_parameter("REQUEST_URI",0); |
| 1398 | const char *zScriptName = cgi_parameter("SCRIPT_NAME",0); |
| 1399 | const char *zPathInfo = cgi_parameter("PATH_INFO",0); |
| 1400 | const char *zContentLength = 0; |
| @@ -1412,11 +1412,11 @@ | |
| 1412 | ** to compute it from REQUEST_URI and PATH_INFO. */ |
| 1413 | if( zScriptName==0 ){ |
| 1414 | if( zRequestUri==0 || zPathInfo==0 ){ |
| 1415 | malformed_request("missing SCRIPT_NAME"); /* Does not return */ |
| 1416 | } |
| 1417 | z = strstr(zRequestUri,zPathInfo); |
| 1418 | if( z==0 ){ |
| 1419 | malformed_request("PATH_INFO not found in REQUEST_URI"); |
| 1420 | } |
| 1421 | zScriptName = fossil_strndup(zRequestUri,(int)(z-zRequestUri)); |
| 1422 | cgi_set_parameter("SCRIPT_NAME", zScriptName); |
| 1423 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1390,11 +1390,11 @@ | |
| 1390 | ** |
| 1391 | */ |
| 1392 | void cgi_init(void){ |
| 1393 | char *z; |
| 1394 | const char *zType; |
| 1395 | const char *zSemi; |
| 1396 | int len; |
| 1397 | const char *zRequestUri = cgi_parameter("REQUEST_URI",0); |
| 1398 | const char *zScriptName = cgi_parameter("SCRIPT_NAME",0); |
| 1399 | const char *zPathInfo = cgi_parameter("PATH_INFO",0); |
| 1400 | const char *zContentLength = 0; |
| @@ -1412,11 +1412,11 @@ | |
| 1412 | ** to compute it from REQUEST_URI and PATH_INFO. */ |
| 1413 | if( zScriptName==0 ){ |
| 1414 | if( zRequestUri==0 || zPathInfo==0 ){ |
| 1415 | malformed_request("missing SCRIPT_NAME"); /* Does not return */ |
| 1416 | } |
| 1417 | z = (char*)strstr(zRequestUri,zPathInfo); |
| 1418 | if( z==0 ){ |
| 1419 | malformed_request("PATH_INFO not found in REQUEST_URI"); |
| 1420 | } |
| 1421 | zScriptName = fossil_strndup(zRequestUri,(int)(z-zRequestUri)); |
| 1422 | cgi_set_parameter("SCRIPT_NAME", zScriptName); |
| 1423 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -4534,11 +4534,11 @@ | ||
| 4534 | 4534 | if( strchr(zVal,'\n')==0 ){ |
| 4535 | 4535 | fossil_print("%-24s %-11s %s\n", pSetting->name, zName, zVal); |
| 4536 | 4536 | }else{ |
| 4537 | 4537 | fossil_print("%-24s %-11s\n", pSetting->name, zName); |
| 4538 | 4538 | while( zVal[0] ){ |
| 4539 | - char *zNL = strchr(zVal, '\n'); | |
| 4539 | + const char *zNL = strchr(zVal, '\n'); | |
| 4540 | 4540 | if( zNL==0 ){ |
| 4541 | 4541 | fossil_print(" %s\n", zVal); |
| 4542 | 4542 | break; |
| 4543 | 4543 | }else{ |
| 4544 | 4544 | int n = (int)(zNL - zVal); |
| 4545 | 4545 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4534,11 +4534,11 @@ | |
| 4534 | if( strchr(zVal,'\n')==0 ){ |
| 4535 | fossil_print("%-24s %-11s %s\n", pSetting->name, zName, zVal); |
| 4536 | }else{ |
| 4537 | fossil_print("%-24s %-11s\n", pSetting->name, zName); |
| 4538 | while( zVal[0] ){ |
| 4539 | char *zNL = strchr(zVal, '\n'); |
| 4540 | if( zNL==0 ){ |
| 4541 | fossil_print(" %s\n", zVal); |
| 4542 | break; |
| 4543 | }else{ |
| 4544 | int n = (int)(zNL - zVal); |
| 4545 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4534,11 +4534,11 @@ | |
| 4534 | if( strchr(zVal,'\n')==0 ){ |
| 4535 | fossil_print("%-24s %-11s %s\n", pSetting->name, zName, zVal); |
| 4536 | }else{ |
| 4537 | fossil_print("%-24s %-11s\n", pSetting->name, zName); |
| 4538 | while( zVal[0] ){ |
| 4539 | const char *zNL = strchr(zVal, '\n'); |
| 4540 | if( zNL==0 ){ |
| 4541 | fossil_print(" %s\n", zVal); |
| 4542 | break; |
| 4543 | }else{ |
| 4544 | int n = (int)(zNL - zVal); |
| 4545 |
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -344,11 +344,11 @@ | ||
| 344 | 344 | double rounder; /* Used for rounding floating point values */ |
| 345 | 345 | etByte flag_dp; /* True if decimal point should be shown */ |
| 346 | 346 | etByte flag_rtz; /* True if trailing zeros should be removed */ |
| 347 | 347 | etByte flag_exp; /* True to force display of the exponent */ |
| 348 | 348 | int nsd; /* Number of significant digits returned */ |
| 349 | - char *zFmtLookup; | |
| 349 | + const char *zFmtLookup; | |
| 350 | 350 | |
| 351 | 351 | count = length = 0; |
| 352 | 352 | bufpt = 0; |
| 353 | 353 | for(; (c=(*fmt))!=0; ++fmt){ |
| 354 | 354 | if( c!='%' ){ |
| 355 | 355 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -344,11 +344,11 @@ | |
| 344 | double rounder; /* Used for rounding floating point values */ |
| 345 | etByte flag_dp; /* True if decimal point should be shown */ |
| 346 | etByte flag_rtz; /* True if trailing zeros should be removed */ |
| 347 | etByte flag_exp; /* True to force display of the exponent */ |
| 348 | int nsd; /* Number of significant digits returned */ |
| 349 | char *zFmtLookup; |
| 350 | |
| 351 | count = length = 0; |
| 352 | bufpt = 0; |
| 353 | for(; (c=(*fmt))!=0; ++fmt){ |
| 354 | if( c!='%' ){ |
| 355 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -344,11 +344,11 @@ | |
| 344 | double rounder; /* Used for rounding floating point values */ |
| 345 | etByte flag_dp; /* True if decimal point should be shown */ |
| 346 | etByte flag_rtz; /* True if trailing zeros should be removed */ |
| 347 | etByte flag_exp; /* True to force display of the exponent */ |
| 348 | int nsd; /* Number of significant digits returned */ |
| 349 | const char *zFmtLookup; |
| 350 | |
| 351 | count = length = 0; |
| 352 | bufpt = 0; |
| 353 | for(; (c=(*fmt))!=0; ++fmt){ |
| 354 | if( c!='%' ){ |
| 355 |
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -629,11 +629,11 @@ | ||
| 629 | 629 | zFormat = db_get("default-csp",0); |
| 630 | 630 | if( zFormat==0 || zFormat[0]==0 ){ |
| 631 | 631 | zFormat = zBackupCSP; |
| 632 | 632 | } |
| 633 | 633 | blob_init(&csp, 0, 0); |
| 634 | - while( zFormat[0] && (zNonce = strstr(zFormat,"$nonce"))!=0 ){ | |
| 634 | + while( zFormat[0] && (zNonce = (char*)strstr(zFormat,"$nonce"))!=0 ){ | |
| 635 | 635 | blob_append(&csp, zFormat, (int)(zNonce - zFormat)); |
| 636 | 636 | blob_append(&csp, style_nonce(), -1); |
| 637 | 637 | zFormat = zNonce + 6; |
| 638 | 638 | } |
| 639 | 639 | blob_append(&csp, zFormat, -1); |
| 640 | 640 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -629,11 +629,11 @@ | |
| 629 | zFormat = db_get("default-csp",0); |
| 630 | if( zFormat==0 || zFormat[0]==0 ){ |
| 631 | zFormat = zBackupCSP; |
| 632 | } |
| 633 | blob_init(&csp, 0, 0); |
| 634 | while( zFormat[0] && (zNonce = strstr(zFormat,"$nonce"))!=0 ){ |
| 635 | blob_append(&csp, zFormat, (int)(zNonce - zFormat)); |
| 636 | blob_append(&csp, style_nonce(), -1); |
| 637 | zFormat = zNonce + 6; |
| 638 | } |
| 639 | blob_append(&csp, zFormat, -1); |
| 640 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -629,11 +629,11 @@ | |
| 629 | zFormat = db_get("default-csp",0); |
| 630 | if( zFormat==0 || zFormat[0]==0 ){ |
| 631 | zFormat = zBackupCSP; |
| 632 | } |
| 633 | blob_init(&csp, 0, 0); |
| 634 | while( zFormat[0] && (zNonce = (char*)strstr(zFormat,"$nonce"))!=0 ){ |
| 635 | blob_append(&csp, zFormat, (int)(zNonce - zFormat)); |
| 636 | blob_append(&csp, style_nonce(), -1); |
| 637 | zFormat = zNonce + 6; |
| 638 | } |
| 639 | blob_append(&csp, zFormat, -1); |
| 640 |