# HG changeset patch # User neelin # Date 860700138 0 # Node ID aedcdc30fa3d0ffff49efbbd6f02f9a12aa631b8 # Parent 15699e689e957d26c8fa707e3f8ebc89461660ad Removed redefinition of NULL and added pointer casts in appropriate places. diff --git a/libsrc/image_conversion.c b/libsrc/image_conversion.c --- a/libsrc/image_conversion.c +++ b/libsrc/image_conversion.c @@ -33,9 +33,12 @@ MI_icv_calc_scale @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : $Log: image_conversion.c,v $ -@MODIFIED : Revision 3.1 1997-04-10 18:14:50 neelin -@MODIFIED : Fixed handling of invalid data when icv scale is zero. +@MODIFIED : Revision 3.2 1997-04-10 19:22:18 neelin +@MODIFIED : Removed redefinition of NULL and added pointer casts in appropriate places. @MODIFIED : + * Revision 3.1 1997/04/10 18:14:50 neelin + * Fixed handling of invalid data when icv scale is zero. + * * Revision 3.0 1995/05/15 19:33:12 neelin * Release of minc version 0.3 * @@ -86,7 +89,7 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/image_conversion.c,v 3.1 1997-04-10 18:14:50 neelin Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/image_conversion.c,v 3.2 1997-04-10 19:22:18 neelin Exp $ MINC (MNI)"; #endif #include @@ -1686,7 +1689,7 @@ /* Check icv id */ if ((icvid<0) || (icvid>MI_MAX_NUM_ICV) || (minc_icv_list[icvid]==NULL)) { MI_LOG_PKG_ERROR2(MI_ERR_BADICV,"Illegal icv identifier"); - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((void *) NULL); } MI_RETURN(minc_icv_list[icvid]); diff --git a/libsrc/minc_useful.h b/libsrc/minc_useful.h --- a/libsrc/minc_useful.h +++ b/libsrc/minc_useful.h @@ -14,9 +14,12 @@ @CALLS : @CREATED : July 15, 1991 David MacDonald @MODIFIED : $Log: minc_useful.h,v $ -@MODIFIED : Revision 3.0 1995-05-15 19:33:12 neelin -@MODIFIED : Release of minc version 0.3 +@MODIFIED : Revision 3.1 1997-04-10 19:22:18 neelin +@MODIFIED : Removed redefinition of NULL and added pointer casts in appropriate places. @MODIFIED : + * Revision 3.0 1995/05/15 19:33:12 neelin + * Release of minc version 0.3 + * * Revision 2.0 1994/09/28 10:38:10 neelin * Release of minc version 0.2 * @@ -39,7 +42,7 @@ make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_useful.h,v 3.0 1995-05-15 19:33:12 neelin Rel $ MINC (MNI) +@RCSID : $Header: /private-cvsroot/minc/libsrc/minc_useful.h,v 3.1 1997-04-10 19:22:18 neelin Exp $ MINC (MNI) ---------------------------------------------------------------------------- */ /* ------------ define signed for vaxes ----------------- */ @@ -55,12 +58,6 @@ #define private static #define semiprivate -/* --------- define NULL properly -------------------------- */ -#ifdef NULL -#undef NULL -#endif -#define NULL ((void *) 0) - /* --------- define TRUE and FALSE ------------------------ */ #ifndef FALSE diff --git a/libsrc/netcdf_convenience.c b/libsrc/netcdf_convenience.c --- a/libsrc/netcdf_convenience.c +++ b/libsrc/netcdf_convenience.c @@ -34,9 +34,12 @@ MI_vcopy_action @CREATED : July 27, 1992. (Peter Neelin, Montreal Neurological Institute) @MODIFIED : $Log: netcdf_convenience.c,v $ -@MODIFIED : Revision 3.2 1995-09-29 14:34:09 neelin -@MODIFIED : Modified micopy_all_atts to handle MI_ERROR being passed in as a varid. +@MODIFIED : Revision 3.3 1997-04-10 19:22:18 neelin +@MODIFIED : Removed redefinition of NULL and added pointer casts in appropriate places. @MODIFIED : + * Revision 3.2 1995/09/29 14:34:09 neelin + * Modified micopy_all_atts to handle MI_ERROR being passed in as a varid. + * * Revision 3.1 1995/06/12 20:43:52 neelin * Modified miexpand_file and miopen to try adding compression exetensions * to filenames if the first open fails. @@ -89,7 +92,7 @@ ---------------------------------------------------------------------------- */ #ifndef lint -static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/netcdf_convenience.c,v 3.2 1995-09-29 14:34:09 neelin Exp $ MINC (MNI)"; +static char rcsid[] = "$Header: /private-cvsroot/minc/libsrc/netcdf_convenience.c,v 3.3 1997-04-10 19:22:18 neelin Exp $ MINC (MNI)"; #endif #include @@ -398,7 +401,7 @@ *created_tempfile = FALSE; FREE(newfile); MI_LOG_PKG_ERROR2(MI_ERR_UNCOMPRESS,"Cannot uncompress the file"); - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); } /* Return the new file name */ @@ -667,19 +670,19 @@ /* Inquire about the attribute */ if (ncattinq(cdfid, varid, name, &att_type, &att_length)==MI_ERROR) - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); /* Check that the attribute type is character */ if (att_type!=NC_CHAR) { MI_LOG_PKG_ERROR2(MI_ERR_NONCHAR,"Non-character datatype"); - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); } /* Check to see if the attribute length is less than maxlen. If it is, just get the value. */ if (att_length <= maxlen) { if (ncattget(cdfid, varid, name, value) == MI_ERROR) - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); /* Check the last character for a '\0' */ if (value[att_length-1] != '\0') { if (att_length==maxlen) @@ -694,13 +697,13 @@ if ((att_value = MALLOC(att_length * nctypelen(att_type), char)) ==NULL) { MI_LOG_SYS_ERROR1("miattgetstr"); - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); } /* Get the attribute */ if (ncattget(cdfid, varid, name, att_value)==MI_ERROR) { FREE(att_value); - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((char *) NULL); } /* Copy the attribute */ @@ -1008,7 +1011,7 @@ == MI_ERROR) || (ncvarinq(cdfid, outvar, NULL, NULL, &out_ndims, out_dim, NULL) == MI_ERROR)) { - MI_RETURN_ERROR(NULL); + MI_RETURN_ERROR((long *) NULL); } /* Loop through out_dim, looking for dimensions in in_dim */