[svn-r4978] Purpose:

Code cleanup
Description:
    Cleanup compiler warnings found by the SGI compiler and gcc 3.0
Platforms tested:
    FreeBSD 4.5 w/gcc 3.0 (hack) && IRIX64 (modi4)
This commit is contained in:
Quincey Koziol 2002-02-16 21:51:21 -05:00
parent 855aa23823
commit b8dbd390db
21 changed files with 36 additions and 46 deletions

View File

@ -78,7 +78,7 @@ typedef float real_f;
#endif /*IBM6000*/
/* LINUX definitions */
#if defined(i386) && defined(linux)
#if defined(i386) && (defined(linux) || defined(__FreeBSD__))
#define DF_MT DFMT_LINIX
typedef char *_fcd;
typedef long long hsize_t_f;

View File

@ -22,9 +22,6 @@
#define MAX_FILE_LEN 256
#define MAX_NUMBER_IMAGES 50
extern int hdfWriteGIF(FILE *fp, BYTE *pic, int ptype, int w, int h,
BYTE *rmap, BYTE *gmap, BYTE *bmap, BYTE *pc2ncmap,
int numcols, int colorstyle, int BitsPerPixel);
int EndianOrder;
#ifdef NOT_USED
@ -67,7 +64,6 @@ int main(int argc , char **argv)
/* reference variables */
int has_local_palette; /* treated as a flag */
int loop_times; /* number of times to loop, treat it as yes/no */
BYTE* b;
@ -304,10 +300,8 @@ int main(int argc , char **argv)
/* Write out the GIF header and logical screen descriptor */
if (n_images > 1) {
fwrite("GIF89a", 1, 6, fpGif); /* the GIF magic number */
loop_times = 0;
} else {
fwrite("GIF87a", 1, 6, fpGif); /* the GIF magic number */
loop_times = 1;
}
putword(RWidth, fpGif); /* screen descriptor */

View File

@ -101,6 +101,14 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap,
int i;
byte *pic8 = pic;
/* Shut compiler up... */
ptype=ptype;
rmap=rmap;
gmap=gmap;
bmap=bmap;
numcols=numcols;
colorstyle=colorstyle;
#ifdef UNUSED
Interlace = 0;
Background = 0;

View File

