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 t__EMIT: {
|
||||
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('{')) {
|
||||
lexpush();
|
||||
emit_flags |= efBLOCK;
|
||||
|
@ -554,7 +554,7 @@ static void stripcom(unsigned char *line)
|
||||
} /* if */
|
||||
} /* if */
|
||||
if (*line == '\a') {
|
||||
memmove(line,line+1,strlen(line+1)+1);
|
||||
memmove(line,line+1,strlen((char *)line+1)+1);
|
||||
}
|
||||
} /* while */
|
||||
#if !defined SC_LIGHT
|
||||
@ -1128,7 +1128,7 @@ static int command(void)
|
||||
lptr++;
|
||||
pc_deprecate=(char*)malloc(strlen((char*)lptr)+1);
|
||||
if (pc_deprecate!=NULL) {
|
||||
strcpy(pc_deprecate,lptr);
|
||||
strcpy(pc_deprecate,(const char *)lptr);
|
||||
pc_deprecate[strcspn(pc_deprecate,"\r\n")]='\0';
|
||||
} /* if */
|
||||
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')
|
||||
lptr++;
|
||||
if (!SKIPPING) {
|
||||
char *usermsg=(char*)malloc(strlen(lptr)+1);
|
||||
char *usermsg=(char*)malloc(strlen((const char *)lptr)+1);
|
||||
if(usermsg!=NULL) {
|
||||
strcpy(usermsg,lptr);
|
||||
strcpy(usermsg,(const char *)lptr);
|
||||
usermsg[strcspn(usermsg,"\r\n")]='\0';
|
||||
error(237,usermsg); /* user warning */
|
||||
free(usermsg);
|
||||
@ -1840,12 +1840,12 @@ static void substallpatterns(unsigned char *line,int buffersize)
|
||||
} /* 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) {
|
||||
if (is_startstring(c))
|
||||
c=skipstring(c);
|
||||
c=(unsigned char *)skipstring(c);
|
||||
if (*c=='#' && *(c+1)=='#') {
|
||||
p=c-1;
|
||||
b=c+2;
|
||||
@ -1853,7 +1853,7 @@ static void ppconcat(const char *line)
|
||||
p--;
|
||||
while (*b==' ')
|
||||
b++;
|
||||
strcpy((char*)p+1,b);
|
||||
strcpy((char *)p+1,(char *)b);
|
||||
} /* if */
|
||||
} /* for */
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ static int skim(int *opstr,void (*testfunc)(int),int dropval,int endval,
|
||||
|
||||
foundop=nextop(&opidx,opstr);
|
||||
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 (!hits) {
|
||||
/* this is the first operator in the list */
|
||||
|
@ -1074,7 +1074,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
||||
instr=skipwhitespace(line);
|
||||
/* ignore empty lines and labels (labels have a special syntax, so these
|
||||
* must be parsed separately) */
|
||||
if (*instr=='\0' || (tolower(*instr)=='l') && *(instr+1)=='.')
|
||||
if (*instr=='\0' || (tolower(*instr)=='l' && *(instr+1)=='.'))
|
||||
continue;
|
||||
/* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user