You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
To be able to compile with -Wwrite-strings, a few obvious ones are needed:
@@ -5034,7+5040,7 @@
{
SyBlob*pWorker=&pVm->sWorker;
SyString*pFile;
-char*zErr;
+constchar*zErr;
sxi32rc;
if( !pVm->bErrReport ){
/* Don't bother reporting errors */
@@ -5083,7+5089,7 @@
{
SyBlob*pWorker=&pVm->sWorker;
SyString*pFile;
-char*zErr;
+constchar*zErr;
sxi32rc;
if( !pVm->bErrReport ){
/* Don't bother reporting errors */
@@ -22083,7+22092,7 @@
constph7_io_stream*pStream;
structcsv_datasCsv;
io_private*pDev;
-char*zEol;
+constchar*zEol;
inteolen;
if( nArg<2|| !ph7_value_is_resource(apArg[0]) || !ph7_value_is_array(apArg[1]) ){
/* Missing/Invalid arguments,return FALSE */
@@ -22083,7+22092,7 @@
constph7_io_stream*pStream;
structcsv_datasCsv;
io_private*pDev;
-char*zEol;
+constchar*zEol;
inteolen;
if( nArg<2|| !ph7_value_is_resource(apArg[0]) || !ph7_value_is_array(apArg[1]) ){
/* Missing/Invalid arguments,return FALSE */
@@ -32603,8+32618,8 @@
sxu8base; /* The base for radix conversion */intflags; /* One or more of SXFLAG_ constants below */sxu8type; /* Conversion paradigm */-char*charset; /* The character set for conversion */-char*prefix; /* Prefix on non-zero values in alt format */+constchar*charset; /* The character set for conversion */+constchar*prefix; /* Prefix on non-zero values in alt format */
};
typedefstructSyFmtConsumerSyFmtConsumer;
structSyFmtConsumer
@@ -32868,7+32883,7 @@
}
bufpt=&buf[SXFMT_BUFSIZ-1];
{
-registerchar*cset; /* Use registers for speed */+registerconstchar*cset; /* Use registers for speed */
register intbase;
cset=infop->charset;
base=infop->base;
@@ -32883,7+32898,8 @@
}
if( prefix ) *(--bufpt) =prefix; /* Add sign */if( flag_alternateform&&infop->prefix ){ /* Add "0" or "0x" */-char*pre, x;
+constchar*pre;
+charx;
pre=infop->prefix;
if( *bufpt!=pre[0] ){
for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) =x;
@@ -54996,8+55012,8 @@
sxu8base; /* The base for radix conversion */intflags; /* One or more of PH7_FMT_FLAG_ constants below */sxu8type; /* Conversion paradigm */-char*charset; /* The character set for conversion */-char*prefix; /* Prefix on non-zero values in alt format */+constchar*charset; /* The character set for conversion */+constchar*prefix; /* Prefix on non-zero values in alt format */
};
#ifndefPH7_OMIT_FLOATING_POINT/*@@ -55301,7 +55318,7 @@ } zBuf = &zWorker[PH7_FMT_BUFSIZ-1]; {- register char *cset; /* Use registers for speed */+registerconstchar*cset; /* Use registers for speed */
register intbase;
cset=pInfo->charset;
base=pInfo->base;
@@ -55316,7+55333,8 @@
}
if( prefix ) *(--zBuf) = (char)prefix; /* Add sign */if( flag_alternateform&&pInfo->prefix ){ /* Add "0" or "0x" */-char*pre, x;
+constchar*pre;
+charx;
pre=pInfo->prefix;
if( *zBuf!=pre[0] ){
for(pre=pInfo->prefix; (x=(*pre))!=0; pre++) *(--zBuf) =x;
There were a couple of more complicated places, which ideally should be handled by having a separate "char_" and a "const char_". Many of these are quite similar, so perhaps they can be refactored into something common? For now, this also works to get the compiler to shut up:
In Solaris, MAP_FILE doesn't exist, so I added this:
The function flock() doesn't seem to exist there. The best solution would be to use some other mechanism, but for now I simply disabled it:
Gcc doesn't like large constants without a suffix:
These are related to the previous, to avoid duplication:
To be able to compile with -Wwrite-strings, a few obvious ones are needed:
There were a couple of more complicated places, which ideally should be handled by having a separate "char_" and a "const char_". Many of these are quite similar, so perhaps they can be refactored into something common? For now, this also works to get the compiler to shut up:
Also, sizeof() is unsigned, while ph7_int64 is signed, so these two are needed (the second one is nicer, I think):
The text was updated successfully, but these errors were encountered: