Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move ArgType from NativeCallBody to NativeCall.
  • Loading branch information
arnsholt committed Jan 14, 2014
1 parent 6d42937 commit d70f835
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
Expand Up @@ -12,9 +12,9 @@
import org.perl6.nqp.sixmodel.reprs.CArrayInstance;
import org.perl6.nqp.sixmodel.reprs.CPointerInstance;
import org.perl6.nqp.sixmodel.reprs.CStrInstance;
import org.perl6.nqp.sixmodel.reprs.NativeCall.ArgType;
import org.perl6.nqp.sixmodel.reprs.NativeCallInstance;
import org.perl6.nqp.sixmodel.reprs.NativeCallBody;
import org.perl6.nqp.sixmodel.reprs.NativeCallBody.ArgType;

public final class NativeCallOps {
public static long init() {
Expand Down
Expand Up @@ -14,7 +14,7 @@
import org.perl6.nqp.sixmodel.SixModelObject;

import org.perl6.nqp.sixmodel.reprs.CArrayREPRData.ElemKind;
import org.perl6.nqp.sixmodel.reprs.NativeCallBody.ArgType;
import org.perl6.nqp.sixmodel.reprs.NativeCall.ArgType;

public class CArrayInstance extends SixModelObject {
public Pointer storage;
Expand Down
19 changes: 19 additions & 0 deletions src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/NativeCall.java
Expand Up @@ -16,6 +16,25 @@


public class NativeCall extends REPR {
/* The available native call argument types. */
public enum ArgType {
VOID,
CHAR,
SHORT,
INT,
LONG,
LONGLONG,
FLOAT,
DOUBLE,
ASCIISTR,
UTF8STR,
UTF16STR,
CSTRUCT,
CARRAY,
CALLBACK,
CPOINTER;
}

public SixModelObject type_object_for(ThreadContext tc, SixModelObject HOW) {
STable st = new STable(this, HOW);
st.REPRData = null; /* No REPR data needed. */
Expand Down
Expand Up @@ -2,6 +2,8 @@

import com.sun.jna.Function;

import org.perl6.nqp.sixmodel.reprs.NativeCall.ArgType;

/* Holds a description of a native call site. */
public class NativeCallBody {
/* Flag for whether we should free a string after passing it or not. These
Expand All @@ -10,25 +12,6 @@ public class NativeCallBody {
public static final byte ARG_FREE_STR = 1;
public static final byte ARG_FREE_STR_MASK = 1;

/* The available native call argument types. */
public enum ArgType {
VOID,
CHAR,
SHORT,
INT,
LONG,
LONGLONG,
FLOAT,
DOUBLE,
ASCIISTR,
UTF8STR,
UTF16STR,
CSTRUCT,
CARRAY,
CALLBACK,
CPOINTER;
}

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

0 comments on commit d70f835

Please sign in to comment.