MCPcopy Create free account
hub / github.com/HelloBush/Java_MHXYdemo / makeArray

Function makeArray

lib/jacob-1.20_src/jacob-1.20/jni/SafeArray.cpp:35–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33#define V_FLD "m_pV"
34
35static SAFEARRAY *makeArray(int vt, int nDims, long *lb, long *cel)
36{
37 if (nDims == 1) {
38 // no need to alloc
39 SAFEARRAYBOUND sab;
40 sab.lLbound = lb[0];
41 sab.cElements = cel[0];
42 SAFEARRAY *sa = SafeArrayCreate(vt,1,&sab);
43 return sa;
44 } else {
45 SAFEARRAYBOUND* rgsaBounds = new SAFEARRAYBOUND[nDims];
46 for(int i=0;i<nDims;i++)
47 {
48 rgsaBounds[i].lLbound = lb[i];
49 rgsaBounds[i].cElements = cel[i];
50 }
51 SAFEARRAY *sa = SafeArrayCreate(vt,nDims,rgsaBounds);
52 delete[] rgsaBounds;
53 return sa;
54 }
55}
56
57/**
58 * extracts the Variant from the int pointer in the java object

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected