]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/trim_sgr0.c
ncurses 5.9 - patch 20110507
[ncurses.git] / ncurses / tinfo / trim_sgr0.c
index 446679a77f4864b2c5bf1bac06392ae37313273a..1f99208667ec62320de07524ed373677a8475ceb 100644 (file)
@@ -35,9 +35,8 @@
 #include <ctype.h>
 
 #include <tic.h>
 #include <ctype.h>
 
 #include <tic.h>
-#include <term_entry.h>
 
 
-MODULE_ID("$Id: trim_sgr0.c,v 1.9 2010/01/16 16:45:13 tom Exp $")
+MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $")
 
 #undef CUR
 #define CUR tp->
 
 #undef CUR
 #define CUR tp->
@@ -100,8 +99,8 @@ rewrite_sgr(char *s, char *attr)
 {
     if (PRESENT(s)) {
        if (PRESENT(attr)) {
 {
     if (PRESENT(s)) {
        if (PRESENT(attr)) {
-           unsigned len_s = strlen(s);
-           unsigned len_a = strlen(attr);
+           size_t len_s = strlen(s);
+           size_t len_a = strlen(attr);
 
            if (len_s > len_a && !strncmp(attr, s, len_a)) {
                unsigned n;
 
            if (len_s > len_a && !strncmp(attr, s, len_a)) {
                unsigned n;
@@ -124,8 +123,8 @@ similar_sgr(char *a, char *b)
     bool result = FALSE;
     int csi_a = is_csi(a);
     int csi_b = is_csi(b);
     bool result = FALSE;
     int csi_a = is_csi(a);
     int csi_b = is_csi(b);
-    unsigned len_a;
-    unsigned len_b;
+    size_t len_a;
+    size_t len_b;
 
     TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s",
                        _nc_visbuf2(1, a),
 
     TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s",
                        _nc_visbuf2(1, a),
@@ -265,7 +264,7 @@ _nc_trim_sgr0(TERMTYPE *tp)
                                                   off + i);
                        if (k2 != 0) {
                            found = TRUE;
                                                   off + i);
                        if (k2 != 0) {
                            found = TRUE;
-                           chop_out(off, i, i + k2);
+                           chop_out(off, (unsigned) i, (unsigned) (i + k2));
                            break;
                        }
                    }
                            break;
                        }
                    }
@@ -286,7 +285,7 @@ _nc_trim_sgr0(TERMTYPE *tp)
                        if (off[i - 1] == ';')
                            i--;
                        j = (size_t) (skip_zero(tmp + 1) - off);
                        if (off[i - 1] == ';')
                            i--;
                        j = (size_t) (skip_zero(tmp + 1) - off);
-                       i = chop_out(off, i, j);
+                       (void) chop_out(off, (unsigned) i, (unsigned) j);
                        found = TRUE;
                    }
                }
                        found = TRUE;
                    }
                }
@@ -297,7 +296,7 @@ _nc_trim_sgr0(TERMTYPE *tp)
                i = (size_t) (tmp - end);
                j = strlen(off);
                tmp = strdup(end);
                i = (size_t) (tmp - end);
                j = strlen(off);
                tmp = strdup(end);
-               chop_out(tmp, i, j);
+               chop_out(tmp, (unsigned) i, (unsigned) j);
                free(off);
                result = tmp;
            }
                free(off);
                result = tmp;
            }