]> Creatis software - clitk.git/blobdiff - common/clitkXdrImageIOWriter.cxx
The lower and upper options can be tuned for all type of region growing algorithm
[clitk.git] / common / clitkXdrImageIOWriter.cxx
index 19567aaec1c58ac98895460d945fa6c5f71e0f77..6eae6a595f529f45a76286370010b25710a30a61 100644 (file)
@@ -41,6 +41,7 @@
 //From portdefs.h
 #if defined(unix) || defined(__APPLE__)
 #define O_BINARY 0
+//#define setmode(a,b) 0 // comment by ds
 #endif
 
 #ifndef __LARGE__
@@ -99,8 +100,8 @@ void clitk::XdrImageIO::Write(const void* buffer)
 #ifndef _WIN32
 #  include <unistd.h>
 #endif
-#if !defined(unix) && !defined(__APPLE__)
-#include <io.h>
+#ifdef _WIN32
+#  include <io.h>
 #endif
 #include <fcntl.h>
 #include <errno.h>
@@ -956,7 +957,7 @@ void clitk::XdrImageIO::WriteImage(const char* file, char* headerinfo, char* hea
 
   for (i=0; i<GetNumberOfDimensions(); i++) {
     if (!raw) {
-      sprintf(temp, "dim%d=%d\n", i+1, GetDimensions(i));
+      sprintf(temp, "dim%d=%lu\n", i+1, GetDimensions(i));
       slen = strlen(temp);
       if (!checked_write(f, temp, slen, buffer)) {
         free(pCompressed);