aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/hdf5-file.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-05-30 17:17:11 +0200
committerThomas White <taw@physics.org>2012-05-30 17:17:11 +0200
commit4e0fe58f0d35f2a73f718917b2b99dc17fb9f7dd (patch)
tree4b1279360d9d4de28825e4608f554c187ed6ee0d /libcrystfel/src/hdf5-file.c
parent781b32aa84eb9fb3092636beb3f6e4fee43add6c (diff)
Formatting
Diffstat (limited to 'libcrystfel/src/hdf5-file.c')
-rw-r--r--libcrystfel/src/hdf5-file.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c
index 88d11bff..9924e665 100644
--- a/libcrystfel/src/hdf5-file.c
+++ b/libcrystfel/src/hdf5-file.c
@@ -719,6 +719,9 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name)
hsize_t max_size;
hid_t type;
hid_t class;
+ herr_t r;
+ int buf;
+ char *tmp;
dh = H5Dopen2(f->fh, name, H5P_DEFAULT);
if ( dh < 0 ) return NULL;
@@ -761,11 +764,8 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name)
}
switch ( class ) {
- case H5T_FLOAT : {
- herr_t r;
- double buf;
- char *tmp;
+ case H5T_FLOAT :
r = H5Dread(dh, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL,
H5P_DEFAULT, &buf);
@@ -776,12 +776,8 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name)
return tmp;
- }
- case H5T_INTEGER : {
+ case H5T_INTEGER :
- herr_t r;
- int buf;
- char *tmp;
r = H5Dread(dh, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, &buf);
@@ -791,6 +787,7 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name)
snprintf(tmp, 255, "%d", buf);
return tmp;
+
}
default : {
goto fail;