]> mj.ucw.cz Git - libucw.git/commitdiff
comparison of signed and unsigned encountered without CONFIG_LFS
authorRobert Spalek <robert@ucw.cz>
Sat, 19 Feb 2005 22:23:38 +0000 (22:23 +0000)
committerRobert Spalek <robert@ucw.cz>
Sat, 19 Feb 2005 22:23:38 +0000 (22:23 +0000)
lib/partmap.c
lib/sorter.h

index 04e0891243aeaa79882736d5695409abedce73cf..7a31de28c33ebf94f964fdb1dee814178f62bb6d 100644 (file)
@@ -65,16 +65,16 @@ partmap_close(struct partmap *p)
 void *
 partmap_map(struct partmap *p, sh_off_t start, uns size)
 {
-  if (!p->start_map || start < p->start_off || start+size > p->end_off)
+  if (!p->start_map || start < p->start_off || (sh_off_t) (start+size) > p->end_off)
     {
       if (p->start_map)
        munmap(p->start_map, p->end_off - p->start_off);
       sh_off_t end = start + size;
       sh_off_t win_start = start/PAGE_SIZE * PAGE_SIZE;
       uns win_len = PARTMAP_WINDOW;
-      if (win_start+win_len > p->file_size)
+      if ((sh_off_t) (win_start+win_len) > p->file_size)
        win_len = ALIGN(p->file_size - win_start, PAGE_SIZE);
-      if (win_start+win_len < end)
+      if ((sh_off_t) (win_start+win_len) < end)
        die("partmap_map: Window is too small for mapping %d bytes", size);
       p->start_map = sh_mmap(NULL, win_len, p->writeable ? (PROT_READ | PROT_WRITE) : PROT_READ, MAP_SHARED, p->fd, win_start);
       if (p->start_map == MAP_FAILED)
index c33103dda48a4696807a76318968d8489f5aa2ad..3d31b65662c6f90d7d4aa4044b7d145a058df346 100644 (file)
@@ -304,7 +304,7 @@ P(presort)(struct fastbuf **fb1, struct fastbuf **fb2)
        {
          run_count++;
 #ifdef SORT_UP_TO
-         if (sorter_presort_bufsize < SORT_UP_TO)
+         if (sorter_presort_bufsize < (uns) SORT_UP_TO)
 #endif
            SWAP(out1, out2, tbuf);
          if (!out1)