mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-18 17:40:55 +08:00
[svn-r12734] Description:
Clean up some compiler warnings. Tested on: FreeBSD/32 4.11 (sleipnir) w/threadsafe Linux/32 2.4 (heping) w/FORTRAN & C++ Linux/64 2.4 (mir) w/enable-1.6-compat
This commit is contained in:
parent
6a18d20b40
commit
25d1056dbf
@ -2617,7 +2617,7 @@ next:
|
||||
/* Get array information */
|
||||
if((ndims = H5Tget_array_ndims(dtype))<0)
|
||||
goto out;
|
||||
if(H5Tget_array_dims(dtype, dims, NULL)<0)
|
||||
if(H5Tget_array_dims(dtype, dims, NULL) < 0)
|
||||
goto out;
|
||||
|
||||
/* Print array dimensions */
|
||||
|
@ -60,7 +60,7 @@ int csindex = -1; /*pointer to the top of compound stack*/
|
||||
/*structure for array type information*/
|
||||
struct arr_info {
|
||||
hsize_t dims[H5S_MAX_RANK]; /*size of each dimension, limited to 32 dimensions*/
|
||||
int ndims; /*number of dimensions*/
|
||||
unsigned ndims; /*number of dimensions*/
|
||||
hbool_t is_dim; /*flag to lexer for dimension*/
|
||||
};
|
||||
/*stack for nested array type*/
|
||||
@ -873,7 +873,7 @@ case 60:
|
||||
break;
|
||||
case 61:
|
||||
#line 223 "H5LTparse.y"
|
||||
{ int ndims = arr_stack[asindex].ndims;
|
||||
{ unsigned ndims = arr_stack[asindex].ndims;
|
||||
arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
|
||||
arr_stack[asindex].ndims++;
|
||||
arr_stack[asindex].is_dim = 0;
|
||||
|
@ -41,7 +41,7 @@ int csindex = -1; /*pointer to the top of compound stack*/
|
||||
/*structure for array type information*/
|
||||
struct arr_info {
|
||||
hsize_t dims[H5S_MAX_RANK]; /*size of each dimension, limited to 32 dimensions*/
|
||||
int ndims; /*number of dimensions*/
|
||||
unsigned ndims; /*number of dimensions*/
|
||||
hbool_t is_dim; /*flag to lexer for dimension*/
|
||||
};
|
||||
/*stack for nested array type*/
|
||||
@ -220,7 +220,7 @@ dim_list :
|
||||
| dim_list dim
|
||||
;
|
||||
dim : '[' { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ }
|
||||
dimsize { int ndims = arr_stack[asindex].ndims;
|
||||
dimsize { unsigned ndims = arr_stack[asindex].ndims;
|
||||
arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
|
||||
arr_stack[asindex].ndims++;
|
||||
arr_stack[asindex].is_dim = 0;
|
||||
|
@ -833,7 +833,7 @@ static int read_palette(const char* fname,
|
||||
{
|
||||
FILE *file;
|
||||
char buffer[80];
|
||||
int i;
|
||||
unsigned u;
|
||||
unsigned int red;
|
||||
unsigned int green;
|
||||
unsigned int blue;
|
||||
@ -919,14 +919,14 @@ static int read_palette(const char* fname,
|
||||
}
|
||||
|
||||
/* ensure there are a sensible number of colors in the palette */
|
||||
if ((nentries < 0) || (nentries > 256) || (nentries > palette_size))
|
||||
if ((nentries > 256) || (nentries > palette_size))
|
||||
{
|
||||
fclose(file);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/* read the palette entries */
|
||||
for (i = 0; i < nentries; i++)
|
||||
for (u = 0; u < nentries; u++)
|
||||
{
|
||||
/* extract the red, green and blue color components. */
|
||||
if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3)
|
||||
@ -935,9 +935,9 @@ static int read_palette(const char* fname,
|
||||
return -1;
|
||||
}
|
||||
/* store this palette entry */
|
||||
palette[i].r = (unsigned char)red;
|
||||
palette[i].g = (unsigned char)green;
|
||||
palette[i].b = (unsigned char)blue;
|
||||
palette[u].r = (unsigned char)red;
|
||||
palette[u].g = (unsigned char)green;
|
||||
palette[u].b = (unsigned char)blue;
|
||||
}
|
||||
|
||||
/* close file */
|
||||
@ -946,5 +946,3 @@ static int read_palette(const char* fname,
|
||||
return nentries;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1424,7 +1424,7 @@ static int test_arrays(void)
|
||||
if(ndims != 3)
|
||||
goto out;
|
||||
|
||||
if(H5Tget_array_dims(dtype, dims, NULL)<0)
|
||||
if(H5Tget_array_dims(dtype, dims, NULL) < 0)
|
||||
goto out;
|
||||
if(dims[0] != 5 || dims[1] != 7 || dims[2] != 13)
|
||||
goto out;
|
||||
@ -1525,10 +1525,9 @@ static int test_complicated_compound(void)
|
||||
hid_t dtype;
|
||||
int nmembs;
|
||||
H5T_class_t type_class;
|
||||
size_t str_len;
|
||||
char* line=NULL;
|
||||
FILE *fp;
|
||||
int size = 1024;
|
||||
size_t size = 1024;
|
||||
char *srcdir = getenv("srcdir"); /* the source directory */
|
||||
char filename[1024]="";
|
||||
|
||||
@ -1556,7 +1555,7 @@ static int test_complicated_compound(void)
|
||||
*/
|
||||
if((line = (char*)calloc(size, sizeof(char)))==NULL)
|
||||
goto out;
|
||||
if(fgets(line, size, fp)==NULL)
|
||||
if(fgets(line, (int)size, fp)==NULL)
|
||||
goto out;
|
||||
while(strlen(line)==size-1) {
|
||||
size *= 2;
|
||||
@ -1566,7 +1565,7 @@ static int test_complicated_compound(void)
|
||||
goto out;
|
||||
if(fseek(fp, 0L, SEEK_SET)!=0)
|
||||
goto out;
|
||||
if(fgets(line, size, fp)==NULL)
|
||||
if(fgets(line, (int)size, fp)==NULL)
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user