regularized spelling of license to match name of LICENSE file
[platform/upstream/nasm.git] / rdoff / rdfload.c
index 09e3636..ac46de7 100644 (file)
@@ -2,7 +2,7 @@
  *
  * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
  * Julian Hall. All rights reserved. The software is
- * redistributable under the licence given in the file "Licence"
+ * redistributable under the license given in the file "LICENSE"
  * distributed in the NASM archive.
  *
  * Permission to use this file in your own projects is granted, as int32_t
@@ -17,6 +17,8 @@
  *   - support for segment relocations (hard to do in ANSI C)
  */
 
+#include "compiler.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 extern int rdf_errno;
 
-rdfmodule *rdfload(const int8_t *filename)
+rdfmodule *rdfload(const char *filename)
 {
     rdfmodule *f;
     int32_t bsslength = 0;
-    int8_t *hdr;
+    char *hdr;
     rdfheaderrec *r;
 
     f = malloc(sizeof(rdfmodule));
@@ -102,9 +104,9 @@ rdfmodule *rdfload(const int8_t *filename)
 
     rdfheaderrewind(&f->f);
 
-    f->textrel = (int32_t)f->t;
-    f->datarel = (int32_t)f->d;
-    f->bssrel = (int32_t)f->b;
+    f->textrel = (int32_t)(size_t)f->t;
+    f->datarel = (int32_t)(size_t)f->d;
+    f->bssrel  = (int32_t)(size_t)f->b;
 
     return f;
 }
@@ -150,10 +152,10 @@ int rdf_relocate(rdfmodule * m)
                non-portable */
             switch (r->r.length) {
             case 1:
-                seg[r->r.offset] += (int8_t)rel;
+                seg[r->r.offset] += (char)rel;
                 break;
             case 2:
-                *(uint16 *) (seg + r->r.offset) += (uint16) rel;
+                *(uint16_t *) (seg + r->r.offset) += (uint16_t) rel;
                 break;
             case 4:
                 *(int32_t *)(seg + r->r.offset) += rel;