Sha256: 47db8023d556a5658372708bf2639f0a0f36f991517d188e16ec76a58753bf26

Contents?: true

Size: 561 Bytes

Versions: 27

Compression:

Stored size: 561 Bytes

Contents

#include "common.h"

/* Byte swap a 64-bit number. */
static inline uint64_t swap64(uint64_t in) 
{
#ifndef BYTEORDER_BIG_ENDIAN
  /* Little endian, flip the bytes around until someone makes a faster/better
   * way to do this. */
  uint64_t rv= 0;
  uint8_t x= 0;
  for(x= 0; x < 8; x++) 
  {
    rv= (rv << 8) | (in & 0xff);
    in >>= 8;
  }
  return rv;
#else
  /* big-endian machines don't need byte swapping */
  return in;
#endif
}

uint64_t ntohll(uint64_t value)
{
  return swap64(value);
}

uint64_t htonll(uint64_t value)
{
  return swap64(value);
}

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
vinted-memcached-1.8.5 vendor/libmemcached-0.32/libmemcached/byteorder.c
vinted-memcached-1.8.4 ext/libmemcached-0.32/libmemcached/byteorder.c
vinted-memcached-1.8.3 ext/libmemcached-0.32/libmemcached/byteorder.c
vinted-memcached-1.8.2 ext/libmemcached-0.32/libmemcached/byteorder.c
vinted-memcached-1.8.0 ext/libmemcached-0.32/libmemcached/byteorder.c
dalli_memcached-1.8.0 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.8.0 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.7.2 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.7.0 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.6.1 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.6.0 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.5.1 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.5.0 ext/libmemcached-0.32/libmemcached/byteorder.c
boourns-memcached-1.4.6 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.4.6 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.4.5 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.4.3 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.4.2 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.4.1 ext/libmemcached-0.32/libmemcached/byteorder.c
memcached-1.3.7 ext/libmemcached-0.32/libmemcached/byteorder.c