From 65568d75746b56ce7066337cf4c5c4aad11ff5f9 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 7 Apr 2022 06:01:44 -0700 Subject: Normalization of HL library with develop (#1609) --- hl/examples/ex_image1.c | 4 +- hl/src/H5DO.c | 2 +- hl/src/H5DS.c | 8 +-- hl/src/H5LT.c | 60 ++++++++++++++++++--- hl/src/H5LTpublic.h | 6 +++ hl/test/test_ds.c | 28 +++++----- hl/test/test_file_image.c | 2 +- hl/test/test_h5do_compat.c | 2 +- hl/test/test_image.c | 4 +- hl/test/test_ld.c | 6 +-- hl/test/test_lite.c | 109 +++++++++++++++++++++++++++------------ hl/test/test_packet_vlen.c | 2 +- hl/test/test_table.c | 2 +- hl/tools/gif2h5/decompress.c | 4 +- hl/tools/gif2h5/gif2mem.c | 34 ++++++------ hl/tools/gif2h5/gifread.c | 44 ++++++++-------- hl/tools/gif2h5/h52giftest.sh.in | 2 +- hl/tools/gif2h5/hdfgifwr.c | 14 ++--- hl/tools/gif2h5/writehdf.c | 4 +- hl/tools/h5watch/extend_dset.c | 4 +- 20 files changed, 219 insertions(+), 122 deletions(-) diff --git a/hl/examples/ex_image1.c b/hl/examples/ex_image1.c index ead1715..1294ab3 100644 --- a/hl/examples/ex_image1.c +++ b/hl/examples/ex_image1.c @@ -56,10 +56,10 @@ main(void) H5IMmake_image_8bit(file_id, "image1", (hsize_t)WIDTH, (hsize_t)HEIGHT, buf); /* make a palette */ - H5IMmake_palette(file_id, "pallete", pal_dims, pal); + H5IMmake_palette(file_id, "palette", pal_dims, pal); /* attach the palette to the image */ - H5IMlink_palette(file_id, "image1", "pallete"); + H5IMlink_palette(file_id, "image1", "palette"); /* close the file. */ H5Fclose(file_id); diff --git a/hl/src/H5DO.c b/hl/src/H5DO.c index 3bdb4e2..1703669 100644 --- a/hl/src/H5DO.c +++ b/hl/src/H5DO.c @@ -182,7 +182,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t if (FAIL == H5Sselect_hyperslab(new_space_id, H5S_SELECT_SET, start, stride, count, block)) goto done; - /* The # of elemnts in the new extended dataspace */ + /* The # of elements in the new extended dataspace */ if ((snelmts = H5Sget_select_npoints(new_space_id)) < 0) goto done; nelmts = (hsize_t)snelmts; diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index c947d16..387419b 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -88,7 +88,7 @@ H5DSset_scale(hid_t dsid, const char *dimname) return FAIL; /*------------------------------------------------------------------------- - * check if the dataset is a dataset wich has references to dimension scales + * check if the dataset is a dataset which has references to dimension scales *------------------------------------------------------------------------- */ @@ -1122,7 +1122,7 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx) goto out; } /* nelmts */ - /* Free refrences */ + /* Free references */ if (is_new_ref) { if (H5Treclaim(tid, sid, H5P_DEFAULT, ndsbuf) < 0) goto out; @@ -1189,7 +1189,7 @@ out: dsbuf = NULL; } if (buf) { - /* Failure occured before H5Treclaim was called; + /* Failure occurred before H5Treclaim was called; free the pointers allocated when we read data in */ for (i = 0; i < rank; i++) { if (buf[i].p) @@ -1633,7 +1633,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi if (H5DSwith_new_ref(did, &is_new_ref) < 0) return FAIL; - /* get the number of scales assotiated with this DIM */ + /* get the number of scales associated with this DIM */ if ((nscales = H5DSget_num_scales(did, dim)) < 0) return FAIL; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index e63ec92..e4b7090 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1776,6 +1776,32 @@ H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam } /*------------------------------------------------------------------------- + * Function: H5LTset_attribute_ullong + * + * Purpose: Create and write an attribute. + * + * Return: Success: 0, Failure: -1 + * + * Programmer: Alessandro Felder + * + * Date: August 27, 2021 + * + * Comments: + * + *------------------------------------------------------------------------- + */ +herr_t +H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, + const unsigned long long *data, size_t size) +{ + + if (H5LT_set_attribute_numerical(loc_id, obj_name, attr_name, size, H5T_NATIVE_ULLONG, data) < 0) + return -1; + + return 0; +} + +/*------------------------------------------------------------------------- * Function: H5LTset_attribute_float * * Purpose: Create and write an attribute. @@ -1870,19 +1896,12 @@ H5LTfind_attribute(hid_t loc_id, const char *attr_name) * *------------------------------------------------------------------------- */ -/* H5Aiterate wants a non-const pointer but we have a const pointer in the API - * call. It's safe to ignore this because we control the callback, don't - * modify the op_data buffer (i.e.: attr_name) during the traversal, and the - * library never modifies that buffer. - */ -H5_GCC_DIAG_OFF("cast-qual") herr_t H5LT_find_attribute(hid_t loc_id, const char *attr_name) { htri_t attr_exists = H5Aexists(loc_id, attr_name); return (attr_exists < 0) ? (herr_t)-1 : (attr_exists) ? (herr_t)1 : (herr_t)0; } -H5_GCC_DIAG_ON("cast-qual") /*------------------------------------------------------------------------- * Function: H5LTget_attribute_ndims @@ -3272,6 +3291,33 @@ H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam } /*------------------------------------------------------------------------- + * Function: H5LTget_attribute_ullong + * + * Purpose: Reads an attribute named attr_name + * + * Return: Success: 0, Failure: -1 + * + * Programmer: Alessandro Felder + * + * Date: August 27, 2021 + * + * Comments: + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long long *data) +{ + /* Get the attribute */ + if (H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULLONG, data) < 0) + return -1; + + return 0; +} + +/*------------------------------------------------------------------------- * Function: H5LTget_attribute_float * * Purpose: Reads an attribute named attr_name diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 47bb334..a6c7c84 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -139,6 +139,9 @@ H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name, H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size); +H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, + const unsigned long long *buffer, size_t size); + H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name, const float *buffer, size_t size); @@ -182,6 +185,9 @@ H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name, H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long *data); +H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, + unsigned long long *data); + H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name, float *data); diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index c66ef49..12b6840 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -3021,7 +3021,7 @@ test_simple(void) } /*------------------------------------------------------------------------- - * dettach for DIM0 + * detach for DIM0 *------------------------------------------------------------------------- */ @@ -3319,11 +3319,11 @@ test_simple(void) goto out; dim = 0; - /* iterate trough the 1st dimension of "dset_a" and verify that its DS is valid */ + /* iterate through the 1st dimension of "dset_a" and verify that its DS is valid */ if (H5DSiterate_scales(did, dim, NULL, verify_scale, NULL) < 0) goto out; - /* iterate trough the 2nd dimension of "dset_a" and verify that its DS is valid + /* iterate through the 2nd dimension of "dset_a" and verify that its DS is valid start at DS index 2 */ dim = 1; scale_idx = 2; @@ -3344,11 +3344,11 @@ test_simple(void) goto out; dim = 0; - /* iterate trough the 1st dimension of "dset_a" and read the DS */ + /* iterate through the 1st dimension of "dset_a" and read the DS */ if (H5DSiterate_scales(did, dim, NULL, read_scale, s1_wbuf) < 0) goto out; - /* iterate trough the 2nd dimension of "dset_a" and read the DS + /* iterate through the 2nd dimension of "dset_a" and read the DS start at DS index 2 */ dim = 1; scale_idx = 2; @@ -3381,9 +3381,9 @@ test_simple(void) goto out; { int match_size; /* does this scale size matches the dataset DIM size */ - int idx = 0; /* scale index to start iterating, on return, index where iterator stoped */ + int idx = 0; /* scale index to start iterating, on return, index where iterator stopped */ - /* iterate trough all the dimensions */ + /* iterate through all the dimensions */ for (dim = 0; dim < (unsigned)rank; dim++) { if ((match_size = H5DSiterate_scales(did, dim, &idx, match_dim_scale, NULL)) < 0) goto out; @@ -3475,9 +3475,9 @@ test_simple(void) goto out; { int match_size; /* does this scale size matches the dataset DIM size */ - int idx; /* scale index to start iterating, on return, index where iterator stoped */ + int idx; /* scale index to start iterating, on return, index where iterator stopped */ - /* iterate trough all the dimensions */ + /* iterate through all the dimensions */ for (dim = 0; dim < (unsigned)rank; dim++) { /* always start at 1st scale */ idx = 0; @@ -4025,7 +4025,7 @@ test_errors(void) PASSED(); /*------------------------------------------------------------------------- - * try to attach a scale to an image, pallete or table + * try to attach a scale to an image, palette or table *------------------------------------------------------------------------- */ @@ -4036,7 +4036,7 @@ test_errors(void) goto out; /* make a palette */ - if (H5IMmake_palette(fid, "pallete", pal_dims, NULL) < 0) + if (H5IMmake_palette(fid, "palette", pal_dims, NULL) < 0) goto out; /* open the previous written "ds_b" */ @@ -4248,7 +4248,7 @@ test_iterators(void) if ((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0) goto out; - /* try to iterate trough the 1st dimension of "dset_a", return error */ + /* try to iterate through the 1st dimension of "dset_a", return error */ if (H5DSiterate_scales(did, 0, NULL, verify_scale, NULL) < 0) goto out; @@ -4269,7 +4269,7 @@ test_iterators(void) if ((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0) goto out; - /* try to iterate trough the 3rd dimension of "dset_a", return error */ + /* try to iterate through the 3rd dimension of "dset_a", return error */ if (H5DSiterate_scales(did, 3, NULL, verify_scale, NULL) == SUCCEED) goto out; @@ -4306,7 +4306,7 @@ test_iterators(void) goto out; } - /* iterate trough the 1st dimension of "dset_a" */ + /* iterate through the 1st dimension of "dset_a" */ if (H5DSiterate_scales(did, 0, NULL, op_continue, NULL) < 0) goto out; diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c index 36d4db3..4448e41 100644 --- a/hl/test/test_file_image.c +++ b/hl/test/test_file_image.c @@ -244,7 +244,7 @@ test_file_image(size_t open_images, size_t nflags, const unsigned *flags) */ HDmemset((uint8_t *)tmp_ptr + SUPER_STATUS_FLAGS_OFF_V0_V1, (int)0, (size_t)SUPER_STATUS_FLAGS_SIZE_V0_V1); - /* Does the comparision */ + /* Does the comparison */ if (HDmemcmp(tmp_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) FAIL_PUTS_ERROR("comparison of TMP vfd and user buffer failed"); /* Free the temporary buffer */ diff --git a/hl/test/test_h5do_compat.c b/hl/test/test_h5do_compat.c index c554ae7..6f19d4b 100644 --- a/hl/test/test_h5do_compat.c +++ b/hl/test/test_h5do_compat.c @@ -31,7 +31,7 @@ * * Purpose: Test the basic functionality of H5DOwrite_chunk * - * Return: Success: An identifer for the dataset used in the tests + * Return: Success: An identifier for the dataset used in the tests * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- diff --git a/hl/test/test_image.c b/hl/test/test_image.c index e54875e..4997df6 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -219,7 +219,7 @@ test_simple(void) *------------------------------------------------------------------------- */ - HL_TESTING2("pallete functions"); + HL_TESTING2("palette functions"); if (H5IMget_npalettes(fid, IMAGE1_NAME, &npals) < 0) goto out; @@ -422,7 +422,7 @@ test_data(void) /*------------------------------------------------------------------------- * palette #4. blue-red - * make a palette whith blue to red colors + * make a palette with blue to red colors *------------------------------------------------------------------------- */ for (i = 0, n = 0; i < 256 * 3; i += 3, n++) { diff --git a/hl/test/test_ld.c b/hl/test/test_ld.c index dc5755c..150d04c 100644 --- a/hl/test/test_ld.c +++ b/hl/test/test_ld.c @@ -189,7 +189,7 @@ typedef struct set_t { * This will fail on heiwa and amani when VALID_FIELDS1 is "field1,field3,field4" * because of alignment problems: * amani and heiwa - 8 byte alignment - * jam - 4 byte alignemnt + * jam - 4 byte alignment * This will need to be fixed in the library for H5Tget_native_type(). */ /* VALID_FIELDS1 "field1,field2.a,field3,field4" */ @@ -213,8 +213,8 @@ typedef struct test_valid_fields2 { #define TEST_BUF_SIZE 100 int * iibuf; /* buffer for storing retrieved elements */ int * ibuf; /* buffer for storing retrieved elements (integer) */ -set_t * cbuf; /* buffer for storing retrieved elemnets (compound) */ -set_t * ccbuf; /* buffer for storing retrieved elemnets (compound) */ +set_t * cbuf; /* buffer for storing retrieved elements (compound) */ +set_t * ccbuf; /* buffer for storing retrieved elements (compound) */ test_valid_fields1 *vbuf1; /* buffer for storing retrieved elements (FIELDS1) */ test_valid_fields2 *vbuf2; /* buffer for storing retrieved elements (FIELDS2) */ diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index cae91ff..53f834a 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -43,8 +43,9 @@ #define ATTR7_NAME "attr ushort" #define ATTR8_NAME "attr uint" #define ATTR9_NAME "attr ulong" -#define ATTR10_NAME "attr float" -#define ATTR11_NAME "attr double" +#define ATTR10_NAME "attr ullong" +#define ATTR11_NAME "attr float" +#define ATTR12_NAME "attr double" static herr_t make_attributes(hid_t loc_id, const char *obj_name); @@ -472,28 +473,30 @@ make_attributes(hid_t loc_id, const char *obj_name) size_t type_size; int i; - char attr_str_in[] = {"My attribute"}; - char attr_str_out[20]; - char attr_char_in[5] = {1, 2, 3, 4, 5}; - char attr_char_out[5]; - short attr_short_in[5] = {1, 2, 3, 4, 5}; - short attr_short_out[5]; - int attr_int_in[5] = {1, 2, 3, 4, 5}; - int attr_int_out[5]; - long attr_long_in[5] = {1, 2, 3, 4, 5}; - long attr_long_out[5]; - float attr_float_in[5] = {1, 2, 3, 4, 5}; - float attr_float_out[5]; - double attr_double_in[5] = {1, 2, 3, 4, 5}; - double attr_double_out[5]; - unsigned char attr_uchar_in[5] = {1, 2, 3, 4, 5}; - unsigned char attr_uchar_out[5]; - unsigned short attr_ushort_in[5] = {1, 2, 3, 4, 5}; - unsigned short attr_ushort_out[5]; - unsigned int attr_uint_in[5] = {1, 2, 3, 4, 5}; - unsigned int attr_uint_out[5]; - unsigned long attr_ulong_in[5] = {1, 2, 3, 4, 5}; - unsigned long attr_ulong_out[5]; + char attr_str_in[] = {"My attribute"}; + char attr_str_out[20]; + char attr_char_in[5] = {1, 2, 3, 4, 5}; + char attr_char_out[5]; + short attr_short_in[5] = {1, 2, 3, 4, 5}; + short attr_short_out[5]; + int attr_int_in[5] = {1, 2, 3, 4, 5}; + int attr_int_out[5]; + long attr_long_in[5] = {1, 2, 3, 4, 5}; + long attr_long_out[5]; + float attr_float_in[5] = {1, 2, 3, 4, 5}; + float attr_float_out[5]; + double attr_double_in[5] = {1, 2, 3, 4, 5}; + double attr_double_out[5]; + unsigned char attr_uchar_in[5] = {1, 2, 3, 4, 5}; + unsigned char attr_uchar_out[5]; + unsigned short attr_ushort_in[5] = {1, 2, 3, 4, 5}; + unsigned short attr_ushort_out[5]; + unsigned int attr_uint_in[5] = {1, 2, 3, 4, 5}; + unsigned int attr_uint_out[5]; + unsigned long attr_ulong_in[5] = {1, 2, 3, 4, 5}; + unsigned long attr_ulong_out[5]; + unsigned long long attr_ullong_in[5] = {1, 2, 3, 4, 5}; + unsigned long long attr_ullong_out[5]; /*------------------------------------------------------------------------- * H5LTset_attribute_string test @@ -509,7 +512,7 @@ make_attributes(hid_t loc_id, const char *obj_name) PASSED(); /*------------------------------------------------------------------------- - * H5LTset_attribute_string test + * H5LTget_attribute_string test *------------------------------------------------------------------------- */ @@ -859,7 +862,7 @@ make_attributes(hid_t loc_id, const char *obj_name) PASSED(); /*------------------------------------------------------------------------- - * H5LTget_attribute_long test + * H5LTget_attribute_ulong test *------------------------------------------------------------------------- */ @@ -888,6 +891,48 @@ make_attributes(hid_t loc_id, const char *obj_name) PASSED(); /*------------------------------------------------------------------------- + * H5LTset_attribute_ullong test + *------------------------------------------------------------------------- + */ + + HL_TESTING2("H5LTset_attribute_ullong"); + + /* Set the attribute */ + if (H5LTset_attribute_ullong(loc_id, obj_name, ATTR10_NAME, attr_ullong_in, (size_t)5) < 0) + return -1; + + PASSED(); + + /*------------------------------------------------------------------------- + * H5LTget_attribute_ullong test + *------------------------------------------------------------------------- + */ + + HL_TESTING2("H5LTget_attribute_ullong"); + + /* Get the attribute */ + if (H5LTget_attribute_ullong(loc_id, obj_name, ATTR10_NAME, attr_ullong_out) < 0) + return -1; + + for (i = 0; i < 5; i++) { + if (attr_ullong_in[i] != attr_ullong_out[i]) { + return -1; + } + } + + /* Get the attribute */ + if (H5LTget_attribute(loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_ULLONG, attr_ullong_out) < 0) + return -1; + + for (i = 0; i < 5; i++) { + if (attr_ullong_in[i] != attr_ullong_out[i]) { + return -1; + } + } + + PASSED(); + + /*------------------------------------------------------------------------- * H5LTset_attribute_float test *------------------------------------------------------------------------- */ @@ -895,7 +940,7 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTset_attribute_float"); /* Set the attribute */ - if (H5LTset_attribute_float(loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5) < 0) + if (H5LTset_attribute_float(loc_id, obj_name, ATTR11_NAME, attr_float_in, (size_t)5) < 0) return -1; PASSED(); @@ -908,7 +953,7 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTget_attribute_float"); /* Get the attribute */ - if (H5LTget_attribute_float(loc_id, obj_name, ATTR10_NAME, attr_float_out) < 0) + if (H5LTget_attribute_float(loc_id, obj_name, ATTR11_NAME, attr_float_out) < 0) return -1; for (i = 0; i < 5; i++) { @@ -918,7 +963,7 @@ make_attributes(hid_t loc_id, const char *obj_name) } /* Get the attribute */ - if (H5LTget_attribute(loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out) < 0) + if (H5LTget_attribute(loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_FLOAT, attr_float_out) < 0) return -1; for (i = 0; i < 5; i++) { @@ -937,7 +982,7 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTset_attribute_double"); /* Set the attribute */ - if (H5LTset_attribute_double(loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5) < 0) + if (H5LTset_attribute_double(loc_id, obj_name, ATTR12_NAME, attr_double_in, (size_t)5) < 0) return -1; PASSED(); @@ -950,7 +995,7 @@ make_attributes(hid_t loc_id, const char *obj_name) HL_TESTING2("H5LTget_attribute_double"); /* Get the attribute */ - if (H5LTget_attribute_double(loc_id, obj_name, ATTR11_NAME, attr_double_out) < 0) + if (H5LTget_attribute_double(loc_id, obj_name, ATTR12_NAME, attr_double_out) < 0) return -1; for (i = 0; i < 5; i++) { @@ -960,7 +1005,7 @@ make_attributes(hid_t loc_id, const char *obj_name) } /* Get the attribute */ - if (H5LTget_attribute(loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out) < 0) + if (H5LTget_attribute(loc_id, obj_name, ATTR12_NAME, H5T_NATIVE_DOUBLE, attr_double_out) < 0) return -1; for (i = 0; i < 5; i++) { diff --git a/hl/test/test_packet_vlen.c b/hl/test/test_packet_vlen.c index c33479e..aa88a6c 100644 --- a/hl/test/test_packet_vlen.c +++ b/hl/test/test_packet_vlen.c @@ -677,7 +677,7 @@ error: /* An error has occurred. Clean up and exit. */ * * Description: * - Added a fixed-length packet table to the file for variety - * - Use the helper funtion verify_ptlengthtype to test H5PTis_varlen + * - Use the helper function verify_ptlengthtype to test H5PTis_varlen * on each packet table. * * 2016/01/27 -BMR diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 6199e27..90a930c 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -1464,7 +1464,7 @@ test_table(hid_t fid, int do_write) HL_TESTING2("getting field info"); - /* alocate */ + /* allocate */ names_out = (char **)HDmalloc(sizeof(char *) * (size_t)NFIELDS); for (i = 0; i < NFIELDS; i++) { names_out[i] = (char *)HDmalloc(sizeof(char) * 255); diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index 64d9643..ca33f86 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -178,7 +178,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) DataMask = (1 << ((GifHead->PackedField & 0x07) + 1)) - 1; Raster = GifImageDesc->GIFImage; - /* Check for image seperator */ + /* Check for image separator */ /* Now read in values from the image descriptor */ IWidth = GifImageDesc->ImageWidth; @@ -193,7 +193,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ /* - * Start reading the raster data. First we get the intial code size and + * Start reading the raster data. First we get the initial code size and * compute decompressor constant values, based on this code size. */ diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index c66250b..44e18e0 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -40,7 +40,7 @@ Gif2Mem(GIFBYTE *MemGif, GIFTOMEM *GifMemoryStruct) { /* * The gif structure outline for passing data to memory is given in gif.h. - * These pointers are redunant, should take them out in ver. 2 + * These pointers are redundant, should take them out in ver. 2 */ GIFHEAD * gifHead; /* GIF Header structure */ GIFIMAGEDESC ** gifImageDesc; /* Logical Image Descriptor struct */ @@ -49,22 +49,22 @@ Gif2Mem(GIFBYTE *MemGif, GIFTOMEM *GifMemoryStruct) GIFCOMMENT ** gifComment; /* Comment Extension structure */ GIFGRAPHICCONTROL **gifGraphicControl; /* Graphic Control Extension strct */ - register GIFWORD i; /* Loop counter */ - GIFBYTE Identifier; /* Extension block identifier holder */ - GIFBYTE Label; /* Extension block label holder */ - GIFBYTE ImageCount; /* Count of the number of images in the file */ - GIFBYTE ImageArray; /* Keep the size of the array to store Images */ - GIFBYTE CommentCount; - GIFBYTE CommentArray; - GIFBYTE ApplicationCount; - GIFBYTE ApplicationArray; - GIFBYTE PlainTextCount; - GIFBYTE PlainTextArray; - GIFBYTE GCEflag; - GIFBYTE aTemp; - GIFBYTE j; - GIFBYTE w; /* Two more variables needed only while testing */ - GIFBYTE * b; /* Endian Ordering */ + GIFWORD i; /* Loop counter */ + GIFBYTE Identifier; /* Extension block identifier holder */ + GIFBYTE Label; /* Extension block label holder */ + GIFBYTE ImageCount; /* Count of the number of images in the file */ + GIFBYTE ImageArray; /* Keep the size of the array to store Images */ + GIFBYTE CommentCount; + GIFBYTE CommentArray; + GIFBYTE ApplicationCount; + GIFBYTE ApplicationArray; + GIFBYTE PlainTextCount; + GIFBYTE PlainTextArray; + GIFBYTE GCEflag; + GIFBYTE aTemp; + GIFBYTE j; + GIFBYTE w; /* Two more variables needed only while testing */ + GIFBYTE *b; /* Endian Ordering */ /* Allocate memory for the GIF structures */ /* Plug the structs into GifMemoryStruct at the end */ diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index dd9e5be..3a6bcae 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -50,15 +50,15 @@ GetByte(const GIFBYTE *MemGif) * Global Color Table (if any) from a GIF image file. The information * is stored in a GIFHEAD structure. * - * Returns: -1 if a FILE stream error occured during the read, - * otherwise 0 if no error occured. + * Returns: -1 if a FILE stream error occurred during the read, + * otherwise 0 if no error occurred. */ int ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */ GIFBYTE **MemGif2) /* GIF image file input FILE stream */ { GIFWORD i; /* Loop counter */ - GIFWORD tableSize; /* Number of entires in the Global Color Table */ + GIFWORD tableSize; /* Number of entries in the Global Color Table */ GifHead->TableSize = 0; for (i = 0; i < 6; i++) { @@ -103,7 +103,7 @@ ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */ return -1; #endif /* 0 */ - return 0; /* No FILE stream error occured */ + return 0; /* No FILE stream error occurred */ } /* @@ -116,8 +116,8 @@ ReadGifHeader(GIFHEAD * GifHead, /* Pointer to GIF header structure */ ** Note that the ImageSeparator field value in the GIFIMAGEDESC ** structure is assigned by the function calling ReadGifImageDesc(). ** -** Returns: -1 if a FILE stream error occured during the read, -** otherwise 0 if no error occured. +** Returns: -1 if a FILE stream error occurred during the read, +** otherwise 0 if no error occurred. */ int ReadGifImageDesc(GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor structure */ @@ -196,7 +196,7 @@ ReadGifImageDesc(GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor *TempPtr++ = *(*MemGif2)++; } while (ch1); - return (0); /* No FILE stream error occured */ + return (0); /* No FILE stream error occurred */ } /* @@ -205,8 +205,8 @@ ReadGifImageDesc(GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor ** Note that the Introducer and Label field values in the GIFGRAPHICCONTROL ** structure are assigned by the function calling ReadGifGraphicControl(). ** -** Returns: -1 if a FILE stream error occured during the read, -** otherwise 0 if no error occured. +** Returns: -1 if a FILE stream error occurred during the read, +** otherwise 0 if no error occurred. */ int ReadGifGraphicControl(GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Extension structure */ @@ -219,7 +219,7 @@ ReadGifGraphicControl(GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Ext GifGraphicControl->GCEDump[i] = *(*MemGif2)++; } - return (0); /* No FILE stream error occured */ + return (0); /* No FILE stream error occurred */ } /* @@ -228,8 +228,8 @@ ReadGifGraphicControl(GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Ext ** Note that the Introducer and Label field values in the GIFLPLAINTEXT ** structure are assigned by the function calling ReadGifPlainText(). ** -** Returns: -1 if a FILE stream error occured during the read, -** otherwise 0 if no error occured. +** Returns: -1 if a FILE stream error occurred during the read, +** otherwise 0 if no error occurred. */ int ReadGifPlainText(GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension structure */ @@ -256,7 +256,7 @@ ReadGifPlainText(GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension return(-1); */ - return (0); /* No FILE stream error occured */ + return (0); /* No FILE stream error occurred */ } /* @@ -265,8 +265,8 @@ ReadGifPlainText(GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension ** Note that the Introducer and Label field values in the GIFAPPLICATION ** structure are assigned by the function calling ReadGifApplication(). ** -** Returns: -1 if a FILE stream error occured during the read, -** otherwise 0 if no error occured. +** Returns: -1 if a FILE stream error occurred during the read, +** otherwise 0 if no error occurred. */ int ReadGifApplication(GIFAPPLICATION *GifApplication, /* Pointer to Application Extension structure */ @@ -292,7 +292,7 @@ ReadGifApplication(GIFAPPLICATION *GifApplication, /* Pointer to Application Ext return(-1); */ - return (0); /* No FILE stream error occured */ + return (0); /* No FILE stream error occurred */ } /* @@ -301,8 +301,8 @@ ReadGifApplication(GIFAPPLICATION *GifApplication, /* Pointer to Application Ext ** Note that the Introducer and Label field values in the GIFCOMMENT ** structure are assigned by the function calling ReadGifComment(). ** -** Returns: -1 if a FILE stream error occured during the read, -** otherwise 0 if no error occured. +** Returns: -1 if a FILE stream error occurred during the read, +** otherwise 0 if no error occurred. */ int ReadGifComment(GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension structure */ @@ -316,7 +316,7 @@ ReadGifComment(GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension struc GifComment->Terminator = 0; - return (0); /* No FILE stream error occured */ + return (0); /* No FILE stream error occurred */ } /* @@ -326,8 +326,8 @@ ReadGifComment(GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension struc ** A GIF "sub-block" is a single count byte followed by 1 to 255 ** additional data bytes. ** -** Returns: A NULL pointer if a memory allocation error occured, -** otherwise a valid pointer if no error occured. +** Returns: A NULL pointer if a memory allocation error occurred, +** otherwise a valid pointer if no error occurred. */ static GIFBYTE * ReadDataSubBlocks(GIFBYTE **MemGif2, /* GIF image file input FILE stream */ @@ -364,7 +364,7 @@ ReadDataSubBlocks(GIFBYTE **MemGif2, /* GIF image file input FILE stream if ((dataSize = *(*MemGif2)++) == 0) break; /* Block Terminator encountered */ - /* Increase the buffer size to accomodate the next sub-block */ + /* Increase the buffer size to accommodate the next sub-block */ if (!(ptr1 = ptr2 = (GIFBYTE *)realloc(ptr2, bufSize + dataSize + 1))) return ((GIFBYTE *)NULL); diff --git a/hl/tools/gif2h5/h52giftest.sh.in b/hl/tools/gif2h5/h52giftest.sh.in index 2f84ef6..4f4057f 100644 --- a/hl/tools/gif2h5/h52giftest.sh.in +++ b/hl/tools/gif2h5/h52giftest.sh.in @@ -46,7 +46,7 @@ TOOLTEST() # Verify the test runs with failure (return code is not 0) # Use for testing if tool can handle error conditions like -# illegal input, bad arguments, exeeding limits, ... +# illegal input, bad arguments, exceeding limits, ... TOOLTESTFAIL() { # for now, discard any error messages generated. diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 21b14d1..7126da9 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -188,13 +188,13 @@ hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, const byte *rmap, cons static void compress(int init_bits, FILE *outfile, byte *data, int len) { - register long fcode; - register int i = 0; - register int c; - register int ent; - register int disp; - register int hsize_reg; - register int hshift; + long fcode; + int i = 0; + int c; + int ent; + int disp; + int hsize_reg; + int hshift; /* * Set up the globals: g_init_bits - initial number of bits g_outfile - diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index a444cf7..b49e2a6 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -27,7 +27,7 @@ * Programmer: Unknown * * Modifications: pvn - * Use the HDF5 IMAGE API to write the HDF5 image and pallete + * Use the HDF5 IMAGE API to write the HDF5 image and palette * * Date: January, 31, 2006 * @@ -68,7 +68,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName) #endif /* UNUSED */ if ((file_id = H5Fcreate(HDFName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - /* error occured opening the HDF File for write */ + /* error occurred opening the HDF File for write */ fprintf(stderr, "HDF file could not be opened for writing\n"); fprintf(stderr, "NOTE: GIF file must be present in the same directory as the binary on UNIX systems.\n"); diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 07a4053..7756506 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -83,7 +83,7 @@ extend_dset_two(const char *file, char *dname, int action1, int action2) size_t dtype_size; /* size of the dataset's datatype */ unsigned num_elmts; /* number of elements in the dataset */ int * ibuf = NULL; /* buffer for storing retrieved elements (integer) */ - set_t * cbuf = NULL; /* buffer for storing retrieved elemnets (compound) */ + set_t * cbuf = NULL; /* buffer for storing retrieved elements (compound) */ /* Allocate memory */ if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int)))) @@ -237,7 +237,7 @@ extend_dset_one(const char *file, char *dname, int action) hsize_t count[1]; /* dimension sizes of appended data */ size_t dtype_size; /* size of the dataset's datatype */ int * ibuf = NULL; /* buffer for storing retrieved elements (integer) */ - set_t * cbuf = NULL; /* buffer for storing retrieved elemnets (compound) */ + set_t * cbuf = NULL; /* buffer for storing retrieved elements (compound) */ /* Allocate memory */ if (NULL == (ibuf = (int *)HDcalloc(TEST_BUF_SIZE, sizeof(int)))) -- cgit v0.12