Corrected coverity issues, changed some of the cmake files.

This commit is contained in:
Ward Fisher 2013-04-02 19:57:28 +00:00
parent 98002f5edd
commit e468bdd2b9
5 changed files with 18 additions and 42 deletions

View File

@ -654,6 +654,7 @@ CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T)
CHECK_TYPE_SIZE("off64_t" SIZEOF_OFF64_T)
CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
CHECK_TYPE_SIZE("ssize_t" SIZEOF_SSIZE_T)
CHECK_TYPE_SIZE("uchar" SIZEOF_UCHAR)
CHECK_TYPE_SIZE("int64_t" SIZEOF_INT64_T)
CHECK_TYPE_SIZE("uint64_t" SIZEOF_UINT64_T)
@ -700,9 +701,9 @@ IF(NOT WIN32)
ENDIF()
# Create config.h file
configure_file("${netCDF_SOURCE_DIR}/cmake_config.h.in"
configure_file("${netCDF_SOURCE_DIR}/config.h.in.cmake"
"${netCDF_BINARY_DIR}/config.h")
configure_file("${netCDF_SOURCE_DIR}/cmake_nc-config.in"
configure_file("${netCDF_SOURCE_DIR}/nc-config.in.cmake"
"${netCDF_SOURCE_DIR}/nc-config")
FILE(COPY "${netCDF_SOURCE_DIR}/nc-config"
DESTINATION "${netCDF_BINARY_DIR}"

View File

@ -10,8 +10,8 @@ ACLOCAL_AMFLAGS = -I m4
# These files get added to the distribution.
EXTRA_DIST = README COPYRIGHT RELEASE_NOTES INSTALL INSTALL.cmake test_prog.c \
lib_flags.am cmake CMakeLists.txt COMPILE_CMake.txt cmake_config.h.in \
cmake_nc-config.in cmake_uninstall.cmake.in netcdf-config-version.cmake.in \
lib_flags.am cmake CMakeLists.txt COMPILE_CMake.txt config.h.in.cmake \
config.in.cmake cmake_uninstall.cmake.in netcdf-config-version.cmake.in \
netcdf-config.cmake.in FixBundle.cmake.in
# Doxygen doesn't build nicely in vpath builds.

View File

@ -20,6 +20,14 @@
#define lseek _lseek
#endif
#ifdef _WIN32
#ifndef strcasecmp
#define strcasecmp _stricmp
#define snprintf _snprintf
#endif
#endif
#define strdup _strdup
#define fdopen _fdopen
#define write _write
@ -27,13 +35,6 @@
#define strtoll _strtoi64
#endif
#if defined(_WIN32)
#ifndef strcasecmp
#define strcasecmp _stricmp
#define snprintf _snprintf
#endif
#endif
/* Cache Size, other variables for HDF5 */
@ -184,7 +185,6 @@
/* Define to 1 if you have the <malloc.h> header file. */
#cmakedefine HAVE_MALLOC_H @HAVE_MALLOC_H@
#if !defined(__APPLE__)
/* The size of `double` as computed by sizeof. */
#cmakedefine SIZEOF_DOUBLE @SIZEOF_DOUBLE@
/* The size of `float` as computed by sizeof. */
@ -202,22 +202,13 @@
#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
/* The size of `size_t` as computed by sizeof. */
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@
/* The size of `ssize_t` as computed by sizeof. */
#cmakedefine SIZEOF_SSIZE_T @SIZEOF_SSIZE_T@
/* The size of `uchar` as computed by sizeof. */
#cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@
#else
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#if defined(__LP64__) && __LP64__
#define SIZEOF_LONG 8
#define SIZEOF_SIZE_T 8
#else
#define SIZEOF_LONG 4
#define SIZEOF_SIZE_T 4
#endif
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_OFF_T 8
#endif
#cmakedefine TEMP_LARGE "@TEMP_LARGE@"

View File

@ -1743,22 +1743,6 @@ read_dataset(NC_GRP_INFO_T *grp, const char *obj_name)
if(max_dims) free(max_dims);
return NC_NOERR;
//exit:
if (access_pid && H5Pclose(access_pid) < 0)
BAIL2(retval);
#ifdef EXTRA_TESTS
num_plists--;
#endif
if (datasetid && H5Dclose(datasetid) < 0)
BAIL2(retval);
if (spaceid && H5Sclose(spaceid) <0)
BAIL2(retval);
#ifdef EXTRA_TESTS
num_spaces--;
#endif
exit: