diff --git a/cpp/sum.cpp b/cpp/sum.cpp index 3bc1b74..7080e8d 100644 --- a/cpp/sum.cpp +++ b/cpp/sum.cpp @@ -256,16 +256,16 @@ typedef struct MINUTIA item[3]; } MINUTIAE; -extern "C" MINUTIAE *printAndReturnMinutiae(MINUTIAE minutiae) +extern "C" MINUTIAE *printAndReturnMinutiae(MINUTIAE *minutiae) { MINUTIAE *result = new MINUTIAE; - result->nNumber = minutiae.nNumber; - printf("nNumber=%d\n", minutiae.nNumber); + result->nNumber = minutiae->nNumber; + printf("nNumber=%d\n", minutiae->nNumber); for (int i = 0; i < result->nNumber; i++) { - result->item[i] = minutiae.item[i]; + result->item[i] = minutiae->item[i]; printf("Result item[%d]: x=%d, y=%d, dir=%d, kind=%d\n", i, result->item[i].x, result->item[i].y, result->item[i].dir, (int)result->item[i].kind); diff --git a/tests/struct.ts b/tests/struct.ts index 0dc0c77..004c0c0 100644 --- a/tests/struct.ts +++ b/tests/struct.ts @@ -91,7 +91,7 @@ export const testObject = () => { ffiTypeTag: DataType.StackStruct }, length: 3 - }) + }), }, paramsType: [{ nNumber: DataType.I16, @@ -107,7 +107,6 @@ export const testObject = () => { }, length: 3 }), - ffiTypeTag: DataType.StackStruct }], paramsValue: [{ nNumber: 3,