Merge "[Epic-ID: ODUHIGH-405][Task-ID: ODUHIGH-437] Establishing communication betwee...
[o-du/l2.git] / src / cm / cm_gen.c
index a1f88bb..4fa4e20 100644 (file)
@@ -73,7 +73,7 @@
 /* functions in other modules */
 
 /* public variable declarations */
-U16 gTransId = 0;
+uint16_t gTransId = 0;
 
 /* private variable declarations */
 
@@ -97,17 +97,11 @@ U16 gTransId = 0;
 *
 */
   
-#ifdef ANSI
 S16 cmPkDateTime
 (
 DateTime *dateTime,       /* date and time */
 Buffer *mBuf              /* message buffer */
 )
-#else
-S16 cmPkDateTime(dateTime, mBuf)
-DateTime *dateTime;       /* date and time */
-Buffer *mBuf;             /* message buffer */
-#endif
 {
 
    /*-- cm_gen_c_001.main_36 - added for micro seconds --*/
@@ -140,17 +134,11 @@ Buffer *mBuf;             /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkDuration
 (
 Duration *duration,        /* duration */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 cmPkDuration(duration, mBuf)
-Duration *duration;        /* duration */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKPK(oduUnpackUInt8, duration->tenths, mBuf);
@@ -176,24 +164,18 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
  
-#ifdef ANSI
 S16 oduPackPointer
 (
 PTR      ptr,              /* pointer */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 oduPackPointer(ptr, mBuf)
-PTR      ptr;              /* pointer */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
    Data pkArray[PTRSIZE];   /* array for packing */
    S16 ret;                 /* return code */
-   U16 tmp;                 /* temporary value */
+   uint16_t tmp;                 /* temporary value */
 
 #if (defined(ALPHA) || defined(BIT_64))
-   U32 tmp32;
+   uint32_t tmp32;
 #endif
 
    
@@ -213,17 +195,17 @@ Buffer   *mBuf;            /* message buffer */
     
       case 4: 
 #ifndef FCSPKINT        /* backward compatibility, packing order */
-         tmp = (U16) GetHiWord(ptr);
+         tmp = (uint16_t) GetHiWord(ptr);
          pkArray[0] = (Data) GetHiByte(tmp);
          pkArray[1] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(ptr);
+         tmp = (uint16_t) GetLoWord(ptr);
          pkArray[2] = (Data) GetHiByte(tmp);
          pkArray[3] = (Data) GetLoByte(tmp);
 #else                   /* forward compatibility, packing order */
-         tmp = (U16) GetHiWord(ptr);
+         tmp = (uint16_t) GetHiWord(ptr);
          pkArray[3] = (Data) GetHiByte(tmp);
          pkArray[2] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(ptr);
+         tmp = (uint16_t) GetLoWord(ptr);
          pkArray[1] = (Data) GetHiByte(tmp);
          pkArray[0] = (Data) GetLoByte(tmp);
 #endif
@@ -233,33 +215,33 @@ Buffer   *mBuf;            /* message buffer */
       case 8:
 #if (defined(ALPHA) || defined(BIT_64))
 #ifndef FCSPKINT        /* backward compatibility, packing order */
-         tmp32 = (U32) GetHi32Bit(ptr);
-         tmp = (U16) GetHiWord(tmp32);
+         tmp32 = (uint32_t) GetHi32Bit(ptr);
+         tmp = (uint16_t) GetHiWord(tmp32);
          pkArray[0] = (Data) GetHiByte(tmp);
          pkArray[1] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(tmp32);
+         tmp = (uint16_t) GetLoWord(tmp32);
          pkArray[2] = (Data) GetHiByte(tmp);
          pkArray[3] = (Data) GetLoByte(tmp);
-         tmp32 = (U32) GetLo32Bit(ptr);
-         tmp = (U16) GetHiWord(tmp32);
+         tmp32 = (uint32_t) GetLo32Bit(ptr);
+         tmp = (uint16_t) GetHiWord(tmp32);
          pkArray[4] = (Data) GetHiByte(tmp);
          pkArray[5] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(tmp32);
+         tmp = (uint16_t) GetLoWord(tmp32);
          pkArray[6] = (Data) GetHiByte(tmp);
          pkArray[7] = (Data) GetLoByte(tmp);
 #else                   /* forward compatibility, packing order */
-         tmp32 = (U32) GetHi32Bit(ptr);
-         tmp = (U16) GetHiWord(tmp32);
+         tmp32 = (uint32_t) GetHi32Bit(ptr);
+         tmp = (uint16_t) GetHiWord(tmp32);
          pkArray[7] = (Data) GetHiByte(tmp);
          pkArray[6] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(tmp32);
+         tmp = (uint16_t) GetLoWord(tmp32);
          pkArray[5] = (Data) GetHiByte(tmp);
          pkArray[4] = (Data) GetLoByte(tmp);
-         tmp32 = (U32) GetLo32Bit(ptr);
-         tmp = (U16) GetHiWord(tmp32);
+         tmp32 = (uint32_t) GetLo32Bit(ptr);
+         tmp = (uint16_t) GetHiWord(tmp32);
          pkArray[3] = (Data) GetHiByte(tmp);
          pkArray[2] = (Data) GetLoByte(tmp);
-         tmp = (U16) GetLoWord(tmp32);
+         tmp = (uint16_t) GetLoWord(tmp32);
          pkArray[1] = (Data) GetHiByte(tmp);
          pkArray[0] = (Data) GetLoByte(tmp);
 #endif
@@ -267,7 +249,7 @@ Buffer   *mBuf;            /* message buffer */
          break;
 #endif
       default:
-         /* no support for U64 */
+         /* no support for uint64_t */
          ret = RFAILED;
    }
 
@@ -289,17 +271,11 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkEntityId
 (
 EntityId *entityId,        /* entity id */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 cmPkEntityId(entityId, mBuf)
-EntityId *entityId;        /* entity id */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKPK(cmPkInst, entityId->inst, mBuf);
@@ -323,17 +299,11 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkElmntId
 (
 ElmntId *elmntId,         /* element id */
 Buffer  *mBuf             /* message buffer */
 )
-#else
-S16 cmPkElmntId(elmntId, mBuf)
-ElmntId *elmntId;         /* element id */
-Buffer  *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKPK(cmPkElmntInst3, elmntId->elmntInst3, mBuf); 
@@ -359,17 +329,11 @@ Buffer  *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkMemoryId
 (
 MemoryId *memoryId,        /* memoryId */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 cmPkMemoryId(memoryId, mBuf)
-MemoryId *memoryId;        /* memoryId */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKPK(cmPkPool, memoryId->pool, mBuf); 
@@ -393,17 +357,11 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkSystemId
 (
 SystemId *systemId,         /* system id */
 Buffer   *mBuf              /* message buffer */
 )
-#else
-S16 cmPkSystemId(systemId, mBuf)
-SystemId *systemId;         /* system id */
-Buffer   *mBuf;             /* message buffer */
-#endif
 {
    Txt *p;                  /* part number string */
 
@@ -441,19 +399,13 @@ Buffer   *mBuf;             /* message buffer */
  *
  */
 
-#ifdef ANSI
 S16 cmPkProtAddr
 (
 ProtAddr     *pAddr,     /* protocol address */
 Buffer       *mBuf       /* buffer */
 )
-#else
-S16 cmPkProtAddr(pAddr, mBuf)
-ProtAddr     *pAddr;      /* protocol address */
-Buffer       *mBuf;          /* buffer */
-#endif
 {
-   U8              j;                  /* Index */
+   uint8_t              j;                  /* Index */
 
 
 #ifdef CM_ARI2
@@ -489,20 +441,14 @@ Buffer       *mBuf;          /* buffer */
  *
  */
 
-#ifdef ANSI
 S16 cmPkProtAddrTbl
 (
 ProtAddrTbl  *protAddr,      /* protocol address table */
 Buffer       *mBuf          /* buffer */
 )
-#else
-S16 cmPkProtAddrTbl(protAddr, mBuf)
-ProtAddrTbl  *protAddr;      /* protocol address table */
-Buffer       *mBuf;          /* buffer */
-#endif
 {
-   U8              i;                  /* index */
-   U8              j;                  /* Index */
+   uint8_t              i;                  /* index */
+   uint8_t              j;                  /* Index */
    ProtAddr        *pAddr;             /* protocol Address */
 
 
@@ -547,19 +493,13 @@ Buffer       *mBuf;          /* buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkAddrs
 (
 Addrs *addrs,           /* address */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmPkAddrs(addrs, mBuf)
-Addrs *addrs;           /* address */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
-   U8 i;                /* loop counter */
+   uint8_t i;                /* loop counter */
 
 
    if (addrs->length > ADRLEN)
@@ -591,19 +531,13 @@ Buffer *mBuf;           /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkShrtAddrs
 (
 ShrtAddrs *addrs,          /* address */
 Buffer    *mBuf            /* message buffer */
 )
-#else
-S16 cmPkShrtAddrs(addrs, mBuf)
-ShrtAddrs *addrs;          /* address */
-Buffer    *mBuf;           /* message buffer */
-#endif 
 {
-   U8 i;                /* loop counter */
+   uint8_t i;                /* loop counter */
 
 
    if (addrs->length > SHRTADRLEN)
@@ -634,17 +568,11 @@ Buffer    *mBuf;           /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkAddrMask
 (
-U8 *mask,             /* pointer to address mask array */
+uint8_t *mask,             /* pointer to address mask array */
 Buffer  *mBuf         /* message buffer */
 )
-#else
-S16 cmPkAddrMask(mask, mBuf)
-U8 *mask;             /* pointer to address mask array */
-Buffer  *mBuf;        /* message buffer */
-#endif
 {
    S16 i;             /* counter */
 
@@ -673,17 +601,11 @@ Buffer  *mBuf;        /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkBndCfg
 (
 BndCfg *bndCfg,         /* bndCfg */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmPkBndCfg(bndCfg, mBuf)
-BndCfg *bndCfg;         /* bndCfg */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
    Txt *p;              /* temporary */
 
@@ -721,17 +643,11 @@ Buffer *mBuf;           /* message buffer */
 *       File:  cm_gen.c
 *
 */
-#ifdef ANSI
 S16 cmPkPst
 (
 Pst *pst,
 Buffer *mBuf
 )
-#else
-S16 cmPkPst(pst, mBuf)
-Pst *pst;
-Buffer *mBuf;
-#endif
 {
    
    CMCHKPK(cmPkEvent, pst->event, mBuf);
@@ -767,17 +683,11 @@ Buffer *mBuf;
  *
  */
   
-#ifdef ANSI
 S16 cmPkElmtHdr
 (
 ElmtHdr *m,                  /* element header */
 Buffer  *mBuf                /* message buffer */
 )
-#else
-S16 cmPkElmtHdr(m, mBuf)
-ElmtHdr *m;                  /* element header */
-Buffer  *mBuf;               /* message buffer */
-#endif
 {
  
 #if (LCAMT || ATM_BISUP)
@@ -801,9 +711,9 @@ Buffer  *mBuf;               /* message buffer */
 \f
 /*
  *
- *      Fun:   cmPkTknU8
+ *      Fun:   cmPkTknUInt8
  *
- *      Desc:  This function packs a token U8
+ *      Desc:  This function packs a token uint8_t
  *
  *      Ret:   ROK      - ok
  *
@@ -813,30 +723,24 @@ Buffer  *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
-S16 cmPkTknU8
+S16 cmPkTknUInt8
 (
-TknU8  *tknU8,              /* token U8 */
+TknUInt8  *tknUInt8,              /* token uint8_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknU8(tknU8, mBuf)
-TknU8  *tknU8;              /* token U8 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
-   if (tknU8->pres)
+   if (tknUInt8->pres)
    {
       /* Value */
-      CMCHKPK(oduUnpackUInt8, tknU8->val, mBuf);
+      CMCHKPK(oduUnpackUInt8, tknUInt8->val, mBuf);
    }
 
    /* Token Header */
-   CMCHKPK(oduUnpackUInt8, tknU8->pres, mBuf);
+   CMCHKPK(oduUnpackUInt8, tknUInt8->pres, mBuf);
 
    return ROK;
-} /* end of cmPkTknU8 */
+} /* end of cmPkTknUInt8 */
 
 \f
 /*
@@ -853,17 +757,11 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknS8
 (
 TknS8  *tknS8,              /* token S8 */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknS8(tknS8, mBuf)
-TknS8  *tknS8;              /* token S8 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
  
    if (tknS8->pres)
@@ -881,9 +779,9 @@ Buffer *mBuf;               /* message buffer */
 \f
 /*
  *
- *      Fun:   cmPkTknU16
+ *      Fun:   cmPkTknUInt16
  *
- *      Desc:  This function packs a token U16
+ *      Desc:  This function packs a token uint16_t
  *
  *      Ret:   ROK      - ok
  *
@@ -893,37 +791,31 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
-S16 cmPkTknU16
+S16 cmPkTknUInt16
 (
-TknU16 *tknU16,             /* token U16 */
+TknUInt16 *tknUInt16,             /* token uint16_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknU16(tknU16, mBuf)
-TknU16 *tknU16;             /* token U16 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
-   if (tknU16->pres)
+   if (tknUInt16->pres)
    {
       /* Value */
-      CMCHKPK(oduUnpackUInt16, tknU16->val, mBuf);
+      CMCHKPK(oduUnpackUInt16, tknUInt16->val, mBuf);
    }
 
    /* Token Header */
-   CMCHKPK(oduUnpackUInt8, tknU16->pres, mBuf);
+   CMCHKPK(oduUnpackUInt8, tknUInt16->pres, mBuf);
 
    return ROK;
-} /* end of cmPkTknU16 */
+} /* end of cmPkTknUInt16 */
 
 \f
 /*
  *
- *      Fun:   cmPkTknU32
+ *      Fun:   cmPkTknUInt32
  *
- *      Desc:  This function packs a token U32
+ *      Desc:  This function packs a token uint32_t
  *
  *      Ret:   ROK      - ok
  *
@@ -933,30 +825,24 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
-S16 cmPkTknU32
+S16 cmPkTknUInt32
 (
-TknU32 *tknU32,             /* token U32 */
+TknUInt32 *tknUInt32,             /* token uint32_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknU32(tknU32, mBuf)
-TknU32 *tknU32;             /* token U32 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
-   if (tknU32->pres)
+   if (tknUInt32->pres)
    {
       /* Value */
-      CMCHKPK(oduUnpackUInt32, tknU32->val, mBuf);
+      CMCHKPK(oduUnpackUInt32, tknUInt32->val, mBuf);
    }
 
    /* Token Header */
-   CMCHKPK(oduUnpackUInt8, tknU32->pres, mBuf);
+   CMCHKPK(oduUnpackUInt8, tknUInt32->pres, mBuf);
 
    return ROK;
-} /* end of cmPkTknU32 */
+} /* end of cmPkTknUInt32 */
 
 \f
 /*
@@ -973,17 +859,11 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr
 (
 TknStr *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr(tknStr, mBuf)
-TknStr *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                    /* counter */
 
@@ -1021,17 +901,11 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStrM
 (
 TknStrM *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStrM(tknStr, mBuf)
-TknStrM *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                    /* counter */
 
@@ -1069,17 +943,11 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStrS
 (
 TknStrS *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStrS(tknStr, mBuf)
-TknStrS *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                    /* counter */
 
@@ -1117,17 +985,11 @@ Buffer *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStrE
 (
 TknStrE *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStrE(tknStr, mBuf)
-TknStrE *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                    /* counter */
 
@@ -1167,17 +1029,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkPnNodeId
 (
 PnNodeId  *src,     /* source PNNI Node Id */
 Buffer *mBuf        /* message buffer */
 )
-#else
-S16 cmPkPnNodeId (src, mBuf)
-PnNodeId  *src;     /* source PNNI Node Id */
-Buffer *mBuf;       /* message buffer */
-#endif
 {
    S16 i;
    
@@ -1207,17 +1063,11 @@ Buffer *mBuf;       /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr4
 (
 TknStr4 *tknStr,             /* token string */
 Buffer  *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr4(tknStr, mBuf)
-TknStr4 *tknStr;             /* token string */
-Buffer  *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1242,17 +1092,11 @@ Buffer  *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr12
 (
 TknStr12 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr12(tknStr, mBuf)
-TknStr12 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1276,17 +1120,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr32
 (
 TknStr32 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr32(tknStr, mBuf)
-TknStr32 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1310,17 +1148,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr64
 (
 TknStr64 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr64(tknStr, mBuf)
-TknStr64 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1344,17 +1176,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr132
 (
 TknStr132 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr132(tknStr, mBuf)
-TknStr132 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1378,17 +1204,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknStr256
 (
 TknStr256 *tknStr,             /* token string */
 Buffer    *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknStr256(tknStr, mBuf)
-TknStr256 *tknStr;             /* token string */
-Buffer    *mBuf;               /* message buffer */
-#endif
 {
 
    CMPKTKNSTR(tknStr, mBuf);
@@ -1412,33 +1232,27 @@ Buffer    *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknOid
 (
 TknOid   *tknOid,             /* Object Identifier token */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknOid(tknOid, mBuf)
-TknOid   *tknOid;             /* Object Identifier token */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
-   U16    i;
+   uint16_t    i;
 
  
    if (tknOid->pres == TRUE)
    {
       /* Pack the value */
-      for (i = 0; i < (U16)tknOid->len; i++)
+      for (i = 0; i < (uint16_t)tknOid->len; i++)
       {
-         /* cm_gen_c_001.main_33: changes for TknOid value from U16 to U32
-          * with compilation flag TKNOID_U16 */
-#ifndef TKNOID_U16
+         /* cm_gen_c_001.main_33: changes for TknOid value from uint16_t to uint32_t
+          * with compilation flag TKNOID_UINT16 */
+#ifndef TKNOID_UINT16
          CMCHKPK(oduUnpackUInt32, tknOid->val[i], mBuf);
 #else
          CMCHKPK(oduUnpackUInt16, tknOid->val[i], mBuf);
-#endif  /* !TKNOID_U16 */
+#endif  /* !TKNOID_UINT16 */
       }
       /* Pack the length */
       CMCHKPK(oduUnpackUInt8, tknOid->len, mBuf);
@@ -1464,17 +1278,11 @@ Buffer   *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkTknS32
 (
 TknS32 *tknS32,             /* token S32 */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknS32(tknS32, mBuf)
-TknS32 *tknS32;             /* token S32 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    if (tknS32->pres)
@@ -1504,17 +1312,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkHeader
 (
 Header *header,             /* header */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkHeader(header, mBuf)
-Header *header;             /* header */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
 #ifdef LMINT3
@@ -1549,17 +1351,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkCmStatus
 (
 CmStatus *sta,              /* status structure */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmPkCmStatus(sta, mBuf)
-CmStatus *sta;              /* status structure */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    CMCHKPK(oduUnpackUInt16, sta->reason, mBuf);
@@ -1583,17 +1379,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkCmAlarm
 (
 CmAlarm *alarm,            /* alarm structure */
 Buffer  *mBuf              /* message buffer */
 )
-#else
-S16 cmPkCmAlarm(alarm, mBuf)
-CmAlarm *alarm;             /* alarm structure */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    CMCHKPK(oduUnpackUInt16, alarm->cause, mBuf);
@@ -1619,17 +1409,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkSmCfg
 (
 SmCfg *smCfg,           /* stack manager */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmPkSmCfg(smCfg, mBuf)
-SmCfg *smCfg;           /* stack manager */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKPK(cmPkSelector, smCfg->selector, mBuf); 
@@ -1658,17 +1442,11 @@ Buffer *mBuf;           /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkTmrCfg
 (
 TmrCfg *tmrCfg,         /* timer configuration */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmPkTmrCfg(tmrCfg, mBuf)
-TmrCfg *tmrCfg;         /* timer configuration */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKPK(oduUnpackUInt16, tmrCfg->val, mBuf);
@@ -1692,17 +1470,11 @@ Buffer *mBuf;           /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmPkTknBuf
 (
 TknBuf *tknBuf,                /* token string */
 Buffer    *mBuf                /* message buffer */
 )
-#else
-S16 cmPkTknBuf(tknBuf, mBuf)
-TknBuf *tknBuf;                /* token string */
-Buffer    *mBuf;               /* message buffer */
-#endif
 {
 
    if(tknBuf->pres)
@@ -1739,17 +1511,11 @@ Buffer    *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmPkIntf
 (
 CmIntf *intf,           /* interface info */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmPkIntf(intf, mBuf)
-CmIntf *intf;           /* interface info */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKPK(cmPkIntfId,  intf->intfId,  mBuf); 
@@ -1779,17 +1545,11 @@ Buffer *mBuf;           /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkDateTime
 (
 DateTime *dateTime,  /* date/time structure */
 Buffer *mBuf         /* message buffer */
 )
-#else
-S16 cmUnpkDateTime(dateTime, mBuf)
-DateTime *dateTime;  /* date/time structure */
-Buffer *mBuf;        /* message buffer */
-#endif
 {
 
    CMCHKUNPK(oduPackUInt8, &dateTime->month, mBuf); 
@@ -1823,17 +1583,11 @@ Buffer *mBuf;        /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkDuration
 (
 Duration *duration,  /* duration structure */
 Buffer *mBuf         /* message buffer */
 )
-#else
-S16 cmUnpkDuration(duration, mBuf)
-Duration *duration;  /* duration structure */
-Buffer *mBuf;        /* message buffer */
-#endif
 {
 
    CMCHKUNPK(oduPackUInt8, &duration->days, mBuf); 
@@ -1859,25 +1613,19 @@ Buffer *mBuf;        /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 oduUnpackPointer
 (
 PTR *ptr,  /* duration structure */
 Buffer *mBuf    /* message buffer */
 )
-#else
-S16 oduUnpackPointer(ptr, mBuf)
-PTR *ptr;  /* duration structure */
-Buffer *mBuf;   /* message buffer */
-#endif
 {
-   U16 tmp16;               /* temporary value */
-   U32 tmp32;               /* temporary value */
-   Data unpkArray[PTRSIZE]; /* unpacking array */
-   S16 ret;                 /* return code */
+   uint16_t tmp16 =0;               /* temporary value */
+   uint32_t tmp32 =0;               /* temporary value */
+   Data unpkArray[PTRSIZE];        /* unpacking array */
+   S16 ret =ROK;                 /* return code */
 
 #if (defined(ALPHA) || defined(BIT_64))
-   U64 tmp64;
+   uint64_t tmp64 =0;
 #endif
    
 
@@ -1890,11 +1638,11 @@ Buffer *mBuf;   /* message buffer */
 
          tmp16 = 0; 
 #ifndef FCSPKINT            /* backward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]);
 #else                       /* forward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]);
 #endif
          *ptr = tmp16;
          break;
@@ -1907,19 +1655,19 @@ Buffer *mBuf;   /* message buffer */
          tmp16 = 0;
          tmp32 = 0; 
 #ifndef FCSPKINT            /* backward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[3]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[2]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[3]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[2]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
 #else                       /* forward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[2]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[3]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[2]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[3]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
 #endif
          *ptr = tmp32;
          break;
@@ -1934,41 +1682,41 @@ Buffer *mBuf;   /* message buffer */
          tmp32 = 0; 
          tmp64 = 0;
 #ifndef FCSPKINT            /* backward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[7]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[6]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[5]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[4]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
-         tmp64 = (U64) PutHi32Bit(tmp64, tmp32);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[3]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[2]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[1]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[0]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
-         tmp64 = (U64) PutLo32Bit(tmp64, tmp32);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[7]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[6]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[5]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[4]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
+         tmp64 = (uint64_t) PutHi32Bit(tmp64, tmp32);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[3]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[2]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[1]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[0]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
+         tmp64 = (uint64_t) PutLo32Bit(tmp64, tmp32);
 #else                       /* forward compatibility, packing order */
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[0]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[2]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[3]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
-         tmp64 = (U64) PutHi32Bit(tmp64, tmp32);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[4]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[5]);
-         tmp32 = (U32) PutHiWord(tmp32, (U16) tmp16);
-         tmp16 = (U16) PutHiByte(tmp16, (U8) unpkArray[6]);
-         tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[7]);
-         tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16);
-         tmp64 = (U64) PutLo32Bit(tmp64, tmp32);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[0]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[1]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[2]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[3]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
+         tmp64 = (uint64_t) PutHi32Bit(tmp64, tmp32);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[4]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[5]);
+         tmp32 = (uint32_t) PutHiWord(tmp32, (uint16_t) tmp16);
+         tmp16 = (uint16_t) PutHiByte(tmp16, (uint8_t) unpkArray[6]);
+         tmp16 = (uint16_t) PutLoByte(tmp16, (uint8_t) unpkArray[7]);
+         tmp32 = (uint32_t) PutLoWord(tmp32, (uint16_t) tmp16);
+         tmp64 = (uint64_t) PutLo32Bit(tmp64, tmp32);
 #endif
          *ptr = tmp64;
          break;
 #endif
       default:
-         /* no support for U64 */
+         /* no support for uint64_t */
          ret = RFAILED;
    }
 
@@ -1990,17 +1738,11 @@ Buffer *mBuf;   /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkEntityId
 (
 EntityId *entityId,        /* entity id */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 cmUnpkEntityId(entityId, mBuf)
-EntityId *entityId;        /* entity id */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkEnt, &entityId->ent, mBuf); 
@@ -2024,17 +1766,11 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkElmntId
 (
 ElmntId *elmntId,         /* element id */
 Buffer  *mBuf             /* message buffer */
 )
-#else
-S16 cmUnpkElmntId(elmntId, mBuf)
-ElmntId *elmntId;         /* element id */
-Buffer  *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkElmnt, &elmntId->elmnt, mBuf); 
@@ -2060,17 +1796,11 @@ Buffer  *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkMemoryId
 (
 MemoryId *memoryId,        /* memoryId */
 Buffer   *mBuf             /* message buffer */
 )
-#else
-S16 cmUnpkMemoryId(memoryId, mBuf)
-MemoryId *memoryId;        /* memoryId */
-Buffer   *mBuf;            /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkRegion, &memoryId->region,   mBuf); 
@@ -2094,17 +1824,11 @@ Buffer   *mBuf;            /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkSystemId
 (
 SystemId *systemId,         /* system id */
 Buffer   *mBuf              /* message buffer */
 )
-#else
-S16 cmUnpkSystemId(systemId, mBuf)
-SystemId *systemId;         /* system id */
-Buffer   *mBuf;             /* message buffer */
-#endif
 {
    S16 i;               /* loop counter */
    MsgLen len;
@@ -2142,19 +1866,13 @@ Buffer   *mBuf;             /* message buffer */
  *
  */
 
-#ifdef ANSI
 S16 cmUnpkProtAddr
 (
 ProtAddr     *pAddr,         /* protocol address */
 Buffer       *mBuf           /* buffer */
 )
-#else
-S16 cmUnpkProtAddr(pAddr, mBuf)
-ProtAddr     *pAddr;         /* protocol address table */
-Buffer       *mBuf;          /* buffer */
-#endif
 {
-   U8               j;                  /* Index */
+   uint8_t               j;                  /* Index */
 
 
    CMCHKUNPK(oduPackUInt16,  &(pAddr->protType), mBuf);  
@@ -2188,20 +1906,14 @@ Buffer       *mBuf;          /* buffer */
  *
  */
 
-#ifdef ANSI
 S16 cmUnpkProtAddrTbl
 (
 ProtAddrTbl  *protAddr,      /* protocol address table */
 Buffer       *mBuf           /* buffer */
 )
-#else
-S16 cmUnpkProtAddrTbl(protAddr, mBuf)
-ProtAddrTbl  *protAddr;      /* protocol address table */
-Buffer       *mBuf;          /* buffer */
-#endif
 {
-   U8               i;                  /* index */
-   U8               j;                  /* Index */
+   uint8_t               i;                  /* index */
+   uint8_t               j;                  /* Index */
    ProtAddr         *pAddr;             /* Protocol Address */
 
 
@@ -2241,19 +1953,13 @@ Buffer       *mBuf;          /* buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkAddrs
 (
 Addrs *addrs,     /* address */
 Buffer *mBuf      /* message buffer */
 )
-#else
-S16 cmUnpkAddrs(addrs, mBuf)
-Addrs *addrs;     /* address */
-Buffer *mBuf;     /* message buffer */
-#endif
 {
-   U8 i;          /* loop counter */
+   uint8_t i;          /* loop counter */
 
 
    CMCHKUNPK(oduPackUInt8, &addrs->length, mBuf);
@@ -2283,19 +1989,13 @@ Buffer *mBuf;     /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkShrtAddrs
 (
 ShrtAddrs *addrs,    /* address */
 Buffer    *mBuf      /* message buffer */
 )
-#else
-S16 cmUnpkShrtAddrs(addrs, mBuf)
-ShrtAddrs *addrs;    /* address */
-Buffer    *mBuf;     /* message buffer */
-#endif
 {
-   U8 i;          /* loop counter */
+   uint8_t i;          /* loop counter */
 
 
    CMCHKUNPK(oduPackUInt8, &addrs->length, mBuf);
@@ -2325,17 +2025,11 @@ Buffer    *mBuf;     /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkAddrMask
 (
-U8 *mask,             /* pointer to address mask */
+uint8_t *mask,             /* pointer to address mask */
 Buffer  *mBuf         /* message buffer */
 )
-#else
-S16 cmUnpkAddrMask(mask, mBuf)
-U8 *mask;             /* pointer to address mask */
-Buffer  *mBuf;        /* message buffer */
-#endif
 {
    S16 i;             /* counter */
 
@@ -2363,17 +2057,11 @@ Buffer  *mBuf;        /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkBndCfg
 (
 BndCfg *bndCfg,         /* bndCfg */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmUnpkBndCfg(bndCfg, mBuf)
-BndCfg *bndCfg;         /* bndCfg */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
    S16 i;               /* loop counter */
 
@@ -2410,17 +2098,11 @@ Buffer *mBuf;           /* message buffer */
 *       File:  cm_gen.c
 *
 */
-#ifdef ANSI
 S16 cmUnpkPst
 (
 Pst *pst,
 Buffer *mBuf
 )
-#else
-S16 cmUnpkPst(pst, mBuf)
-Pst *pst;
-Buffer *mBuf;
-#endif
 {
 
 #ifdef TDS_ROLL_UPGRADE_SUPPORT
@@ -2456,17 +2138,11 @@ Buffer *mBuf;
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkElmtHdr
 (
 ElmtHdr *m,                  /* element header */
 Buffer  *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkElmtHdr(m, mBuf)
-ElmtHdr *m;                  /* element header */
-Buffer  *mBuf;               /* message buffer */
-#endif
 {
  
    /* Present */
@@ -2490,9 +2166,9 @@ Buffer  *mBuf;               /* message buffer */
 \f
 /*
 *
-*       Fun:   cmUnpkTknU8
+*       Fun:   cmUnpkTknUInt8
 *
-*       Desc:  This function unpacks a token U8
+*       Desc:  This function unpacks a token uint8_t
 *
 *       Ret:   ROK      - ok
 *
@@ -2502,30 +2178,24 @@ Buffer  *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
-S16 cmUnpkTknU8
+S16 cmUnpkTknUInt8
 (
-TknU8 *tknU8,               /* token U8 */
+TknUInt8 *tknUInt8,               /* token uint8_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknU8(tknU8, mBuf)
-TknU8 *tknU8;               /* token U8 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    /* Token Header */
-   CMCHKUNPK(oduPackUInt8, &tknU8->pres, mBuf);
+   CMCHKUNPK(oduPackUInt8, &tknUInt8->pres, mBuf);
 
-   if (tknU8->pres)
+   if (tknUInt8->pres)
    {
       /* Value */
-      CMCHKUNPK(oduPackUInt8, &tknU8->val, mBuf);
+      CMCHKUNPK(oduPackUInt8, &tknUInt8->val, mBuf);
    }
 
    return ROK;
-} /* end of cmUnpkTknU8 */
+} /* end of cmUnpkTknUInt8 */
 
 \f
 /*
@@ -2542,17 +2212,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknS8
 (
 TknS8 *tknS8,               /* token S8 */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknS8(tknS8, mBuf)
-TknS8 *tknS8;               /* token S8 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
  
    /* Token Header */
@@ -2570,9 +2234,9 @@ Buffer *mBuf;               /* message buffer */
 \f
 /*
 *
-*       Fun:   cmUnpkTknU16
+*       Fun:   cmUnpkTknUInt16
 *
-*       Desc:  This function unpacks a token U16
+*       Desc:  This function unpacks a token uint16_t
 *
 *       Ret:   ROK      - ok
 *
@@ -2582,37 +2246,31 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
-S16 cmUnpkTknU16
+S16 cmUnpkTknUInt16
 (
-TknU16 *tknU16,             /* token U16 */
+TknUInt16 *tknUInt16,             /* token uint16_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknU16(tknU16, mBuf)
-TknU16 *tknU16;             /* token U16 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    /* Token Header */
-   CMCHKUNPK(oduPackUInt8, &tknU16->pres, mBuf);
+   CMCHKUNPK(oduPackUInt8, &tknUInt16->pres, mBuf);
 
-   if (tknU16->pres)
+   if (tknUInt16->pres)
    {
       /* Value */
-      CMCHKUNPK(oduPackUInt16, &tknU16->val, mBuf);
+      CMCHKUNPK(oduPackUInt16, &tknUInt16->val, mBuf);
    }
 
    return ROK;
-} /* end of cmUnpkTknU16 */
+} /* end of cmUnpkTknUInt16 */
 
 \f
 /*
 *
-*       Fun:   cmUnpkTknU32
+*       Fun:   cmUnpkTknUInt32
 *
-*       Desc:  This function unpacks a token U32
+*       Desc:  This function unpacks a token uint32_t
 *
 *       Ret:   ROK      - ok
 *
@@ -2622,30 +2280,24 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
-S16 cmUnpkTknU32
+S16 cmUnpkTknUInt32
 (
-TknU32 *tknU32,             /* token U32 */
+TknUInt32 *tknUInt32,             /* token uint32_t */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknU32(tknU32, mBuf)
-TknU32 *tknU32;             /* token U32 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    /* Token Header */
-   CMCHKUNPK(oduPackUInt8, &tknU32->pres, mBuf);
+   CMCHKUNPK(oduPackUInt8, &tknUInt32->pres, mBuf);
 
-   if (tknU32->pres)
+   if (tknUInt32->pres)
    {
       /* Value */
-      CMCHKUNPK(oduPackUInt32, &tknU32->val, mBuf);
+      CMCHKUNPK(oduPackUInt32, &tknUInt32->val, mBuf);
    }
 
    return ROK;
-} /* end of cmUnpkTknU32 */
+} /* end of cmUnpkTknUInt32 */
 
 /*
 *
@@ -2661,17 +2313,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknStr
 (
 TknStr *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr(tknStr, mBuf)
-TknStr *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                     /* counter */
 
@@ -2710,17 +2356,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknStrM
 (
 TknStrM *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStrM(tknStr, mBuf)
-TknStrM *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                     /* counter */
 
@@ -2760,17 +2400,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknStrS
 (
 TknStrS *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStrS(tknStr, mBuf)
-TknStrS *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                     /* counter */
 
@@ -2810,17 +2444,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknStrE
 (
 TknStrE *tknStr,             /* token string */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStrE(tknStr, mBuf)
-TknStrE *tknStr;             /* token string */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
    Cntr i;                     /* counter */
 
@@ -2862,17 +2490,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkPnNodeId
 (
 PnNodeId  *dst,     /* source PNNI Node Id */
 Buffer *mBuf        /* message buffer */
 )
-#else
-S16 cmUnpkPnNodeId (dst, mBuf)
-PnNodeId  *dst;     /* source PNNI Node Id */
-Buffer *mBuf;       /* message buffer */
-#endif
 {
    S16 i;
    
@@ -2902,17 +2524,11 @@ Buffer *mBuf;       /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr4
 (
 TknStr4 *tknStr,             /* token string */
 Buffer  *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr4(tknStr, mBuf)
-TknStr4 *tknStr;             /* token string */
-Buffer  *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -2937,17 +2553,11 @@ Buffer  *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr12
 (
 TknStr12 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr12(tknStr, mBuf)
-TknStr12 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -2971,17 +2581,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr32
 (
 TknStr32 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr32(tknStr, mBuf)
-TknStr32 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -3005,17 +2609,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr64
 (
 TknStr64 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr64(tknStr, mBuf)
-TknStr64 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -3039,17 +2637,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr132
 (
 TknStr132 *tknStr,             /* token string */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr132(tknStr, mBuf)
-TknStr132 *tknStr;             /* token string */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -3073,17 +2665,11 @@ Buffer   *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknStr256
 (
 TknStr256 *tknStr,             /* token string */
 Buffer    *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknStr256(tknStr, mBuf)
-TknStr256 *tknStr;             /* token string */
-Buffer    *mBuf;               /* message buffer */
-#endif
 {
 
    CMUNPKTKNSTR(tknStr, mBuf);
@@ -3107,19 +2693,13 @@ Buffer    *mBuf;               /* message buffer */
  *
  */
   
-#ifdef ANSI
 S16 cmUnpkTknOid
 (
 TknOid   *tknOid,             /* Object Identifier token */
 Buffer   *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknOid(tknOid, mBuf)
-TknOid   *tknOid;             /* Object Identifier token */
-Buffer   *mBuf;               /* message buffer */
-#endif
 {
-   U16    i;
+   uint16_t    i;
 
  
    /* Unpack the token header */
@@ -3131,15 +2711,15 @@ Buffer   *mBuf;               /* message buffer */
       CMCHKUNPK(oduPackUInt8, &tknOid->len, mBuf);
 
       /* Pack the value */
-      for (i = 1; i <= (U16)tknOid->len; i++)
+      for (i = 1; i <= (uint16_t)tknOid->len; i++)
       {
-         /* cm_gen_c_001.main_33: changes for TknOid value from U16 to U32
-          * with compilation flag TKNOID_U16 */
-#ifndef TKNOID_U16
+         /* cm_gen_c_001.main_33: changes for TknOid value from uint16_t to uint32_t
+          * with compilation flag TKNOID_UINT16 */
+#ifndef TKNOID_UINT16
          CMCHKUNPK(oduPackUInt32, &tknOid->val[tknOid->len - i], mBuf);
 #else
          CMCHKUNPK(oduPackUInt16, &tknOid->val[tknOid->len - i], mBuf);
-#endif /* !TKNOID_U16 */
+#endif /* !TKNOID_UINT16 */
       }
    }
 
@@ -3161,17 +2741,11 @@ Buffer   *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTknS32
 (
 TknS32 *tknS32,             /* token S32 */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknS32(tknS32, mBuf)
-TknS32 *tknS32;             /* token S32 */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    /* Token Header */
@@ -3201,17 +2775,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkHeader
 (
 Header *header,   /* header structure */
 Buffer *mBuf      /* message buffer */
 )
-#else
-S16 cmUnpkHeader(header, mBuf)
-Header *header;   /* header structure */
-Buffer *mBuf;     /* message buffer */
-#endif
 {
 
    CMCHKUNPK(oduPackUInt16, &header->msgLen, mBuf); 
@@ -3246,17 +2814,11 @@ Buffer *mBuf;     /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkCmStatus
 (
 CmStatus *sta,              /* status structure */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkCmStatus(sta, mBuf)
-CmStatus *sta;              /* status structure */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    CMCHKUNPK(oduPackUInt16, &sta->status, mBuf);
@@ -3280,17 +2842,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkCmAlarm
 (
 CmAlarm *alarm,             /* alarm structure */
 Buffer *mBuf                /* message buffer */
 )
-#else
-S16 cmUnpkCmAlarm(alarm, mBuf)
-CmAlarm *alarm;             /* alarm structure */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkDateTime, &alarm->dt, mBuf);
@@ -3316,17 +2872,11 @@ Buffer *mBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkSmCfg
 (
 SmCfg *smCfg,           /* stack manager */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmUnpkSmCfg(smCfg, mBuf)
-SmCfg *smCfg;           /* stack manager */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkEnt, &smCfg->ent, mBuf); 
@@ -3355,17 +2905,11 @@ Buffer *mBuf;           /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkTmrCfg
 (
 TmrCfg *tmrCfg,         /* timer configuration */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmUnpkTmrCfg(tmrCfg, mBuf)
-TmrCfg *tmrCfg;         /* timer configuration */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKUNPK(oduUnpackBool, &tmrCfg->enb, mBuf); 
@@ -3388,17 +2932,11 @@ Buffer *mBuf;           /* message buffer */
  *
  */
 
-#ifdef ANSI
 S16 cmUnpkTknBuf
 (
 TknBuf *tknBuf,                /* token string */
 Buffer    **tBuf                /* message buffer */
 )
-#else
-S16 cmUnpkTknBuf(tknBuf, tBuf)
-TknBuf *tknBuf;                /* token string */
-Buffer    **tBuf;               /* message buffer */
-#endif
 {
    Buffer *mBuf;
 
@@ -3456,17 +2994,11 @@ Buffer    **tBuf;               /* message buffer */
 *
 */
   
-#ifdef ANSI
 S16 cmUnpkIntf
 (
 CmIntf *intf,           /* interface info */
 Buffer *mBuf            /* message buffer */
 )
-#else
-S16 cmUnpkIntf(intf, mBuf)
-CmIntf *intf;           /* interface info */
-Buffer *mBuf;           /* message buffer */
-#endif
 {
 
    CMCHKUNPK(cmUnpkIntfVer, &intf->intfVer, mBuf); 
@@ -3487,7 +3019,7 @@ Buffer *mBuf;           /* message buffer */
 *       File:  cm_gen.c
 *
 */
-U16 getTransId()
+uint16_t getTransId()
 {
    gTransId = (gTransId%65535) + 1;
    return gTransId;