#include <string.h>
#include "../common/exprdefs.h"
-#include "../common/symdefs.h"
-#include "../common/segdefs.h"
#include "../common/hashstr.h"
+#include "../common/segdefs.h"
+#include "../common/symdefs.h"
+#include "../common/xmalloc.h"
-#include "mem.h"
-#include "global.h"
#include "error.h"
-#include "fileio.h"
#include "expr.h"
+#include "fileio.h"
+#include "global.h"
#include "segments.h"
/* Create a new fragment and insert it into the segment S */
{
/* Allocate memory */
- Fragment* F = Xmalloc (sizeof (Fragment) - 1 + Size); /* Portable? */
+ Fragment* F = xmalloc (sizeof (Fragment) - 1 + Size); /* Portable? */
/* Initialize the data */
F->Next = 0;
unsigned Len = strlen (Name);
/* Allocate memory */
- Segment* S = Xmalloc (sizeof (Segment) + Len);
+ Segment* S = xmalloc (sizeof (Segment) + Len);
/* Initialize the fields */
S->Next = 0;
/* Allocate memory */
- Section* S = Xmalloc (sizeof (Segment));
+ Section* S = xmalloc (sizeof (Segment));
/* Initialize the data */
S->Next = 0;
/* Calculate the alignment bytes needed for the section */
V = (0x01UL << S->Align) - 1;
- S->Fill = ((Seg->Size + V) & ~V) - Seg->Size;
+ S->Fill = (unsigned char) (((Seg->Size + V) & ~V) - Seg->Size);
/* Adjust the segment size and set the section offset */
Seg->Size += S->Fill;
Segment** SegPool;
/* Allocate memory for the segment pool */
- SegPool = Xmalloc (SegCount * sizeof (Segment*));
+ SegPool = xmalloc (SegCount * sizeof (Segment*));
/* Collect pointers to the segments */
I = 0;
}
/* Free the segment pool */
- Xfree (SegPool);
+ xfree (SegPool);
}