third_party/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
/**
 * Convert U32 value to hex string. Masked bytes are replaced with dots.
 *
 * @remarks The mask has byte (not bit) granularity (e.g. 000000FF).
 *
 * @returns The buffer.
 *
 * @param   u32         The word to convert into string.
 * @param   mask        Selects which bytes to convert.
 * @param   buf         Where to put the result.
 */
Convert U32 value to hex string. Masked bytes are replaced with dots.
@remarks The mask has byte (not bit) granularity .

@returns The buffer.

@param   u32         The word to convert into string.
@param   mask        Selects which bytes to convert.
@param   buf         Where to put the result.
Convert U32 value to hex string . Masked bytes are replaced with dots . @remarks The mask has byte ( not bit ) granularity . @returns The buffer . @param u32 The word to convert into string . @param mask Selects which bytes to convert . @param buf Where to put the result .
static char *e1kU32toHex(uint32_t u32, uint32_t mask, char *buf)
{
    for (char *ptr = buf + 7; ptr >= buf; --ptr, u32 >>=4, mask >>=4)
    {
        if (mask & 0xF)
            *ptr = (u32 & 0xF) + ((u32 & 0xF) > 9 ? '7' : '0');
        else
            *ptr = '.';
    }
    buf[8] = 0;
    return buf;
}
static char * e1kU32toHex ( uint32_t u32 , uint32_t mask , char * buf ) { for ( char * ptr = buf + 7 ; ptr >= buf ; -- ptr , u32 >>= 4 , mask >>= 4 ) { if ( mask & 0xF ) * ptr = ( u32 & 0xF ) + ( ( u32 & 0xF ) > 9 ? ' ' : ' ' ) ; else * ptr = ' ' ; } buf [ 8 ] = 0 ; return buf ; }
Convert U32 value to hex string.
Convert U32 value to hex string .