Reduce warnings

This commit is contained in:
Allen Byrne 2017-05-25 15:55:55 -05:00
parent 3261491a47
commit 618a6adb64
5 changed files with 10 additions and 9 deletions

View File

@ -24,6 +24,7 @@ extern "C" {
#include <jni.h>
#include "hdf5.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
JNIEXPORT jlong JNICALL

View File

@ -457,7 +457,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx
} /* end if */
else {
buf_size = infobuf.u.val_size;
if(buf_size < 0) {
if(buf_size == 0) {
h5libraryError(env);
} /* end if */
else {

View File

@ -5127,8 +5127,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options
else {
/* get the length of the filename */
H5Pget_mdc_log_options((hid_t)fapl_id, &is_enabled, NULL, &location_size, &start_on_access);
if (location_size < 0) {
h5badArgument(env, "H5Pget_mdc_log_options: location_size < 0");
if (location_size == 0) {
h5badArgument(env, "H5Pget_mdc_log_options: location_size is 0");
}/* end if */
else if (location_size > 0) {
location_size++; /* add extra space for the null terminator */

View File

@ -68,7 +68,7 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLappend
(JNIEnv *env, jclass clss, jobjectArray plugin_path)
{
char *aName;
const char *aName;
herr_t retVal = -1;
PIN_JAVA_STRING(plugin_path, aName);
@ -90,7 +90,7 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLprepend
(JNIEnv *env, jclass clss, jobjectArray plugin_path)
{
char *aName;
const char *aName;
herr_t retVal = -1;
PIN_JAVA_STRING(plugin_path, aName);
@ -113,7 +113,7 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLreplace
(JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
{
char *aName;
const char *aName;
herr_t retVal = -1;
PIN_JAVA_STRING(plugin_path, aName);
@ -136,7 +136,7 @@ JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLinsert
(JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
{
char *aName;
const char *aName;
herr_t retVal = -1;
PIN_JAVA_STRING(plugin_path, aName);

View File

@ -1206,8 +1206,8 @@ Java_hdf_hdf5lib_H5_H5Sencode
if (status < 0) {
h5libraryError(env);
} /* end else if */
else if (buf_size < 0) {
h5badArgument(env, "H5Sencode: buf_size < 0");
else if (buf_size == 0) {
h5badArgument(env, "H5Sencode: buf_size = 0");
} /* end if */
else {
bufPtr = (unsigned char*)HDcalloc((size_t) 1, buf_size);