netmsgs/libnetmsgs/nmLibPack.c
int nmUnpackP64(byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian)
{
  static size_t fvalLen = NMFVAL_LEN_P64;     // message field value length

  uint_t    uMSB;     // Most Signifcant Bytes
  uint_t    uLSB;     // Least Signifcant Bytes
  ulong_t  *pluVal;   // longs are same size as pointers on 32/64 bit machines

  _NM_CHK_MEM(bufSize, fvalLen);
  
  pluVal = (ulong_t *)pVal;

  UNPACK64NATIVE(buf, &uMSB, &uLSB);

  // 8-byte pointer
  if( sizeof(void *) == fvalLen )
  {
#if HOST_WORD_SIZE == 64
    *pluVal = (ulong_t)(((ulong_t)uMSB  << 32) | (uLSB & 0xffffffff));
#else
    *pluVal = (ulong_t)uLSB;
#endif // HOST_WORD_SIZE
  }

  // 4-byte pointer
  else
  {
    _NM_CHK_ARCH(pVal, (size_t)NMFVAL_LEN_P32);

    if( uMSB != 0 )
    {
      NMLIB_WARNING("0x%08x%08x: Unpacking 64-bit pointer into 32 bits "
                    "lost non-zero significance.\n",
                    uMSB, uLSB);
    }
    *pluVal = (ulong_t)uLSB;
  }

  return (int)fvalLen;
}
/*!
 * \brief Unpack a 64-bit pointer from the message buffer.
 *
 * If the machine architecture only supports 32-bit pointers, then
 * the 4 MSBs are padded with 0's.
 *
 * \note Pointer is always unpacked in native byte order.
 *
 * \copydoc doc_params_unpack_std
 * \copydoc doc_return_unpack_std 
 */
\brief Unpack a 64-bit pointer from the message buffer.
If the machine architecture only supports 32-bit pointers, then
the 4 MSBs are padded with 0's.

\note Pointer is always unpacked in native byte order.


\ brief Unpack a 64 - bit pointer from the message buffer . If the machine architecture only supports 32 - bit pointers then the 4 MSBs are padded with 0 ' s . \ note Pointer is always unpacked in native byte order .
int nmUnpackP64(byte_t buf[], size_t bufSize, void *pVal, NMEndian_T eEndian)
{
  static size_t fvalLen = NMFVAL_LEN_P64;     
  uint_t    uMSB;     
  uint_t    uLSB;     
  ulong_t  *pluVal;   
  _NM_CHK_MEM(bufSize, fvalLen);
  pluVal = (ulong_t *)pVal;
  UNPACK64NATIVE(buf, &uMSB, &uLSB);
  if( sizeof(void *) == fvalLen )
  {
#if HOST_WORD_SIZE == 64
    *pluVal = (ulong_t)(((ulong_t)uMSB  << 32) | (uLSB & 0xffffffff));
#else
    *pluVal = (ulong_t)uLSB;
#endif 
  }
  else
  {
    _NM_CHK_ARCH(pVal, (size_t)NMFVAL_LEN_P32);
    if( uMSB != 0 )
    {
      NMLIB_WARNING("0x%08x%08x: Unpacking 64-bit pointer into 32 bits "
                    "lost non-zero significance.\n",
                    uMSB, uLSB);
    }
    *pluVal = (ulong_t)uLSB;
  }
  return (int)fvalLen;
}
int nmUnpackP64 ( byte_t buf [ ] , size_t bufSize , void * pVal , NMEndian_T eEndian ) { static size_t fvalLen = NMFVAL_LEN_P64 ; uint_t uMSB ; uint_t uLSB ; ulong_t * pluVal ; _NM_CHK_MEM ( bufSize , fvalLen ) ; pluVal = ( ulong_t * ) pVal ; UNPACK64NATIVE ( buf , & uMSB , & uLSB ) ; if ( sizeof ( void * ) == fvalLen ) { #if HOST_WORD_SIZE == 64 * pluVal = ( ulong_t ) ( ( ( ulong_t ) uMSB << 32 ) | ( uLSB & 0xffffffff ) ) ; #else * pluVal = ( ulong_t ) uLSB ; #endif } else { _NM_CHK_ARCH ( pVal , ( size_t ) NMFVAL_LEN_P32 ) ; if ( uMSB != 0 ) { NMLIB_WARNING ( " " " \n " , uMSB , uLSB ) ; } * pluVal = ( ulong_t ) uLSB ; } return ( int ) fvalLen ; }
\brief Unpack a 64-bit pointer from the message buffer.
\ brief Unpack a 64 - bit pointer from the message buffer .
// message field value length // Most Signifcant Bytes // Least Signifcant Bytes // longs are same size as pointers on 32/64 bit machines // 8-byte pointer // HOST_WORD_SIZE // 4-byte pointer