diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-10-19 17:54:22 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-10-19 17:54:22 (GMT) |
commit | 74d0aa11adda90a62ea9fce563d926eb56857ac2 (patch) | |
tree | 3f83c58dc0a00e9805305d584f192effbe5f2fca /tools/misc | |
parent | 82dd00095e7ca97fd0d4636a79ad276284dc1bf5 (diff) | |
download | hdf5-74d0aa11adda90a62ea9fce563d926eb56857ac2.zip hdf5-74d0aa11adda90a62ea9fce563d926eb56857ac2.tar.gz hdf5-74d0aa11adda90a62ea9fce563d926eb56857ac2.tar.bz2 |
[svn-r22929] Description:
Bring r22921 from trunk to 1.8 branch:
Review Coverity changes and bring them back to trunk. (QK & JK)
r20402:
Added #includes for h5tools.y or h5tools_utils.h as required to remedy implicit
function declarations which caused compiler warnings and coverity issues 703-4
and 708-11.
r20414:
This is related to the previous checkin r20399. There were incorrect updates
which caused incorrect behavior when no file was given. Also possible segfault
when handling hyperslab options. Simplify the code changes.
r20449:
Description: Modified H5E_walk2_cb to check return value of H5I_object_verify.
r20450:
fixed coverity 813
Tested on:
Mac OSX/64 10.8.2 (amazon) w/C++, FORTRAN, debug & threadsafe
(too minor to require h5committest)
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/talign.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/misc/talign.c b/tools/misc/talign.c index b77d846..017eb55 100644 --- a/tools/misc/talign.c +++ b/tools/misc/talign.c @@ -23,6 +23,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" const char *fname = "talign.h5"; const char *setname = "align"; @@ -46,8 +47,8 @@ int main(void) hsize_t cdim[4]; char string5[5]; - float fok[2] = {1234., 2341.}; - float fnok[2] = {5678., 6785.}; + float fok[2] = {1234.0f, 2341.0f}; + float fnok[2] = {5678.0f, 6785.0f}; float *fptr; char *data = NULL; @@ -125,7 +126,7 @@ int main(void) H5Dclose(set); /* Now open the set, and read it back in */ - data = malloc(H5Tget_size(fix)); + data = (char *)malloc(H5Tget_size(fix)); if(!data) { perror("malloc() failed"); @@ -159,8 +160,8 @@ out: "%14s (%2d) %6f = %f\n" " %6f = %f\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1), - fok[0], fptr[0], - fok[1], fptr[1]); + (double)fok[0], (double)fptr[0], + (double)fok[1], (double)fptr[1]); if(mname) free(mname); @@ -169,8 +170,8 @@ out: printf("%14s (%2d) %6f = %f\n" " %6f = %6f\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2), - fnok[0], fptr[0], - fnok[1], fptr[1]); + (double)fnok[0], (double)fptr[0], + (double)fnok[1], (double)fptr[1]); if(mname) free(mname); @@ -181,10 +182,10 @@ out: " %6f = %f\n" " %6f = %f\n" " %6f = %f\n", - fok[0], fptr[0], - fok[1], fptr[1], - fnok[0], fptr[2], - fnok[1], fptr[3]); + (double)fok[0], (double)fptr[0], + (double)fok[1], (double)fptr[1], + (double)fnok[0], (double)fptr[2], + (double)fnok[1], (double)fptr[3]); puts("*FAILED - compound type alignmnent problem*"); } else { puts(" PASSED"); |