01eaae6724
git-svn-id: svn://kolibrios.org@7626 a494cfbc-eb01-0410-851d-a64ba20cac60
42 lines
817 B
C++
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);
|
|
|
|
}
|
|
|
|
}
|
|
|