@ -371,7 +371,7 @@ main (void)
cache_size+=RM_CACHE_DELT) {
for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) {
io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Rowmaj-rd %8d %8.2f", cache_size, io_percent);
printf ("Rowmaj-rd %8d %8.2f", (int)cache_size, io_percent);
fflush (stdout);
effic = test_rowmaj (READ, cache_size, io_size);
printf (" %8.2f\n", effic);
@ -417,7 +417,7 @@ main (void)
cache_size+=RM_CACHE_DELT) {
for (io_percent=RM_START; io_percent<=RM_END; io_percent+=RM_DELTA) {
io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Rowmaj-wr %8d %8.2f", cache_size, io_percent);
printf ("Rowmaj-wr %8d %8.2f", (int)cache_size, io_percent);
fflush (stdout);
effic = test_rowmaj (WRITE, cache_size, io_size);
printf (" %8.2f\n", effic);
@ -462,7 +462,7 @@ main (void)
io_percent<=DIAG_END;
io_percent+=DIAG_DELTA) {
io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Diag-rd %8d %8.2f", cache_size, io_percent);
printf ("Diag-rd %8d %8.2f", (int)cache_size, io_percent);
fflush (stdout);
effic = test_diag (READ, cache_size, io_size, MAX (1, io_size/2));
printf (" %8.2f\n", effic);
@ -507,7 +507,7 @@ main (void)
io_percent<=DIAG_END;
io_percent+=DIAG_DELTA) {
io_size = MAX (1, (size_t)(CH_SIZE*io_percent));
printf ("Diag-wr %8d %8.2f", cache_size, io_percent);
printf ("Diag-wr %8d %8.2f", (int)cache_size, io_percent);
fflush (stdout);
effic = test_diag (WRITE, cache_size, io_size, MAX (1, io_size/2));
printf (" %8.2f\n", effic);

View File

@ -232,7 +232,7 @@ test(fill_t fill_style, const double splits[],
break;
case FILL_OUTWARD:
j = (cur_size[0]-i)+1;
hs_start[0] = j%2 ? j/2 : cur_size[0]-j/2;
hs_start[0] = j%2 ? j/2 : (hssize_t)cur_size[0]-j/2;
break;
case FILL_RANDOM:
for (j=rand()%cur_size[0]; had[j]; j=(j+1)%cur_size[0]) /*void*/;

View File

@ -2123,7 +2123,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
}
} else {
hobj_ref_t ref = va_arg (ap, hobj_ref_t);
fprintf (out, "Reference Object=%p", &ref);
fprintf (out, "Reference Object=%p", (void *)&ref);
}
break;

View File

@ -876,7 +876,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si
* list does not belong to this driver then assume defaults
*/
if(NULL == (plist = H5I_object(dxpl_id)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5P_get_driver(plist)) {
H5FD_family_dxpl_t *dx = H5P_get_driver_info(plist);
@ -954,7 +954,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s
* list does not belong to this driver then assume defaults.
*/
if(NULL == (plist = H5I_object(dxpl_id)))
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list");
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list");
if (H5P_DEFAULT!=dxpl_id && H5FD_FAMILY==H5P_get_driver(plist)) {
H5FD_family_dxpl_t *dx = H5P_get_driver_info(plist);

View File

@ -140,7 +140,7 @@ typedef struct H5FL_arr_head_t {
* Macros for defining & using free lists for an array of a type
*/
/* Declare a free list to manage arrays of type 't' */
#define H5FL_ARR_DEFINE(t,m) H5FL_arr_head_t t##_arr_free_list={0,0,NULL,0,#t##"_arr",m+1,sizeof(t),{NULL}}
#define H5FL_ARR_DEFINE(t,m) H5FL_arr_head_t t##_arr_free_list={0,0,NULL,0,#t"_arr",m+1,sizeof(t),{NULL}}
/* Reference a free list for arrays of type 't' defined in another file */
#define H5FL_ARR_EXTERN(t) extern H5FL_arr_head_t t##_arr_free_list

View File

@ -4717,9 +4717,6 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, unsigned hashsize,
)
{
H5P_genclass_t *pclass; /* Property list class created */
H5P_genprop_t *tmp; /* Temporary pointer to parent class properties */
H5P_genprop_t *pcopy; /* Copy of property to insert into class */
unsigned u; /* Local index variable */
H5P_genclass_t *ret_value=NULL; /* return value */
FUNC_ENTER (H5P_create_class, NULL);

View File

@ -632,7 +632,7 @@ for (u=0; u<=mem_space->extent.u.simple.rank; u++)
*must_convert = FALSE;
done:
FUNC_LEAVE(SUCCEED);
FUNC_LEAVE(ret_value);
}
@ -892,7 +892,7 @@ H5S_all_write(H5F_t *f, const struct H5O_layout_t *layout,
done:
FUNC_LEAVE(SUCCEED);
FUNC_LEAVE(ret_value);
}

View File

@ -2637,7 +2637,6 @@ H5T_detect_class (H5T_t *dt, H5T_class_t cls)
case H5T_VLEN:
case H5T_ENUM:
HRETURN(H5T_detect_class(dt->parent,cls));
break;
default:
break;
@ -2891,7 +2890,7 @@ H5Tget_precision(hid_t type_id)
}
if (dt->parent) dt = dt->parent; /*defer to parent*/
if (H5T_COMPOUND==dt->type || H5T_OPAQUE==dt->type || H5T_ARRAY==dt->type) {
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_ORDER_ERROR,
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0,
"operation not defined for specified data type");
}

View File

@ -65,7 +65,7 @@
#include "H5TBprivate.h" /*Threaded, balanced, binary trees */
# define KEYcmp(k1,k2,a) ((NULL!=compar) ? (*compar)( k1, k2, a) \
: HDmemcmp( k1, k2, 0<(a) ? (a) : HDstrlen(k1) ) )
: HDmemcmp( k1, k2, 0<(a) ? ((size_t)a) : HDstrlen(k1) ) )
/* Return maximum of two scalar values (use arguments w/o side effects): */
#define Max(a,b) ( (a) > (b) ? (a) : (b) )

View File

