Subversion Repositories Kolibri OS

Rev

Rev 6446 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #define _NEW_TYPE_
  2.  
  3.  
  4.  
  5. #include "tok.h"
  6.  
  7.  
  8.  
  9. void convert_type(int *sign,int *rettype,int *pointr,int reg)
  10.  
  11. {
  12.  
  13. int usebracket=FALSE;
  14.  
  15.         if(tok==tk_openbracket&&(tok2>=tk_char&&tok2<=tk_double)){
  16.  
  17.                 nexttok();
  18.  
  19.                 usebracket=TRUE;
  20.  
  21.         }
  22.  
  23.         switch ( tok ){
  24.  
  25.                 case tk_byte:
  26.  
  27.                 case tk_word:
  28.  
  29.                 case tk_dword:
  30.  
  31.                 case tk_float:
  32.  
  33.                 case tk_double:
  34.  
  35.                 case tk_qword:
  36.  
  37.                         *sign=0;
  38.  
  39.                         *rettype=tok;
  40.  
  41.                         if(usebracket)nexttok();
  42.  
  43.                         else getoperand(reg);
  44.  
  45.                         break;
  46.  
  47.                 case tk_char:
  48.  
  49.                 case tk_int:
  50.  
  51.                 case tk_long:
  52.  
  53.                         *sign=1;
  54.  
  55.                         *rettype=tok;
  56.  
  57.                         if(usebracket)nexttok();
  58.  
  59.                         else getoperand(reg);
  60.  
  61.                         break;
  62.  
  63.         }
  64.  
  65.         if(usebracket){
  66.  
  67.                 while(tok==tk_mult){
  68.  
  69.                         nexttok();
  70.  
  71.                         (*pointr)++;  // fix by cppcheck
  72.  
  73.                 }
  74.  
  75.                 if(tok!=tk_closebracket)expected(')');
  76.  
  77.                 else getoperand(reg);
  78.  
  79.         }
  80.  
  81. }
  82.  
  83.