Being a bit more strict on warnings (-Wall).

This commit is contained in:
Manoel Trapier
2013-03-18 14:16:36 +01:00
committed by Manoël Trapier
parent 74fb1cff61
commit a262a916dc
22 changed files with 105 additions and 134 deletions

View File

@@ -15,40 +15,37 @@
* alloc.c
* Interface to malloc() and realloc()
*/
#include <stdio.h>
#include <stdlib.h>
# include "types.h"
# include "extern.h"
# ifndef NORCSID
static string rcsid = "$Id$";
# endif
# include "LLgen.h"
static string e_nomem = "Out of memory";
p_mem
alloc(size) unsigned size; {
p_mem alloc(unsigned int size)
{
/*
Allocate "size" bytes. Panic if it fails
*/
p_mem p;
if ((p = malloc(size)) == 0) fatal(linecount,e_nomem);
if ((p = malloc(size)) == 0) fatal(linecount,e_nomem, NULL, NULL);
return p;
}
p_mem
ralloc(p,size) p_mem p; unsigned size; {
p_mem ralloc(p_mem p, unsigned int size)
{
/*
Re-allocate the chunk of memory indicated by "p", to
occupy "size" bytes
*/
if ((p = realloc(p,size)) == 0) fatal(linecount,e_nomem);
if ((p = realloc(p,size)) == 0) fatal(linecount,e_nomem, NULL, NULL);
return p;
}
p_mem
new_mem(p) register p_info p; {
p_mem new_mem(p_info p)
{
/*
This routine implements arrays that can grow.
It must be called every time a new element is added to it.
@@ -60,7 +57,7 @@ new_mem(p) register p_info p; {
be updated each time this routine is called
*/
p_mem rp;
unsigned sz;
unsigned int sz;
if (p->i_max >= p->i_top) { /* No more free elements */
sz = p->i_size;