@ -472,7 +472,7 @@ h5_fileaccess(void)
if ((val = HDstrtok(NULL, " \t\n\r")))
log_flags = HDstrtol(val, NULL, 0);
if (H5Pset_fapl_log(fapl, NULL, log_flags, 0) < 0)
if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0)
return -1;
#endif /* H5_WANT_H5_V1_4_COMPAT */
} else {

View File

@ -29,10 +29,12 @@ int main( void )
hsize_t dims_out[2];
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
int data1[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} };
#if 0
int buf1[3][3];
#endif
int buf2[2][2];
herr_t status;
int i, j;
hsize_t i, j;
TESTING("extend dataset");

View File

@ -70,7 +70,7 @@ herr_t aiter_cb(hid_t loc_id, const char *name, void *op_data);
****************************************************************/
int iter_strcmp(const void *s1, const void *s2)
{
return(strcmp(*(const char **)s1,*(const char **)s2));
return(strcmp(*(const char * const *)s1,*(const char * const *)s2));
}
/****************************************************************

View File

@ -1048,7 +1048,7 @@ test_select_hyper_stride(void)
tbuf2=rbuf+loc2[i];
if(*tbuf!=*tbuf2) {
printf("%d: hyperslab values don't match!, loc1[%d]=%d, loc2[%d]=%d\n",__LINE__,i,(int)loc1[i],i,(int)loc2[i]);
printf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",wbuf,tbuf,rbuf,tbuf2);
printf("wbuf=%p, tbuf=%p, rbuf=%p, tbuf2=%p\n",(void *)wbuf,(void *)tbuf,(void *)rbuf,(void *)tbuf2);
printf("*tbuf=%u, *tbuf2=%u\n",(unsigned)*tbuf,(unsigned)*tbuf2);
num_errs++;
} /* end if */

View File

@ -44,10 +44,6 @@ static int dummy; /* just to create a non-empty object file */
#define DATASETNAME "IntData"
#define NUM_THREADS 16
/* Global variables */
extern int num_errs;
extern int Verbosity;
void *tts_acreate_thread(void *);
typedef struct acreate_data_struct {

View File

@ -38,10 +38,6 @@ static int dummy; /* just to create a non-empty object file */
#define FILENAME "ttsafe_cancel.h5"
#define DATASETNAME "commonname"
/* Global variables */
extern int num_errs;
extern int Verbosity;
void *tts_cancel_thread(void *);
void tts_cancel_barrier(void);
herr_t tts_cancel_callback(void *, hid_t, hsize_t, hssize_t *, void *);

View File

@ -35,10 +35,6 @@ static int dummy; /* just to create a non-empty object file */
#define DATASETNAME_LENGTH 10
#define NUM_THREAD 16
/* Global variables */
extern int num_errs;
extern int Verbosity;
void *tts_dcreate_creator(void *);
typedef struct thread_info {

View File

@ -22,9 +22,6 @@
#define MAX_FILE_LEN 256
#define MAX_NUMBER_IMAGES 50
extern int hdfWriteGIF(FILE *fp, BYTE *pic, int ptype, int w, int h,
BYTE *rmap, BYTE *gmap, BYTE *bmap, BYTE *pc2ncmap,
int numcols, int colorstyle, int BitsPerPixel);
int EndianOrder;
#ifdef NOT_USED
@ -67,7 +64,6 @@ int main(int argc , char **argv)
/* reference variables */
int has_local_palette; /* treated as a flag */
int loop_times; /* number of times to loop, treat it as yes/no */
BYTE* b;
@ -304,10 +300,8 @@ int main(int argc , char **argv)
/* Write out the GIF header and logical screen descriptor */
if (n_images > 1) {
fwrite("GIF89a", 1, 6, fpGif); /* the GIF magic number */
loop_times = 0;
} else {
fwrite("GIF87a", 1, 6, fpGif); /* the GIF magic number */
loop_times = 1;
}
putword(RWidth, fpGif); /* screen descriptor */

View File

@ -101,6 +101,14 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap,
int i;
byte *pic8 = pic;
/* Shut compiler up... */
ptype=ptype;
rmap=rmap;
gmap=gmap;
bmap=bmap;
numcols=numcols;
colorstyle=colorstyle;
#ifdef UNUSED
Interlace = 0;
Background = 0;