diff --git a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt index bf539c1c7e1..f387b03f388 100644 --- a/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt +++ b/Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt @@ -7,12 +7,12 @@ PROJECT(LIBMINC) SET(LIBMINC_PACKAGE_VERSION_MAJOR 2) SET(LIBMINC_PACKAGE_VERSION_MINOR 4) -SET(LIBMINC_PACKAGE_VERSION_PATCH 05) +SET(LIBMINC_PACKAGE_VERSION_PATCH 06) SET(LIBMINC_SOVERSION "5.3.0") SET(LIBMINC_PACKAGE "libminc") -SET(LIBMINC_PACKAGE_BUGREPORT "a.janke@gmail.com") +SET(LIBMINC_PACKAGE_BUGREPORT "vladimir.fonov@gmail.com") SET(LIBMINC_PACKAGE_NAME "libminc") SET(LIBMINC_PACKAGE_VERSION "${LIBMINC_PACKAGE_VERSION_MAJOR}.${LIBMINC_PACKAGE_VERSION_MINOR}.${LIBMINC_PACKAGE_VERSION_PATCH}") @@ -54,6 +54,8 @@ IF(NOT LIBMINC_EXTERNALLY_CONFIGURED) OPTION(LIBMINC_USE_NIFTI "Build with NIfTI support" OFF) OPTION(LIBMINC_USE_SYSTEM_NIFTI "Use system NIfTI-1 library" OFF) + OPTION(LIBMINC_USE_ASAN "Build with Address Sanitizer" OFF) + SET (LIBMINC_EXPORTED_TARGETS "LIBMINC-targets") SET (LIBMINC_INSTALL_BIN_DIR bin) SET (LIBMINC_INSTALL_LIB_DIR lib${LIB_SUFFIX}) @@ -109,6 +111,13 @@ IF(UNIX) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") ENDIF(UNIX) + +IF(LIBMINC_USE_ASAN) + add_compile_options(-fno-omit-frame-pointer -fsanitize=address) + add_link_options(-fno-omit-frame-pointer -fsanitize=address) +ENDIF(LIBMINC_USE_ASAN) + + # check for prereqs INCLUDE(CheckFunctionExists) INCLUDE(CheckSymbolExists) diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c b/Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c index 83fc3c8c57b..260f5745fae 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/ParseArgv.c @@ -82,7 +82,7 @@ static void PrintVersion(ArgvInfo *argTable); * * Quick replacement for strtol which eliminates the undesirable property * of interpreting numbers with leading '0' characters as octal, while - * retaining "0x" as indicating a hexidecimal number. + * retaining "0x" as indicating a hexadecimal number. */ long int ParseLong(const char *argPtr, char **endPtr) @@ -173,7 +173,7 @@ ParseArgv(argcPtr, argv, argTable, flags) length = strlen(curArg); /* - * Loop throught the argument descriptors searching for one with + * Loop through the argument descriptors searching for one with * the matching key string. If found, leave a pointer to it in * matchPtr. */ diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.c b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.c index 2c9185948d2..fab28b51d96 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.c +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.c @@ -46,7 +46,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:09 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.h b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.h index 396538907bc..3b1864fe416 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.h +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc2_error.h @@ -3,7 +3,7 @@ @DESCRIPTION: File containing error codes for libminc package. @GLOBALS : @CALLS : -@CREATED : 17 Feburary, 2004 (Robert Vincent) +@CREATED : 17 February, 2004 (Robert Vincent) @MODIFIED : * * $Log: minc_error.h,v $ diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.c b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.c index f64b7799c5c..64752e817ed 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.c +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.c @@ -46,7 +46,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:09 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.h b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.h index 2788e953666..50502b4f5d0 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.h +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/minc_error.h @@ -3,7 +3,7 @@ @DESCRIPTION: File containing error codes for minc package. @GLOBALS : @CALLS : -@CREATED : 17 Feburary, 2004 (Robert Vincent) +@CREATED : 17 February, 2004 (Robert Vincent) @MODIFIED : * * $Log: minc_error.h,v $ diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.c b/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.c index 172ec2cd7d3..663934cc6fb 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.c +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.c @@ -24,7 +24,7 @@ * Fixed log message containing log substitution * * Revision 6.1 1999/10/19 14:45:14 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.h b/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.h index 77035126855..2987eca3a94 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.h +++ b/Modules/ThirdParty/MINC/src/libminc/libcommon/time_stamp.h @@ -16,7 +16,7 @@ * Fixed log message containing log substitution * * Revision 6.1 1999/10/19 14:45:14 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/dim_conversion.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/dim_conversion.c index 0a17201393f..845539c77f0 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/dim_conversion.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/dim_conversion.c @@ -36,7 +36,7 @@ * Use standard labs() and fabs() instead of our private macros * * Revision 6.1 1999/10/19 14:45:07 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 @@ -537,7 +537,7 @@ PRIVATE int MI_get_dim_bufsize_step(mi_icv_type *icvp, int subsc[]) dimensions @OUTPUT : (none) @RETURNS : MI_ERROR if an error occurs -@DESCRIPTION: Sets the variables for dimensions converions +@DESCRIPTION: Sets the variables for dimensions conversions @METHOD : @GLOBALS : @CALLS : NetCDF routines diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/hdf_convenience.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/hdf_convenience.c index 657188f21cf..13342f32a1e 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/hdf_convenience.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/hdf_convenience.c @@ -309,12 +309,12 @@ hdf_is_dimension_name(struct m2_file *file, const char *varnm) * may not yet exist in the file. */ static hid_t -hdf_path_from_name(struct m2_file *file, const char *varnm, char *varpath) +hdf_path_from_name(struct m2_file *file, const char *varnm, char *varpath, size_t varpathlength) { if (!strcmp(varnm, MIimage) || !strcmp(varnm, MIimagemax) || !strcmp(varnm, MIimagemin)) { - sprintf(varpath, "/minc-2.0/image/%d/", file->resolution); + snprintf(varpath, varpathlength, "/minc-2.0/image/%d/", file->resolution); } else if (hdf_is_dimension_name(file, varnm)) { strcpy(varpath, "/minc-2.0/dimensions/"); @@ -1102,7 +1102,7 @@ hdf_attput(int fd, int varid, const char *attnm, nc_type val_typ, char temp[128]; unsigned int i; - sprintf(temp, "junkXXXX"); + snprintf(temp, sizeof(temp), "junkXXXX"); new_type_id = H5Tcopy(var->ftyp_id); if (new_type_id < 0) { @@ -1295,7 +1295,7 @@ hdf_vardef(int fd, const char *varnm, nc_type vartype, int ndims, return (MI_ERROR); } - if (hdf_path_from_name(file, varnm, varpath) < 0) { + if (hdf_path_from_name(file, varnm, varpath, sizeof(varpath)) < 0) { return (MI_ERROR); } @@ -2221,7 +2221,7 @@ hdf_open(const char *path, int mode) /*Set cachine parameters*/ fpid=H5Pcreate( H5P_FILE_ACCESS ); - /* Limit file compatability to 1.8.x */ + /* Limit file compatibility to 1.8.x */ H5Pset_libver_bounds (fpid, H5F_LIBVER_V18, H5F_LIBVER_V18); /*setup a bigger cache to work with typical chunking ( MI_MAX_VAR_BUFFER_SIZE )*/ @@ -2332,7 +2332,7 @@ hdf_create(const char *path, int cmode, struct mi2opts *opts_ptr) /*Set cachine parameters*/ fpid = H5Pcreate (H5P_FILE_ACCESS); - /* Limit file compatability to 1.8.x */ + /* Limit file compatibility to 1.8.x */ H5Pset_libver_bounds (fpid, H5F_LIBVER_V18, H5F_LIBVER_V18); /*setup a bigger cache to work with typical chunking ( MI_MAX_VAR_BUFFER_SIZE )*/ diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/image_conversion.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/image_conversion.c index 4856b1f63d4..5769b1cf126 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/image_conversion.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/image_conversion.c @@ -100,7 +100,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:07 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc.h index e33ca9a0903..2da1677ad2c 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc.h @@ -95,7 +95,7 @@ * Start of modifications to get minc working with netcdf 3.5. * * Revision 6.1 1999/10/19 14:45:08 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_basic.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_basic.h index f9c66ed5da7..84addae2f1c 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_basic.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_basic.h @@ -40,7 +40,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:08 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_convenience.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_convenience.c index 655b3d3aa31..5e41caef2a6 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_convenience.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_convenience.c @@ -111,7 +111,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:09 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 @@ -1342,7 +1342,7 @@ MNCAPI int micreate_group_variable(int cdfid, const char *name) @INPUT : id - cdf file id tm_stamp - timestamp as returned by time_stamp() function. @OUTPUT : (none) -@RETURNS : MI_NOERROR if successfuly +@RETURNS : MI_NOERROR if successful @DESCRIPTION: Appends the string (which should be in the format returned by the time_stamp() function) to the global "history" attribute. diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_private.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_private.h index f3ae4493bcd..28d418b58f9 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_private.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_private.h @@ -23,7 +23,7 @@ * #include minc_config.h and minc_error.h * * Revision 6.1 1999/10/19 14:45:09 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_routines.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_routines.h index 3e0d6b62c6d..cd85e3de8e9 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_routines.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_routines.h @@ -23,7 +23,7 @@ * Minor changes for Windows compatibility * * Revision 6.1 1999/10/19 14:45:10 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_simple.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_simple.c index f294676a060..21817823338 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_simple.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_simple.c @@ -529,7 +529,7 @@ minc_save_start(char *path, /* Path to the file */ int var_ndims; /* Number of dimensions per variable */ int var_dims[MI_S_NDIMS]; /* Dimension ID's per variable */ int i, j; /* Generic loop counters */ - int old_ncopts; /* For supressing fatal error messages */ + int old_ncopts; /* For suppressing fatal error messages */ struct file_info *p_file; /* For accessing the file structure */ struct var_info *p_var; struct att_info *p_att; diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_structures.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_structures.h index 9c177293d31..b9896748dae 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_structures.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_structures.h @@ -14,7 +14,7 @@ @MODIFIED : * $Log: minc_structures.h,v $ * Revision 6.1 1999-10-19 14:45:10 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_useful.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_useful.h index 9a4479c51a0..8c777913dcf 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_useful.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_useful.h @@ -18,7 +18,7 @@ * Minor changes for Windows compatibility * * Revision 6.1 1999/10/19 14:45:10 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_varlists.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_varlists.h index 638ca2d33ec..d199505ad85 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_varlists.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/minc_varlists.h @@ -7,7 +7,7 @@ @MODIFIED : * $Log: minc_varlists.h,v $ * Revision 6.1 1999-10-19 14:45:11 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.c index 36896accfdc..dd1888d775a 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.c @@ -22,7 +22,7 @@ * in order to include them in the main minc library. * * Revision 6.1 1999/10/19 14:45:13 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.h index d7f4290a897..e1984d84511 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/nd_loop.h @@ -27,7 +27,7 @@ * in order to include them in the main minc library. * * Revision 6.1 1999/10/19 14:45:14 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/netcdf_convenience.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/netcdf_convenience.c index dabfc55d3fc..c7dbf763460 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/netcdf_convenience.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/netcdf_convenience.c @@ -107,7 +107,7 @@ * For newer versions of glibc, this would cause a seg fault. * * Revision 6.2 1999/10/19 14:45:11 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.1 1997/10/06 12:54:08 neelin * Changed call to tmpnam to tempnam so that TMPDIR variable is checked when @@ -257,7 +257,7 @@ PRIVATE int execute_decompress_command(char *command, const char *infile, /* we now ignore header_only and always uncompress the whole * file as the previous "header only" hack that used to work * on MINC1 files doesn't work reliably with MINC2 */ - (void) sprintf(whole_command, "exec %s %s > %s 2> /dev/null", + (void) snprintf(whole_command, sizeof(whole_command), "exec %s %s > %s 2> /dev/null", command, infile, outfile); status = system(whole_command); diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/strdup.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/strdup.c index f82adedb954..86135cdb638 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/strdup.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/strdup.c @@ -14,7 +14,7 @@ @MODIFIED : * $Log: strdup.c,v $ * Revision 6.1 1999-10-19 14:45:11 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/type_limits.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/type_limits.h index 52c28319335..6695e29427a 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/type_limits.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/type_limits.h @@ -7,7 +7,7 @@ @MODIFIED : * $Log: type_limits.h,v $ * Revision 6.1 1999-10-19 14:45:12 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/value_conversion.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/value_conversion.c index f9129be212f..4aa4d6ed677 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/value_conversion.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/value_conversion.c @@ -41,7 +41,7 @@ * A few fixes to the configure script. * * Revision 6.1 1999/10/19 14:45:12 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:24:54 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.c b/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.c index 6961de19b83..e7cc0d2db2d 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.c @@ -99,7 +99,7 @@ * in their own way. * * Revision 6.1 1999/10/19 14:45:15 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.h b/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.h index 7361630f001..d86e5af2ff1 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc/voxel_loop.h @@ -30,7 +30,7 @@ * in their own way. * * Revision 6.1 1999/10/19 14:45:16 neelin - * Fixed Log subsitutions for CVS + * Fixed Log substitutions for CVS * * Revision 6.0 1997/09/12 13:23:41 neelin * Release of minc version 0.6 diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/datatype.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/datatype.c index 9935df7c137..d6bf234d2b0 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/datatype.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/datatype.c @@ -23,7 +23,7 @@ int miget_data_type ( mihandle_t volume, mitype_t *data_type ) return ( MI_NOERROR ); } -/** Return the byte size of the voxel datatytpe +/** Return the byte size of the voxel datatype */ int miget_data_type_size ( mihandle_t volume, misize_t *voxel_size ) { diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/dimension.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/dimension.c index 63caa35963e..bfbd2016f06 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/dimension.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/dimension.c @@ -184,7 +184,7 @@ int micopy_dimension ( midimhandle_t dim_ptr, midimhandle_t *new_dim_ptr ) * enough range to represent detail on the order of 10 Angstroms in * typical medical imaging applications. * - * For the detailed defintion of \a class and \a type refer to the MINC 2.0 API + * For the detailed definition of \a class and \a type refer to the MINC 2.0 API * definition. * \ingroup mi2Dim */ @@ -1217,7 +1217,7 @@ int miset_dimension_separation ( midimhandle_t dimension, double separation ) * Get the sampling interval (STEP) for a list of dimensions. * \param dimensions An array of dimension handles. * \param voxel_order The order in which the voxel indices increase/decrease. - * \param array_length The number of dimensions in the dimesions array. + * \param array_length The number of dimensions in the dimensions array. * \param separations An array of dimensions sampling intervals (step) values. * * Get or Set the scalar separation (sampling interval) @@ -1245,7 +1245,7 @@ int miget_dimension_separations ( const midimhandle_t dimensions[], /** * Set the sampling interval (STEP) for a list of dimensions. * \param dimensions An array of dimension handles. - * \param array_length The number of dimensions in the dimesions array. + * \param array_length The number of dimensions in the dimensions array. * \param separations An array of dimensions sampling intervals (step) values. * * Refer to miget_dimension_separations(). diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/grpattr.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/grpattr.c index 2d4a0f801b9..bb0c6d8dea7 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/grpattr.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/grpattr.c @@ -899,7 +899,7 @@ int miset_attr_values ( mihandle_t vol, mitype_t data_type, const char *path, full_path_for_attr(fullpath, sizeof(fullpath), path, name, vol); - /* find last occurance of '/' */ + /* find last occurrence of '/' */ pch = strrchr ( path, '/' ); if ( pch != NULL ) { diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/hyper.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/hyper.c index deb7354a2cc..71d8d13bcaf 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/hyper.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/hyper.c @@ -199,7 +199,7 @@ static int mirw_hyperslab_raw(int opcode, return MI_LOG_ERROR(MI2_MSG_GENERIC,"Trying to write to a volume thumbnail"); } - sprintf(path, MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); + snprintf(path, sizeof(path), MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); /*printf("Using:%s\n",path);*/ /* Open the dataset with the specified path @@ -411,7 +411,7 @@ static int mirw_hyperslab_icv(int opcode, return MI_LOG_ERROR(MI2_MSG_GENERIC,"Trying to write to a volume thumbnail"); } - sprintf(path, MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); + snprintf(path, sizeof(path), MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); /*printf("Using:%s\n",path);*/ /* Open the dataset with the specified path @@ -895,7 +895,7 @@ static int mirw_hyperslab_normalized(int opcode, return (MI_ERROR); } - sprintf(path, MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); + snprintf(path, sizeof(path), MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); /* Open the dataset with the specified path */ diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/m2util.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/m2util.c index 324d5aada02..f9f619e2bf1 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/m2util.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/m2util.c @@ -1447,7 +1447,7 @@ int minc_create_thumbnail ( mihandle_t volume, int grp ) return ( MI_ERROR ); } - sprintf ( path, MI_ROOT_PATH "/image/%d", grp ); + snprintf ( path, sizeof(path), MI_ROOT_PATH "/image/%d", grp ); grp_id = H5Gcreate2 ( volume->hdf_id, path, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT ); if ( grp_id < 0 ) { @@ -1691,7 +1691,7 @@ minc_update_thumbnail ( mihandle_t volume, hid_t loc_id, int igrp, int ogrp ) /* Open the input path. */ - sprintf ( path, "%d/image", igrp ); + snprintf ( path, sizeof(path), "%d/image", igrp ); idst_id = H5Dopen1 ( loc_id, path ); if ( idst_id < 0 ) { @@ -1727,7 +1727,7 @@ minc_update_thumbnail ( mihandle_t volume, hid_t loc_id, int igrp, int ogrp ) */ ofspc_id = H5Screate_simple ( ndims, osize, NULL ); - sprintf ( path, "%d/image", ogrp ); + snprintf ( path, sizeof(path), "%d/image", ogrp ); H5E_BEGIN_TRY { odst_id = H5Dcreate1 ( loc_id, path, typ_id, ofspc_id, H5P_DEFAULT ); @@ -1753,7 +1753,7 @@ minc_update_thumbnail ( mihandle_t volume, hid_t loc_id, int igrp, int ogrp ) /* Create a simple scalar dataspace. */ tmspc_id = H5Screate ( H5S_SCALAR ); - sprintf ( path, "%d/image-max", ogrp ); + snprintf ( path, sizeof(path), "%d/image-max", ogrp ); H5E_BEGIN_TRY { omax_id = H5Dcreate1 ( loc_id, path, H5T_IEEE_F64LE, tfspc_id, H5P_DEFAULT ); @@ -1763,7 +1763,7 @@ minc_update_thumbnail ( mihandle_t volume, hid_t loc_id, int igrp, int ogrp ) omax_id = H5Dopen1 ( loc_id, path ); } - sprintf ( path, "%d/image-min", ogrp ); + snprintf ( path, sizeof(path), "%d/image-min", ogrp ); H5E_BEGIN_TRY { omin_id = H5Dcreate1 ( loc_id, path, H5T_IEEE_F64LE, tfspc_id, H5P_DEFAULT ); @@ -2209,7 +2209,7 @@ scaled_maximal_pivoting_gaussian_elimination_real ( int n, /** Computes the inverse of a square matrix. */ -static int +int invert_4x4_matrix ( double matrix[4][4], /**< Input matrix */ double inverse[4][4] ) /**< Output (inverted) matrix */ { diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_api.h b/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_api.h index db6a589b8f4..ca1f64dbc87 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_api.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_api.h @@ -121,7 +121,7 @@ int miget_data_class(mihandle_t vol, miclass_t *volume_class); */ int miget_data_type(mihandle_t vol, mitype_t *volume_data_type); -/** Return the byte size of the voxel datatytpe +/** Return the byte size of the voxel datatype * \ingroup mi2DataType */ int miget_data_type_size(mihandle_t vol, misize_t *voxel_size); @@ -187,7 +187,7 @@ int micopy_dimension(midimhandle_t dim_ptr, midimhandle_t *new_dim_ptr); * enough range to represent detail on the order of 10 Angstroms in * typical medical imaging applications. * - * For the detailed defintion of \a class and \a type refer to the MINC 2.0 API + * For the detailed definition of \a class and \a type refer to the MINC 2.0 API * definition. * \ingroup mi2Dim */ @@ -493,7 +493,7 @@ int miset_dimension_separation(midimhandle_t dimension, * Get the sampling interval (STEP) for a list of dimensions. * \param dimensions An array of dimension handles. * \param voxel_order The order in which the voxel indices increase/decrease. - * \param array_length The number of dimensions in the dimesions array. + * \param array_length The number of dimensions in the dimensions array. * \param separations An array of dimensions sampling intervals (step) values. * * Get or Set the scalar separation (sampling interval) @@ -512,7 +512,7 @@ int miget_dimension_separations(const midimhandle_t dimensions[], /** * Set the sampling interval (STEP) for a list of dimensions. * \param dimensions An array of dimension handles. - * \param array_length The number of dimensions in the dimesions array. + * \param array_length The number of dimensions in the dimensions array. * \param separations An array of dimensions sampling intervals (step) values. * * Refer to miget_dimension_separations(). @@ -730,7 +730,7 @@ int miget_volume_dimension_count(mihandle_t volume, midimclass_t dimclass, midimattr_t attr, int *number_of_dimensions); /** Return the number of slice dimensions associated with this volume. - * it's only usefull for slice normalization + * it's only useful for slice normalization * will return the total number of volume dimensions if slice normalization is not used * \ingroup mi2Vol */ @@ -1425,7 +1425,7 @@ int miget_record_field_name(mihandle_t volume, int index, char **name); /** This method sets a field name for the volume record. The volume * must be of class "MI_CLASS_UNIFORM_RECORD". The size of record - * type will be increased if necessary to accomodate the new field. + * type will be increased if necessary to accommodate the new field. * \ingroup mi2Rec */ int miset_record_field_name(mihandle_t volume, int index, diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_private.h b/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_private.h index 4807b054856..8c31a97039f 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_private.h +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/minc2_private.h @@ -170,6 +170,7 @@ int minc_update_thumbnail(mihandle_t volume, hid_t loc_id, int igrp, int ogrp); int minc_update_thumbnails(mihandle_t volume); + int scaled_maximal_pivoting_gaussian_elimination(int n, int row[], double **a, diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/record.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/record.c index 1fc32a3e500..9049118290f 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/record.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/record.c @@ -63,7 +63,7 @@ int miget_record_field_name(mihandle_t volume, /** This method sets a field name for the volume record. The volume * must be of class "MI_CLASS_UNIFORM_RECORD". The size of record - * type will be increased if necessary to accomodate the new field. + * type will be increased if necessary to accommodate the new field. */ int miset_record_field_name(mihandle_t volume, int index, diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/volprops.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/volprops.c index 680ea21d854..2e6675bfd0a 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/volprops.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/volprops.c @@ -269,20 +269,20 @@ int miselect_resolution(mihandle_t volume, int depth) if (volume->image_id >= 0) { H5Dclose(volume->image_id); } - sprintf(path, "%d/image", depth); + snprintf(path, sizeof(path), "%d/image", depth); volume->image_id = H5Dopen1(grp_id, path); if (volume->volume_class == MI_CLASS_REAL) { if (volume->imax_id >= 0) { H5Dclose(volume->imax_id); } - sprintf(path, "%d/image-max", depth); + snprintf(path, sizeof(path), "%d/image-max", depth); volume->imax_id = H5Dopen1(grp_id, path); if (volume->imin_id >= 0) { H5Dclose(volume->imin_id); } - sprintf(path, "%d/image-min", depth); + snprintf(path, sizeof(path), "%d/image-min", depth); volume->imin_id = H5Dopen1(grp_id, path); } return (MI_NOERROR); diff --git a/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c b/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c index f4fe0988d1f..6a74cedd96e 100644 --- a/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c +++ b/Modules/ThirdParty/MINC/src/libminc/libsrc2/volume.c @@ -611,8 +611,8 @@ int micreate_volume(const char *filename, int number_of_dimensions, */ if (volume_class != MI_CLASS_LABEL && volume_class != MI_CLASS_UNIFORM_RECORD) { - size_t siz = H5Tget_size(handle->ftype_id); - char *tmp = calloc(1, siz); + size_t size = H5Tget_size(handle->ftype_id); + char *tmp = calloc(1, size); H5Pset_fill_value(hdf_plist, handle->ftype_id, tmp); free(tmp); } @@ -784,7 +784,7 @@ int micreate_volume(const char *filename, int number_of_dimensions, */ miset_attr_at_loc(dataset_width, "length", MI_TYPE_INT, 1, &dimensions[i]->length); - /* Close the specified datatset */ + /* Close the specified dataset */ H5Dclose(dataset_width); free(name); } @@ -1056,7 +1056,7 @@ int miget_volume_voxel_count(mihandle_t volume, misize_t *number_of_voxels) /* Quickest way to do this is with the dataspace identifier of the * volume. Use the volume's current resolution. */ - sprintf(path, MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); + snprintf(path, sizeof(path), MI_ROOT_PATH "/image/%d/image", volume->selected_resolution); /* Open the dataset with the specified path */ MI_CHECK_HDF_CALL_RET(dset_id = H5Dopen1(volume->hdf_id, path),"H5Dopen1"); @@ -1166,7 +1166,7 @@ static int _miget_irregular_spacing(mihandle_t hvol, midimhandle_t hdim) char path[MI2_CHAR_LENGTH]; hssize_t n_points; - sprintf(path, MI_ROOT_PATH "/dimensions/%s", hdim->name); + snprintf(path, sizeof(path),MI_ROOT_PATH "/dimensions/%s", hdim->name); MI_CHECK_HDF_CALL_RET(dset_id = H5Dopen1(hvol->hdf_id, path),"H5Dopen1"); MI_CHECK_HDF_CALL_RET(dspc_id = H5Dget_space(dset_id), "H5Dget_space"); @@ -1184,13 +1184,13 @@ static int _miget_irregular_spacing(mihandle_t hvol, midimhandle_t hdim) hdim->offsets), "H5Dread") H5Dclose(dset_id); - sprintf(path, MI_ROOT_PATH "/dimensions/%s-width", hdim->name); + snprintf(path, sizeof(path),MI_ROOT_PATH "/dimensions/%s-width", hdim->name); dset_id = H5Dopen1(hvol->hdf_id, path); if (dset_id < 0) { /* Unfortunately, the emulation library in MINC1 puts this variable * in the wrong place. */ - sprintf(path, MI_ROOT_PATH "/info/%s-width", hdim->name); + snprintf(path, sizeof(path), MI_ROOT_PATH "/info/%s-width", hdim->name); dset_id = H5Dopen1(hvol->hdf_id, path); if (dset_id < 0) { return 0; @@ -1217,7 +1217,7 @@ static int _miget_file_dimension(mihandle_t volume, const char *dimname, unsigned int len; /* Create a path with the dimension name */ - sprintf(path, MI_ROOT_PATH "/dimensions/%s", dimname); + snprintf(path, sizeof(path), MI_ROOT_PATH "/dimensions/%s", dimname); /* Allocate space for the dimension handle */ hdim = (midimhandle_t) malloc(sizeof (*hdim)); /* Initialize everything to zero */ @@ -1376,7 +1376,7 @@ int miopen_volume(const char *filename, int mode, mihandle_t *volume) { if( (file_id = _hdf_open(temp_file, hdf_mode) ) >0) { - unlink( temp_file ); /*file will be deleted immedeately after closing...*/ + unlink( temp_file ); /*file will be deleted immediately after closing...*/ free( temp_file ); } else { unlink( temp_file ); @@ -1403,7 +1403,7 @@ int miopen_volume(const char *filename, int mode, mihandle_t *volume) return MI_LOG_ERROR(MI2_MSG_OPENFILE,filename); #endif } - /* Set some varibales associated with the volume handle */ + /* Set some variables associated with the volume handle */ handle->hdf_id = file_id; handle->mode = mode; diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Geometry/transforms.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Geometry/transforms.c index eee78535b40..6a70f9feeb0 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Geometry/transforms.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Geometry/transforms.c @@ -603,7 +603,7 @@ VIOAPI void concat_transforms( y_trans z_trans @RETURNS : VIO_Status -@DESCRIPTION: Transforms the point (x,y,z,w) by the homogenous transform +@DESCRIPTION: Transforms the point (x,y,z,w) by the homogeneous transform matrix, resulting in (x_trans,y_trans,z_trans). @METHOD : @GLOBALS : diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Include/volume_io/arrays.h b/Modules/ThirdParty/MINC/src/libminc/volume_io/Include/volume_io/arrays.h index 60f374a8b9c..64ce3fca44e 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Include/volume_io/arrays.h +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Include/volume_io/arrays.h @@ -121,7 +121,7 @@ @DESCRIPTION: Adds an element to an array where a separate n_allocated and : n_elems is maintained. n_allocated will always be greater than : or equal to n_elems. This routine is useful so that you don't - : have to call SET_ARRAY_SIZE everytime you remove an element, + : have to call SET_ARRAY_SIZE every time you remove an element, : as in done in DELETE_ELEMENT_FROM_ARRAY @METHOD : @GLOBALS : diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/MNI_formats/gen_xf_io.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/MNI_formats/gen_xf_io.c index 6e0a1450d29..35eef07eb86 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/MNI_formats/gen_xf_io.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/MNI_formats/gen_xf_io.c @@ -80,6 +80,7 @@ static void output_one_transform( int i, c, trans; VIO_Transform *lin_transform; VIO_STR volume_filename, base_filename, prefix_filename; + size_t volume_filename_length; switch( transform->type ) { @@ -181,9 +182,9 @@ static void output_one_transform( /*--- write out the volume filename to the transform file */ /* if( ! transform->displacement_volume_file ) {*/ - volume_filename = alloc_string( string_length(prefix_filename) + - 100 ); - sprintf( volume_filename, "%s_grid_%d.mnc", prefix_filename, + volume_filename_length = string_length(prefix_filename) + 100; + volume_filename = alloc_string( volume_filename_length ); + snprintf( volume_filename, volume_filename_length, "%s_grid_%d.mnc", prefix_filename, *volume_count ); transform->displacement_volume_file = volume_filename; diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/files.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/files.c index 03a1380b04e..293c5acb4c2 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/files.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/files.c @@ -304,12 +304,12 @@ static VIO_STR create_backup_filename( { if( count == 0 ) { - (void) sprintf( backup_filename, "%s.%s.bkp", + (void) snprintf( backup_filename, len, "%s.%s.bkp", expanded, date ); } else { - (void) sprintf( backup_filename, "%s.%s.bkp_%d", + (void) snprintf( backup_filename, len, "%s.%s.bkp_%d", expanded, date, count ); } @@ -1012,13 +1012,13 @@ VIOAPI VIO_Status open_file( tmp_name = get_temporary_filename(); - (void) sprintf( command, "gunzip -c %s > %s", expanded, tmp_name ); + (void) snprintf( command, sizeof(command), "gunzip -c %s > %s", expanded, tmp_name ); command_status = system( command ); /* Try again, using bzip2 */ if( command_status != 0 ) { - (void) sprintf( command, "bunzip2 -c %s > %s", expanded, tmp_name ); + (void) snprintf( command, sizeof(command), "bunzip2 -c %s > %s", expanded, tmp_name ); command_status = system( command ); } diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/print.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/print.c index 3e8385e7751..c8f92cf33d7 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/print.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/print.c @@ -120,7 +120,7 @@ VIOAPI void print( VIO_STR format, ... ) char print_buffer[VIO_EXTREMELY_LARGE_STRING_SIZE]; va_start( ap, format ); - (void) vsprintf( print_buffer, format, ap ); + (void) vsnprintf( print_buffer, sizeof(print_buffer), format, ap ); va_end( ap ); if( print_function[top_of_stack] == NULL ) @@ -219,7 +219,7 @@ VIOAPI void print_error( char format[], ... ) char print_buffer[VIO_EXTREMELY_LARGE_STRING_SIZE]; va_start( ap, format ); - vsprintf( print_buffer, format, ap ); + vsnprintf( print_buffer, sizeof(print_buffer), format, ap ); va_end( ap ); if( print_error_function[top_of_error_stack] == NULL ) diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/time.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/time.c index 4604e393904..0da5d7b7741 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/time.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Prog_utils/time.c @@ -202,7 +202,7 @@ VIOAPI VIO_STR format_time( if( negative ) seconds = -seconds; - (void) sprintf( buffer, format, seconds, units[i] ); + (void) snprintf( buffer, sizeof(buffer), format, seconds, units[i] ); return( create_string( buffer ) ); } diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/evaluate.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/evaluate.c index 6dbb3a66164..be1c048404d 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/evaluate.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/evaluate.c @@ -320,7 +320,7 @@ static void trilinear_interpolate_rgb( @OUTPUT : value derivs @RETURNS : -@DESCRIPTION: Computes the trilinear interpolation of the 8 coeficients, passing +@DESCRIPTION: Computes the trilinear interpolation of the 8 coefficients, passing the value back in the 'value' parameter. If the derivs parameter is not null, then the 3 derivatives are also computed and passed back. @@ -533,7 +533,7 @@ static void trilinear_interpolate( parameters[] - 0 to 1 parameters for each dim n_values - number of values to interpolate degree - degree of interpolation, 4 == cubic - coefs - [degree*degree*degree... *n_values] coeficients + coefs - [degree*degree*degree... *n_values] coefficients @OUTPUT : values - pass back values first_deriv - pass first derivs [n_values][n_dims] second_deriv - pass back values [n_values][n_dims][n_dims] @@ -1083,7 +1083,7 @@ VIOAPI int evaluate_volume( } } - /*--- make room for the coeficients */ + /*--- make room for the coefficients */ if( n_values * n_coefs > MAX_COEF_SPACE ) { @@ -1125,13 +1125,13 @@ VIOAPI int evaluate_volume( for_less( v, 0, n_values * n_coefs ) coefs[v] = outside_value; - /*--- get the necessary coeficients from the volume */ + /*--- get the necessary coefficients from the volume */ extract_coefficients( volume, start, end, &coefs[start_index], inc ); } else { - /*--- get the necessary coeficients from the volume */ + /*--- get the necessary coefficients from the volume */ for_less( d, n_dims, VIO_MAX_DIMENSIONS ) { @@ -1146,7 +1146,7 @@ VIOAPI int evaluate_volume( end[4] - start[4], coefs ); } - /*--- now that we have the coeficients, do the interpolation */ + /*--- now that we have the coefficients, do the interpolation */ switch( degrees_continuity ) { diff --git a/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/input_mnc2.c b/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/input_mnc2.c index 88f42ef2d0c..a402427d3a2 100644 --- a/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/input_mnc2.c +++ b/Modules/ThirdParty/MINC/src/libminc/volume_io/Volumes/input_mnc2.c @@ -173,7 +173,7 @@ static Minc_file initialize_minc_input_from_minc2_id( n_slice_dimensions=file->n_file_dimensions-n_slice_dimensions; - /*now iterate throught all slices to find out global image intensity range*/ + /*now iterate through all slices to find out global image intensity range*/ for_less(d,0,n_slice_dimensions) { slices_count*=dimension_size[d]; @@ -186,7 +186,7 @@ static Minc_file initialize_minc_input_from_minc2_id( double slice_min,slice_max; d=0; - /*iteration trough dimensions*/ + /*iteration through dimensions*/ while(dspatial_axes[2] >= 0 ) dim = 2; - /*--- set a1 to the lowest occuring non-spatial axis, and create + /*--- set a1 to the lowest occurring non-spatial axis, and create a unit vector normal to that of the spatial axis */ if( dim == 0 )