kolibrios/programs/develop/cmm/new_type.cpp
siemargl 01eaae6724 c-- cppchecked
git-svn-id: svn://kolibrios.org@7626 a494cfbc-eb01-0410-851d-a64ba20cac60
2019-04-11 07:12:30 +00:00

42 lines
817 B
C++

#define _NEW_TYPE_
#include "tok.h"
void convert_type(int *sign,int *rettype,int *pointr,int reg)
{
int usebracket=FALSE;
if(tok==tk_openbracket&&(tok2>=tk_char&&tok2<=tk_double)){
nexttok();
usebracket=TRUE;
}
switch ( tok ){
case tk_byte:
case tk_word:
case tk_dword:
case tk_float:
case tk_double:
case tk_qword:
*sign=0;
*rettype=tok;
if(usebracket)nexttok();
else getoperand(reg);
break;
case tk_char:
case tk_int:
case tk_long:
*sign=1;
*rettype=tok;
if(usebracket)nexttok();
else getoperand(reg);
break;
}
if(usebracket){
while(tok==tk_mult){
nexttok();
(*pointr)++; // fix by cppcheck
}
if(tok!=tk_closebracket)expected(')');
else getoperand(reg);
}
}