Changeset 38986 for trunk/Ohana/src/libfits
- Timestamp:
- Oct 27, 2015, 4:49:06 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 9 edited
-
. (modified) (1 prop)
-
src/libfits/Makefile (modified) (1 diff)
-
src/libfits/extern/gzip.c (modified) (1 diff)
-
src/libfits/header/F_H_field.c (modified) (1 diff)
-
src/libfits/include/gfitsio.h (modified) (1 diff)
-
src/libfits/matrix/F_compress_data.c (modified) (1 diff)
-
src/libfits/table/F_compress_T.c (modified) (4 diffs)
-
src/libfits/table/F_read_T.c (modified) (2 diffs)
-
src/libfits/test/tcomptiming.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ipp-20150625/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/libfits/Makefile
r38441 r38986 25 25 TEST_CPPFLAGS = $(BASE_CPPFLAGS) 26 26 TEST_LDFLAGS = $(BASE_LDFLAGS) -lFITS -lohana -ltap_ohana 27 28 27 29 28 TESTXTRA = tcomptiming -
trunk/Ohana/src/libfits/extern/gzip.c
r38441 r38986 215 215 err = inflate(&stream, Z_FINISH); 216 216 if (err != Z_STREAM_END) { 217 if (err == Z_DATA_ERROR) { 218 fprintf (stderr, "compressed data is corrupted\n"); 219 ESCAPE(err); 220 } 217 221 inflateEnd(&stream); 218 222 if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) ESCAPE (Z_DATA_ERROR); -
trunk/Ohana/src/libfits/header/F_H_field.c
r29537 r38986 33 33 } 34 34 35 if (N < 0) {35 if (N <= 0) { 36 36 /* count the entries */ 37 37 Nfound = 0; -
trunk/Ohana/src/libfits/include/gfitsio.h
r38553 r38986 237 237 int gfits_fread_ftable PROTO((FILE *f, FTable *ftable, char *extname)); 238 238 int gfits_fread_ftable_data PROTO((FILE *f, FTable *ftable, int padIfShort)); 239 int gfits_fread_ftable_range PROTO((FILE *f, int padIfShort, FTable *ftable, off_t start, off_t Nrows));239 int gfits_fread_ftable_range PROTO((FILE *f, int padIfShort, int noSeek, FTable *ftable, off_t start, off_t Nrows)); 240 240 int gfits_fread_vtable PROTO((FILE *f, VTable *vtable, char *extname, off_t Nrow, off_t *row)); 241 241 int gfits_fread_vtable_range PROTO((FILE *f, VTable *vtable, off_t start, off_t Nrows)); -
trunk/Ohana/src/libfits/matrix/F_compress_data.c
r38441 r38986 119 119 return (FALSE); 120 120 } 121 if (Nout > *Nzdata) { 122 fprintf (stderr, "buffer overrun! %d out, %d available\n", Nout, *Nzdata); 123 return FALSE; 124 } 121 125 *Nzdata = Nout; 122 126 return TRUE; -
trunk/Ohana/src/libfits/table/F_compress_T.c
r38553 r38986 211 211 212 212 // allocate the intermediate storage buffers 213 int Nzdata_alloc = max_width*ztilelen + 100;213 int Nzdata_alloc = 2*max_width*ztilelen + 100; 214 214 ALLOCATE (raw, char, max_width*ztilelen); 215 215 ALLOCATE (zdata, char, Nzdata_alloc); … … 223 223 gettimeofday (&startTimer, (void *) NULL); 224 224 225 // ohana_memcheck (TRUE); 226 225 227 // compress the data : copy into a tile, compress the tile, then add to the output table 226 228 // each tile -> 1 row of the output table … … 243 245 } 244 246 247 // ohana_memcheck (TRUE); 248 245 249 // XXX TIMER 2a 246 250 gettimeofday (&stopTimer, (void *) NULL); … … 260 264 } 261 265 266 // ohana_memcheck (TRUE); 262 267 // optname, optvalue = NULL, Noptions = 0 263 268 -
trunk/Ohana/src/libfits/table/F_read_T.c
r38441 r38986 62 62 63 63 /*********************** fits read ftable data ***********************************/ 64 int gfits_fread_ftable_range (FILE *f, int padIfShort, FTable *table, off_t start, off_t Nrows) {64 int gfits_fread_ftable_range (FILE *f, int padIfShort, int noSeek, FTable *table, off_t start, off_t Nrows) { 65 65 66 66 off_t Nbytes, Nread, Nskip, Nx, Ny; … … 79 79 Nskip = start * Nx; 80 80 Nbytes = Nrows * Nx; 81 ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1)); 82 83 fseeko (f, Nskip, SEEK_CUR); 81 82 if (table[0].buffer) { 83 if (table[0].datasize < Nbytes) { 84 REALLOCATE (table[0].buffer, char, MAX (Nbytes, 1)); 85 } 86 } else { 87 ALLOCATE (table[0].buffer, char, MAX (Nbytes, 1)); 88 } 89 90 if (!noSeek) { 91 fseeko (f, Nskip, SEEK_CUR); 92 } 84 93 85 94 Nread = fread (table[0].buffer, sizeof (char), Nbytes, f); -
trunk/Ohana/src/libfits/test/tcomptiming.c
r38553 r38986 25 25 int Ntile = pow (10.0, lNtile); 26 26 fprintf (stderr, "--- Ntile = %d ---\n", Ntile); 27 test_compress_timing (" NONE_2", Ntile);27 test_compress_timing ("GZIP_2", Ntile); 28 28 gfits_compress_timing(); 29 29 gfits_uncompress_timing();
Note:
See TracChangeset
for help on using the changeset viewer.
