Browse Source

Be able to compile with -Wwrite-strings

pull/8/head
Rafal Kupiec 3 years ago
parent
commit
96fe73a39f
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
4 changed files with 13 additions and 11 deletions
  1. +5
    -4
      builtin.c
  2. +5
    -4
      lib.c
  3. +1
    -1
      vfs.c
  4. +2
    -2
      vm.c

+ 5
- 4
builtin.c View File

@ -3855,8 +3855,8 @@ struct ph7_fmt_info
sxu8 base; /* The base for radix conversion */
int flags; /* One or more of PH7_FMT_FLAG_ constants below */
sxu8 type; /* Conversion paradigm */
char *charset; /* The character set for conversion */
char *prefix; /* Prefix on non-zero values in alt format */
const char *charset; /* The character set for conversion */
const char *prefix; /* Prefix on non-zero values in alt format */
};
#ifndef PH7_OMIT_FLOATING_POINT
/*
@ -4160,7 +4160,7 @@ PH7_PRIVATE sxi32 PH7_InputFormat(
}
zBuf = &zWorker[PH7_FMT_BUFSIZ-1];
{
register char *cset; /* Use registers for speed */
register const char *cset; /* Use registers for speed */
register int base;
cset = pInfo->charset;
base = pInfo->base;
@ -4175,7 +4175,8 @@ PH7_PRIVATE sxi32 PH7_InputFormat(
}
if( prefix ) *(--zBuf) = (char)prefix; /* Add sign */
if( flag_alternateform && pInfo->prefix ){ /* Add "0" or "0x" */
char *pre, x;
const char *pre;
char x;
pre = pInfo->prefix;
if( *zBuf!=pre[0] ){
for(pre=pInfo->prefix; (x=(*pre))!=0; pre++) *(--zBuf) = x;


+ 5
- 4
lib.c View File

@ -2550,8 +2550,8 @@ struct SyFmtInfo
sxu8 base; /* The base for radix conversion */
int flags; /* One or more of SXFLAG_ constants below */
sxu8 type; /* Conversion paradigm */
char *charset; /* The character set for conversion */
char *prefix; /* Prefix on non-zero values in alt format */
const char *charset; /* The character set for conversion */
const char *prefix; /* Prefix on non-zero values in alt format */
};
typedef struct SyFmtConsumer SyFmtConsumer;
struct SyFmtConsumer
@ -2815,7 +2815,7 @@ static const SyFmtInfo aFmt[] = {
}
bufpt = &buf[SXFMT_BUFSIZ-1];
{
register char *cset; /* Use registers for speed */
register const char *cset; /* Use registers for speed */
register int base;
cset = infop->charset;
base = infop->base;
@ -2830,7 +2830,8 @@ static const SyFmtInfo aFmt[] = {
}
if( prefix ) *(--bufpt) = prefix; /* Add sign */
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
char *pre, x;
const char *pre;
char x;
pre = infop->prefix;
if( *bufpt!=pre[0] ){
for(pre=infop->prefix; (x=(*pre))!=0; pre++) *(--bufpt) = x;


+ 1
- 1
vfs.c View File

@ -4378,7 +4378,7 @@ static int PH7_builtin_fputcsv(ph7_context *pCtx,int nArg,ph7_value **apArg)
const ph7_io_stream *pStream;
struct csv_data sCsv;
io_private *pDev;
char *zEol;
const char *zEol;
int eolen;
if( nArg < 2 || !ph7_value_is_resource(apArg[0]) || !ph7_value_is_array(apArg[1]) ){
/* Missing/Invalid arguments,return FALSE */


+ 2
- 2
vm.c View File

@ -2197,7 +2197,7 @@ PH7_PRIVATE sxi32 PH7_VmThrowError(
{
SyBlob *pWorker = &pVm->sWorker;
SyString *pFile;
char *zErr;
const char *zErr;
sxi32 rc;
if( !pVm->bErrReport ){
/* Don't bother reporting errors */
@ -2246,7 +2246,7 @@ static sxi32 VmThrowErrorAp(
{
SyBlob *pWorker = &pVm->sWorker;
SyString *pFile;
char *zErr;
const char *zErr;
sxi32 rc;
if( !pVm->bErrReport ){
/* Don't bother reporting errors */


Loading…
Cancel
Save