aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2022-01-02 20:02:23 +0100
committerbozo.kopic <bozo@kopic.xyz>2022-01-02 20:02:23 +0100
commit1a73bd946b8636dbcbb2970c8f8e919b888074ab (patch)
treee9f448c03632d4c35486fc8fefbca527121c54da
parent90600e3f0761dcd2858a591c68c62c2fd259a381 (diff)
WIP c implementation
-rwxr-xr-xplayground/native-calculate.sh2
-rw-r--r--src_c/common.c5
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;