Get rid of malloc.h.

This is a non-POSIX/ISO-C header.  It is ok to include this on Linux, but it
is obsolete on BSD; FreeBSD even throws an error if you include it with
__STDC__ defined.  Every system should nowadays have malloc() defined in
stdlib.h.

Diff is largely mechanical, replacing malloc.h with stdlib.h where it is not
yet included anyway.
This commit is contained in:
Pascal Stumpf
2012-08-12 16:41:42 +02:00
committed by Jon Trulson
parent 18a5139d7a
commit 0bbd4ff9aa
146 changed files with 123 additions and 156 deletions

View File

@@ -67,7 +67,7 @@
/* include files */
#include <stdio.h>
#include <stdarg.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>

View File

@@ -85,7 +85,6 @@ static char rcs_id[]="$XConsortium: Graphics.c /main/23 1996/12/06 11:12:54 cde-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <errno.h>
#include <sys/stat.h>
#include <X11/Xlib.h>

View File

@@ -42,7 +42,7 @@
*/
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <setjmp.h>

View File

@@ -41,8 +41,7 @@ static char version[] = "$XConsortium: ilhplrotation.c /main/3 1995/10/23 15:48:
static char vdate[] = "$XConsortium: ilhplrotation.c /main/3 1995/10/23 15:48:35 rswiston $";
# include <stdio.h>
# include <malloc.h>
/*# include <stdlib.h> */
# include <stdlib.h>
# include <math.h>
# include <limits.h> /* Get definition of */
# include <float.h> /* FLX_MAX */

View File

@@ -34,7 +34,7 @@
#include <stdio.h>
#include <ctype.h>
#include <malloc.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <X11/X.h>

View File

@@ -32,7 +32,6 @@
#include <sys/types.h>
#include <unistd.h>
#include <malloc.h>
#include <sys/utsname.h>
#include <stdlib.h>

View File

@@ -26,7 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "DtHash.h"
#include "DtShmDb.h"

View File

@@ -37,7 +37,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <malloc.h>
#include <string.h>
#include "DtHash.h"
#include "DtShmDb.h"

View File

@@ -125,7 +125,7 @@ extern size_t nl_strlen(); /* __OBSOLETE */
#if defined(__cplusplus)
}
#if defined(apollo) || defined(__aix) || defined(USL) || defined(__uxp__) || defined(__osf__)
#if defined(apollo) || defined(__aix) || defined(USL) || defined(__uxp__) || defined(__osf__) || defined(linux) || defined(CSRG_BASED)
#include <stdlib.h>
#else
#include <malloc.h>

View File

@@ -29,7 +29,6 @@
*/
#include <EUSCompat.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include "rtable2.h"

View File

@@ -29,7 +29,6 @@
*/
#include <EUSCompat.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include "rtable3.h"

View File

@@ -29,7 +29,6 @@
*/
#include <EUSCompat.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include "rtable2.h"

View File

@@ -29,7 +29,6 @@
*/
#include <EUSCompat.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#include "rtable3.h"

View File

@@ -44,7 +44,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include <unistd.h>
#include <security/pam_appl.h>

View File

@@ -34,7 +34,7 @@
#include <sys/stat.h>
#include <utmpx.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include <unistd.h>
#include <libintl.h>
#include <synch.h>

View File

@@ -82,7 +82,6 @@ typedef union
# define TT_STRING 290
# define TT_NUMBER 291
#include <malloc.h>
#include <memory.h>
#if defined (__hpux)

View File

@@ -54,7 +54,6 @@
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <sys/param.h>
#include <stdlib.h>
#include <poll.h>

View File

@@ -53,7 +53,7 @@
*/
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include "CoEdSiteID.h"
CoEdSiteID::

View File

@@ -55,7 +55,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <limits.h>
#include "CoEdTextVersion.h"
#include "CoEdTextChange.h"

View File

@@ -52,7 +52,7 @@
* connection with the use or performance of this software.
*/
#include <malloc.h>
#include <stdlib.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <memory.h>

View File

@@ -37,7 +37,6 @@
#define _API_STORAGE_H
#include <stdlib.h>
#include <malloc.h>
#include "util/tt_object.h"
#include "util/tt_list.h"

View File

@@ -35,13 +35,10 @@
*/
#include "tt_options.h"
#if defined(OPT_BUG_SUNOS_4) && defined(__GNUG__)
# include <stdlib.h>
#endif
#include <stdlib.h>
#include <rpc/rpc.h>
#include "api/c/api_xdr.h"
#include <mp/mp_xdr_functions.h>
#include <malloc.h>
bool_t
_tt_xdr_cstring_list(XDR *xdrs, char ***ar)

View File

@@ -33,7 +33,7 @@
*/
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
#include "api/c/tt_c.h"
#include "ttdnd.h"

View File

@@ -58,7 +58,7 @@ extern "C" { extern int ioctl (int, int, ...) ; };
#include "mp/mp_desktop.h"
#include "mp/mp_mp.h"
#include <unistd.h>
#include <malloc.h>
#include <stdlib.h>
#include "util/tt_gettext.h"
static int parse_Xdisplay_string(_Tt_string display,

View File

@@ -46,7 +46,7 @@
#include "api/c/api_error.h"
#include <errno.h>
#include <sys/resource.h>
#include <malloc.h>
#include <stdlib.h>
#include "tt_options.h"
#if defined(_AIX)

View File

@@ -101,7 +101,7 @@ typedef union
# define _TT_TRACE_LINETERM 280
# define _TT_TRACE_PARSE_EOF 281
#include <malloc.h>
#include <stdlib.h>
#include <memory.h>
#include <values.h>

View File

@@ -37,7 +37,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <errno.h>
#include "util/tt_new.h"

View File

@@ -41,7 +41,7 @@ static char sccsid[] = "@(#)isalloc.c 1.3 89/07/17 Copyr 1988 Sun Micro";
*/
#include "isam_impl.h"
#include <malloc.h>
#include <stdlib.h>
/* strdup is not defined in Ultrix' string.h, so it is implemented in a separate
* file named strdup.ultrix.c