qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs buffer.c qe.c tty.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs buffer.c qe.c tty.c
Date: Fri, 14 Apr 2017 02:59:17 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        17/04/14 02:59:17

Modified files:
        .              : buffer.c qe.c tty.c 

Log message:
        fixed compilation warnings

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/buffer.c?cvsroot=qemacs&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.264&r2=1.265
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.78&r2=1.79

Patches:
Index: buffer.c
===================================================================
RCS file: /sources/qemacs/qemacs/buffer.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- buffer.c    12 Apr 2017 07:33:20 -0000      1.110
+++ buffer.c    14 Apr 2017 06:59:17 -0000      1.111
@@ -1048,6 +1048,9 @@
                   int offset, int size)
 {
     union {
+        uint64_t buf8[256 / 8];
+        uint32_t buf4[256 / 4];
+        uint16_t buf2[256 / 2];
         unsigned char buf[256];
         QETermStyle align;
     } s;
@@ -1067,18 +1070,18 @@
         while (size > 0) {
             len = min(size, ssizeof(s.buf));
             if (b->style_shift == 3) {
-                for (i = 0; i < len; i += 8) {
-                    *(uint64_t*)(void *)(s.buf + i) = style;
+                for (i = 0; i < len >> 3; i++) {
+                    s.buf8[i] = style;
                 }
             } else
             if (b->style_shift == 2) {
-                for (i = 0; i < len; i += 4) {
-                    *(uint32_t*)(void *)(s.buf + i) = style;
+                for (i = 0; i < len >> 2; i++) {
+                    s.buf4[i] = style;
                 }
             } else
             if (b->style_shift == 1) {
-                for (i = 0; i < len; i += 2) {
-                    *(uint16_t*)(void *)(s.buf + i) = style;
+                for (i = 0; i < len >> 1; i++) {
+                    s.buf2[i] = style;
                 }
             } else {
                 memset(s.buf, style, len);

Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -b -r1.264 -r1.265
--- qe.c        12 Apr 2017 07:54:30 -0000      1.264
+++ qe.c        14 Apr 2017 06:59:17 -0000      1.265
@@ -2686,7 +2686,7 @@
         buf_printf(out, "-->%d", -s->x_disp[1]);
     tag = eb_find_property(s->b, 0, s->offset + 1, QE_PROP_TAG);
     if (tag)
-        buf_printf(out, "--%s", tag->data);
+        buf_printf(out, "--%s", (char*)tag->data);
 #if 0
     buf_printf(out, "--[%d]", s->y_disp);
 #endif

Index: tty.c
===================================================================
RCS file: /sources/qemacs/qemacs/tty.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- tty.c       12 Apr 2017 07:33:20 -0000      1.78
+++ tty.c       14 Apr 2017 06:59:17 -0000      1.79
@@ -935,10 +935,12 @@
             break;
         }
         if (w == 0) {
+            int nacc;
+
             if (str == str0)
                 continue;
             /* allocate synthetic glyph for multicharacter combination */
-            int nacc = 1;
+            nacc = 1;
             while (nacc < len && tty_term_glyph_width(s, str[nacc]) == 0)
                 nacc++;
             cc = comb_cache_add(ts, str - 1, nacc + 1);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]