IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30726


Ignore:
Timestamp:
Feb 21, 2011, 11:12:21 AM (15 years ago)
Author:
eugene
Message:

do not cast the large allocs to unsigned int (use size_t)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana_allocate.h

    r30602 r30726  
    4949
    5050# define REALLOCATE(PTR,TYPE,SIZE) {                                    \
    51   PTR = (TYPE *) realloc(PTR,(unsigned)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
     51  PTR = (TYPE *) realloc(PTR,(size_t)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
    5252  if (PTR == NULL) {                                                    \
    5353    fprintf(stderr,"failed realloc at %d in %s\n", __LINE__, __FILE__); \
     
    5757  if ((NCURR) >= (SIZE)) {                              \
    5858    SIZE += DELTA;                                                      \
    59     PTR = (TYPE *) realloc(PTR,(unsigned)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
     59    PTR = (TYPE *) realloc(PTR,(size_t)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
    6060    if (PTR == NULL) {                                                  \
    6161      fprintf(stderr,"failed realloc increment at %d in %s\n", __LINE__, __FILE__); \
Note: See TracChangeset for help on using the changeset viewer.