kolibrios/programs/develop/cmm/new_type.cpp
Kirill Lipatov (Leency) 7984195956 upload fixed verion by paulcodeman
git-svn-id: svn://kolibrios.org@7700 a494cfbc-eb01-0410-851d-a64ba20cac60
2019-11-14 18:45:31 +00:00

42 lines
795 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++;
}
if(tok!=tk_closebracket)expected(')');
else getoperand(reg);
}
}