Changeset 3391
- Timestamp:
- Mar 7, 2005, 6:19:29 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/include/fits.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/include/fits.h
r2415 r3391 22 22 # endif /* NEWLINE */ 23 23 24 # ifndef MAX 25 # define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) 26 # define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) 27 # endif 28 24 29 /* general macros which should exist anyway! */ 25 30 # ifndef ALLOCATE 31 # define ALLOCATE(X,T,S) \ 32 X = (T *) malloc ((unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 33 if (X == NULL) { \ 34 fprintf(stderr,"failed malloc at %s in %s\n", __LINE__, __FILE__);\ 35 exit (10); } 36 # define REALLOCATE(X,T,S) \ 37 X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 38 if (X == NULL) { \ 39 fprintf(stderr,"failed realloc at %s in %s\n", __LINE__, __FILE__);\ 40 exit (10); } 41 # define CHECK_REALLOCATE(X,T,S,N,D) \ 42 if ((N) >= (S)) { \ 43 S += D; \ 44 X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 45 if (X == NULL) { \ 46 fprintf(stderr,"failed realloc increment at %s in %s\n", __LINE__, __FILE__);\ 47 exit (10); } } 48 # endif /* ALLOCATE */ 49 50 51 # if (0) 26 52 # define ALLOCATE(X,T,S) \ 27 53 X=(T *)malloc((unsigned) ((S)*sizeof(T)));\ … … 38 64 exit(0); \ 39 65 } 40 # endif /* ALLOCATE*/66 # endif /* old versions */ 41 67 42 68 # ifndef TRUE … … 49 75 # endif 50 76 51 # define MIN(X,Y) ((X) < (Y) ? (X) : (Y))52 # define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
Note:
See TracChangeset
for help on using the changeset viewer.
