From 1a73bd946b8636dbcbb2970c8f8e919b888074ab Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Sun, 2 Jan 2022 20:02:23 +0100 Subject: WIP c implementation --- playground/native-calculate.sh | 2 +- src_c/common.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/playground/native-calculate.sh b/playground/native-calculate.sh index 06756ba..d47035e 100755 --- a/playground/native-calculate.sh +++ b/playground/native-calculate.sh @@ -2,7 +2,7 @@ . $(dirname -- "$0")/env.sh -exec $ROOT_PATH/build/c/opcut-calculate \ +exec $ROOT_PATH/src_py/opcut/bin/linux-opcut-calculate \ --method greedy \ --output result.json \ params.json diff --git a/src_c/common.c b/src_c/common.c index 66b826d..066ff5a 100644 --- a/src_c/common.c +++ b/src_c/common.c @@ -436,7 +436,7 @@ int opcut_result_write(opcut_result_t *result, FILE *stream) { if (fputs(",\"used\":[", stream) < 0) return OPCUT_ERROR; - for (opcut_used_t *used; used; used = used->next) { + for (opcut_used_t *used = result->used; used; used = used->next) { if (write_used(used, stream)) return OPCUT_ERROR; @@ -449,7 +449,8 @@ int opcut_result_write(opcut_result_t *result, FILE *stream) { if (fputs("],\"unused\":[", stream) < 0) return OPCUT_ERROR; - for (opcut_unused_t *unused; unused; unused = unused->next) { + for (opcut_unused_t *unused = result->unused; unused; + unused = unused->next) { if (write_unused(unused, stream)) return OPCUT_ERROR; -- cgit v1.2.3-70-g09d2