rEFIt_UEFI/libeg/lodepng.cpp
/*returns 1 if success, 0 if failure ==> nothing done*/
returns 1 if success, 0 if failure ==> nothing done
returns 1 if success 0 if failure == > nothing done
static unsigned ucvector_resize(ucvector* p, size_t size) {
  if(size > p->allocsize) {
    size_t newsize = (size > p->allocsize * 2u) ? size : ((size * 3u) >> 1u);
    void* data = lodepng_realloc(p->data, p->allocsize, newsize);
    if(data) {
      p->allocsize = newsize;
      p->data = (unsigned char*)data;
    }
    else return 0; 
  }
  p->size = size;
  return 1; 
}
static unsigned ucvector_resize ( ucvector * p , size_t size ) { if ( size > p -> allocsize ) { size_t newsize = ( size > p -> allocsize * 2u ) ? size : ( ( size * 3u ) >> 1u ) ; void * data = lodepng_realloc ( p -> data , p -> allocsize , newsize ) ; if ( data ) { p -> allocsize = newsize ; p -> data = ( unsigned char * ) data ; } else return 0 ; } p -> size = size ; return 1 ; }
returns 1 if success, 0 if failure ==> nothing done
returns 1 if success 0 if failure == > nothing done
/*error: not enough memory*/ /*success*/