summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
Commit message (Collapse)AuthorAgeFilesLines
* [svn-r5842] Purpose:Quincey Koziol2002-08-081-1768/+1818
| | | | | | | | | | | | | | | | Code cleanup Description: Change most (all?) HRETURN_ERROR macros to HGOTO_ERROR macros, along with HRETURN macros to HGOTO_DONE macros. This unifies the error return path from functions and reduces the size of the library by up to 10% on some platforms. Additionally, I improved a lot of the error cleanup code in many routines. Platforms tested: FreeBSD 4.6 (sleipnir) serial & parallel and IRIX64 6.5 (modi4) serial & parallel.
* [svn-r5840] Purpose:Quincey Koziol2002-07-311-127/+54
| | | | | | | | | | | | | | Code cleanup Description: Created a new H5I function which combined the some of the functionality of H5I_get_type and H5I_object: H5I_object_verify. Using this new function in the library trims another ~200 lines of code off the library and makes the resulting binaries smaller and faster also. Platforms tested: FreeBSD 4.6 (sleipnir)
* [svn-r5834] Purpose:Quincey Koziol2002-07-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Large code cleanup/re-write Description: This is phase 1 of the data I/O re-architecture, with the following changes: - Changed the selection drivers to not actually do any I/O, they only generate the sequences of offset/length pairs needed for the I/O (or memory access, in the case of iterating or filling a selection in a memory buffer) - Wrote more abstract I/O routines which get the sequence of offset/ length pairs for each selection and access perform the I/O or memory access. Benefits of this change include: - Removed ~3400 lines of quite redundant code, with corresponding reduction in the size of library binary. - Any selection can now directly access memory when performing I/O, if no type conversions are required, instead of just "regular" hyperslab and 'all' selections, which speeds up I/O. - Sped up I/O for hyperslab selections which have contiguous lower dimensions by "flattening" them out into lesser dimensional objects for the I/O. No file format or API changes were necessary for this change. The next phase will be to create a "selection driver" for each type of selection, allowing each type of selection to directly call certain methods that only apply to that type of selection, instead of passing through dozens of functions which have switch statements to call the appropriate method for each selection type. This will also reduce the amount of code in the library and speed things up a bit more. Phase 3 will involve generating an MPI datatype for all types of selections, instead of only "regular" hyperslab and 'all' selections. This will allow collective parallel I/O for all I/O operations which don't require type conversions. It will also open up the door for allowing collective I/O on datasets which require type conversion. Phase 4 will involve changing the access pattern to deal with chunked datasets in a more optimal way (in serial). Phase 5 will deal with accessing chunked datasets more optimally for collective parallel I/O operations. Platforms tested: FreeBSD 4.6 (sleipnir) w/ parallel & C++ and IRIX64 6.5 (modi4) w/parallel
* [svn-r5812] Raymond Lu2002-07-171-14/+42
| | | | | | | | | Purpose: Bug fix. Description: This should fix the nested VL datatype bug. Platforms tested: modi4, eirene, impact
* [svn-r5779] Raymond Lu2002-07-111-3/+4
| | | | | | | | | | | Purpose: Bug fix Description: Nested VL datatype test fails on 64-bit machines Solution: bug fixed. Platforms tested: IRIX64 6.5(modi4) 64-bit
* [svn-r5776] Raymond Lu2002-07-101-2/+19
| | | | | | | | | | | | | Purpose: Bug fix. Description: For nested VL datatype, the heap object of VL elements lower than top level weren't freed. Solution: Read in the content of heap object for VL elements and free them in function H5T_conv_vlen. Platforms tested: eirene
* [svn-r5764] Raymond Lu2002-07-031-20/+39
| | | | | | | | | | | Purpose: Bug Fix. Description: VL type memory leak when data is overwritten. Solution: Free heap objects holding old data. Platforms tested: Linux 2.2(eirene), IRIX 6.5(paz).
* [svn-r5471] Purpose:Quincey Koziol2002-05-291-105/+286
| | | | | | | | | | | | | | | | Code cleanup Description: Broke the FUNC_ENTER macro into several macros, with more specialized uses (which followup mail will describe). This was designed to move most/all of the checks which could be done at compile time to that point, instead of needlessly performing them (over & over :-) at run-time. This reduces the library's size (and thus staticly linked binaries) and has a minor speedup effect also. Platforms tested: IRIX64 6.5 (modi4) with parallel & FORTRAN enabled, and additional testing on FreeBSD and Solaris immediately after the checkin.
* [svn-r5467] Purpose:Quincey Koziol2002-05-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Code cleanup. Description: Took Robb's recent ideas for improving the FUNC_ENTER/FUNC_LEAVE macros equivalents in the SAF library and adapted them to our library. I added an additional macro which is equivalent to FUNC_ENTER: FUNC_ENTER_NOINIT - Has the API tracing code, etc. from FUNC_ENTER but none of the library or interface initialization code. This is to be used _only_ for static functions and those which explicitly cannot have the library or interface initialization code enabled (like the API termination routines, etc.). This allowed many more of the functions in the library [but not all yet :-(] to be wrapped with FUNC_ENTER[_NOINIT]/FUNC_LEAVE pairs. It also reduced the size of the library and executables (by cutting out a bunch of code which was never executed), I'll e-mail the exact results when I've finished editing it. Platforms tested: IRIX64 6.5 (modi4)
* [svn-r5452] Pedro Vicente Nunes2002-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Purpose: eliminating the compiler warnings in Windows Solution: I am eliminating the compiler warnings in Windows. the last 2 were: 1) if((oid_list = H5MM_malloc(oid_count*sizeof(hid_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); D:\disk_w\hdf5\src\H5F.c(2590) : warning C4047: '=' : 'int ' differs in levels of indirection from 'void *' on the HGOTO_ERROR call , I replaced the NULL with FAIL 2) *((float*)d) = *((double*)s); D:\disk_w\hdf5\src\H5Tconv.c(6426) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data I added the type cast *((float*)d) = (float) *((double*)s); we have now 0 errors 0 warnings on Windows ! Platforms tested: w2000, linux
* [svn-r5200] Purpose:Quincey Koziol2002-04-181-3/+3
| | | | | | | | | | Code Cleanup Description: Clean up compiler warnings from the last bunch of checkins Platforms tested: FreeBSD 4.5 (sleipnir)
* [svn-r5195] Purpose:Quincey Koziol2002-04-171-37/+4
| | | | | | | | | | | | | | Code cleanup Description: Got rid of the "H5T_BKG_TEMP" setting that was used internally to the library, since temporary background buffers are now handled by the individual conversion routines instead of in a global background buffer. No APIs were changed or affected by this. Platforms tested: FreeBSD 4.5 (sleipnir)
* [svn-r5191] Purpose:Quincey Koziol2002-04-171-32/+63
| | | | | | | | | | | | | | | | | | | Bug fix Description: When several level deep nested compound & VL datatypes are used, the data in the nested compound datatypes is incorrectly sharing the same "background buffer", causing data corruption when the data is written to the file. Solution: Allocate a separate background buffer for each level of the nested types to convert. (Also allocate temporary background buffers for array datatypes, where this sort of problem could occur also) Added more regression tests to check for these errors. Platforms tested: FreeBSD 4.5 (sleipnir) & Solaris 2.6 (baldric)
* [svn-r4862] ./hdf5-devel/src/H5Tconv.cRobb Matzke2002-01-251-537/+401
| | | | | | | | | | | | | | More optimizing for byte order conversion. Mostly just making code easier to follow by simplifying Duff's device coding of the loops. I also split the conversion function into two functions with different names so output from H5T debugging indicates whether the optimized or unoptimized case was invoked. 2002-01-25 10:48:54 Robb Matzke <matzke@arborea.spizella.com> * H5T_conv_order: Removed Duff's device consisting of >500 lines of code. Unrolled two loops by hand resulting in <300 lines of code which is a few percent faster and far easier to read.
* [svn-r4768] Purpose:Quincey Koziol2002-01-031-26/+11
| | | | | | | | | | Bug Fix/Code Cleanup Description: Duplicated call to H5T_path_find was being made. Solution: Removed one... :-) Platforms tested: FreeBSD 4.5 (sleipnir)
* [svn-r4645] Purpose:Quincey Koziol2001-11-271-0/+2
| | | | | | | | | | Bug Fix Description: Replace an 'if' statement taken out in commit earlier today which was necessary for routing around endian conversions when zero elements were converted. Platforms tested: IRIX64 6.5 (modi4)
* [svn-r4643] Purpose:Quincey Koziol2001-11-271-521/+519
| | | | | | | | | | | | | | | | | | | | | | Code cleanup Description: Windows is generating hundreds of warnings from some of the practices in the library. Mostly, they are because size_t is 32-bit and hsize_t is 64-bit on Windows and we were carelessly casting the larger values down to the smaller ones without checking for overflow. Also, some other small code cleanups,etc. Solution: Re-worked some algorithms to eliminate the casts and also added more overflow checking for assignments and function parameters which needed casts. Kent did most of the work, I just went over his changes and fit them into the the library code a bit better. Platforms tested: FreeBSD 4.4 (hawkwind)
* [svn-r4393] Purpose:Quincey Koziol2001-08-201-514/+516
| | | | | | | | | | | | | | | Bug Fix Description: Byte swapping routine was core dumping when attempting to convert 0 elements. Solution: Don't try to byte swap when there is nothing to do... :-) Apologies to Kent for my comments on Friday about testing his checkins, especially when it was I who needed to do moer testing. :-/ Platforms tested: Solaris 2.7 (arabica)
* [svn-r4390] Purpose:Quincey Koziol2001-08-191-4/+6
| | | | | | | | | | Bug fix. Description: Byte swapping algorithm wasn't converting the last 8 elements correctly. Solution: Used correct variable... :-) Platforms tested: FreeBSD 4.4 (hawkwind)
* [svn-r4377] Purpose:Quincey Koziol2001-08-171-7/+534
| | | | | | | | | | | Code improvement Description: The byte swapping routine for data conversion was inefficient. Solution: Applied a number of optimizations which should yield around a 2-3 times faster algorithm. Platforms tested: Solaris 2.6 (baldric)
* [svn-r4355] Purpose:Quincey Koziol2001-08-141-32/+32
| | | | | | | | | | | | | | | | | | | | | | Code cleanup (sorta) Description: When the first versions of the HDF5 library were designed, I remembered vividly the difficulties of porting code from a 32-bit platform to a 16-bit platform and asked that people use intn & uintn instead of int & unsigned int, respectively. However, in hindsight, this was overkill and unnecessary since we weren't going to be porting the HDF5 library to 16-bit architectures. Currently, the extra uintn & intn typedefs are causing problems for users who'd like to include both the HDF5 and HDF4 header files in one source module (like Kent's h4toh5 library). Solution: Changed the uintn & intn's to unsigned and int's respectively. Platforms tested: FreeBSD 4.4 (hawkwind)
* [svn-r4324] Purpose:Quincey Koziol2001-08-101-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | New Features! Description: Start migrating the internal use of property lists in the library from the older implementation to the new generic property lists. Currently, only the dataset transfer property lists are migrated to the new architecture, all the rest of the property list types are still using the older architecture. Also, the backward compatibility features are not implemented yet, so applications which use dataset transfer properties may need to make the following changes: H5Pcreate(H5P_DATASET_XFER) -> H5Pcreate_list(H5P_DATASET_XFER_NEW) and H5Pclose(<a dataset transfer property list>) -> H5Pclose_list(id) This still may have some bugs in it, especially with Fortran, but I should be wrapping up those later today. Platforms tested: FreeBSD 4.4 (hawkwind)
* [svn-r4181] Purpose:Quincey Koziol2001-07-101-1/+1
| | | | | | | | | Bug Fix, Code Cleanup, Code Optimization, etc. Description: Fold in the hyperslab speedups, clean up compile warnings and change a few things from using 'unsigned' or 'hsize_t' to use 'size_t' instead. Platforms tested: FreeBSD 4.3 (hawkwind), Solaris 2.7 (arabica), Irix64 6.5 (modi4)
* [svn-r3781] Purpose:Bill Wendling2001-04-051-8/+8
| | | | | | | | | | | | | | | | | | Update Description: Changed #include <hdf_file.h> construct to #include "hdf_file.h" so that the GNU compiler can more easily pick up the dependencies which it places in the .depend and Dependencies files. Also regenerated the Dependencies to go along with this. Platforms tested: Linux
* [svn-r3384] Purpose:Quincey Koziol2001-02-091-1/+3
| | | | | | | | | | | | | | Bug Fix Description: The 'carry' variable in the general floating point-to-floating point conversion routine wasn't getting initialized correctly and was causing problems while converting certain sequences of floating point numbers on the Cray SV1. Solution: Added 'else carry=0;' line to always reset the carry variable to a known value. Platforms tested: Cray SV1 (killeen)
* [svn-r3346] ./hdf5-1.4/src/H5Tconv.cRobb Matzke2001-02-031-0/+36
| | | | | | | | 2001-02-03 00:19:25 Robb Matzke <matzke@llnl.gov> * H5T_conv_f_f: Fixed a bug where I had forgotten to increment the floating-point exponent if rounding the significand resulted in a carry. Thanks to Guillaume Colin de Verdiere for finding this one!
* [svn-r3252] Purpose:Quincey Koziol2001-01-091-1021/+1018
| | | | | | | | | | | | | Code cleanup. Description: Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the extra warnings. Including a few show-stoppers for compression on IRIX machines. Solution: Changed lots of variables' types to more sensible and consistent types, more range-checking, more variable typecasts, etc. Platforms tested: FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
* [svn-r3138] Purpose:Quincey Koziol2000-12-141-5/+12
| | | | | | | | | | | Bug Fix Description: More descrimination is necessary for the type of background buffer needed. Compound types need H5T_BKG_TEMP and vlen & array types need H5T_BKG_YES. Solution: Make the internal routine be more specific about the background type set. Platforms tested: FreeBSD 4.2 (hawkwind)
* [svn-r3133] Purpose:Quincey Koziol2000-12-141-5/+5
| | | | | | | | | Bug fix Description: Set the background buffer type to different values for compound vs. vlen & array datatypes. Platforms tested: Cray J90 (killeen)
* [svn-r3131] Purpose:Quincey Koziol2000-12-131-0/+4
| | | | | | | | | | | | Bug fix Description: Non-optimized conversions have a memory overwrite bug when the destination size of a compound datatype is greater than the source size. Solution: Corrected direction of walking through the destination array for final copying. Platforms tested: FreeBSD 4.2 (hawkwind) & Cray J90 (killeen)
* [svn-r3110] Purpose:Quincey Koziol2000-12-111-1/+1
| | | | | | | | | | | Bug Fix Description: Compound datatypes weren't reading background data properly when used with array or vlen fields. Solution: Changed to always read background information from file in those situations. Platforms tested: FreeBSD 4.2 (hawkwind)
* [svn-r3020] Purpose:Quincey Koziol2000-11-291-58/+1
| | | | | | | | | | Code addition Description: The dumper needs to know when a datatype needs to be reclaimed, so I added a small helper function to detect if a particular datatype is or contains a particular class of datatypes. Platforms tested: Linux 2.2.16-3smp (eirene)
* [svn-r3019] Purpose:Quincey Koziol2000-11-291-6/+6
| | | | | | | | Patch on the patch of my code cleanup... :-) Description: Fix compiler problems with previous code patching... Platforms tested: Linux 2.2.16-3smp (eirene)
* [svn-r3015] Purpose:Quincey Koziol2000-11-291-27/+115
| | | | | | | | | | | | | | | | | Bug fixes Description: Patch things back up from incompletely changing some variables in yesterday's code cleanup, this should fix the compiler errors that Kent and Bill have found in the CVS version of the code. Also, fix a bug buried in the datatype conversions when compound datasets were nested inside an array or variable-length datatype. Internally require that any datatype which contains a compound datatype sets the "need_bkg" conversion flag so a background buffer to pass to the compound datatype conversion is allocated. Platforms tested: FreeBSD 4.2 (hawkwind) & Solaris 2.6 (baldric)
* [svn-r3013] Purpose:Quincey Koziol2000-11-281-5/+2
| | | | | | | | | Code cleanup Description: Cleaned up a few warnings which cropped up with different configure switches. Platforms tested: FreeBSD 4.2 (hawkwind)
* [svn-r3005] Purpose:Quincey Koziol2000-11-271-1/+1
| | | | | | | | Backward compatibility code Description: Add in code to allow the library to emulate the v1.2 API and behavior. Platforms tested: FreeBSD 4.2 (hawkwind)
* [svn-r2952] Purpose:Quincey Koziol2000-11-161-22/+36
| | | | | | | | | | | | | Small code optimization Description: Statistics on the amount of times a datatype conversion required alignment were being kept in all case, even though they are only used when H5T_DEBUG is turned on. Solution: Build some extra macros so that the statistics are only kept when the H5T_DEBUG macro is defined. Platforms tested: Solaris 2.6 (baldric)
* [svn-r2865] Purpose:Quincey Koziol2000-11-111-9/+0
| | | | | | | | Code Cleanup Description: Removed unused variable. Platforms tested: FreeBSD 4.1.1 (hawkwind)
* [svn-r2854] ./hdf5/src/H5Tconv.cRobb Matzke2000-11-101-1/+1
|
* [svn-r2843] Purpose:Quincey Koziol2000-11-091-126/+227
| | | | | | | | | | | | | | | New Feature Description: Added array datatype to library. See documentation at: http://hdf.ncsa.uiuc.edu/HDF5/planning/DP/ArrayType.html for complete details on the impact to the library. Solution: Changes to the base library include removing the ability of compound datatype fields to be an array (they can use an array type for the field, to duplicate the functionality) and adding in the new array datatype everywhere appropriate. (I hope :-) Platforms tested: FreeBSD 4.1.1 (hawkwind)
* [svn-r2657] Quincey Koziol2000-10-101-7/+5
| | | | | | | | | | | | Purpose: Parallel Bug Fixes Description: Was out of sync with header file re-arrangements I checked in last night. Solution: Fixed to use new header files, etc. Platforms tested: O2K (modi4)
* [svn-r2652] Purpose:Quincey Koziol2000-10-101-2/+2
| | | | | | | | | | | | | | | Maintainance & performance enhancements Description: Re-arranged header files to protect private symbols better. Changed optimized regular hyperslab I/O to compute the offsets more efficiently from previous method of using matrix operations. Added sequential I/O operations at a more abstract level (at the same level as H5F_arr_read/write), to support the optimized hyperslab I/O. Platforms tested: Solaris 2.6 (baldric) & FreeBSD 4.1.1 (hawkwind)
* [svn-r2597] Purpose:Quincey Koziol2000-09-261-2/+2
| | | | | | | | | | | Fix compiler warning Description: "HUGE_VAL" (a double value) was being put into a float type and generating a warning during compile time. Solution: Replaced "HUGE_VAL" with "FLT_MAX" Platforms tested: FreeBSD 4.1
* [svn-r2262] * 2000-05-18Robb Matzke2000-05-181-311/+444
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ** src/H5Tconv.c ** src/H5Tpkg.h ** src/H5Tpublic.h The H5T_conv_struct_opt() function had a design flaw -- it didn't keep information about the stride to use to step through the temporary/background-value buffer and thus nested invocations would clobber each other's temp buffers. This was fixed by splitting the `stride' argument into `buf_stride' and `bkg_stride' arguments for all the conversion functions. THIS IS AN API CHANGE, but users will get a compiler warning when they pass their conversion function pointer to H5Tregister(). ** src/H5T.c ** src/H5Tprivate.h Added a bkg_stride argument to the H5T_convert() definition in order to fix a bug related to the optimized compound datatype conversion function. ** src/H5T.c ** src/H5A.c ** src/H5D.c ** src/H5Ofill.c ** src/H5P.c Added bkg_stride=0 argument to the H5T_convert() calls. ** test/dtypes.c Added a test for the H5T_conv_struct_opt() bug fixed above. ** src/H5FL.c The H5FL_term() function should return non-zero even when it couldn't free all the free lists do to their being used by some other package. When that other package terminates it will return non-zero, causing H5FL_term() to be called again. This fixes some of the `infinite loop closing library' messages. ** tools/pdb2hdf Uses print_version() instead of doing that itself. ** src/H5Ppublic.h Renamed H5Pget_gc_reference() declaration to make it match the definition. ** src/H5FDlog.c Added API tracing macros. Removed `const' qualifier from a `char*' member of a struct which was allocated on the heap. ** src/H5TB.c Added curly braces to a couple deeply-nested `if' statements to make them clearer and to shut up the increadibly stupid and just plain incorrect gcc warning about ambiguous `else'. ** test/titerate.c Removed incomplete initialization in favor of memset() for one auto variable to stop compiler warnings. ** tools/Depencencies Regenerated to remove references to h5dumputil.c
* [svn-r2073] Added free-list code to the library and took out the older ↵Quincey Koziol2000-04-041-10/+13
| | | | | | | "temporary buffer" code, since the functionality was superceded. See the followup document for details on the free-list code.
* [svn-r2009] PurposeAlbert Cheng2000-03-081-1/+1
| | | | | | | | | | | | | | Bug fix. Description When converting a floating point zero to a different format (e.g. Cray), the mantissa part was not set to zeros complete. Cray does not seem to mind since the exponent part was set to all 0's. Somehow, the HDF4 does not like it and convert that pattern to a non-zero value in IEEE. Solution corrected the code to set the whole mantissa to zeros completely. Platform tested: J90 & Solaris 2.7.
* [svn-r1847] ** src/H5T.cRobb Matzke1999-11-231-429/+509
| | | | | Fixed a bug with enumeration types not having the correct object header pointer.
* [svn-r1836] Mainly fixed a bug in VL datatype comparisons which was causing ↵Quincey Koziol1999-11-171-453/+451
| | | | | | | non-equal VL types to compare as equal. Added some asserts to make certain nothing slips through again. Also cleaned up a few warnings from the SGI compiler.
* [svn-r1702] Closed some more memory leaks on failure conditions...Quincey Koziol1999-10-011-0/+6
|
* [svn-r1689] Mainly adding support for "native" variable-length strings (C ↵Quincey Koziol1999-09-291-1/+2
| | | | | | | | only currently), but I fixed lots of misc. compiler warnings in other code and also tracked down the memory overwrite bug that was causing the development branch to core dump on most machines.