From 829e58009babedd3bf1c7762fcc756eec563442b Mon Sep 17 00:00:00 2001 From: Oussama Saoudi Date: Wed, 6 Nov 2024 10:03:31 -0800 Subject: [PATCH] Fix precision smaller than scale and printing --- ffi/examples/visit-expression/expression.h | 1 - ffi/examples/visit-expression/expression_print.h | 6 +++--- ffi/src/expressions/kernel.rs | 2 +- ffi/src/test_ffi.rs | 2 +- ffi/tests/test-expression-visitor/expected.txt | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ffi/examples/visit-expression/expression.h b/ffi/examples/visit-expression/expression.h index 302566d10..eee88d1dc 100644 --- a/ffi/examples/visit-expression/expression.h +++ b/ffi/examples/visit-expression/expression.h @@ -5,7 +5,6 @@ #include #include #include -#include #include /** diff --git a/ffi/examples/visit-expression/expression_print.h b/ffi/examples/visit-expression/expression_print.h index 23c1dcb7b..7507c8de0 100644 --- a/ffi/examples/visit-expression/expression_print.h +++ b/ffi/examples/visit-expression/expression_print.h @@ -144,11 +144,11 @@ void print_tree_helper(ExpressionItem ref, int depth) { } case Decimal: { struct Decimal* dec = &lit->value.decimal; - printf("Decimal(%lld,%lld, %d, %d)\n", + printf("Decimal(%lld,%lld,%d,%d)\n", (long long)dec->value[0], (long long)dec->value[1], - dec->scale, - dec->precision); + dec->precision, + dec->scale); break; } case Null: diff --git a/ffi/src/expressions/kernel.rs b/ffi/src/expressions/kernel.rs index c4f5aaf0c..188d0d6a9 100644 --- a/ffi/src/expressions/kernel.rs +++ b/ffi/src/expressions/kernel.rs @@ -106,7 +106,7 @@ pub struct EngineExpressionVisitor { pub visit_literal_struct: extern "C" fn( data: *mut c_void, sibling_list_id: usize, - child_field_list_value: usize, + child_field_list_id: usize, child_value_list_id: usize, ), /// Visit an array literal belonging to the list identified by `sibling_list_id`. diff --git a/ffi/src/test_ffi.rs b/ffi/src/test_ffi.rs index fa7e2ef05..27c7063fa 100644 --- a/ffi/src/test_ffi.rs +++ b/ffi/src/test_ffi.rs @@ -61,7 +61,7 @@ pub unsafe extern "C" fn get_testing_kernel_expression() -> Handle