Fix compile warnings in pawnc
This commit is contained in:
parent
2c7659c65d
commit
11199da210
@ -5234,7 +5234,7 @@ static void statement(int *lastindent,int allow_decl)
|
|||||||
case tEMIT:
|
case tEMIT:
|
||||||
case t__EMIT: {
|
case t__EMIT: {
|
||||||
extern char *sc_tokens[];
|
extern char *sc_tokens[];
|
||||||
const char *bck_lptr=lptr-strlen(sc_tokens[tok-tFIRST]);
|
const unsigned char *bck_lptr=lptr-strlen(sc_tokens[tok-tFIRST]);
|
||||||
if (matchtoken('{')) {
|
if (matchtoken('{')) {
|
||||||
lexpush();
|
lexpush();
|
||||||
emit_flags |= efBLOCK;
|
emit_flags |= efBLOCK;
|
||||||
|
@ -554,7 +554,7 @@ static void stripcom(unsigned char *line)
|
|||||||
} /* if */
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
if (*line == '\a') {
|
if (*line == '\a') {
|
||||||
memmove(line,line+1,strlen(line+1)+1);
|
memmove(line,line+1,strlen((char *)line+1)+1);
|
||||||
}
|
}
|
||||||
} /* while */
|
} /* while */
|
||||||
#if !defined SC_LIGHT
|
#if !defined SC_LIGHT
|
||||||
@ -1128,7 +1128,7 @@ static int command(void)
|
|||||||
lptr++;
|
lptr++;
|
||||||
pc_deprecate=(char*)malloc(strlen((char*)lptr)+1);
|
pc_deprecate=(char*)malloc(strlen((char*)lptr)+1);
|
||||||
if (pc_deprecate!=NULL) {
|
if (pc_deprecate!=NULL) {
|
||||||
strcpy(pc_deprecate,lptr);
|
strcpy(pc_deprecate,(const char *)lptr);
|
||||||
pc_deprecate[strcspn(pc_deprecate,"\r\n")]='\0';
|
pc_deprecate[strcspn(pc_deprecate,"\r\n")]='\0';
|
||||||
} /* if */
|
} /* if */
|
||||||
lptr=(unsigned char*)strchr((char*)lptr,'\0'); /* skip to end (ignore "extra characters on line") */
|
lptr=(unsigned char*)strchr((char*)lptr,'\0'); /* skip to end (ignore "extra characters on line") */
|
||||||
@ -1509,9 +1509,9 @@ static int command(void)
|
|||||||
while (*lptr<=' ' && *lptr!='\0')
|
while (*lptr<=' ' && *lptr!='\0')
|
||||||
lptr++;
|
lptr++;
|
||||||
if (!SKIPPING) {
|
if (!SKIPPING) {
|
||||||
char *usermsg=(char*)malloc(strlen(lptr)+1);
|
char *usermsg=(char*)malloc(strlen((const char *)lptr)+1);
|
||||||
if(usermsg!=NULL) {
|
if(usermsg!=NULL) {
|
||||||
strcpy(usermsg,lptr);
|
strcpy(usermsg,(const char *)lptr);
|
||||||
usermsg[strcspn(usermsg,"\r\n")]='\0';
|
usermsg[strcspn(usermsg,"\r\n")]='\0';
|
||||||
error(237,usermsg); /* user warning */
|
error(237,usermsg); /* user warning */
|
||||||
free(usermsg);
|
free(usermsg);
|
||||||
@ -1840,12 +1840,12 @@ static void substallpatterns(unsigned char *line,int buffersize)
|
|||||||
} /* while */
|
} /* while */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ppconcat(const char *line)
|
static void ppconcat(unsigned char *line)
|
||||||
{
|
{
|
||||||
const char *c,*p,*b;
|
unsigned char *c,*p,*b;
|
||||||
for (c=line; *c!='\0'; ++c) {
|
for (c=line; *c!='\0'; ++c) {
|
||||||
if (is_startstring(c))
|
if (is_startstring(c))
|
||||||
c=skipstring(c);
|
c=(unsigned char *)skipstring(c);
|
||||||
if (*c=='#' && *(c+1)=='#') {
|
if (*c=='#' && *(c+1)=='#') {
|
||||||
p=c-1;
|
p=c-1;
|
||||||
b=c+2;
|
b=c+2;
|
||||||
@ -1853,7 +1853,7 @@ static void ppconcat(const char *line)
|
|||||||
p--;
|
p--;
|
||||||
while (*b==' ')
|
while (*b==' ')
|
||||||
b++;
|
b++;
|
||||||
strcpy((char*)p+1,b);
|
strcpy((char *)p+1,(char *)b);
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* for */
|
} /* for */
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ static int skim(int *opstr,void (*testfunc)(int),int dropval,int endval,
|
|||||||
|
|
||||||
foundop=nextop(&opidx,opstr);
|
foundop=nextop(&opidx,opstr);
|
||||||
if ((foundop || hits) && (lval->ident==iARRAY || lval->ident==iREFARRAY))
|
if ((foundop || hits) && (lval->ident==iARRAY || lval->ident==iREFARRAY))
|
||||||
error(33, lval->sym ? (lval->sym->name ? lval->sym->name : "-unknown") : "-unknown-"); /* array was not indexed in an expression */
|
error(33, lval->sym ? lval->sym->name : "-unknown-"); /* array was not indexed in an expression */
|
||||||
if (foundop) {
|
if (foundop) {
|
||||||
if (!hits) {
|
if (!hits) {
|
||||||
/* this is the first operator in the list */
|
/* this is the first operator in the list */
|
||||||
|
@ -1074,7 +1074,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
instr=skipwhitespace(line);
|
instr=skipwhitespace(line);
|
||||||
/* ignore empty lines and labels (labels have a special syntax, so these
|
/* ignore empty lines and labels (labels have a special syntax, so these
|
||||||
* must be parsed separately) */
|
* must be parsed separately) */
|
||||||
if (*instr=='\0' || (tolower(*instr)=='l') && *(instr+1)=='.')
|
if (*instr=='\0' || (tolower(*instr)=='l' && *(instr+1)=='.'))
|
||||||
continue;
|
continue;
|
||||||
/* get to the end of the instruction (make use of the '\n' that fgets()
|
/* get to the end of the instruction (make use of the '\n' that fgets()
|
||||||
* added at the end of the line; this way we will *always* drop on a
|
* added at the end of the line; this way we will *always* drop on a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user