Rationalised use of #includes to be more standards-compliant.

This commit is contained in:
dtrg
2006-07-18 17:10:29 +00:00
parent 8ea67498ed
commit 4c0a0e6119
48 changed files with 80 additions and 66 deletions

View File

@@ -25,6 +25,9 @@ static char RcsId[] = "$Id$";
#endif
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
@@ -38,7 +41,6 @@ struct ranlib *tab;
unsigned int tnum = 0;
char *tstrtab;
unsigned int tssiz = 0;
char *malloc(), *realloc(), *strcpy(), *strncpy();
long time();
unsigned int tabsz, strtabsz;
#else

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "states.h"

View File

@@ -1,3 +1,6 @@
#include <stdlib.h>
#include <string.h>
#if __STDC__
#include <stdarg.h>
extern out(char *, ...);

View File

@@ -38,6 +38,8 @@
*/
{
#include <stdlib.h>
#include <string.h>
#include "decl.h"
extern int lineno, yyleng;

View File

@@ -11,7 +11,9 @@ static char rcsid[]="$Id$";
* Author: Hans van Staveren
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <em_spec.h>
#include <em_flag.h>
@@ -37,8 +39,8 @@ static char rcsid[]="$Id$";
inst_t yy_instance;
}
%type <yy_list1> list1,structlistel
%type <yy_list2> structlist,structdecl
%type <yy_list1> list1 structlistel
%type <yy_list2> structlist structdecl
%type <yy_expr> expr optexpr
%type <yy_cost> optcost cost optcommacost
%type <yy_int> optboolexpr optnocoerc mnem emargno tokargno optprop
@@ -48,8 +50,8 @@ static char rcsid[]="$Id$";
%type <yy_instance> tokeninstance
%type <yy_string> optformat
%token <yy_string> IDENT TYPENAME
%token <yy_ident> RIDENT,PIDENT,TIDENT,EIDENT
%token <yy_string> LSTRING,STRING
%token <yy_ident> RIDENT PIDENT TIDENT EIDENT
%token <yy_string> LSTRING STRING
%token <yy_int> NUMBER
%token <yy_intp> CIDENT
%token REGISTERHEAD TOKENHEAD EXPRESSIONHEAD CODEHEAD MOVEHEAD TESTHEAD STACKHEAD
@@ -63,12 +65,12 @@ static char rcsid[]="$Id$";
%left OR2
%left AND2
%left CMPEQ,CMPNE
%left CMPLT,CMPLE,CMPGT,CMPGE
%left RSHIFT,LSHIFT
%left '+','-'
%left '*','/','%'
%nonassoc NOT,COMP,UMINUS
%left CMPEQ CMPNE
%left CMPLT CMPLE CMPGT CMPGE
%left RSHIFT LSHIFT
%left '+' '-'
%left '*' '/' '%'
%nonassoc NOT COMP UMINUS
%nonassoc '$'
%%
machinespec

View File

@@ -1,20 +1,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <em_spec.h>
#include <em_flag.h>
#include <em_reg.h>
#include "booth.h"
extern char *strncpy(), *strcpy();
extern char *malloc();
#ifndef __STDC__
extern char *sprintf();
#else
/* sprintf should be declared in stdio.h, as returning an int */
#endif
char * myalloc(n) {
register char *p;

View File

@@ -9,7 +9,9 @@
Many mods by Ceriel Jacobs
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef NORCSID
static char *RcsId = "$Id$";
@@ -28,8 +30,6 @@ char *ProgCall; /* callname of this program */
int TabSize = 128; /* default size of generated table */
char *InitialValue; /* initial value of all table entries */
extern char *malloc(), *strcpy();
main(argc, argv)
char *argv[];
{

View File

@@ -5,6 +5,8 @@
*/
/* PREPROCESSOR: MACRO-TEXT REPLACEMENT ROUTINES */
#include <stdlib.h>
#include <string.h>
#include "debug.h" /* UF */
#include "pathlength.h" /* UF */
#include "textsize.h" /* UF */