From cbdc497413b534d1b825fb1306f78134b3dcc362 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Wed, 11 Apr 2007 14:56:23 -0500 Subject: [svn-r13642] avoid hsize_t array index use tested: linux --- hl/tools/gif2h5/h52gifgentst.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c index 57afdb0..a48c825 100644 --- a/hl/tools/gif2h5/h52gifgentst.c +++ b/hl/tools/gif2h5/h52gifgentst.c @@ -18,10 +18,8 @@ #include "hdf5.h" #include "H5IM.h" - - /*------------------------------------------------------------------------- - * Program: h52giftst + * Program: h52gifgentst * * Purpose: generate files for h52gif testing * @@ -33,8 +31,8 @@ */ #define FILENAME "h52giftst.h5" -#define WIDTH (hsize_t)400 -#define HEIGHT (hsize_t)200 +#define WIDTH 400 +#define HEIGHT 200 #define PAL_ENTRIES 256 #define IMAGE1_NAME "image" #define PAL_NAME "palette" @@ -54,6 +52,8 @@ int main(void) unsigned char buf [ WIDTH*HEIGHT ]; unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */ hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */ + hsize_t width = WIDTH; + hsize_t height = HEIGHT; /* create a file */ @@ -70,11 +70,11 @@ int main(void) n++; j=0; } - if (n>PAL_ENTRIES-1) n=0; + } /* make the image */ - if (H5IMmake_image_8bit( fid, IMAGE1_NAME, WIDTH, HEIGHT, buf )<0) + if (H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf )<0) return 1; /*------------------------------------------------------------------------- -- cgit v0.12