[Epic-ID: ODUHIGH-475][Task-ID: ODUHIGH-476]Integration fixes upto PRACH scheduling...
[o-du/l2.git] / src / mt / ss_msg.c
index bad1d7f..87e1037 100644 (file)
@@ -91,8 +91,8 @@
 #endif /* SS_SEUM_CAVIUM */
 #include <pthread.h>
 #ifdef XEON_SPECIFIC_CHANGES
-U32 startMemLeak=0; 
-extern pthread_mutex_t  memLock;
+uint32_t startMemLeak=0; 
+pthread_mutex_t  memLock;
 #endif
 
 #if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
@@ -107,19 +107,19 @@ extern pthread_mutex_t  memLock;
 S16 ssGetDBufOfSize ARGS((Region region, Size size, Buffer **dBuf));
 S16 SIncMsgRef(Buffer *srcBuf,Region dstRegion, Pool dstPool,Buffer **dstBuf);
 #ifdef SSI_STATIC_MEM_LEAK_DETECTION
-EXTERN U32 GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo));
-EXTERN void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char* 
-         file, U32 line, U32 size, void* ptr, U32 idx));
-EXTERN void FreeIdx ARGS((U8* ptr, U32 idx, StaticMemAllocInfo*
-         memAllocInfo,U32 size, char* file, U32 line));
+uint32_t GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo));
+void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char* 
+         file, uint32_t line, uint32_t size, void* ptr, uint32_t idx));
+void FreeIdx ARGS((uint8_t* ptr, uint32_t idx, StaticMemAllocInfo*
+         memAllocInfo,uint32_t size, char* file, uint32_t line));
 #endif
 
 #ifdef SS_USE_ZBC_MEMORY
 #ifdef T2K_MEM_LEAK_DBG
-PRIVATE S16 SPutZbcDBufNew ARGS((Region region, Buffer *buf,char*,U32));
+static S16 SPutZbcDBufNew ARGS((Region region, Buffer *buf,char*,uint32_t));
 
 #else
-PRIVATE S16 SPutZbcDBuf ARGS((Region region, Buffer *buf));
+static S16 SPutZbcDBuf ARGS((Region region, Buffer *buf));
 S16 SAttachPtrToBuf ARGS(( Region   region, Pool     pool, Data    *ptr,
          MsgLen   totalLen, Buffer** mBuf));
 #endif
@@ -129,12 +129,12 @@ S16 SAttachPtrToBuf ARGS(( Region   region, Pool     pool, Data    *ptr,
 #ifdef SS_M_PROTO_REGION 
 #ifdef T2K_MEM_LEAK_DBG
 #define DupMsg(region,buffer) DupMsgNew(region,buffer,file,line)
-PRIVATE Buffer *DupMsgNew ARGS((Region region, Buffer *buffer,char*,U32));
+static Buffer *DupMsgNew ARGS((Region region, Buffer *buffer,char*,uint32_t));
 #else
 #ifdef INTEL_WLS
 #ifdef T2K_MEM_LEAK_DBG
 S16 SAttachPtrToMBuf1 ARGS(( Region   region, Pool     pool, Data    *ptr, MsgLen   totalLen,
-                                   MsgLen   ptrLen, Buffer** mBuf, char* file, U32 line));
+                                   MsgLen   ptrLen, Buffer** mBuf, char* file, uint32_t line));
 #else
 S16 SAttachPtrToMBuf ARGS(( Region   region, Pool     pool, Data    *ptr, MsgLen   totalLen,
                                    MsgLen   ptrLen, Buffer** mBuf));
