Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move constants to enum from static final byte FOO.
  • Loading branch information
arnsholt committed Sep 9, 2013
1 parent 0e2ce95 commit 518a292
Showing 1 changed file with 20 additions and 18 deletions.
Expand Up @@ -5,29 +5,31 @@
import org.perl6.nqp.sixmodel.SixModelObject;

public class NativeCallInstance extends SixModelObject {
/* Constants. Might be more idiomatic Java to move these to an enum. */
public static final byte ARG_VOID = 0;
public static final byte ARG_CHAR = 2;
public static final byte ARG_SHORT = 4;
public static final byte ARG_INT = 6;
public static final byte ARG_LONG = 8;
public static final byte ARG_LONGLONG = 10;
public static final byte ARG_FLOAT = 12;
public static final byte ARG_DOUBLE = 14;
public static final byte ARG_ASCIISTR = 16;
public static final byte ARG_UTF8STR = 18;
public static final byte ARG_UTF16STR = 20;
public static final byte ARG_CSTRUCT = 22;
public static final byte ARG_CARRAY = 24;
public static final byte ARG_CALLBACK = 26;
public static final byte ARG_CPOINTER = 28;
public static final byte ARG_TYPE_MASK = 30;

/* Flag for whether we should free a string after passing it or not. These
* are going away once the array handling is refactored.*/
public static final byte ARG_NO_FREE_STR = 0;
public static final byte ARG_FREE_STR = 1;
public static final byte ARG_FREE_STR_MASK = 1;

public Function entry_point;
public ArgType[] arg_types;
public ArgType ret_type;

public enum ArgType {
VOID,
CHAR,
SHORT,
INT,
LONG,
LONGLONG,
FLOAT,
DOUBLE,
ASCIISTR,
UTF8STR,
UTF16STR,
CSTRUCT,
CARRAY,
CALLBACK,
CPOINTER;
}
}

0 comments on commit 518a292

Please sign in to comment.