X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_lib.c;h=ac6b699abcb7dffe9bda002fe9c8cb8daf9d8567;hb=4a4be152a02505f732a92caa2a5592f2ec70b9ae;hp=52f83d5e1da5920b6414a511f70393429a62192c;hpb=def50dc175cebc67238db5f1acd5ff322a2279bd;p=o-du%2Fl2.git diff --git a/src/cm/cm_lib.c b/src/cm/cm_lib.c index 52f83d5e1..ac6b699ab 100644 --- a/src/cm/cm_lib.c +++ b/src/cm/cm_lib.c @@ -174,8 +174,8 @@ #endif #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */ -EXTERN Data *startPtr128; -EXTERN Size regMemSize; +Data *startPtr128; +Size regMemSize; #endif /* @@ -196,19 +196,7 @@ EXTERN Size regMemSize; * File: cm_lib.c * */ -#ifdef ANSI -uint8_t *cmMemcpy -( -uint8_t *tgt, -CONSTANT uint8_t *src, -PTR len -) -#else -uint8_t *cmMemcpy(tgt, src, len) -uint8_t *tgt; -CONSTANT uint8_t *src; -PTR len; -#endif +uint8_t *cmMemcpy(uint8_t *tgt,const uint8_t *src,PTR len) { /*cm_lib_c_001.main_14 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ @@ -261,23 +249,11 @@ if ((src > startPtr128) && (src < (startPtr128+regMemSize))) * File: cm_lib.c * */ -#ifdef ANSI -S16 cmMemcmp -( -CONSTANT uint8_t *s1, -CONSTANT uint8_t *s2, -PTR len -) -#else -S16 cmMemcmp (s1, s2, len) -CONSTANT uint8_t *s1; -CONSTANT uint8_t *s2; -PTR len; -#endif +S16 cmMemcmp(const uint8_t *s1,const uint8_t *s2,PTR len) { /*cm_lib_c_001.main_14 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #if MEMCMP_AVAIL /* memcmp is available */ - return ((S16) memcmp((CONSTANT Void *)s1, (CONSTANT Void *)s2, (size_t)len)); + return ((S16) memcmp((const Void *)s1, (const Void *)s2, (size_t)len)); #else /* MEMCMP_AVAIL: memcmp is not available */ while (len--) { @@ -309,19 +285,7 @@ PTR len; * File: cm_lib.c * */ -#ifdef ANSI -uint8_t *cmMemset -( -uint8_t *str, -uint8_t val, -PTR len -) -#else -uint8_t *cmMemset(str, val, len) -uint8_t *str; -uint8_t val; -PTR len; -#endif +uint8_t *cmMemset(uint8_t *str,uint8_t val,PTR len) { /*cm_lib_c_001.main_14 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #if MS_MBUF_CORRUPTION /* checking for valid memory address */ @@ -387,21 +351,11 @@ if ((str > startPtr128) && (str < (startPtr128+regMemSize))) * File: cm_lib.c * */ -#ifdef ANSI -S16 cmStrcmp -( -CONSTANT uint8_t *s1, -CONSTANT uint8_t *s2 -) -#else -S16 cmStrcmp (s1, s2) -CONSTANT uint8_t *s1; -CONSTANT uint8_t *s2; -#endif +S16 cmStrcmp(const uint8_t *s1,const uint8_t *s2) { /*cm_lib_c_001.main_14 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #if (STRCMP_AVAIL) - return (strcmp((CONSTANT S8 *)s1, (CONSTANT S8 *)s2)); + return (strcmp((const char *)s1, (const char *)s2)); #else /* STRCMP_AVAIL */ while (*s1 && *s2) @@ -451,23 +405,16 @@ CONSTANT uint8_t *s2; * File: cm_lib.c * */ -#ifdef ANSI S16 cmStrncmp ( -CONSTANT uint8_t *s1, -CONSTANT uint8_t *s2, +const uint8_t *s1, +const uint8_t *s2, MsgLen len /* cm_lib_c_001.main_12: Changing from S16 to MsgLen.*/ ) -#else -S16 cmStrncmp (s1, s2, len) -CONSTANT uint8_t *s1; -CONSTANT uint8_t *s2; -MsgLen len; -#endif { /*cm_lib_c_001.main_14 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #if (STRNCMP_AVAIL) - return (strncmp((CONSTANT S8 *)s1, (CONSTANT S8 *)s2, (size_t) len)); + return (strncmp((const char *)s1, (const char *)s2, (size_t) len)); #else /* STRNCMP_AVAIL */ while (*s1 && *s2 && len--) @@ -505,20 +452,11 @@ MsgLen len; * File: cm_lib.c * */ -#ifdef ANSI -MsgLen cmStrlen -( -CONSTANT uint8_t *s -) -#else -/* cm_lib_c_001.main_12: Changing from S16 to MsgLen.*/ -MsgLen cmStrlen (s) -CONSTANT uint8_t *s; -#endif +MsgLen cmStrlen(const uint8_t *s) { #if (STRLEN_AVAIL) /*cm_lib_c_001.main_15 : Fix for warning due to mixed declation*/ - return ((MsgLen)strlen((CONSTANT S8 *)s)); + return ((MsgLen)strlen((const char *)s)); #else /* STRLEN_AVAIL */ MsgLen i;