summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-03-06 19:53:23 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-03-06 19:53:23 (GMT)
commit89ffc9f2d7b5c9f929c761823296f60abf4bc7df (patch)
tree521dda7a2680e7ad76e63af969b2bfed0902cf83
parent84f0d4735a2e4a91d8e7bc0b2028c9234dc9fc7c (diff)
downloadhdf5-89ffc9f2d7b5c9f929c761823296f60abf4bc7df.zip
hdf5-89ffc9f2d7b5c9f929c761823296f60abf4bc7df.tar.gz
hdf5-89ffc9f2d7b5c9f929c761823296f60abf4bc7df.tar.bz2
[svn-r26387] warning fixes from Feb27.
-rw-r--r--hl/tools/gif2h5/gif.h2
-rw-r--r--hl/tools/gif2h5/gif2hdf.c2
-rw-r--r--hl/tools/gif2h5/gif2mem.c20
-rw-r--r--src/H5HG.c4
-rw-r--r--src/H5HGpkg.h6
-rw-r--r--src/H5Oalloc.c2
-rw-r--r--src/H5Zfletcher32.c4
-rw-r--r--tools/lib/h5trav.c16
8 files changed, 32 insertions, 24 deletions
diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h
index 5334919..f34a111 100644
--- a/hl/tools/gif2h5/gif.h
+++ b/hl/tools/gif2h5/gif.h
@@ -143,7 +143,7 @@ typedef struct _GifToMem {
*/
/* GIF2MEM.C */
-GIFTOMEM Gif2Mem(BYTE *);
+int Gif2Mem(BYTE *, GIFTOMEM *);
/* GIFREAD.C */
int ReadGifHeader(GIFHEAD *, BYTE **);
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c
index 810be78..8a9e971 100644
--- a/hl/tools/gif2h5/gif2hdf.c
+++ b/hl/tools/gif2h5/gif2hdf.c
@@ -99,7 +99,7 @@ main(int argv , char *argc[])
* Call Gif2Mem and break the whole file into parts. Gif2Mem also calls
* decompresses the images so we don't have to worry about that
*/
- GifMemoryStruct = Gif2Mem(MemGif);
+ Gif2Mem(MemGif, &GifMemoryStruct);
if (ferror(fpGif)) {
printf("File Stream Error\n\n");
diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c
index ac4b0ec..a2e4893 100644
--- a/hl/tools/gif2h5/gif2mem.c
+++ b/hl/tools/gif2h5/gif2mem.c
@@ -37,8 +37,8 @@
#include "gif.h"
-GIFTOMEM
-Gif2Mem(BYTE *MemGif)
+int
+Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
{
/*
* The gif structure outline for passing data to memory is given in gif.h.
@@ -51,8 +51,6 @@ Gif2Mem(BYTE *MemGif)
GIFCOMMENT **gifComment; /* Comment Extension structure */
GIFGRAPHICCONTROL **gifGraphicControl; /* Graphic Control Extension strct */
- GIFTOMEM GifMemoryStruct;
-
register WORD i; /* Loop counter */
BYTE Identifier; /* Extension block identifier holder */
BYTE Label; /* Extension block label holder */
@@ -133,15 +131,15 @@ Gif2Mem(BYTE *MemGif)
gifHead->PlainTextCount = PlainTextCount;
/* putting stuff into the gif2mem structure */
- GifMemoryStruct.GifHeader = gifHead;
- GifMemoryStruct.GifImageDesc = gifImageDesc;
- GifMemoryStruct.GifPlainTextExtension = gifPlainText;
- GifMemoryStruct.GifApplicationExtension = gifApplication;
- GifMemoryStruct.GifCommentExtension = gifComment;
- GifMemoryStruct.GifGraphicControlExtension = gifGraphicControl;
+ GifMemoryStruct->GifHeader = gifHead;
+ GifMemoryStruct->GifImageDesc = gifImageDesc;
+ GifMemoryStruct->GifPlainTextExtension = gifPlainText;
+ GifMemoryStruct->GifApplicationExtension = gifApplication;
+ GifMemoryStruct->GifCommentExtension = gifComment;
+ GifMemoryStruct->GifGraphicControlExtension = gifGraphicControl;
/* return the struct */
- return GifMemoryStruct;
+ return 0;
case 0x2C: /* Image Descriptor */
/*
diff --git a/src/H5HG.c b/src/H5HG.c
index d55eaab..ac8ed8d 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -182,7 +182,7 @@ HDmemset(heap->chunk, 0, size);
* which was always at least H5HG_ALIGNMENT aligned then we could just
* align the pointer, but this might not be the case.
*/
- n = H5HG_ALIGN(p - heap->chunk) - (p - heap->chunk);
+ n = H5HG_ALIGN(p - heap->chunk) - (size_t)(p - heap->chunk);
#ifdef OLD_WAY
/* Don't bother zeroing out the rest of the info in the heap -QAK */
HDmemset(p, 0, n);
@@ -776,7 +776,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj)
else
heap->obj[0].size += need;
HDmemmove(obj_start, obj_start + need,
- heap->size - ((obj_start + need) - heap->chunk));
+ heap->size - (size_t)((obj_start + need) - heap->chunk));
if(heap->obj[0].size >= H5HG_SIZEOF_OBJHDR(f)) {
p = heap->obj[0].begin;
UINT16ENCODE(p, 0); /*id*/
diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h
index 5d4234f..274e0e3 100644
--- a/src/H5HGpkg.h
+++ b/src/H5HGpkg.h
@@ -77,7 +77,7 @@ H5FL_BLK_EXTERN(gheap_chunk);
* largest data type is eight bytes.
*/
#define H5HG_ALIGNMENT 8
-#define H5HG_ALIGN(X) (H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/ \
+#define H5HG_ALIGN(X) (size_t)(H5HG_ALIGNMENT*(((X)+H5HG_ALIGNMENT-1)/ \
H5HG_ALIGNMENT))
#define H5HG_ISALIGNED(X) ((X)==H5HG_ALIGN(X))
@@ -108,8 +108,8 @@ H5FL_BLK_EXTERN(gheap_chunk);
* some overhead and each message has some overhead. The `+2' accounts for
* rounding and for the free space object.
*/
-#define H5HG_NOBJS(f,z) (int)((((z)-H5HG_SIZEOF_HDR(f))/ \
- H5HG_SIZEOF_OBJHDR(f)+2))
+#define H5HG_NOBJS(f,z) ((((z)-H5HG_SIZEOF_HDR(f))/ \
+ H5HG_SIZEOF_OBJHDR(f)+2))
/****************************/
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index 5c00fb2..76f392d 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -762,7 +762,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size, size_t *new
size_t idx; /* Message number */
uint8_t *p = NULL; /*ptr into new chunk */
H5O_cont_t *cont = NULL; /*native continuation message */
- unsigned chunkno; /* Chunk allocated */
+ size_t chunkno; /* Chunk allocated */
haddr_t new_chunk_addr;
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
index 7f67015..2ee69d1 100644
--- a/src/H5Zfletcher32.c
+++ b/src/H5Zfletcher32.c
@@ -137,9 +137,11 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
/* Compute checksum (can't fail) */
fletcher = H5_checksum_fletcher32(src, nbytes);
- if (NULL==(dst=outbuf=H5MM_malloc(nbytes+FLETCHER_LEN)))
+ if (NULL == (outbuf = H5MM_malloc(nbytes + FLETCHER_LEN)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate Fletcher32 checksum destination buffer")
+ dst = (unsigned char *) outbuf;
+
/* Copy raw data */
HDmemcpy((void*)dst, (void*)(*buf), nbytes);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index d0a4a76..90e6d3d 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -50,6 +50,10 @@ typedef struct {
hid_t fid; /* File ID being traversed */
} trav_print_udata_t;
+typedef struct trav_path_op_data_t {
+ const char *path;
+} trav_path_op_data_t;
+
/* format for hsize_t */
#ifdef H5TRAV_PRINT_SPACE
#define HSIZE_T_FORMAT "%" H5_PRINTF_LL_WIDTH "u"
@@ -899,11 +903,11 @@ trav_attr(hid_t
#ifndef H5TRAV_PRINT_SPACE
UNUSED
#endif /* H5TRAV_PRINT_SPACE */
-obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data)
+obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data)
{
- char *buf;
+ trav_path_op_data_t *op_data = (trav_path_op_data_t *)_op_data;
+ const char *buf = op_data->path;
- buf = (char*)op_data;
if((strlen(buf)==1) && (*buf=='/'))
printf(" %-10s %s%s", "attribute", buf, attr_name);
else
@@ -1009,10 +1013,14 @@ trav_print_visit_obj(const char *path, const H5O_info_t *oinfo,
/* Check if we've already seen this object */
if(NULL == already_visited) {
+ trav_path_op_data_t op_data;
+
+ op_data.path = path;
/* Finish printing line about object */
printf("\n");
if(trav_verbosity > 0)
- H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order, NULL, trav_attr, (void *)path, H5P_DEFAULT);
+ H5Aiterate_by_name(print_udata->fid, path, trav_index_by, trav_index_order,
+ NULL, trav_attr, &op_data, H5P_DEFAULT);
}
else
/* Print the link's original name */