From 7e49dea8e7e2c47fa0b3ea8d686e69a8aee3bde6 Mon Sep 17 00:00:00 2001 From: lyriccoder Date: Fri, 5 Sep 2025 15:25:16 +0300 Subject: [PATCH 1/2] Fix mixed signed/unsigned comparisons and enforce size_t for object sizes in infer_shape --- source/operator/prototype/generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/operator/prototype/generic.c b/source/operator/prototype/generic.c index bf504d6d2..43a5e9276 100644 --- a/source/operator/prototype/generic.c +++ b/source/operator/prototype/generic.c @@ -41,8 +41,8 @@ static int infer_shape(struct node* node) struct generic_param* generic_param = (struct generic_param*)(node->op.param_mem); /* check input/output number */ - int input_num = input->elem_num; - int output_num = output->elem_num; + size_t input_num = input->elem_num; + size_t output_num = output->elem_num; if (input_num > generic_param->max_input_num) { From e94a53db470b6ddaccb2ec99510d12f5f17915a0 Mon Sep 17 00:00:00 2001 From: lyriccoder Date: Fri, 5 Sep 2025 15:27:02 +0300 Subject: [PATCH 2/2] Update generic_param.h for fixing another warnings New warnings appeared after fixing the previous one --- source/operator/prototype/generic_param.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/operator/prototype/generic_param.h b/source/operator/prototype/generic_param.h index c63206af8..ee8762828 100644 --- a/source/operator/prototype/generic_param.h +++ b/source/operator/prototype/generic_param.h @@ -28,8 +28,8 @@ struct generic_param { const char* op_name; // what real action? - int max_input_num; - int max_output_num; + size_t max_input_num; + size_t max_output_num; }; #endif