# HG changeset patch # User Rik # Date 1328121445 28800 # Node ID 824e5d362aba9f8e8b11bb56384b3ea78932114e # Parent 61db003b8e4735933ab4c0152108556f3224ebbf Fix Qhull calling convention by passing true file pointer to qh_new_qhull * __delaunayn__.cc, __voronoi__.cc, convhulln.cc: Pass file pointer to "/dev/null" for output of Qhull rather than 0. diff -r 61db003b8e47 -r 824e5d362aba src/DLD-FUNCTIONS/__delaunayn__.cc --- a/src/DLD-FUNCTIONS/__delaunayn__.cc Fri Jan 27 14:06:07 2012 -0500 +++ b/src/DLD-FUNCTIONS/__delaunayn__.cc Wed Feb 01 10:37:25 2012 -0800 @@ -121,10 +121,20 @@ sprintf (flags, "qhull d %s", options.c_str ()); - // Replace the 0 pointer with stdout for debugging information - FILE *outfile = 0; + // Replace the outfile pointer with stdout for debugging information. +#if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) + FILE *outfile = gnulib::fopen ("NUL", "w"); +#else + FILE *outfile = gnulib::fopen ("/dev/null", "w"); +#endif FILE *errfile = stderr; - + + if (! outfile) + { + error ("__delaunayn__: Unable to create temporary file for output."); + return retval; + } + int exitcode = qh_new_qhull (dim, n, pt_array, ismalloc, flags, outfile, errfile); if (! exitcode) diff -r 61db003b8e47 -r 824e5d362aba src/DLD-FUNCTIONS/__voronoi__.cc --- a/src/DLD-FUNCTIONS/__voronoi__.cc Fri Jan 27 14:06:07 2012 -0500 +++ b/src/DLD-FUNCTIONS/__voronoi__.cc Wed Feb 01 10:37:25 2012 -0800 @@ -115,9 +115,19 @@ boolT ismalloc = false; - // Replace the 0 pointer with stdout for debugging information - FILE *outfile = 0; + // Replace the outfile pointer with stdout for debugging information. +#if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) + FILE *outfile = gnulib::fopen ("NUL", "w"); +#else + FILE *outfile = gnulib::fopen ("/dev/null", "w"); +#endif FILE *errfile = stderr; + + if (! outfile) + { + error ("__voronoi__: Unable to create temporary file for output."); + return retval; + } // qh_new_qhull command and points arguments are not const... diff -r 61db003b8e47 -r 824e5d362aba src/DLD-FUNCTIONS/convhulln.cc --- a/src/DLD-FUNCTIONS/convhulln.cc Fri Jan 27 14:06:07 2012 -0500 +++ b/src/DLD-FUNCTIONS/convhulln.cc Wed Feb 01 10:37:25 2012 -0800 @@ -128,10 +128,20 @@ boolT ismalloc = false; - // Replace the 0 pointer with stdout for debugging information. - FILE *outfile = 0; + // Replace the outfile pointer with stdout for debugging information. +#if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM) + FILE *outfile = gnulib::fopen ("NUL", "w"); +#else + FILE *outfile = gnulib::fopen ("/dev/null", "w"); +#endif FILE *errfile = stderr; + if (! outfile) + { + error ("convhulln: Unable to create temporary file for output."); + return retval; + } + // qh_new_qhull command and points arguments are not const... std::string cmd = "qhull" + options;