-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnew_type.cpp
More file actions
46 lines (44 loc) · 825 Bytes
/
new_type.cpp
File metadata and controls
46 lines (44 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#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);
}
}