[ismrmrd] 137/177: Got rid of some compiler warnings.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Jan 14 20:02:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag v1.1.0.beta.1
in repository ismrmrd.

commit cacea24dce9ffa5ee852ffc669b41287341561aa
Author: Souheil Inati <souheil.inati at nih.gov>
Date:   Tue Oct 14 14:31:44 2014 -0400

    Got rid of some compiler warnings.
---
 examples/c/main.c | 14 ++++++--------
 libsrc/dataset.c  |  2 ++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/examples/c/main.c b/examples/c/main.c
index 005f847..524f436 100644
--- a/examples/c/main.c
+++ b/examples/c/main.c
@@ -13,8 +13,6 @@ void myerror(const char *file, int line, const char *func, int code, const char
 
 int main(void)
 {
-    int status;
-
     /* Set the error handler */
     ismrmrd_set_error_handler(myerror);
 
@@ -26,11 +24,11 @@ int main(void)
     const char *filename = "myfile.h5";
     const char *groupname = "/dataset";
     ismrmrd_init_dataset(&dataset1, filename, groupname);
-    status = ismrmrd_open_dataset(&dataset1, true);
+    ismrmrd_open_dataset(&dataset1, true);
 
     /* Write an XML header */
     const char *xmlhdr = "Yo! This is some text for the header.";
-    status = ismrmrd_write_header(&dataset1, xmlhdr);
+    ismrmrd_write_header(&dataset1, xmlhdr);
 
     /* Append some acquisitions */
     ISMRMRD_Acquisition acq;
@@ -59,7 +57,7 @@ int main(void)
     }
     
     /* Close the dataset */
-    status = ismrmrd_close_dataset(&dataset1);
+    ismrmrd_close_dataset(&dataset1);
 
     /************/
     /* Old File */
@@ -67,7 +65,7 @@ int main(void)
     /* Reopen the file as a different dataset */
     ISMRMRD_Dataset dataset2;
     ismrmrd_init_dataset(&dataset2, filename, groupname);
-    status = ismrmrd_open_dataset(&dataset2, false);
+    ismrmrd_open_dataset(&dataset2, false);
 
     /* Read the header */
     char *xmlstring = ismrmrd_read_header(&dataset2);
@@ -90,7 +88,7 @@ int main(void)
     printf("Acquisition index: %u\n", index);
     ismrmrd_read_acquisition(&dataset2, index, &acq2);
     printf("Number of samples: %u\n", acq2.head.number_of_samples);
-    printf("Flags: %llu\n", acq2.head.flags);
+    printf("Flags: %lu\n", acq2.head.flags);
     printf("Data[4]: %f, %f\n", creal(acq2.data[4]), cimag(acq2.data[4]));
     
     ISMRMRD_Acquisition acq3;
@@ -131,7 +129,7 @@ int main(void)
     free(xmlstring);
 
     /* Close the dataset */
-    status = ismrmrd_close_dataset(&dataset2);
+    ismrmrd_close_dataset(&dataset2);
 
     //NDArray arr;
     //initNDArray(&arr);
diff --git a/libsrc/dataset.c b/libsrc/dataset.c
index 3a4b017..f04453e 100644
--- a/libsrc/dataset.c
+++ b/libsrc/dataset.c
@@ -543,6 +543,8 @@ int append_element(const ISMRMRD_Dataset * dset, const char * path,
             return ISMRMRD_PUSH_ERR(ISMRMRD_FILEERROR, "Dimensions are incorrect.");
         }
     } else {
+        dataset   = -1; /* will be initialized below */
+        dataspace = -1; /* will be initialized below */
         rank = ndim + 1;
     }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ismrmrd.git



More information about the debian-science-commits mailing list