From c0a99536d70e911094181e21dd666dde43d84bea Mon Sep 17 00:00:00 2001 From: huangke11 Date: Thu, 9 Jun 2022 22:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangke11 --- frameworks/config_policy/src/config_policy_utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 15e93b2..526e745 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -25,7 +25,7 @@ #include "init_param.h" #endif -const int MIN_APPEND_LEN = 32; +const size_t MIN_APPEND_LEN = 32; // ':' split different x rules, example:":relPath,mode[,extra][:]" // ',' split different param for x rules // ":-" split for key:-value @@ -35,7 +35,7 @@ const char SEP_FOR_X_PARAM = ','; const char *SEP_FOR_X_VALUE = ":-"; typedef struct { - size_t size; // alloced buffer size of p + size_t size; // allocated buffer size of p size_t strLen; // strlen(p), less than size char *p; // just init to NULL, by malloc } StringHolder; @@ -47,19 +47,19 @@ typedef struct { } SplitedStr; /** - * query function, the memory is alloced in function + * query function, the memory is allocated in function * @return value, or NULL if not exist or strlen(value) is 0 * @NOTICE caller should free the returned value */ typedef char *(*QueryFunc)(const char *key); static char *ExpandStr(char *src, const char *def, QueryFunc queryFunc); -static inline int Min(int a, int b) +static inline size_t Min(size_t a, size_t b) { return a < b ? a : b; } -static inline int Max(int a, int b) +static inline size_t Max(size_t a, size_t b) { return a > b ? a : b; } -- Gitee