Skip to content

Commit 518a292

Browse files
committed
Move constants to enum from static final byte FOO.
1 parent 0e2ce95 commit 518a292

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/NativeCallInstance.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,31 @@
55
import org.perl6.nqp.sixmodel.SixModelObject;
66

77
public class NativeCallInstance extends SixModelObject {
8-
/* Constants. Might be more idiomatic Java to move these to an enum. */
9-
public static final byte ARG_VOID = 0;
10-
public static final byte ARG_CHAR = 2;
11-
public static final byte ARG_SHORT = 4;
12-
public static final byte ARG_INT = 6;
13-
public static final byte ARG_LONG = 8;
14-
public static final byte ARG_LONGLONG = 10;
15-
public static final byte ARG_FLOAT = 12;
16-
public static final byte ARG_DOUBLE = 14;
17-
public static final byte ARG_ASCIISTR = 16;
18-
public static final byte ARG_UTF8STR = 18;
19-
public static final byte ARG_UTF16STR = 20;
20-
public static final byte ARG_CSTRUCT = 22;
21-
public static final byte ARG_CARRAY = 24;
22-
public static final byte ARG_CALLBACK = 26;
23-
public static final byte ARG_CPOINTER = 28;
24-
public static final byte ARG_TYPE_MASK = 30;
25-
268
/* Flag for whether we should free a string after passing it or not. These
279
* are going away once the array handling is refactored.*/
2810
public static final byte ARG_NO_FREE_STR = 0;
2911
public static final byte ARG_FREE_STR = 1;
3012
public static final byte ARG_FREE_STR_MASK = 1;
3113

3214
public Function entry_point;
15+
public ArgType[] arg_types;
16+
public ArgType ret_type;
17+
18+
public enum ArgType {
19+
VOID,
20+
CHAR,
21+
SHORT,
22+
INT,
23+
LONG,
24+
LONGLONG,
25+
FLOAT,
26+
DOUBLE,
27+
ASCIISTR,
28+
UTF8STR,
29+
UTF16STR,
30+
CSTRUCT,
31+
CARRAY,
32+
CALLBACK,
33+
CPOINTER;
34+
}
3335
}

0 commit comments

Comments
 (0)