gg-utils-tests.c
static int encode_uint32_1(void) {
  char buf[sizeof(uint32_t)];
  /* intermediate pointer is needed to bypass gcc's strict aliasing check */
  void *ptr = buf;
  GG_ptr a;
  a = ggp_init(buf, sizeof(buf));
  encode_uint32(&a, 0xABCDEF);
  if (htonl(*((uint32_t* ) ptr)) == 0xABCDEF)
    return 0;
  else
    return -1;
}
/* should be ok to use encode_uint32 at the edge of the
   buffer */
should be ok to use encode_uint32 at the edge of the
buffer
should be ok to use encode_uint32 at the edge of the buffer
static int encode_uint32_1(void) {
  char buf[sizeof(uint32_t)];
  void *ptr = buf;
  GG_ptr a;
  a = ggp_init(buf, sizeof(buf));
  encode_uint32(&a, 0xABCDEF);
  if (htonl(*((uint32_t* ) ptr)) == 0xABCDEF)
    return 0;
  else
    return -1;
}
static int encode_uint32_1 ( void ) { char buf [ sizeof ( uint32_t ) ] ; void * ptr = buf ; GG_ptr a ; a = ggp_init ( buf , sizeof ( buf ) ) ; encode_uint32 ( & a , 0xABCDEF ) ; if ( htonl ( * ( ( uint32_t * ) ptr ) ) == 0xABCDEF ) return 0 ; else return -1 ; }
should be ok to use encode_uint32 at the edge of the
buffer
should be ok to use encode_uint32 at the edge of the buffer
/* intermediate pointer is needed to bypass gcc's strict aliasing check */