@@ -142,7 +142,7 @@ S16 SAttachPtrToMBuf ARGS(( Region   region, Pool     pool, Data    *ptr, MsgLen
 #ifdef T2K_MEM_LEAK_DBG
 S16 SAttachWlsPtrToMBuf1 ARGS(( Region   region, Pool     pool, Data    *ptr, 
                                       Data    *readPtr,    MsgLen   totalLen,
-                                      MsgLen   ptrLen, Buffer** mBuf, char* file, U32 line));
+                                      MsgLen   ptrLen, Buffer** mBuf, char* file, uint32_t line));
 
 S16 SAttachWlsPtrToMBuf ARGS(( Region   region, Pool     pool, Data    *ptr, 
                                       Data    *readPtr,    MsgLen   totalLen,
@@ -157,7 +157,7 @@ S16 SPutSBufDpdk          ARGS(( Data    *ptr));
 
 #endif /* INTEL_WLS */
 
-PRIVATE Buffer *DupMsg ARGS((Region region, Buffer *buffer));
+static Buffer *DupMsg ARGS((Region region, Buffer *buffer));
 #endif
 #endif /* SS_M_PROTO_REGION */
 
@@ -213,10 +213,10 @@ PRIVATE Buffer *DupMsg ARGS((Region region, Buffer *buffer));
 }
 
 
-EXTERN pthread_t tmpRegTidMap[20];
+pthread_t tmpRegTidMap[20];
 #define CM_MEM_GET_REGION(_region)                        \
 {                                                         \
-   U8  _regCnt;                                           \
+   uint8_t  _regCnt;                                           \
    _region = 0xFF;                                        \
                                                           \
    for(_regCnt = 0; _regCnt < 12; _regCnt++)              \
@@ -230,7 +230,7 @@ EXTERN pthread_t tmpRegTidMap[20];
 }
 
 #if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF) || defined(L2_OPTMZ))
-extern S32 clusterMode;
+S32 clusterMode;
 #endif
 /*
 *
@@ -257,22 +257,15 @@ Region region,
 Size size,
 Buffer **dBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 ssGetDBufOfSize
 (
 Region region,
 Size size,
 Buffer **dBuf
 )
-#else
-S16 ssGetDBufOfSize(region, size, dBuf)
-Region region;
-Size size;
-Buffer **dBuf;
-#endif
 #endif
 {
    Size mdsize;
@@ -305,7 +298,7 @@ Buffer **dBuf;
    /* ss006.301 : optmized this function */
    mdsize = MDBSIZE + size;
 #ifdef SS_HISTOGRAM_SUPPORT 
-   if (SAlloc(region, &mdsize, 0, (Data **) dBuf, __LINE__, (U8*) __FILE__, ENTNC) != ROK)
+   if (SAlloc(region, &mdsize, 0, (Data **) dBuf, __LINE__, (uint8_t*) __FILE__, ENTNC) != ROK)
 #else
    if (SAlloc(region, &mdsize, 0, (Data **) dBuf) != ROK)
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -348,23 +341,14 @@ Buffer **dBuf;
 */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT 
-#ifdef ANSI
 S16 SGetMsgNew
 (
 Region region,              /* region id */
 Pool pool,                  /* pool id */
 Buffer **mBuf,              /* pointer to message buffer */
-U32    line,
-U8     *fileName
+uint32_t    line,
+uint8_t     *fileName
 )
-#else
-S16 SGetMsgNew(region, pool, mBuf, line, fileName)
-Region region;              /* region id */
-Pool pool;                  /* pool id */
-Buffer **mBuf;              /* pointer to message buffer */
-U32    line;
-U8     *fileName;
-#endif
 #else /* SS_HISTOGRAM_SUPPORT */
 #ifdef T2K_MEM_LEAK_DBG
 S16 SGetMsgNew
@@ -373,22 +357,15 @@ Region region,              /* region id */
 Pool pool,                  /* pool id */
 Buffer **mBuf,              /* pointer to message buffer */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SGetMsg
 (
 Region region,              /* region id */
 Pool pool,                  /* pool id */
 Buffer **mBuf              /* pointer to message buffer */
 )
-#else
-S16 SGetMsg(region, pool, mBuf)
-Region region;              /* region id */
-Pool pool;                  /* pool id */
-Buffer **mBuf;              /* pointer to message buffer */
-#endif
 #endif
 #endif /* SS_HISTOGRAM_SUPPORT */
 {
@@ -577,44 +554,32 @@ S16 SSetMBufPool(Buffer *mBuf, Pool pool)
 */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT 
-#ifdef ANSI
 S16 SPutMsgNew
 (
 Buffer *mBuf,
-U32    line,
-U8     *fileName
+uint32_t    line,
+uint8_t     *fileName
 )
-#else
-S16 SPutMsgNew(mBuf, line, fileName)
-Buffer *mBuf;
-U32    line;
-U8     *fileName;
-#endif
 #else /* SS_HISTOGRAM_SUPPORT */
 #ifdef T2K_MEM_LEAK_DBG
 S16 SPutMsgNew
 (
 Buffer *mBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SPutMsg
 (
 Buffer *mBuf
 )
-#else
-S16 SPutMsg(mBuf)
-Buffer *mBuf;
-#endif
 #endif
 #endif /* SS_HISTOGRAM_SUPPORT */
 {
    Buffer *tmp;
    SsMsgInfo *minfo;
 #ifdef SS_MEM_WL_DEBUG
-   U8     tmpThrReg;
+   uint8_t     tmpThrReg;
 #endif
 
 /* ss001.301: additions */
@@ -638,8 +603,8 @@ Buffer *mBuf;
 #endif
 #if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
    {
-      extern pthread_t gMacTId,gRlcTId;
-      extern S32 clusterMode;
+      pthread_t gMacTId,gRlcTId;
+      S32 clusterMode;
       if(clusterMode == RADIO_CLUSTER_MODE)
       {
 
@@ -684,7 +649,9 @@ Buffer *mBuf;
    CM_MEM_GET_REGION(tmpThrReg)
    if(tmpThrReg == 0xFF)
    {
+#ifdef ERROR_PRINT
       printf("\n Not able to get region \n");
+#endif
       return RFAILED;
    }
 #endif
@@ -758,28 +725,19 @@ Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
-U8   memType,                    /* memory type used if shareable or not */
+uint8_t   memType,                    /* memory type used if shareable or not */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SPutStaticBuffer
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
-U8   memType                    /* memory type used if shareable or not */
+uint8_t   memType                    /* memory type used if shareable or not */
 )
-#else
-S16 SPutStaticBuffer(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data *ptr;                      /* pointer to buffer */
-Size size;                      /* size */
-U8   memType;                   /* memory type used if shareable or not */
-#endif
 #endif
 {
    S16 ret = RFAILED;
@@ -814,7 +772,7 @@ U8   memType;                   /* memory type used if shareable or not */
 #endif
 #if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
    {
-      extern pthread_t gMacTId,gRlcTId;
+      pthread_t gMacTId,gRlcTId;
 
       if(clusterMode == RADIO_CLUSTER_MODE)
       {
@@ -911,32 +869,23 @@ Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                      /* size requested */
-U8   memType,                    /* memory type used if shareable or not */
+uint8_t   memType,                    /* memory type used if shareable or not */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SGetStaticBuffer
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                      /* size requested */
-U8   memType                    /* memory type used if shareable or not */
+uint8_t   memType                    /* memory type used if shareable or not */
 )
-#else
-S16 SGetStaticBuffer(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data **ptr;                     /* pointer to buffer */
-Size size;                      /* size requested */
-U8   memType;                   /* memory type used if shareable or not */
-#endif
 #endif
 {
    S16 ret = RFAILED;
-   U32 flags;
+   uint32_t flags;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* validate region ID */
@@ -1017,25 +966,16 @@ U8   memType;                   /* memory type used if shareable or not */
 }
 #endif /* SS_LOCKLESS_MEMORY */
 
-#ifdef INTEL_WLS 
+#ifdef INTEL_WLS_MEM 
 #ifndef SS_LOCKLESS_MEMORY
-#ifdef ANSI
 S16 SGetStaticBuffer
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                      /* size requested */
-U8   memType                    /* memory type used if shareable or not */
+uint8_t   memType                    /* memory type used if shareable or not */
 )
-#else
-S16 SGetStaticBuffer(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data **ptr;                     /* pointer to buffer */
-Size size;                      /* size requested */
-U8   memType;                   /* memory type used if shareable or not */
-#endif
 {
     S16  ret;
 
@@ -1045,23 +985,14 @@ U8   memType;                   /* memory type used if shareable or not */
 }
 
 
-#ifdef ANSI
 S16 SPutStaticBuffer
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
-U8   memType                    /* memory type used if shareable or not */
+uint8_t   memType                    /* memory type used if shareable or not */
 )
-#else
-S16 SPutStaticBuffer(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data *ptr;                      /* pointer to buffer */
-Size size;                      /* size */
-U8   memType;                   /* memory type used if shareable or not */
-#endif
 {
 
    S16   ret;
@@ -1080,7 +1011,7 @@ Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                       /* size requested */
 char* file,
-U32 line
+uint32_t line
 )
 #else
 S16 SGetSBufWls
@@ -1094,7 +1025,7 @@ Size size                       /* size requested */
 {
     S16   ret;
 #ifndef SS_LOCKLESS_MEMORY
-    U32   flags = 0;
+    uint32_t   flags = 0;
 #endif
 
 #ifdef SS_LOCKLESS_MEMORY
@@ -1122,7 +1053,7 @@ Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
 char* file,
-U32 line
+uint32_t line
 )
 #else
 S16 SPutSBufWls
@@ -1173,28 +1104,17 @@ Size size                      /* size */
 */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
 S16 SGetSBufNew
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                       /* size requested */
-U32    line,
-U8     *fileName
+uint32_t    line,
+uint8_t     *fileName
 )
-#else
-S16 SGetSBufNew(region, pool, ptr, size, line, fileName)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data **ptr;                     /* pointer to buffer */
-Size size;                      /* size requested */
-U32    line;
-U8     *fileName;
-#endif
 #else /* SS_HISTOGRAM_SUPPORT */
 #if (defined(SSI_STATIC_MEM_LEAK_DETECTION) || defined(T2K_MEM_LEAK_DBG))
-#ifdef ANSI
 S16 SGetSBuf1
 (
 Region region,                  /* region ID */
@@ -1202,19 +1122,9 @@ Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size,                       /* size requested */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-S16 SGetSBuf1(region, pool, ptr, size, file, line)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data **ptr;                     /* pointer to buffer */
-Size size;                      /* size requested */
-char* file;
-U32 line;
-#endif
-#else
-#ifdef ANSI
 S16 SGetSBuf
 (
 Region region,                  /* region ID */
@@ -1222,18 +1132,11 @@ Pool pool,                      /* pool ID */
 Data **ptr,                     /* pointer to buffer */
 Size size                       /* size requested */
 )
-#else
-S16 SGetSBuf(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data **ptr;                     /* pointer to buffer */
-Size size;                      /* size requested */
-#endif
 #endif
 #endif /* SS_HISTOGRAM_SUPPORT */
 {
    S16 ret;
-   U32 flags;
+   uint32_t flags;
 #ifdef SSI_STATIC_MEM_LEAK_DETECTION
    Size tmpSize;
 #endif
@@ -1368,18 +1271,18 @@ Size size;                      /* size requested */
 #endif
    /*size = tmpSize - 4;*/
    {
-      /*printf("ptr = %p *ptr = %p\n",ptr,*ptr);*/
+      /*printf("\nptr = %p *ptr = %p\n",ptr,*ptr);*/
 #ifdef XEON_SPECIFIC_CHANGES
       pthread_mutex_lock(&(memLock));
 #endif      
-      U32 idx = GetNextFreeIdx(&SMemLeakInfo[region]);
-      U8* allocatedPtr = *ptr;
+      uint32_t idx = GetNextFreeIdx(&SMemLeakInfo[region]);
+      uint8_t* allocatedPtr = *ptr;
       void* actualPtr = allocatedPtr + 4;
       *ptr = actualPtr;
       /* store the index in the memory allocated itself */
-      /**((U32*)*((U32*)allocatedPtr)) = idx;*/
-      *((U32*)allocatedPtr) = idx;
-      /*printf("region = %d idx = %d ptr = %p *ptr = %p actual = %p allocated = %p content = %d\n",region, idx, ptr, *ptr, actualPtr, allocatedPtr, *((U32*)allocatedPtr));*/
+      /**((uint32_t*)*((uint32_t*)allocatedPtr)) = idx;*/
+      *((uint32_t*)allocatedPtr) = idx;
+      /*printf("\nregion = %d idx = %d ptr = %p *ptr = %p actual = %p allocated = %p content = %d\n",region, idx, ptr, *ptr, actualPtr, allocatedPtr, *((uint32_t*)allocatedPtr));*/
 
       LogForStaticMemLeak(&SMemLeakInfo[region],
                           file,
@@ -1449,28 +1352,17 @@ Size size;                      /* size requested */
 */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
 S16 SPutSBufNew
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
-U32    line,
-U8     *fileName
+uint32_t    line,
+uint8_t     *fileName
 )
-#else
-S16 SPutSBufNew(region, pool, ptr, size, line, fileName)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data *ptr;                      /* pointer to buffer */
-Size size;                      /* size */
-U32    line;
-U8     *fileName;
-#endif
 #else  /* SS_HISTOGRAM_SUPPORT  */
 #if (defined(SSI_STATIC_MEM_LEAK_DETECTION) || defined(T2K_MEM_LEAK_DBG))
-#ifdef ANSI
 S16 SPutSBuf1
 (
 Region region,                  /* region ID */
@@ -1478,19 +1370,9 @@ Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size,                      /* size */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-S16 SPutSBuf1(region, pool, ptr, size, file, line)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data *ptr;                      /* pointer to buffer */
-Size size;                      /* size */
-char* file;
-U32 line;
-#endif
-#else
-#ifdef ANSI
 S16 SPutSBuf
 (
 Region region,                  /* region ID */
@@ -1498,13 +1380,6 @@ Pool pool,                      /* pool ID */
 Data *ptr,                      /* pointer to buffer */
 Size size                      /* size */
 )
-#else
-S16 SPutSBuf(region, pool, ptr, size)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Data *ptr;                      /* pointer to buffer */
-Size size;                      /* size */
-#endif
 #endif
 #endif /* SS_HISTOGRAM_SUPPORT */
 {
@@ -1595,7 +1470,7 @@ Size size;                      /* size */
 #ifdef XEON_SPECIFIC_CHANGES
       pthread_mutex_lock(&(memLock));
 #endif      
-      U32 idx = *((U32*)((U8 *)ptr - 4));
+      uint32_t idx = *((uint32_t*)((uint8_t *)ptr - 4));
       FreeIdx(ptr,idx,&SMemLeakInfo[region],size,file,line);
 #ifdef XEON_SPECIFIC_CHANGES
       pthread_mutex_unlock(&(memLock));
@@ -1678,19 +1553,11 @@ Size size;                      /* size */
 *
 */
 
-#ifdef ANSI
-S16 SInitMsg
-(
-Buffer *mBuf
-)
-#else
-S16 SInitMsg(mBuf)
-Buffer *mBuf;
-#endif
+S16 SInitMsg(Buffer *mBuf)
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
-   U8     tmpRegId;
+   uint8_t     tmpRegId;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* check message buffer */
@@ -1726,7 +1593,7 @@ Buffer *mBuf;
 #if 1
 #ifdef T2K_MEM_LEAK_DBG
    char * file = __FILE__;
-   U32  line   = __LINE__;
+   uint32_t  line   = __LINE__;
 #endif
 
       (Void) SPutDBuf(tmpRegId, minfo->pool, tmp);
@@ -1767,19 +1634,12 @@ Buffer *mBuf;
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SAddPreMsgMultInOrder
 (
- Data *src,
- MsgLen cnt,
- Buffer *mBuf
- )
-#else
-S16 SAddPreMsgMultInOrder(src, cnt, mBuf)
-    Data *src;
-    MsgLen cnt;
-    Buffer *mBuf;
-#endif
+Data *src,
+MsgLen cnt,
+Buffer *mBuf
+)
 {
    SsMsgInfo *minfo;   /* Message info */
    Buffer *tmp;
@@ -1872,7 +1732,7 @@ S16 SAddPreMsgMultInOrder(src, cnt, mBuf)
             prevblk = prevblk->b_cont;
 #ifdef T2K_MEM_LEAK_DBG
    char * file = __FILE__;
-   U32  line   = __LINE__;
+   uint32_t  line   = __LINE__;
 #endif
 
             (Void) SPutDBuf(minfo->region, minfo->pool, curblk);
@@ -1955,17 +1815,11 @@ S16 SAddPreMsgMultInOrder(src, cnt, mBuf)
 */
 
  
-#ifdef ANSI
 S16 SAddPreMsg
 (
 Data data,
 Buffer *mBuf
 )
-#else
-S16 SAddPreMsg (data, mBuf)
-Data data;
-Buffer *mBuf;
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -2057,17 +1911,11 @@ Buffer *mBuf;
 */
 
  
-#ifdef ANSI
 S16 SAddPstMsg
 (
 Data data,
 Buffer *mBuf
 )
-#else
-S16 SAddPstMsg (data, mBuf)
-Data data;
-Buffer *mBuf;
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -2154,23 +2002,16 @@ Data *src,
 MsgLen cnt,
 Buffer *mBuf,
 char   *file,
-U32    line
+uint32_t    line
 )
 
 #else
-#ifdef ANSI
 S16 SAddPreMsgMult
 (
 Data *src,
 MsgLen cnt,
 Buffer *mBuf
 )
-#else
-S16 SAddPreMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo;   /* Message info */
@@ -2331,22 +2172,15 @@ Data *src,
 MsgLen cnt,
 Buffer *mBuf,
 char   *file,
-U32    line
+uint32_t    line
 )
 #else
-#ifdef ANSI
 S16 SAddPstMsgMult
 (
 Data *src,
 MsgLen cnt,
 Buffer *mBuf
 )
-#else
-S16 SAddPstMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo;
@@ -2509,23 +2343,17 @@ Buffer *mBuf;
 */
 
  
-#ifdef ANSI
 S16 SRemPreMsg
 (
 Data *dataPtr,
 Buffer *mBuf
 )
-#else
-S16 SRemPreMsg(dataPtr, mBuf)
-Data *dataPtr;
-Buffer *mBuf;
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -2594,24 +2422,18 @@ Buffer *mBuf;
 */
 
 
-#ifdef ANSI
 S16 SRemPstMsg
 (
 Data *dataPtr,              /* pointer to data */
 Buffer *mBuf
 )
-#else
-S16 SRemPstMsg(dataPtr, mBuf)
-Data *dataPtr;              /* pointer to data */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
    Buffer *last;
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -2694,26 +2516,19 @@ Buffer *mBuf;               /* message buffer */
 *
 */
 
-#ifdef ANSI
 S16 SRemPreMsgMult
 (
 Data *dst,                  /* destination */
 MsgLen cnt,                 /* count */
 Buffer *mBuf
 )
-#else
-S16 SRemPreMsgMult(dst, cnt, mBuf)
-Data *dst;                  /* destination */
-MsgLen cnt;                 /* count */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
-   SsMsgInfo *minfo;
-   Buffer *tmp;
-   MsgLen numBytes;
+   SsMsgInfo *minfo = NULLP;
+   Buffer *tmp = NULLP;
+   MsgLen numBytes =0;
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 
@@ -2816,19 +2631,12 @@ Buffer *mBuf;               /* message buffer */
 *
 */
 
-#ifdef ANSI
 S16 SRemPstMsgMult
 (
 Data *dst,                  /* destination */
 MsgLen cnt,                 /* count */
 Buffer *mBuf
 )
-#else
-S16 SRemPstMsgMult(dst, cnt, mBuf)
-Data *dst;                  /* destination */
-MsgLen cnt;                 /* count */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -2838,7 +2646,7 @@ Buffer *mBuf;               /* message buffer */
    Data *cptr;
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 
@@ -2950,19 +2758,12 @@ Buffer *mBuf;               /* message buffer */
 */
 
 
-#ifdef ANSI
 S16 SExamMsg
 (
 Data *dataPtr,              /* pointer to data */
 Buffer *mBuf,               /* message buffer */
 MsgLen idx
 )
-#else
-S16 SExamMsg(dataPtr, mBuf, idx)
-Data *dataPtr;              /* pointer to data */
-Buffer *mBuf;               /* message buffer */
-MsgLen idx;                 /* index */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -3043,7 +2844,6 @@ MsgLen idx;                 /* index */
 */
 
 
-#ifdef ANSI
 S16 SGetDataFrmMsg 
 (
 Buffer *mBuf,               /* message buffer */
@@ -3051,13 +2851,6 @@ Data *dataPtr,              /* pointer to data */
 MsgLen idx,
 MsgLen dataLen
 )
-#else
-S16 SGetDataFrmMsg(mBuf, dataPtr, idx, dataLen)
-Buffer *mBuf;               /* message buffer */
-Data *dataPtr;              /* pointer to data */
-MsgLen idx;                 /* index */
-MsgLen dataLen;
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -3149,17 +2942,11 @@ MsgLen dataLen;
 */
 
 
-#ifdef ANSI
 S16 SFndLenMsg
 (
 REG1 Buffer *mBuf,          /* message buffer */
 MsgLen *lngPtr
 )
-#else
-S16 SFndLenMsg(mBuf, lngPtr)
-REG1 Buffer *mBuf;          /* message buffer */
-MsgLen *lngPtr;             /* pointer to length */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -3239,22 +3026,15 @@ Buffer *mBuf1,              /* message 1 */
 MsgLen idx,                 /* index */
 Buffer **mBuf2,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SSegMsg
 (
 Buffer *mBuf1,              /* message 1 */
 MsgLen idx,                 /* index */
 Buffer **mBuf2
 )
-#else
-S16 SSegMsg(mBuf1, idx, mBuf2)
-Buffer *mBuf1;              /* message 1 */
-MsgLen idx;                 /* index */
-Buffer **mBuf2;             /* message 2 */
-#endif
 #endif
 {
    SsMsgInfo *minfo1;
@@ -3439,7 +3219,6 @@ Buffer **mBuf2;             /* message 2 */
 *
 */
 
-#ifdef ANSI
 S16 SCpyFixMsg
 (
 Data *srcBuf,               /* source buffer */
@@ -3448,14 +3227,6 @@ MsgLen dstIdx,              /* destination index */
 MsgLen cnt,                 /* count */
 MsgLen *cCnt
 )
-#else
-S16 SCpyFixMsg(srcBuf, dstMbuf, dstIdx, cnt, cCnt)
-Data *srcBuf;               /* source buffer */
-Buffer *dstMbuf;            /* destination message buffer */
-MsgLen dstIdx;              /* destination index */
-MsgLen cnt;                 /* count */
-MsgLen *cCnt;               /* copied count */
-#endif
 {
    S16 ret;
    SsMsgInfo *minfo;
@@ -3592,7 +3363,6 @@ MsgLen *cCnt;               /* copied count */
 *
 */
 
-#ifdef ANSI
 S16 SCpyMsgFix
 (
 Buffer *srcMbuf,            /* source message buffer */
@@ -3601,19 +3371,11 @@ MsgLen cnt,                 /* count */
 Data *dstBuf,               /* destination buffer */
 MsgLen *cCnt
 )
-#else
-S16 SCpyMsgFix(srcMbuf, srcIdx, cnt, dstBuf, cCnt)
-Buffer *srcMbuf;            /* source message buffer */
-MsgLen srcIdx;              /* source index */
-MsgLen cnt;                 /* count */
-Data *dstBuf;               /* destination buffer */
-MsgLen *cCnt;               /* copied count */
-#endif
 {
-   Data *cptr;
-   Buffer *tmp;
-   SsMsgInfo *minfo;
-   MsgLen numBytes;
+   Data *cptr = NULLP;
+   Buffer *tmp = NULLP;
+   SsMsgInfo *minfo = NULLP;
+   MsgLen numBytes =0;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* check source message buffer */
@@ -3727,10 +3489,9 @@ Region dstRegion,
 Pool dstPool,
 Buffer **dstBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SCpyMsgMsg
 (
 Buffer *srcBuf,
@@ -3738,13 +3499,6 @@ Region dstRegion,
 Pool dstPool,
 Buffer **dstBuf
 )
-#else
-S16 SCpyMsgMsg(srcBuf, dstRegion, dstPool, dstBuf)
-Buffer *srcBuf;
-Region dstRegion;
-Pool dstPool;
-Buffer **dstBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo1;
@@ -3879,7 +3633,9 @@ Buffer **dstBuf;
                (Void) SPutDBuf(minfo1->region, minfo1->pool, newblk);
                newblk = curblk;
             }
-            printf("Failed to get the buffer of size %s %d\n", __FILE__, __LINE__);
+#ifdef ERROR_PRINT
+            printf("\nFailed to get the buffer of size %s %d\n", __FILE__, __LINE__);
+#endif            
             (Void) SPutMsg(*dstBuf);
             return (ROUTRES);
          }
@@ -3928,10 +3684,9 @@ Region dstRegion,
 Pool dstPool,
 Buffer **dstBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SAddMsgRef
 (
 Buffer *srcBuf,
@@ -3939,13 +3694,6 @@ Region dstRegion,
 Pool dstPool,
 Buffer **dstBuf
 )
-#else
-S16 SAddMsgRef(srcBuf, dstRegion, dstPool, dstBuf)
-Buffer *srcBuf;
-Region dstRegion;
-Pool dstPool;
-Buffer **dstBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo1;
@@ -4085,25 +3833,19 @@ Buffer **dstBuf;
 *
 */
 #ifdef T2K_MEM_LEAK_DBG
-PRIVATE Buffer *DupMsgNew
+static Buffer *DupMsgNew
 (
 Region region,              /* region id */
 Buffer *mp,                  /* message block */
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
-PRIVATE Buffer *DupMsg
+static Buffer *DupMsg
 (
 Region region,              /* region id */
 Buffer *mp                  /* message block */
 )
-#else
-PRIVATE Buffer *DupMsg(region, mp)
-Region region;              /* region id */
-Buffer *mp;                 /* message block */
-#endif
 #endif
 {
    Buffer *bp;                  /* mblk for iteration */
@@ -4136,7 +3878,7 @@ Buffer *mp;                 /* message block */
 #endif /* SS_MULTICORE_SUPPORT */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT 
-   r = SAlloc(region, &m, 0, (Data **)&bp, __LINE__, (U8*) __FILE__, ENTNC);
+   r = SAlloc(region, &m, 0, (Data **)&bp, __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
    r = SAlloc(region, &m, 0, (Data **)&bp);
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -4151,11 +3893,11 @@ Buffer *mp;                 /* message block */
 /* generic set-up-message function */
 #if 1
 #ifndef SS_DBUF_REFLOCK_DISABLE
-   SS_STRM_INITB(bp, (SsDblk *)(((U8 *)bp) + sizeof(SsMblk)), NULLP, 0, NULLP);
+   SS_STRM_INITB(bp, (SsDblk *)(((uint8_t *)bp) + sizeof(SsMblk)), NULLP, 0, NULLP);
 #endif
 #else
    data = (Data *) (bp) + MDBSIZE;
-   SS_STRM_INITB(bp,(SsDblk *)(((U8 *)bp) + sizeof(SsMblk)), data, numBytes, NULLP);
+   SS_STRM_INITB(bp,(SsDblk *)(((uint8_t *)bp) + sizeof(SsMblk)), data, numBytes, NULLP);
 #endif /* SS_MULTICORE_SUPPORT */
 
 
@@ -4221,22 +3963,15 @@ Region region,              /* region id */
 Pool pool,                  /* pool id */
 Buffer **bufPtr,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SGetDBuf
 (
 Region region,              /* region id */
 Pool pool,                  /* pool id */
 Buffer **bufPtr
 )
-#else
-S16 SGetDBuf(region, pool, bufPtr)
-Region region;              /* region id */
-Pool pool;                  /* pool id */
-Buffer **bufPtr;            /* pointer to buffer */
-#endif
 #endif
 {
    Size size;
@@ -4353,7 +4088,7 @@ Buffer **bufPtr;            /* pointer to buffer */
    /* ss006.301 : optimized this function */
 /* ss001.301: additions */
 #ifdef SS_HISTOGRAM_SUPPORT 
-    if (SAlloc(region, &mdsize, 0, (Data **) bufPtr, __LINE__, (U8*) __FILE__, ENTNC) != ROK)
+    if (SAlloc(region, &mdsize, 0, (Data **) bufPtr, __LINE__, (uint8_t*) __FILE__, ENTNC) != ROK)
 #else
     if (SAlloc(region, &mdsize, 0, (Data **) bufPtr) != ROK)
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -4369,7 +4104,9 @@ Buffer **bufPtr;            /* pointer to buffer */
 #ifndef SS_DBUF_REFLOCK_DISABLE
    if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
    {
-      printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+      printf("\nFalied to destroy lock\n");
+#endif
    }
 #endif
 
@@ -4404,29 +4141,22 @@ Region region,
 Pool pool,
 Buffer *buf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SPutDBuf
 (
 Region region,
 Pool pool,
 Buffer *buf
 )
-#else
-S16 SPutDBuf(region, pool, buf)
-Region region;
-Pool pool;
-Buffer *buf;
-#endif
 #endif
 {
-   register SsDblk *dptr;
+   register SsDblk *dptr = NULLP;
    /* ss021.103 - Addition to check return value of SFree */
-   S16 ret;
+   S16 ret = ROK;
 #if (defined(SS_USE_ZBC_MEMORY) && defined (TENB_DPDK_BUF))
-   Data  *dpdkBuf;
+   Data  *dpdkBuf = NULLP;
 #endif   
  
  
@@ -4492,7 +4222,7 @@ Buffer *buf;
       /* if the data block is not shared, free the buffer, checks not reqd */
 #ifdef SS_HISTOGRAM_SUPPORT 
       ret = SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base
-         , __LINE__, (U8*) __FILE__, ENTNC);
+         , __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
       ret =  SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base);
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -4512,13 +4242,13 @@ Buffer *buf;
       if (buf != (SsMblk *) (((Data*) dptr) - MBSIZE))
       {
         
-         SsDblk* dupdptr = (SsDblk *)((U8 *)buf + MBSIZE);
+         SsDblk* dupdptr = (SsDblk *)((uint8_t *)buf + MBSIZE);
          dupdptr->db_ref--;
          if(dupdptr->db_ref == 0)
          {
 
 #ifdef SS_HISTOGRAM_SUPPORT 
-         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (U8*) __FILE__, ENTNC);
+         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
          ret = SFree(region, (Data *) buf, MDBSIZE);
 
@@ -4533,13 +4263,15 @@ Buffer *buf;
         ret = SUnlock(&dptr->dBufLock) ;
         if((SDestroyLock(&dptr->dBufLock)) != 0)
         {
-            printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+            printf("\nFalied to destroy lock\n");
+#endif
         }
 #endif
       /* free buffer to region */
 #ifdef SS_HISTOGRAM_SUPPORT 
          ret = SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base
-         , __LINE__, (U8*) __FILE__, ENTNC);
+         , __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
          ret =  SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base);
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -4553,7 +4285,7 @@ Buffer *buf;
    /* If MultiCore Support enabled, Dblk never be shared */
 #ifdef SS_HISTOGRAM_SUPPORT 
    ret = SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base
-         , __LINE__, (U8*) __FILE__, ENTNC);
+         , __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
    ret =  SFree(region, (Data *) buf, MDBSIZE + dptr->db_lim - dptr->db_base);
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -4592,19 +4324,12 @@ Buffer *buf;
 */
 
 
-#ifdef ANSI
 S16 SCatMsg
 (
 Buffer *mBuf1,              /* message 1 */
 Buffer *mBuf2,              /* message 2 */
 Order order
 )
-#else
-S16 SCatMsg(mBuf1, mBuf2, order)
-Buffer *mBuf1;              /* message 1 */
-Buffer *mBuf2;              /* message 2 */
-Order order;                /* order */
-#endif
 {
    SsMsgInfo *minfo1;
    SsMsgInfo *minfo2;
@@ -4751,19 +4476,12 @@ Order order;                /* order */
 */
 
 
-#ifdef ANSI
 S16 SRepMsg
 (
 Data data,                  /* data */
 Buffer *mBuf,               /* message buffer */
 MsgLen idx
 )
-#else
-S16 SRepMsg(data, mBuf, idx)
-Data data;                  /* data */
-Buffer *mBuf;               /* message buffer */
-MsgLen idx;                 /* index */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -4774,7 +4492,7 @@ MsgLen idx;                 /* index */
 
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 #if ( ERRCLASS & ERRCLS_INT_PAR)
    /* check message buffer */
@@ -4852,19 +4570,12 @@ MsgLen idx;                 /* index */
 */
 
 
-#ifdef ANSI
 S16 SUpdMsg
 (
 Buffer *mBuf,                   /* message buffer */
 Buffer *dBuf,                   /* data buffer */
 MsgLen dLen
 )
-#else
-S16 SUpdMsg(mBuf, dBuf, dLen)
-Buffer *mBuf;                   /* message buffer */
-Buffer *dBuf;                   /* data buffer */
-MsgLen dLen;                    /* data length */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -4943,17 +4654,11 @@ MsgLen dLen;                    /* data length */
 */
 
  
-#ifdef ANSI
 S16 SAddDBufPst
 (
 Buffer *mBuf,                   /* message buffer */
 Buffer *dBuf
 )
-#else
-S16 SAddDBufPst(mBuf, dBuf)
-Buffer *mBuf;                   /* message buffer */
-Buffer *dBuf;                   /* data buffer */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -5014,17 +4719,11 @@ Buffer *dBuf;                   /* data buffer */
 */
 
  
-#ifdef ANSI
 S16 SAddDBufPre
 (
 Buffer *mBuf,                    /* message buffer */
 Buffer *dBuf
 )
-#else
-S16 SAddDBufPre(mBuf, dBuf)
-Buffer *mBuf;                    /* message buffer */
-Buffer *dBuf;                    /* data buffer */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -5088,17 +4787,11 @@ Buffer *dBuf;                    /* data buffer */
 */
 
  
-#ifdef ANSI
 S16 SRemDBufPre
 (
 Buffer *mBuf,                   /* message buffer */
 Buffer **dBufPtr
 )
-#else
-S16 SRemDBufPre(mBuf, dBufPtr)
-Buffer *mBuf;                   /* message buffer */
-Buffer **dBufPtr;               /* pointer to data buffer */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -5163,17 +4856,11 @@ Buffer **dBufPtr;               /* pointer to data buffer */
 */
 
  
-#ifdef ANSI
 S16 SRemDBufPst
 (
 Buffer *mBuf,                   /* message buffer */
 Buffer **dBufPtr
 )
-#else
-S16 SRemDBufPst(mBuf, dBufPtr)
-Buffer *mBuf;                   /* message buffer */
-Buffer **dBufPtr;               /* pointer to data buffer */
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -5235,15 +4922,10 @@ Buffer **dBufPtr;               /* pointer to data buffer */
 */
 
  
-#ifdef ANSI
 S16 SInitNxtDBuf
 (
 Buffer *mBuf
 )
-#else
-S16 SInitNxtDBuf(mBuf)
-Buffer *mBuf;                   /* message buffer */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -5284,17 +4966,11 @@ Buffer *mBuf;                   /* message buffer */
 */
 
  
-#ifdef ANSI
 S16 SGetNxtDBuf
 (
 Buffer *mBuf,                   /* message buffer */
 Buffer **dBuf
 )
-#else
-S16 SGetNxtDBuf(mBuf, dBuf)
-Buffer *mBuf;                   /* message buffer */
-Buffer **dBuf;                  /* data buffer return */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -5343,15 +5019,10 @@ Buffer **dBuf;                  /* data buffer return */
 *
 */
 
-#ifdef ANSI
 S16 SChkNxtDBuf
 (
 Buffer *mBuf
 )
-#else
-S16 SChkNxtDBuf(mBuf)
-Buffer *mBuf;                   /* message buffer */
-#endif
 {
    SsMsgInfo *minfo;
 
@@ -5396,7 +5067,6 @@ Buffer *mBuf;                   /* message buffer */
 */
 
  
-#ifdef ANSI
 S16 SGetDataRx
 (
 Buffer *dBuf,                   /* data buffer */
@@ -5404,13 +5074,6 @@ MsgLen pad,                     /* pad */
 Data **retDatPtr,               /* return data pointer */
 MsgLen *retDatLen
 )
-#else
-S16 SGetDataRx(dBuf, pad, retDatPtr, retDatLen)
-Buffer *dBuf;                   /* data buffer */
-MsgLen pad;                     /* pad */
-Data **retDatPtr;               /* return data pointer */
-MsgLen *retDatLen;              /* return data length */
-#endif
 {
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -5479,19 +5142,12 @@ MsgLen *retDatLen;              /* return data length */
 */
 
  
-#ifdef ANSI
 S16 SGetDataTx
 (
 Buffer *dBuf,                   /* data buffer */
 Data **retDatPtr,               /* return data pointer */
 MsgLen *retDatLen               /* return data length */
 )
-#else
-S16 SGetDataTx(dBuf, retDatPtr, retDatLen)
-Buffer *dBuf;                   /* data buffer */
-Data **retDatPtr;               /* return data pointer */
-MsgLen *retDatLen;              /* return data length */
-#endif
 {
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -5552,19 +5208,12 @@ MsgLen *retDatLen;              /* return data length */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SGetBufRegionPool
 (
 Buffer *mBuf,                   /* message buffer */
 Region *region,                 /* region */
 Pool   *pool                    /* pool */
 )
-#else
-S16 SGetBufRegionPool(mBuf, region, pool)
-Buffer *mBuf;                   /* message buffer */
-Region *region;                 /* region */
-Pool   *pool;                   /* pool */
-#endif
 {
    SsMsgInfo *mInfo;            /* message info pointer */
 
@@ -5629,15 +5278,10 @@ Pool   *pool;                   /* pool */
 */
 
  
-#ifdef ANSI
 S16 SCompressMsg
 (
 Buffer *mBuf
 )
-#else
-S16 SCompressMsg(mBuf)
-Buffer *mBuf;                    /* message buffer */
-#endif
 {
    SsMsgInfo *minfo;
    MsgLen numBytes;
@@ -5648,7 +5292,7 @@ Buffer *mBuf;                    /* message buffer */
 
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -5726,36 +5370,29 @@ Buffer *mBuf;                    /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 SPrntMsg
 (
 Buffer *mBuf,               /* message buffer */
 S16 src,                    /* source id */
 S16 dst                     /* destination id */
 )
-#else
-S16 SPrntMsg(mBuf, src, dst)
-Buffer *mBuf;               /* message buffer */
-S16 src;                    /* source id */
-S16 dst;                    /* destination id */
-#endif
 {
-   QLen qlen;               /* queue length */
-       MsgLen mlen;             /* message length */
+   QLen qlen =0;               /* queue length */
+   MsgLen mlen =0;             /* message length */
 /*
  * SDeRegTTsk patch
  */
        /* ss038.103 : 102061 Changed to MsgLen from S16 */
-       MsgLen i;                /* counter */
-       S16 j;                   /* counter */
-   S16 k;                   /* counter */
-   U8 data;                 /* data */
-   U8 tdata[16] = {0};            /* temporary data */
-   S8 prntBuf[256];         /* print buffer */
-   Buffer *tmp;             /* buffer ptr */
-   Data *cptr;
+   MsgLen i =0;                /* counter */
+   S16 j =0;                   /* counter */
+   S16 k =0;                   /* counter */
+   uint8_t data =0;                 /* data */
+   uint8_t tdata[16] = {0};            /* temporary data */
+   S8 prntBuf[256] ={0};         /* print buffer */
+   Buffer *tmp = NULLP;             /* buffer ptr */
+   Data *cptr =NULLP;
 /* ss012.13: Addition */
-   Data reg;
+   Data reg =0;
 
 
 
@@ -5772,8 +5409,9 @@ S16 dst;                    /* destination id */
    mlen = ((SsMsgInfo*)(mBuf->b_rptr))->len;
    reg = ((SsMsgInfo*)(mBuf->b_rptr))->region;
    /*ss013.301: Fixed Warnings for 32/64 bit compilation*/
+#ifdef DEBUG_PRINT
    sprintf(prntBuf,"\nmsg: qlen: %04d mlen: %04d   %02d-->%02d region: %02d\n",
-           (U16)qlen,(U16)mlen,src,dst,reg);
+           (uint16_t)qlen,(uint16_t)mlen,src,dst,reg);
    SPrint( prntBuf);
 #ifdef XEON_SPECIFIC_CHANGES
    printf("%s\n", prntBuf);
@@ -5781,6 +5419,7 @@ S16 dst;                    /* destination id */
    SPrint((S8*) "dat: ");
 #ifdef XEON_SPECIFIC_CHANGES
    printf("\ndat: ");
+#endif   
 #endif   
 
    if (mlen == 0)
@@ -5803,10 +5442,12 @@ S16 dst;                    /* destination id */
          { 
             /* print hex */
             tdata[j]=data;
-            sprintf( prntBuf,"%02x ",(U16) data);
+            sprintf( prntBuf,"%02x ",(uint16_t) data);
+#ifdef DEBUG_PRINT
             SPrint( prntBuf);
 #ifdef XEON_SPECIFIC_CHANGES
    printf("%s\n", prntBuf);
+#endif
 #endif   
             if (cptr == tmp->b_wptr)
             {
@@ -5822,9 +5463,11 @@ S16 dst;                    /* destination id */
          else
          {
             sprintf( prntBuf,"   ");
+#ifdef DEBUG_PRINT
             SPrint( prntBuf );
 #ifdef XEON_SPECIFIC_CHANGES
    printf("%s\n", prntBuf);
+#endif
 #endif   
          }
       } 
@@ -5836,25 +5479,31 @@ S16 dst;                    /* destination id */
          {
             /* print character if printable */
             sprintf(prntBuf,"%c",tdata[k]);
+#ifdef DEBUG_PRINT
             SPrint( prntBuf);
 #ifdef XEON_SPECIFIC_CHANGES
    printf("%s\n", prntBuf);
+#endif
 #endif   
          }
          else
          {
             /* print . if non printable */
+#ifdef DEBUG_PRINT
             SPrint((S8*) ".");
 #ifdef XEON_SPECIFIC_CHANGES
    printf(".");
 #endif   
+#endif
          }
       }
       sprintf(prntBuf,"\n     ");
+#ifdef DEBUG_PRINT
       SPrint(prntBuf);
 #ifdef XEON_SPECIFIC_CHANGES
    printf("%s\n", prntBuf);
 #endif   
+#endif
    }
    return ROK;
 
@@ -5883,17 +5532,11 @@ S16 dst;                    /* destination id */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SGetPstMsgMult
 (
 MsgLen cnt,                 /* count */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 SGetPstMsgMult(cnt, mBuf)
-MsgLen cnt;                 /* count */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Buffer *tmp;
    Buffer *newb;
@@ -5987,15 +5630,10 @@ Buffer *mBuf;               /* message buffer */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SChkMsg
 (
 Buffer *mBuf
 )
-#else
-S16 SChkMsg(mBuf)
-Buffer *mBuf;
-#endif
 {
    SsMsgInfo *minfo;
    Buffer *tmp;
@@ -6041,15 +5679,10 @@ Buffer *mBuf;
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SAlignDBufEven
 (
 Buffer *dBuf                      /* data buffer */
 )
-#else
-S16 SAlignDBufEven(dBuf)
-Buffer *dBuf;                   /* data buffer  */
-#endif
 {
    MsgLen len;
    Data *src;
@@ -6114,22 +5747,16 @@ Buffer *dBuf;                   /* data buffer  */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SAlignDBuf
 (
 Buffer *dBuf,                      /* data buffer */
-U32    align                       /* alignemnt required */
+uint32_t    align                       /* alignemnt required */
 )
-#else
-S16 SAlignDBuf(dBuf, align)
-Buffer *dBuf;                      /* data buffer  */
-U32    align;                      /* alignemnt required */
-#endif
 {
    MsgLen len;
    Data   *src;
-   U32    upShift;                 /* no. of bytes to be shifted up */
-   U32    downShift;               /* no. of bytes to be shifted down */
+   uint32_t    upShift;                 /* no. of bytes to be shifted up */
+   uint32_t    downShift;               /* no. of bytes to be shifted down */
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (!dBuf)
@@ -6205,19 +5832,12 @@ U32    align;                      /* alignemnt required */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SGetSMem
 (
 Region region,                  /* region ID */
 Size size,                      /* size */
 Pool *pool                      /* pointer to pool ID */
 )
-#else
-S16 SGetSMem(region, size, pool)
-Region region;                  /* region ID */
-Size size;                      /* size */
-Pool *pool;                     /* pointer to pool ID */
-#endif
 {
 
    UNUSED(size);
@@ -6264,17 +5884,11 @@ Pool *pool;                     /* pointer to pool ID */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SPutSMem
 (
 Region region,                  /* region ID */
 Pool pool                       /* pool ID */
 )
-#else
-S16 SPutSMem(region, pool)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-#endif
 {
    /* ss021.103 - Addition of return value */
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -6358,19 +5972,12 @@ Pool pool;                      /* pool ID */
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SChkRes
 (
 Region region,                  /* region ID */
 Pool pool,                      /* pool ID */
 Status *status                  /* pointer to status */
 )
-#else
-S16 SChkRes(region, pool, status)
-Region region;                  /* region ID */
-Pool pool;                      /* pool ID */
-Status *status;                 /* pointer to status */
-#endif
 {
    S16 ret;
    SMemCtl mctl;
@@ -6484,17 +6091,11 @@ Status *status;                 /* pointer to status */
 */
 
 
-#ifdef ANSI
 S16 SSwapMsg
 (
 Buffer *mBuf1,              /* message 1 */
 Buffer *mBuf2               /* message 2 */
 )
-#else
-S16 SSwapMsg(mBuf1, mBuf2)
-Buffer *mBuf1;              /* message 1 */
-Buffer *mBuf2;              /* message 2 */
-#endif
 {
    SsMsgInfo *minfop;
    SsMsgInfo minfo;
@@ -6503,7 +6104,7 @@ Buffer *mBuf2;              /* message 2 */
    SsMsgInfo *minfo2;
 #endif
    Buffer *tmp;
-   U8 tmp2;
+   uint8_t tmp2;
    
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -6595,15 +6196,10 @@ Buffer *mBuf2;              /* message 2 */
  *       File:  ss_msg.c
  *
  */
-#ifdef ANSI
 S16 SConvPtrPhy
 (
  Buffer  **mBuf
 )
-#else
-S16 SConvPtrPhy (mBuf)
-  Buffer **mBuf;
-#endif
 {
 
   Buffer      *curPtr;
@@ -6651,9 +6247,9 @@ S16 SConvPtrPhy (mBuf)
         minfoPtr->next = (Buffer*)cvmx_ptr_to_phys (minfoPtr->next);
   }
 
-  curPtr->b_rptr = (U8*)cvmx_ptr_to_phys (curPtr->b_rptr);
+  curPtr->b_rptr = (uint8_t*)cvmx_ptr_to_phys (curPtr->b_rptr);
 
-  curPtr->b_wptr = (U8*)cvmx_ptr_to_phys (curPtr->b_wptr);
+  curPtr->b_wptr = (uint8_t*)cvmx_ptr_to_phys (curPtr->b_wptr);
 
   /* Convert the pointers of Dblock to Physical addr */
   dblkPtr = (SsDblk*)curPtr->b_datap;
@@ -6676,8 +6272,8 @@ S16 SConvPtrPhy (mBuf)
   }
 #endif
 
-  dblkPtr->db_base = (U8*)cvmx_ptr_to_phys (dblkPtr->db_base);
-  dblkPtr->db_lim = (U8*)cvmx_ptr_to_phys (dblkPtr->db_lim);
+  dblkPtr->db_base = (uint8_t*)cvmx_ptr_to_phys (dblkPtr->db_base);
+  dblkPtr->db_lim = (uint8_t*)cvmx_ptr_to_phys (dblkPtr->db_lim);
 
   curPtr->b_datap = (SsDblk*)cvmx_ptr_to_phys (curPtr->b_datap);
 
@@ -6694,8 +6290,8 @@ S16 SConvPtrPhy (mBuf)
                curPtr->b_cont = (Buffer*)cvmx_ptr_to_phys (curPtr->b_cont);
         }
 
-        curPtr->b_rptr = (U8*)cvmx_ptr_to_phys (curPtr->b_rptr);
-        curPtr->b_wptr = (U8*)cvmx_ptr_to_phys (curPtr->b_wptr);
+        curPtr->b_rptr = (uint8_t*)cvmx_ptr_to_phys (curPtr->b_rptr);
+        curPtr->b_wptr = (uint8_t*)cvmx_ptr_to_phys (curPtr->b_wptr);
 
         /* Convert the pointers of Dblock to Physical addr */
         dblkPtr = (SsDblk*)curPtr->b_datap;
@@ -6718,8 +6314,8 @@ S16 SConvPtrPhy (mBuf)
         }
 #endif    
 
-        dblkPtr->db_base = (U8*)cvmx_ptr_to_phys (dblkPtr->db_base);
-        dblkPtr->db_lim = (U8*)cvmx_ptr_to_phys (dblkPtr->db_lim);
+        dblkPtr->db_base = (uint8_t*)cvmx_ptr_to_phys (dblkPtr->db_base);
+        dblkPtr->db_lim = (uint8_t*)cvmx_ptr_to_phys (dblkPtr->db_lim);
 
         curPtr->b_datap = (SsDblk*)cvmx_ptr_to_phys (curPtr->b_datap);
 
@@ -6751,15 +6347,10 @@ S16 SConvPtrPhy (mBuf)
  *       File:  ss_msg.c
  *
  */
-#ifdef ANSI
 S16 SConvPhyPtr
 (
- Buffer  **workPtr
- )
-#else
-S16 SConvPhyPtr (workPtr)
-  Buffer  **workPtr;
-#endif
+Buffer  **workPtr
+)
 {
 
   Buffer      *curPtr;
@@ -6776,43 +6367,43 @@ S16 SConvPhyPtr (workPtr)
   }
 
   /* Convert the buffer address to pointer */
-  mBuf = (Buffer*)cvmx_phys_to_ptr ((U64)(*workPtr));
+  mBuf = (Buffer*)cvmx_phys_to_ptr ((uint64_t)(*workPtr));
 
   curPtr = mBuf;
 
   /* first block is mblk */
   if (curPtr->b_next)
   {
-        curPtr->b_next = (Buffer*)cvmx_phys_to_ptr ((U64)curPtr->b_next);
+        curPtr->b_next = (Buffer*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_next);
   }
 
   if (curPtr->b_prev)
   {
-        curPtr->b_prev = (Buffer*)cvmx_phys_to_ptr ((U64)curPtr->b_prev);
+        curPtr->b_prev = (Buffer*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_prev);
   }
 
   if(curPtr->b_cont)
   {
-        curPtr->b_cont = (Buffer*)cvmx_phys_to_ptr ((U64)curPtr->b_cont);
+        curPtr->b_cont = (Buffer*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_cont);
   }
 
-  curPtr->b_rptr = (U8*)cvmx_phys_to_ptr ((U64)curPtr->b_rptr);
+  curPtr->b_rptr = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_rptr);
 
   /* Get the pointer for minfo */
   minfoPtr = (SsMsgInfo*)curPtr->b_rptr;
 
   if (minfoPtr->endptr)
   {
-        minfoPtr->endptr = (Buffer*)cvmx_phys_to_ptr ((U64)minfoPtr->endptr);
+        minfoPtr->endptr = (Buffer*)cvmx_phys_to_ptr ((uint64_t)minfoPtr->endptr);
   }
   if (minfoPtr->next)
   {
-        minfoPtr->next = (Buffer*)cvmx_phys_to_ptr ((U64)minfoPtr->next);
+        minfoPtr->next = (Buffer*)cvmx_phys_to_ptr ((uint64_t)minfoPtr->next);
   }
 
-  curPtr->b_wptr = (U8*)cvmx_phys_to_ptr ((U64)curPtr->b_wptr);
+  curPtr->b_wptr = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_wptr);
 
-  curPtr->b_datap = (SsDblk*)cvmx_phys_to_ptr ((U64)curPtr->b_datap);
+  curPtr->b_datap = (SsDblk*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_datap);
 
   /* Get the Dblock pointers */
   dblkPtr = (SsDblk*)curPtr->b_datap;
@@ -6821,22 +6412,22 @@ S16 SConvPhyPtr (workPtr)
 #ifdef SS_DBLK_FREE_RTN 
   if (dblkPtr->db_frtnp)
   {
-        dblkPtr->db_frtnp = (SsFrtn*)cvmx_phys_to_ptr ((U64)dblkPtr->db_frtnp);
+        dblkPtr->db_frtnp = (SsFrtn*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_frtnp);
     frtnPtr = dblkPtr->db_frtnp;
 
         if (frtnPtr->free_func)
         {
-               frtnPtr->free_func = cvmx_phys_to_ptr ((U64)frtnPtr->free_func);
+               frtnPtr->free_func = cvmx_phys_to_ptr ((uint64_t)frtnPtr->free_func);
         }
         if (frtnPtr->free_arg)
         {
-               frtnPtr->free_arg = (S8*)cvmx_phys_to_ptr ((U64)frtnPtr->free_arg);
+               frtnPtr->free_arg = (S8*)cvmx_phys_to_ptr ((uint64_t)frtnPtr->free_arg);
         }
   }
 #endif  
 
-  dblkPtr->db_base = (U8*)cvmx_phys_to_ptr ((U64)dblkPtr->db_base);
-  dblkPtr->db_lim = (U8*)cvmx_phys_to_ptr ((U64)dblkPtr->db_lim);
+  dblkPtr->db_base = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_base);
+  dblkPtr->db_lim = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_lim);
 
   curPtr = curPtr->b_cont;
 
@@ -6845,14 +6436,14 @@ S16 SConvPhyPtr (workPtr)
   {
         if(curPtr->b_cont)
         {
-               curPtr->b_cont = (Buffer*)cvmx_phys_to_ptr ((U64)curPtr->b_cont);
+               curPtr->b_cont = (Buffer*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_cont);
         }
 
-        curPtr->b_rptr = (U8*)cvmx_phys_to_ptr ((U64)curPtr->b_rptr);
+        curPtr->b_rptr = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_rptr);
 
-        curPtr->b_wptr = (U8*)cvmx_phys_to_ptr ((U64)curPtr->b_wptr);
+        curPtr->b_wptr = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_wptr);
 
-        curPtr->b_datap = (SsDblk*)cvmx_phys_to_ptr ((U64)curPtr->b_datap);
+        curPtr->b_datap = (SsDblk*)cvmx_phys_to_ptr ((uint64_t)curPtr->b_datap);
 
         /* Get the Dblock pointers */
         dblkPtr = (SsDblk*)curPtr->b_datap;
@@ -6861,23 +6452,23 @@ S16 SConvPhyPtr (workPtr)
 #ifdef SS_DBLK_FREE_RTN 
         if (dblkPtr->db_frtnp)
         {
-               dblkPtr->db_frtnp = (SsFrtn*)cvmx_phys_to_ptr ((U64)dblkPtr->db_frtnp);
+               dblkPtr->db_frtnp = (SsFrtn*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_frtnp);
 
       frtnPtr = dblkPtr->db_frtnp;
 
                if (frtnPtr->free_func)
                {
-                 frtnPtr->free_func = cvmx_phys_to_ptr ((U64)frtnPtr->free_func);
+                 frtnPtr->free_func = cvmx_phys_to_ptr ((uint64_t)frtnPtr->free_func);
                }
                if (frtnPtr->free_arg)
                {
-                 frtnPtr->free_arg = (S8*)cvmx_phys_to_ptr ((U64)frtnPtr->free_arg);
+                 frtnPtr->free_arg = (S8*)cvmx_phys_to_ptr ((uint64_t)frtnPtr->free_arg);
                }
         }
 #endif    
 
-        dblkPtr->db_base = (U8*)cvmx_phys_to_ptr ((U64)dblkPtr->db_base);
-        dblkPtr->db_lim = (U8*)cvmx_phys_to_ptr ((U64)dblkPtr->db_lim);
+        dblkPtr->db_base = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_base);
+        dblkPtr->db_lim = (uint8_t*)cvmx_phys_to_ptr ((uint64_t)dblkPtr->db_lim);
 
         curPtr = curPtr->b_cont;
   }
@@ -6907,21 +6498,13 @@ S16 SConvPhyPtr (workPtr)
  *       File:
  *
  */
-#ifdef ANSI
 S16 SCpyFpaMsg
 (
- Buffer *srcBuf,
- Region dstRegion,
- Pool dstPool,
- Buffer **dstBuf
- )
-#else
-S16 SCpyFpaMsg (srcBuf, dstRegion, dstPool, dstBuf)
-  Buffer *srcBuf;
-  Region dstRegion;
-  Pool dstPool;
-  Buffer **dstBuf;
-#endif
+Buffer *srcBuf,
+Region dstRegion,
+Pool dstPool,
+Buffer **dstBuf
+)
 {
 
   Size        numBytes;
@@ -7060,17 +6643,11 @@ S16 SCpyFpaMsg (srcBuf, dstRegion, dstPool, dstBuf)
  *       File:
  *
  */
-#ifdef ANSI
 S16 SCpyMsgFpa
 (
- Buffer *srcBuf,
- Buffer **dstBuf
- )
-#else
-S16 SCpyMsgFpa (srcBuf, dstBuf)
-  Buffer *srcBuf;
-  Buffer **dstBuf;
-#endif
+Buffer *srcBuf,
+Buffer **dstBuf
+)
 {
 
   Buffer     *curPtr = NULLP;
@@ -7082,7 +6659,7 @@ S16 SCpyMsgFpa (srcBuf, dstBuf)
   SsMsgInfo  *minfoDst = NULLP;
   SsDblk     *dblkPtr = NULLP;
   SsDblk     *dptr = NULLP;
-  U32         numBytes;
+  uint32_t         numBytes;
   Pool        pool;
 
 
@@ -7241,17 +6818,12 @@ S16 SCpyMsgFpa (srcBuf, dstBuf)
  *       File:
  *
  */
-#ifdef ANSI
 S16 SPutFpaMsg
 (
- Buffer *fpaBuf
+Buffer *fpaBuf
 )
-#else
-S16 SPutFpaMsg(fpaBuf)
-Buffer *fpaBuf;
-#endif
 {
-  U16      size;
+  uint16_t      size;
   Buffer   *curBlk;
   Buffer   *nextBlk;
   SsDblk   *dblkPtr;
@@ -7327,7 +6899,6 @@ Buffer *fpaBuf;
 *
 */
 
-#ifdef ANSI
 S16 SCpyPartMsg
 (
 Buffer *srcBuf,
@@ -7335,13 +6906,6 @@ MsgLen idx,
 MsgLen cnt,
 Buffer *dstBuf
 )
-#else
-S16 SCpyPartMsg(srcBuf, idx, cnt, dstBuf)
-Buffer *srcBuf;
-MsgLen idx;
-MsgLen cnt;
-Buffer *dstBuf;
-#endif
 {
    SsMsgInfo *sMinfo;
    SsMsgInfo *dMinfo;
@@ -7493,7 +7057,6 @@ Buffer *dstBuf;
 *
 */
 
-#ifdef ANSI
 S16 SRepPartMsg
 (
 Buffer *srcBuf,
@@ -7501,13 +7064,6 @@ MsgLen idx,
 MsgLen cnt,
 Buffer *dstBuf
 )
-#else
-S16 SRepPartMsg(srcBuf, idx, cnt, dstBuf)
-Buffer *srcBuf;
-MsgLen idx;
-MsgLen cnt;
-Buffer *dstBuf;
-#endif
 {
    SsMsgInfo *sMinfo;
    SsMsgInfo *dMinfo;
@@ -7635,19 +7191,12 @@ Buffer *dstBuf;
 */
 
 
-#ifdef ANSI
 S16 SMovPartMsg
 (
 Buffer *srcBuf,              /* message 1 */
 MsgLen idx,                 /* index */
 Buffer *dstBuf              /* message 2 */
 )
-#else
-S16 SMovPartMsg(srcBuf, idx, dstBuf)
-Buffer *srcBuf;              /* message 1 */
-MsgLen idx;                 /* index */
-Buffer *dstBuf;             /* message 2 */
-#endif
 {
    MsgLen     dCnt;
    MsgLen     sCnt;
@@ -7658,7 +7207,7 @@ Buffer *dstBuf;             /* message 2 */
    SsMsgInfo  *dMinfo;
 #ifdef T2K_MEM_LEAK_DBG
    char* file = __FILE__;
-   U32 line = __LINE__;
+   uint32_t line = __LINE__;
 #endif
 
 
@@ -7762,7 +7311,7 @@ Buffer *dstBuf;             /* message 2 */
             idx -= sCnt;
             /* deallocate the sBuf here */
             tmp = sBuf->b_cont;
-            /* printf("SMovPartMsg() sBuf is completely copied sBuf->b_cont(%p)\n", sBuf->b_cont); */
+            /* printf("\nSMovPartMsg() sBuf is completely copied sBuf->b_cont(%p)\n", sBuf->b_cont); */
             (Void)SPutDBuf(sMinfo->region, sMinfo->pool, sBuf);
             srcBuf->b_cont = sBuf = tmp;
          }
@@ -7809,19 +7358,12 @@ Buffer *dstBuf;             /* message 2 */
 *
 */
  
-#ifdef ANSI
 S16 SPkMsgMult
 (
 Data *src,
 MsgLen cnt,
 Buffer *mBuf
 )
-#else
-S16 SPkMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
 {
    SsMsgInfo *minfo;   /* Message info */
    Buffer *tmp;
@@ -7879,7 +7421,7 @@ Buffer *mBuf;
       /* update the read ptr */
       tmp->b_rptr -= numBytes;
       /* copy data */
-      memcpy((U8*)tmp->b_rptr, (src + cnt), numBytes);
+      memcpy(tmp->b_rptr, (src + cnt), numBytes);
       minfo->len += numBytes;
       if (!cnt)
       {
@@ -7896,7 +7438,7 @@ Buffer *mBuf;
    newblk->b_datap->db_type = SS_M_DATA;
    newblk->b_rptr = newblk->b_datap->db_lim - cnt;
    newblk->b_wptr = newblk->b_datap->db_lim;
-   memcpy((U8*)newblk->b_rptr, src, cnt);
+   memcpy(newblk->b_rptr, src, cnt);
    /* attach the newblk chain into mBuf */
    newblk->b_cont = tmp;
    mBuf->b_cont = newblk;
@@ -7920,19 +7462,12 @@ Buffer *mBuf;
 *       File:  ss_msg.c
 *
 */
-#ifdef ANSI
 S16 SGetReadPtr
 (
- Buffer *mBuf, 
- U8** data, 
- MsgLen *len
+Buffer *mBuf, 
+uint8_t** data, 
+MsgLen *len
 )
-#else
-S16 SGetReadPtr (mBuf, data, len)
-Buffer *mBuf; 
-U8** data; 
-MsgLen *len;
-#endif 
 {
 /*   Buffer       *tmp; */
 
@@ -7978,10 +7513,9 @@ Data    *ptr,
 MsgLen   totalLen,
 Buffer** mBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SAttachPtrToBuf
 (
 Region   region,
@@ -7990,14 +7524,6 @@ Data    *ptr,
 MsgLen   totalLen,
 Buffer** mBuf
 )
-#else
-S16 SAttachPtrToBuf(region, pool, ptr, totalLen, mBuf)
-Region   region;
-Pool     pool;
-Data    *ptr;
-MsgLen   totalLen;
-Buffer** mBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo;   /* Message info */
@@ -8027,7 +7553,7 @@ Buffer** mBuf;
    mdsize = MDBSIZE;
 
 #ifdef SS_HISTOGRAM_SUPPORT 
-   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (U8*) __FILE__, ENTNC) != ROK)
+   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (uint8_t*) __FILE__, ENTNC) != ROK)
 #else
    if (SAlloc(region, &mdsize, 0, (Data **) &newblk) != ROK)
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -8052,7 +7578,9 @@ Buffer** mBuf;
 #ifndef SS_DBUF_REFLOCK_DISABLE
    if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
    {
-      printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+      printf("\nFalied to destroy lock\n");
+#endif     
    }
 #endif
 
@@ -8083,25 +7611,19 @@ Buffer** mBuf;
 */
 
 #ifdef T2K_MEM_LEAK_DBG
-PRIVATE S16 SPutZbcDBufNew
+static S16 SPutZbcDBufNew
 (
 Region region,
 Buffer *buf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
-PRIVATE S16 SPutZbcDBuf
+static S16 SPutZbcDBuf
 (
 Region region,
 Buffer *buf
 )
-#else
-PRIVATE S16 SPutZbcDBuf(region, buf)
-Region region;
-Buffer *buf;
-#endif
 #endif
 {
    register SsDblk *dptr;
@@ -8125,14 +7647,14 @@ Buffer *buf;
 
 #ifdef SS_HISTOGRAM_SUPPORT 
       ret = SFree(region, (Data *) buf->b_datap->db_base, bufLen, __LINE__, 
-                  (U8*) __FILE__, ENTNC);
+                  (uint8_t*) __FILE__, ENTNC);
 #else
       ret = SFree(region, (Data *) buf->b_datap->db_base, bufLen);
 #endif /* SS_HISTOGRAM_SUPPORT */
 
       /* if the data block is not shared, free the buffer, checks not reqd */
 #ifdef SS_HISTOGRAM_SUPPORT 
-      ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (U8*) __FILE__, 
+      ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (uint8_t*) __FILE__, 
                   ENTNC);
 #else
       ret =  SFree(region, (Data *) buf, MDBSIZE);
@@ -8155,7 +7677,7 @@ Buffer *buf;
       if (buf != (SsMblk *) (((Data*) dptr) - MBSIZE))
       {
 #ifdef SS_HISTOGRAM_SUPPORT 
-         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (U8*) __FILE__, ENTNC);
+         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (uint8_t*) __FILE__, ENTNC);
 #else
          ret = SFree(region, (Data *) buf, MDBSIZE);
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -8168,18 +7690,20 @@ Buffer *buf;
          ret = SUnlock(&dptr->dBufLock) ;
          if((SDestroyLock(&dptr->dBufLock)) != 0)
          {
-             printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+             printf("\nFalied to destroy lock\n");
+#endif
          }
 #endif
 #ifdef SS_HISTOGRAM_SUPPORT 
          ret = SFree(region, (Data *) buf->b_datap->db_base, bufLen, __LINE__, 
-                   (U8*) __FILE__, ENTNC);
+                   (uint8_t*) __FILE__, ENTNC);
 #else
          ret = SFree(region, (Data *) buf->b_datap->db_base, bufLen);
 #endif /* SS_HISTOGRAM_SUPPORT */
 
 #ifdef SS_HISTOGRAM_SUPPORT 
-         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (U8*) __FILE__, 
+         ret = SFree(region, (Data *) buf, MDBSIZE, __LINE__, (uint8_t*) __FILE__, 
                   ENTNC);
 #else
          ret =  SFree(region, (Data *) buf, MDBSIZE);
@@ -8225,10 +7749,9 @@ MsgLen   totalLen,
 MsgLen   ptrLen,
 Buffer** mBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SAttachPtrToMBuf
 (
 Region   region,
@@ -8238,15 +7761,6 @@ MsgLen   totalLen,
 MsgLen   ptrLen,
 Buffer** mBuf
 )
-#else
-S16 SAttachPtrToMBuf(region, pool, ptr, totalLen, ptrLen, mBuf)
-Region   region;
-Pool     pool;
-Data    *ptr;
-MsgLen   totalLen;
-MsgLen   ptrLen;
-Buffer** mBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo;   /* Message info */
@@ -8274,7 +7788,7 @@ Buffer** mBuf;
    mdsize = MDBSIZE;
 
 #ifdef SS_HISTOGRAM_SUPPORT 
-   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (U8*) __FILE__, ENTNC) != ROK)
+   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (uint8_t*) __FILE__, ENTNC) != ROK)
 #else
    if (SAlloc(region, &mdsize, 0, (Data **) &newblk) != ROK)
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -8299,7 +7813,9 @@ Buffer** mBuf;
 #ifndef SS_DBUF_REFLOCK_DISABLE
    if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
    {
-      printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+      printf("\nFalied to destroy lock\n");
+#endif
    }
 #endif
 
@@ -8310,7 +7826,7 @@ Buffer** mBuf;
    minfo->len    = totalLen;
    minfo->endptr = newblk;
 
-   //printf("Mbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
+   //printf("\nMbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
    return ROK;
 }
 #endif /* INTEL_WLS */
@@ -8338,7 +7854,7 @@ Void SResetMBuf(Buffer *mbuf)
    if(tmp)
    {
 
-    //    printf("SResetMBuf The write & read ptr is %p %p %p %p \n", tmp->b_wptr, tmp->b_rptr, tmp->b_datap->db_base, tmp->b_datap->db_lim );
+    //    printf("\nSResetMBuf The write & read ptr is %p %p %p %p \n", tmp->b_wptr, tmp->b_rptr, tmp->b_datap->db_base, tmp->b_datap->db_lim );
 //      tmp->b_wptr = tmp->b_rptr = tmp->b_datap->db_base;
       tmp->b_wptr = tmp->b_rptr = (tmp->b_datap->db_base + 5);
       tmp->b_datap->db_ref = 1;
@@ -8347,7 +7863,7 @@ Void SResetMBuf(Buffer *mbuf)
 #endif
 
 
-   RETVOID;
+   return;
 }
 #endif
 
@@ -8381,10 +7897,9 @@ MsgLen   totalLen,
 MsgLen   ptrLen,
 Buffer** mBuf,
 char* file,
-U32 line
+uint32_t line
 )
 #else
-#ifdef ANSI
 S16 SAttachWlsPtrToMBuf
 (
 Region   region,
@@ -8395,16 +7910,6 @@ MsgLen   totalLen,
 MsgLen   ptrLen,
 Buffer** mBuf
 )
-#else
-S16 SAttachWlsPtrToMBuf(region, pool, ptr, readPtr, totalLen, ptrLen, mBuf)
-Region   region;
-Pool     pool;
-Data    *ptr;
-Data    *readPtr;
-MsgLen   totalLen;
-MsgLen   ptrLen;
-Buffer** mBuf;
-#endif
 #endif
 {
    SsMsgInfo *minfo;   /* Message info */
@@ -8432,7 +7937,7 @@ Buffer** mBuf;
    mdsize = MDBSIZE;
 
 #ifdef SS_HISTOGRAM_SUPPORT 
-   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (U8*) __FILE__, ENTNC) != ROK)
+   if (SAlloc(region, &mdsize, 0, (Data **) &newblk, __LINE__, (uint8_t*) __FILE__, ENTNC) != ROK)
 #else
    if (SAlloc(region, &mdsize, 0, (Data **) &newblk) != ROK)
 #endif /* SS_HISTOGRAM_SUPPORT */
@@ -8457,7 +7962,9 @@ Buffer** mBuf;
 #ifndef SS_DBUF_REFLOCK_DISABLE
    if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
    {
-      printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+      printf("\nFalied to destroy lock\n");
+#endif
    }
 #endif
 
@@ -8468,13 +7975,13 @@ Buffer** mBuf;
    minfo->len    = totalLen;
    minfo->endptr = newblk;
 
-   //printf("Mbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
+   //printf("\nMbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
    return ROK;
 }
 
 #ifdef TENB_DPDK_BUF
 
-extern U32 numeTti;
+uint32_t numeTti;
 
 S16 SGetSBufDpdk
 (
@@ -8494,8 +8001,8 @@ S16 SPutSBufDpdk
 Data *ptr                     /* pointer to buffer */
 )
 {
-    S16   ret;
-    U32   flags = 0;
+    S16   ret = ROK;
+    uint32_t   flags = 0;
 
     ntl_free(mtGetNtlHdl(), ptr);
 
@@ -8513,8 +8020,8 @@ Data       **ptr
     SsMsgInfo    *minfo;
 
     //msgBlk = mBuf->b_cont;
-    //*ptr   = msgBlk->b_rptr;;
-    *ptr   = mBuf->b_datap->db_base;;
+    //*ptr   = msgBlk->b_rptr;
+    *ptr   = mBuf->b_datap->db_base;
 
     mBuf->b_cont = NULL;
 
@@ -8553,7 +8060,7 @@ S16 SDetachDpdkPtrFrmMBuf
       return RFAILED;
    }   
 
-   *ptr   = msgBlk->b_rptr;;
+   *ptr   = msgBlk->b_rptr;
 
    mBuf->b_cont = NULL;
 
@@ -8564,7 +8071,6 @@ S16 SDetachDpdkPtrFrmMBuf
 }
 
 
-#ifdef ANSI
 S16 SAttachDpdkPtrToMBuf
 (
 Region   region,
@@ -8575,16 +8081,6 @@ MsgLen   msgLen,
 MsgLen   totalLen,
 Buffer** mBuf
 )
-#else
-S16 SAttachDpdkPtrToMBuf(region, pool, ptr, readPtr, msgLen, totalLen, mBuf)
-Region   region;
-Pool     pool;
-Data    *ptr;
-Data    *readPtr;
-MsgLen   msgLen;
-MsgLen   totalLen;
-Buffer** mBuf;
-#endif
 {
 
    SsDblk    *dptr;