]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codeseg.c
Fixed two compiler warnings.
[cc65] / src / cc65 / codeseg.c
index 36fdc05b6e853d537434ccd00b0434f9dd4703e2..fff502d3ea6009f44a73b287499511641da8a9a5 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2001-2009, Ullrich von Bassewitz                                      */
+/* (C) 2001-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -41,7 +41,7 @@
 #include "check.h"
 #include "debugflag.h"
 #include "global.h"
-#include "hashstr.h"
+#include "hashfunc.h"
 #include "strbuf.h"
 #include "strutil.h"
 #include "xmalloc.h"
@@ -655,6 +655,11 @@ void CS_MoveEntries (CodeSeg* S, unsigned Start, unsigned Count, unsigned NewPos
  * current code end)
  */
 {
+    /* Transparently handle an empty range */
+    if (Count == 0) {
+        return;
+    }
+
     /* If NewPos is at the end of the code segment, move any labels from the
      * label pool to the first instruction of the moved range.
      */
@@ -1079,7 +1084,7 @@ void CS_DelCodeRange (CodeSeg* S, unsigned First, unsigned Last)
     if (CE_HasLabel (FirstEntry)) {
         /* Get the entry following last */
         CodeEntry* FollowingEntry = CS_GetNextEntry (S, Last);
-        if (FollowingEntry) {       
+        if (FollowingEntry) {
             /* There is an entry after Last - move the labels */
             CS_MoveLabels (S, FirstEntry, FollowingEntry);
         } else {
@@ -1395,7 +1400,7 @@ void CS_Output (CodeSeg* S)
                     const char* N = strchr (L, '\n');
                     if (N) {
                         /* We have a newline, just write the first part */
-                        WriteOutput ("%.*s\n; ", N - L, L);
+                        WriteOutput ("%.*s\n; ", (int) (N - L), L);
                         L = N+1;
                     } else {
                         /* No Newline, write as is */