src/sg_logs.c
static uint64_t
decode_count(const uint8_t * xp, int len)
{
    int j;
    uint64_t ull;

    if (len > (int)sizeof(ull)) {
        xp += (len - sizeof(ull));
        len = sizeof(ull);
    }
    ull = 0;
    for (j = 0; j < len; ++j) {
        if (j > 0)
            ull <<= 8;
        ull |= xp[j];
    }
    return ull;
}
/* Decode counter up to 8 chars long (big endian) into an uint64_t.
 * In the unlikely event that the counter is larger than 8 chars long
 * then take the last 8 chars. */
Decode counter up to 8 chars long (big endian) into an uint64_t.
In the unlikely event that the counter is larger than 8 chars long
then take the last 8 chars.
Decode counter up to 8 chars long ( big endian ) into an uint64_t . In the unlikely event that the counter is larger than 8 chars long then take the last 8 chars .
static uint64_t
decode_count(const uint8_t * xp, int len)
{
    int j;
    uint64_t ull;
    if (len > (int)sizeof(ull)) {
        xp += (len - sizeof(ull));
        len = sizeof(ull);
    }
    ull = 0;
    for (j = 0; j < len; ++j) {
        if (j > 0)
            ull <<= 8;
        ull |= xp[j];
    }
    return ull;
}
static uint64_t decode_count ( const uint8_t * xp , int len ) { int j ; uint64_t ull ; if ( len > ( int ) sizeof ( ull ) ) { xp += ( len - sizeof ( ull ) ) ; len = sizeof ( ull ) ; } ull = 0 ; for ( j = 0 ; j < len ; ++ j ) { if ( j > 0 ) ull <<= 8 ; ull |= xp [ j ] ; } return ull ; }
Decode counter up to 8 chars long (big endian) into an uint64_t.
Decode counter up to 8 chars long ( big endian ) into an uint64_t .