summaryrefslogtreecommitdiffstats
path: root/test/trefer_deprec.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-11-13 19:29:59 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-11-13 19:29:59 (GMT)
commitb505226ad581f50804ee0a8cb5cb63b85d698dc7 (patch)
tree57dc3df32efa7da2251fe440f04ed2d3e0972594 /test/trefer_deprec.c
parent695c62bafe07cf6213135f439b122ea7c4755a39 (diff)
downloadhdf5-b505226ad581f50804ee0a8cb5cb63b85d698dc7.zip
hdf5-b505226ad581f50804ee0a8cb5cb63b85d698dc7.tar.gz
hdf5-b505226ad581f50804ee0a8cb5cb63b85d698dc7.tar.bz2
Change hdset_reg_ref_t and H5R_ref_t from arrays of unsigned char to
structs containing those arrays. Encapsulating the arrays in this way makes it easier to write and think about pointers to these types, casts to/from these types, etc. An interesting side-effect that we probably should *not* rely on is that the struct-encapsulation changes the alignment so that some GCC warnings about casts that increase the alignment requirement of the operand go away. Warnings like that have to be taken seriously: I will add -Werror=cast-align to the default compiler flags so that they stop the build quickly. GCC warnings led me to some surprising casts in test/trefer.c. I found that it was possible to make many simplifications after introducing the struct-encapsulation that I described, above.
Diffstat (limited to 'test/trefer_deprec.c')
-rw-r--r--test/trefer_deprec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c
index 949f41b..1b77e9c 100644
--- a/test/trefer_deprec.c
+++ b/test/trefer_deprec.c
@@ -517,7 +517,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
hsize_t high[SPACE2_RANK]; /* Selection bounds */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
- hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
+ hdset_reg_ref_t nvrbuf[3]={{{0}},{{101}},{{255}}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
uint8_t *tu8; /* Temporary pointer to uint8 data */