From 2f5164b1047a705e81fff46f1b8107426cbcc61b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 27 May 2010 14:20:58 -0500 Subject: [svn-r18915] Description: Clean up a couple of compiler warnings (in Windows). Tested on: Mac OS X/32 10.6.3 (amazon) w/debug (too minor to require h5committest) --- fortran/src/H5Ff.c | 50 ++++++++++++++++++++++++-------------------- hl/c++/src/H5PacketTable.cpp | 2 +- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 51a53a8..9640444 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -444,32 +444,36 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) * number of open objects * Thursday, September 25, 2008 EIP *---------------------------------------------------------------------------*/ - int_f -nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) +nh5fget_obj_ids_c(hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, + hid_t_f *obj_ids, size_t_f *num_objs) { - int ret_value = 0; - hid_t c_file_id; - unsigned c_obj_type; - int i; - size_t c_max_objs; - ssize_t c_num_objs; - hid_t *c_obj_ids; - - c_file_id = (hid_t)*file_id; - c_obj_type = (unsigned) *obj_type; - c_max_objs = (size_t)*max_objs; - c_obj_ids = (hid_t *)HDmalloc(sizeof(hid_t)*c_max_objs); - - c_num_objs = H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids); - if ( c_num_objs < 0 ) ret_value = -1; - for (i=0; i< c_max_objs; i++) obj_ids[i] = (hid_t_f)c_obj_ids[i]; - - HDfree(c_obj_ids); - *num_objs = (size_t_f)c_num_objs; - - return ret_value; + int ret_value = 0; + hid_t c_file_id; + unsigned c_obj_type; + size_t u; + size_t c_max_objs; + ssize_t c_num_objs; + hid_t *c_obj_ids; + + c_file_id = (hid_t)*file_id; + c_obj_type = (unsigned) *obj_type; + c_max_objs = (size_t)*max_objs; + c_obj_ids = (hid_t *)HDmalloc(sizeof(hid_t)*c_max_objs); + + c_num_objs = H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, c_obj_ids); + if(c_num_objs < 0) + ret_value = -1; + for(u = 0; u < c_max_objs; u++) + obj_ids[u] = (hid_t_f)c_obj_ids[u]; + + HDfree(c_obj_ids); + *num_objs = (size_t_f)c_num_objs; + + return ret_value; } + + /*---------------------------------------------------------------------------- * Name: h5fget_freespace_c * Purpose: Call H5Fget_freespace to get amount of free space within a file diff --git a/hl/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index f815a66..74b8029 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -190,7 +190,7 @@ if (startIndex > endIndex) return -1; - return H5PTread_packets(table_id, startIndex, endIndex-startIndex+1, data); + return H5PTread_packets(table_id, startIndex, (size_t)(endIndex-startIndex+1), data); } /* GetNextPacket (single packet) -- cgit v0.12