ANSIfication] Another batch.

This commit is contained in:
Manoel Trapier
2013-03-11 16:08:38 +01:00
committed by Manoël Trapier
parent 3d1d1277b7
commit 0946773758
27 changed files with 419 additions and 388 deletions

View File

@@ -10,6 +10,7 @@
#include <alloc.h>
#include <assert.h>
#include <system.h>
#include <string.h>
#include "arith.h"
#include "file_info.h"
#include "idfsize.h"
@@ -32,8 +33,13 @@ char *prog_name;
extern char **inctable;
extern int inc_max, inc_total;
main(argc, argv)
char *argv[];
void compile(int argc, char *argv[]);
void list_dependencies(char *source);
void dependency(char *s, char *source);
int main(int argc, char *argv[])
{
/* parse and interpret the command line options */
prog_name = argv[0];
@@ -61,11 +67,12 @@ main(argc, argv)
}
compile(argc - 1, &argv[1]);
sys_stop(err_occurred ? S_EXIT : S_END);
/*NOTREACHED*/
return -1;
}
compile(argc, argv)
char *argv[];
void compile(int argc, char *argv[])
{
register char *source = 0;
char *dummy;
@@ -94,10 +101,8 @@ compile(argc, argv)
}
struct idf *file_head;
extern char *strrchr();
list_dependencies(source)
char *source;
void list_dependencies(char *source)
{
register struct idf *p = file_head;
@@ -112,7 +117,7 @@ list_dependencies(source)
* object generated, so don't include the pathname
* leading to it.
*/
if (s = strrchr(source, '/')) {
if ( (s = strrchr(source, '/')) ) {
source = s + 1;
}
}
@@ -128,8 +133,7 @@ list_dependencies(source)
}
}
add_dependency(s)
char *s;
void add_dependency(char *s)
{
register struct idf *p = str2idf(s, 0);
@@ -140,8 +144,7 @@ add_dependency(s)
}
}
dependency(s, source)
char *s, *source;
void dependency(char *s, char *source)
{
if (options['i'] && !strncmp(s, "/usr/include/", 13)) {
return;
@@ -152,8 +155,7 @@ dependency(s, source)
else fprint(dep_fd, "%s\n", s);
}
void
No_Mem() /* called by alloc package */
void No_Mem() /* called by alloc package */
{
fatal("out of memory");
}