Changeset 3400 for trunk/Ohana/src/libfits
- Timestamp:
- Mar 9, 2005, 9:20:18 PM (21 years ago)
- Location:
- trunk/Ohana/src/libfits
- Files:
-
- 4 edited
-
header/F_modify.c (modified) (1 diff)
-
include/fits.h (modified) (2 diffs)
-
table/F_get_column.c (modified) (1 diff)
-
table/F_table_format.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/header/F_modify.c
r3369 r3400 102 102 char *fits_keyword_start (char *line) { 103 103 104 int done;105 104 char *c; 106 105 -
trunk/Ohana/src/libfits/include/fits.h
r3391 r3400 32 32 X = (T *) malloc ((unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 33 33 if (X == NULL) { \ 34 fprintf(stderr,"failed malloc at % sin %s\n", __LINE__, __FILE__);\34 fprintf(stderr,"failed malloc at %d in %s\n", __LINE__, __FILE__);\ 35 35 exit (10); } 36 36 # define REALLOCATE(X,T,S) \ 37 37 X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 38 38 if (X == NULL) { \ 39 fprintf(stderr,"failed realloc at % sin %s\n", __LINE__, __FILE__);\39 fprintf(stderr,"failed realloc at %d in %s\n", __LINE__, __FILE__);\ 40 40 exit (10); } 41 41 # define CHECK_REALLOCATE(X,T,S,N,D) \ … … 44 44 X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \ 45 45 if (X == NULL) { \ 46 fprintf(stderr,"failed realloc increment at % sin %s\n", __LINE__, __FILE__);\46 fprintf(stderr,"failed realloc increment at %d in %s\n", __LINE__, __FILE__);\ 47 47 exit (10); } } 48 48 # endif /* ALLOCATE */ -
trunk/Ohana/src/libfits/table/F_get_column.c
r2415 r3400 197 197 if (label == (char *) NULL) return (FALSE); 198 198 if (label[0] == 0) return (FALSE); 199 array = NULL; 199 200 200 201 /* find label in header */ -
trunk/Ohana/src/libfits/table/F_table_format.c
r2415 r3400 54 54 int fits_table_format (char *format, char *type, int *Nval, int *Nbytes) { 55 55 56 char Fchar, foo[80], bar;56 char Fchar, Size[80], Type; 57 57 int Nv; 58 58 … … 64 64 if (Nv == 0) { 65 65 Nv = 1; 66 strcpy ( foo, "1");66 strcpy (Size, "1"); 67 67 } else { 68 strcpy ( foo, &format[1]);68 strcpy (Size, &format[1]); 69 69 } 70 71 if (Fchar == 'F') { *Nbytes = 1; strcpy (type, "float"); bar = 'f'; *Nval = Nv; } 72 if (Fchar == 'I') { *Nbytes = 1; strcpy (type, "int"); bar = 'd'; *Nval = Nv; } 73 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); bar = 's'; *Nval = Nv; } 70 71 Type = 'x'; 72 if (Fchar == 'F') { *Nbytes = 1; strcpy (type, "float"); Type = 'f'; *Nval = Nv; } 73 if (Fchar == 'I') { *Nbytes = 1; strcpy (type, "int"); Type = 'd'; *Nval = Nv; } 74 if (Fchar == 'A') { *Nbytes = 1; strcpy (type, "char"); Type = 's'; *Nval = Nv; } 74 75 if (!*Nbytes) { return (FALSE); } 75 76 76 sprintf (format, "%%-%s%c", foo, bar);77 sprintf (format, "%%-%s%c", Size, Type); 77 78 78 79 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
