summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-10-18 19:47:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-10-18 19:47:39 (GMT)
commite9519f5e6a437650aedf200356d1af7138f68b22 (patch)
tree6e9510fd472ad9567524b7c226cb68e4fd1bbfcb /tools/misc
parent0324f055660fde2ddbdd928b6b674814a9e53210 (diff)
downloadhdf5-e9519f5e6a437650aedf200356d1af7138f68b22.zip
hdf5-e9519f5e6a437650aedf200356d1af7138f68b22.tar.gz
hdf5-e9519f5e6a437650aedf200356d1af7138f68b22.tar.bz2
[svn-r22921] Description:
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.c23
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");