Code Review
/
o-du
/
l2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[ JIRA Id - ODUHIGH-606 ] Fixing null memory size allocation issue
[o-du/l2.git]
/
src
/
mt
/
ss_pack.c
diff --git
a/src/mt/ss_pack.c
b/src/mt/ss_pack.c
index
b998e5d
..
d02f690
100644
(file)
--- a/
src/mt/ss_pack.c
+++ b/
src/mt/ss_pack.c
@@
-88,17
+88,11
@@
*
*/
*
*/
-#ifdef ANSI
S16 SPkS8
(
S8 val, /* value */
Buffer *mBuf /* message buffer */
)
S16 SPkS8
(
S8 val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SPkS8(val, mBuf)
-S8 val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
ret = SAddPreMsg((Data) val, mBuf);
{
S16 ret; /* return code */
ret = SAddPreMsg((Data) val, mBuf);
@@
-113,7
+107,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
Unp
ackUInt8
+* Fun: odu
P
ackUInt8
*
* Desc: This function packs an unsigned 8 bit value into a message.
*
*
* Desc: This function packs an unsigned 8 bit value into a message.
*
@@
-127,17
+121,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduUnpackUInt8
+S16 oduPackUInt8
(
uint8_t val, /* value */
Buffer *mBuf /* message buffer */
)
(
uint8_t val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduUnpackUInt8(val, mBuf)
-uint8_t val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
ret = SAddPreMsg((Data) val, mBuf);
{
S16 ret; /* return code */
ret = SAddPreMsg((Data) val, mBuf);
@@
-146,7
+134,7
@@
Buffer *mBuf; /* message buffer */
SSLOGERROR(ERRCLS_ADD_RES, ESS243, (ErrVal)ret, "SAddPreMsg() failed");
#endif
return (ret);
SSLOGERROR(ERRCLS_ADD_RES, ESS243, (ErrVal)ret, "SAddPreMsg() failed");
#endif
return (ret);
-} /* end of odu
Unp
ackUInt8 */
+} /* end of odu
P
ackUInt8 */
\f
/*
*
\f
/*
*
@@
-164,17
+152,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SPkS16
(
S16 val, /* value */
Buffer *mBuf /* message buffer */
)
S16 SPkS16
(
S16 val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SPkS16(val, mBuf)
-S16 val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
Data pkArray[2]; /* array for packing */
S16 ret; /* return code */
{
Data pkArray[2]; /* array for packing */
S16 ret; /* return code */
@@
-197,7
+179,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
Unp
ackUInt16
+* Fun: odu
P
ackUInt16
*
* Desc: This function packs an unsigned 16 bit value into a message.
*
*
* Desc: This function packs an unsigned 16 bit value into a message.
*
@@
-211,17
+193,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduUnpackUInt16
+S16 oduPackUInt16
(
uint16_t val, /* value */
Buffer *mBuf /* message buffer */
)
(
uint16_t val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduUnpackUInt16(val, mBuf)
-uint16_t val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
Data pkArray[2]; /* array for packing */
S16 ret; /* return code */
{
Data pkArray[2]; /* array for packing */
S16 ret; /* return code */
@@
-239,7
+215,7
@@
Buffer *mBuf; /* message buffer */
SSLOGERROR(ERRCLS_ADD_RES, ESS245, (ErrVal)ret, "SAddPreMsgMult() failed");
#endif
return (ret);
SSLOGERROR(ERRCLS_ADD_RES, ESS245, (ErrVal)ret, "SAddPreMsgMult() failed");
#endif
return (ret);
-} /* end of odu
Unp
ackUInt16 */
+} /* end of odu
P
ackUInt16 */
\f
/*
\f
/*
@@
-258,17
+234,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SPkS32
(
S32 val, /* value */
Buffer *mBuf /* message buffer */
)
S16 SPkS32
(
S32 val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SPkS32(val, mBuf)
-S32 val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp; /* temporary value */
Data pkArray[4]; /* packing array */
{
uint16_t tmp; /* temporary value */
Data pkArray[4]; /* packing array */
@@
-300,7
+270,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
Unp
ackUInt32
+* Fun: odu
P
ackUInt32
*
* Desc: This function packs an unsigned 32 bit value into a message.
*
*
* Desc: This function packs an unsigned 32 bit value into a message.
*
@@
-314,17
+284,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduUnpackUInt32
+S16 oduPackUInt32
(
uint32_t val, /* value */
Buffer *mBuf /* message buffer */
)
(
uint32_t val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduUnpackUInt32(val, mBuf)
-uint32_t val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp; /* temporary value */
Data pkArray[4]; /* packing array */
{
uint16_t tmp; /* temporary value */
Data pkArray[4]; /* packing array */
@@
-351,7
+315,7
@@
Buffer *mBuf; /* message buffer */
SSLOGERROR(ERRCLS_ADD_RES, ESS247, (ErrVal)ret, "SAddPreMsgMult() failed");
#endif
return (ret);
SSLOGERROR(ERRCLS_ADD_RES, ESS247, (ErrVal)ret, "SAddPreMsgMult() failed");
#endif
return (ret);
-} /* end of odu
Unp
ackUInt32 */
+} /* end of odu
P
ackUInt32 */
/*ss038.103 1. Added Floating point support*/
#ifdef SS_FLOAT
/*ss038.103 1. Added Floating point support*/
#ifdef SS_FLOAT
@@
-371,17
+335,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SPkF32
(
F32 val, /* value */
Buffer *mBuf /* message buffer */
)
S16 SPkF32
(
F32 val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SPkF32(val, mBuf)
-F32 val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
S8 tmpArray[15]; /* temporary array */
{
S16 ret; /* return code */
S8 tmpArray[15]; /* temporary array */
@@
-428,17
+386,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SPkF64
(
F64 val, /* value */
Buffer *mBuf /* message buffer */
)
S16 SPkF64
(
F64 val, /* value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SPkF64(val, mBuf)
-F64 val; /* value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
{
S16 ret; /* return code */
@@
-486,17
+438,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SUnpkS8
(
S8 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
S16 SUnpkS8
(
S8 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SUnpkS8(val, mBuf)
-S8 *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
Data tmp; /* temporary value */
S16 ret; /* return code */
{
Data tmp; /* temporary value */
S16 ret; /* return code */
@@
-523,7
+469,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
P
ackUInt8
+* Fun: odu
Unp
ackUInt8
*
* Desc: This function unpacks an unsigned 8 bit value from a message.
*
*
* Desc: This function unpacks an unsigned 8 bit value from a message.
*
@@
-535,17
+481,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduPackUInt8
+S16 oduUnpackUInt8
(
uint8_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
(
uint8_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduPackUInt8(val, mBuf)
-uint8_t *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
Data tmp; /* temporary value */
S16 ret; /* return code */
{
Data tmp; /* temporary value */
S16 ret; /* return code */
@@
-555,7
+495,7
@@
Buffer *mBuf; /* message buffer */
/* check data pointer */
if (!val)
{
/* check data pointer */
if (!val)
{
- SSLOGERROR(ERRCLS_INT_PAR, ESS252, ERRZERO, "odu
P
ackUInt8 : Null value");
+ SSLOGERROR(ERRCLS_INT_PAR, ESS252, ERRZERO, "odu
Unp
ackUInt8 : Null value");
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
@@
-567,7
+507,7
@@
Buffer *mBuf; /* message buffer */
#endif
*val = (uint8_t) tmp;
return (ret);
#endif
*val = (uint8_t) tmp;
return (ret);
-} /* end of odu
P
ackUInt8 */
+} /* end of odu
Unp
ackUInt8 */
\f
/*
*
\f
/*
*
@@
-583,17
+523,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SUnpkS16
(
S16 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
S16 SUnpkS16
(
S16 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SUnpkS16(val, mBuf)
-S16 *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp16; /* temporary value */
Data unpkArray[2]; /* unpacking array */
{
uint16_t tmp16; /* temporary value */
Data unpkArray[2]; /* unpacking array */
@@
-629,7
+563,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
P
ackUInt16
+* Fun: odu
Unp
ackUInt16
*
* Desc: This function unpacks an unsigned 16 bit value from a message.
*
*
* Desc: This function unpacks an unsigned 16 bit value from a message.
*
@@
-641,17
+575,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduPackUInt16
+S16 oduUnpackUInt16
(
uint16_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
(
uint16_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduPackUInt16(val, mBuf)
-uint16_t *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp16; /* temporary value */
Data unpkArray[2]; /* unpacking array */
{
uint16_t tmp16; /* temporary value */
Data unpkArray[2]; /* unpacking array */
@@
-662,7
+590,7
@@
Buffer *mBuf; /* message buffer */
/* check data pointer */
if (!val)
{
/* check data pointer */
if (!val)
{
- SSLOGERROR(ERRCLS_INT_PAR, ESS256, ERRZERO, "odu
P
ackUInt16 : Null value");
+ SSLOGERROR(ERRCLS_INT_PAR, ESS256, ERRZERO, "odu
Unp
ackUInt16 : Null value");
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
@@
-682,7
+610,7
@@
Buffer *mBuf; /* message buffer */
#endif
*val = tmp16;
return (ret);
#endif
*val = tmp16;
return (ret);
-} /* end of odu
P
ackUInt16 */
+} /* end of odu
Unp
ackUInt16 */
\f
/*
\f
/*
@@
-699,17
+627,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SUnpkS32
(
S32 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
S16 SUnpkS32
(
S32 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SUnpkS32(val, mBuf)
-S32 *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp16; /* temporary value */
uint32_t tmp32; /* temporary value */
{
uint16_t tmp16; /* temporary value */
uint32_t tmp32; /* temporary value */
@@
-755,7
+677,7
@@
Buffer *mBuf; /* message buffer */
\f
/*
*
\f
/*
*
-* Fun: odu
P
ackUInt32
+* Fun: odu
Unp
ackUInt32
*
* Desc: This function unpacks an unsigned 32 bit value from a message.
*
*
* Desc: This function unpacks an unsigned 32 bit value from a message.
*
@@
-767,17
+689,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
-S16 oduPackUInt32
+S16 oduUnpackUInt32
(
uint32_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
(
uint32_t *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 oduPackUInt32(val, mBuf)
-uint32_t *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
uint16_t tmp16; /* temporary value */
uint32_t tmp32; /* temporary value */
{
uint16_t tmp16; /* temporary value */
uint32_t tmp32; /* temporary value */
@@
-791,7
+707,7
@@
Buffer *mBuf; /* message buffer */
/* check data pointer */
if (!val)
{
/* check data pointer */
if (!val)
{
- SSLOGERROR(ERRCLS_INT_PAR, ESS260, ERRZERO, "odu
P
ackUInt32 : Null value");
+ SSLOGERROR(ERRCLS_INT_PAR, ESS260, ERRZERO, "odu
Unp
ackUInt32 : Null value");
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
return RFAILED;
}
#endif /* ERRCLASS & ERRCLS_INT_PAR */
@@
-821,7
+737,7
@@
Buffer *mBuf; /* message buffer */
#endif
*val = tmp32;
return (ret);
#endif
*val = tmp32;
return (ret);
-} /* end of odu
P
ackUInt32 */
+} /* end of odu
Unp
ackUInt32 */
/*ss038.103 1. Added Floating point support*/
#ifdef SS_FLOAT
/*ss038.103 1. Added Floating point support*/
#ifdef SS_FLOAT
@@
-839,17
+755,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SUnpkF32
(
F32 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
S16 SUnpkF32
(
F32 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SUnpkF32(val, mBuf)
-F32 *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
S8 tmpArray[15]; /* temporary array */
{
S16 ret; /* return code */
S8 tmpArray[15]; /* temporary array */
@@
-903,17
+813,11
@@
Buffer *mBuf; /* message buffer */
*
*/
*
*/
-#ifdef ANSI
S16 SUnpkF64
(
F64 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
S16 SUnpkF64
(
F64 *val, /* pointer to value */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SUnpkF64(val, mBuf)
-F64 *val; /* pointer to value */
-Buffer *mBuf; /* message buffer */
-#endif
{
S16 ret; /* return code */
{
S16 ret; /* return code */