qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs README TODO.org VERSION arm.c hex.c inpu...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs README TODO.org VERSION arm.c hex.c inpu...
Date: Wed, 27 Mar 2019 03:43:56 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        19/03/27 03:43:56

Modified files:
        .              : README TODO.org VERSION arm.c hex.c input.c 
                         qe.h search.c util.c 

Log message:
        Small fixes
        
        - add qe_digit_value(): returns arithmetic value of character
        - single test in qe_inrange()
        - simplify qe_isxdigit() and use qe_isxdigit_()
        - remove to_hex()
        - hex.c: use qe_digit_value() instead of to_hex()
        - update TODO.org, README
        - bump VERSION to 5.2alpha

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/README?cvsroot=qemacs&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qemacs/TODO.org?cvsroot=qemacs&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/qemacs/VERSION?cvsroot=qemacs&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/qemacs/arm.c?cvsroot=qemacs&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/qemacs/hex.c?cvsroot=qemacs&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/qemacs/input.c?cvsroot=qemacs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.271&r2=1.272
http://cvs.savannah.gnu.org/viewcvs/qemacs/search.c?cvsroot=qemacs&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/qemacs/util.c?cvsroot=qemacs&r1=1.84&r2=1.85

Patches:
Index: README
===================================================================
RCS file: /sources/qemacs/qemacs/README,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- README      29 May 2004 10:17:45 -0000      1.1.1.1
+++ README      27 Mar 2019 07:43:56 -0000      1.2
@@ -2,16 +2,18 @@
                      Compiling
 ----------------------------------------------------------
 
-* If you want image, audio and video support, download FFmpeg at
-  http://ffmpeg.org and install it in the qemacs/ directory (it should
-  be in qemacs/ffmpeg).
-
-* Launch the configure tool './configure'. You can look at the
+* Launch the configure tool './configure'. You can list the
   possible options by typing './configure --help'.
 
 * Type 'make' to compile qemacs and its associated tools.
 
-* type 'make install' as root to install it in /usr/local.
+* Type 'make install' as root to install it in /usr/local.
+
+* Image support is provided via the public domain stb_image
+  package. Source: http://nothings.org/stb_image.h
+
+* FFmpeg image, audio and video support is currently broken
+  and disabled
 
 ----------------------------------------------------------
                      Documentation
@@ -23,7 +25,8 @@
                      Licensing
 ----------------------------------------------------------
 
-QEmacs is released under the GNU Lesser General Public License (read
-the accompagning COPYING file).
+QEmacs is released under the GNU Lesser General Public License
+(read the accompagning COPYING file).
 
 Fabrice Bellard.
+Charlie Gordon.

Index: TODO.org
===================================================================
RCS file: /sources/qemacs/qemacs/TODO.org,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- TODO.org    19 Dec 2018 11:45:39 -0000      1.43
+++ TODO.org    27 Mar 2019 07:43:56 -0000      1.44
@@ -1,14 +1,14 @@
 ; TODO list for qemacs
 ;
 ; Author: Charles Gordon
-; Updated: 2017-05-15
+; Updated: 2019-03-14
 
 * Recent bugs and ideas
 
+** markdown: recognise ~~~ {.c} language tags
 ** basic: add property lists in buffer and window for default directory and 
similar properties (override)
-** shell: C-c C-c should abort make process
 ** basic: backspace delete hacking tabs
-** charset: use unichar typedef
+** charset: use unichar typedef?
 ** charset: limit number of combining marks to 20
 ** clang: colorizing bug: static int (*qe__initcall_first)(void) qe__init_call 
= NULL;
 ** clang: missed tag: static int (*qe__initcall_first)(void) qe__init_call = 
NULL;
@@ -29,11 +29,14 @@
 ** files: ignore .DS_Store in completion
 ** files: fix SPC / TAB distinct behaviors on ~/comp/project/gnachman/
 ** modes: next-mode should include buffer default_mode in list
+** preview: add auto skip feature at top and bottom of file to skip to the 
previous and/or next file in the dired window
 ** shell: support ':' as alternate escape sequence argument separator
 ** shell: use target window for man and similar commands
+** shell: C-c C-c should abort make process
 ** tags: remove tags for modified line
 ** undo: undo some cursor movements
 ** xml: merge xml and htmlsrc modes, add submodes for plist and other config 
files
+** extra: grep, grep-buffer, grep-sources, grep-tree...
 
 * Priority 0
 

Index: VERSION
===================================================================
RCS file: /sources/qemacs/qemacs/VERSION,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- VERSION     19 Dec 2018 11:45:39 -0000      1.7
+++ VERSION     27 Mar 2019 07:43:56 -0000      1.8
@@ -1 +1 @@
-5.1beta
+5.2alpha

Index: arm.c
===================================================================
RCS file: /sources/qemacs/qemacs/arm.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- arm.c       29 May 2017 06:21:42 -0000      1.8
+++ arm.c       27 Mar 2019 07:43:56 -0000      1.9
@@ -320,15 +320,15 @@
         /* Hex Load format: `:SSOOOOTTxx...xxCC` */
         int i, sh, sum = 0, chksum = 0;
         for (i = 1, sh = 4; i < n - 2; i++) {
-            int x = to_hex(str[i]);
-            if (x >= 0) {
+            int x = qe_digit_value(str[i]);
+            if (x < 16) {
                 sum += x << sh;
                 sh ^= 4;
             }
         }
         sum = (-sum & 0xFF);
-        chksum = to_hex(str[i]) << 4;
-        chksum += to_hex(str[i + 1]);
+        chksum = qe_digit_value(str[i]) << 4;
+        chksum += qe_digit_value(str[i + 1]);
 
         SET_COLOR(str, 0, 1, INTEL_HEX_STYLE_LEAD);
         SET_COLOR(str, 1, 3, INTEL_HEX_STYLE_SIZE);

Index: hex.c
===================================================================
RCS file: /sources/qemacs/qemacs/hex.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- hex.c       25 Apr 2017 17:41:27 -0000      1.54
+++ hex.c       27 Mar 2019 07:43:56 -0000      1.55
@@ -264,8 +264,8 @@
             hsize = s->unihex_mode;
         else
             hsize = 2;
-        h = to_hex(key);
-        if (h < 0)
+        h = qe_digit_value(key);
+        if (h >= 16)
             return;
         if ((s->insert || offset >= s->b->total_size) && s->hex_nibble == 0) {
             ch = h << ((hsize - 1) * 4);

Index: input.c
===================================================================
RCS file: /sources/qemacs/qemacs/input.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- input.c     25 Mar 2017 18:14:59 -0000      1.23
+++ input.c     27 Mar 2019 07:43:56 -0000      1.24
@@ -45,8 +45,8 @@
     if (len > 5)
         len = 5;
     for (i = 1; i < len; i++) {
-        h = to_hex(buf[i]);
-        if (h == -1)
+        h = qe_digit_value(buf[i]);
+        if (h >= 16)
             return INPUTMETHOD_NOMATCH;
         c = (c << 4) | h;
     }

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.271
retrieving revision 1.272
diff -u -b -r1.271 -r1.272
--- qe.h        19 Dec 2018 11:45:39 -0000      1.271
+++ qe.h        27 Mar 2019 07:43:56 -0000      1.272
@@ -341,9 +341,14 @@
 void splitpath(char *dirname, int dirname_size,
                char *filename, int filename_size, const char *pathname);
 
+extern unsigned char const qe_digit_value__[128];
+static inline int qe_digit_value(int c) {
+    return (unsigned int)c < 128 ? qe_digit_value__[c] : 255;
+}
 static inline int qe_inrange(int c, int a, int b) {
-    return c >= a && c <= b;
+    return (unsigned int)(c - a) <= (unsigned int)(b - a);
 }
+/* character classification tests assume ASCII superset */
 static inline int qe_isspace(int c) {
     /* CG: what about \v and \f */
     return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == 160);
@@ -388,21 +393,16 @@
     return qe_inrange(c, '0', '1') || (c == '_');
 }
 static inline int qe_isxdigit(int c) {
-    return (qe_inrange(c, '0', '9') ||
-            qe_inrange(c | ('a' - 'A'), 'a', 'f'));
+    return qe_digit_value(c) < 16;
 }
 static inline int qe_isxdigit_(int c) {
-    return (qe_inrange(c, '0', '9') ||
-            qe_inrange(c | ('a' - 'A'), 'a', 'f') || (c == '_'));
+    return (qe_digit_value(c) < 16) || (c == '_');
 }
 static inline int qe_isalnum(int c) {
-    return (qe_inrange(c, '0', '9') ||
-            qe_inrange(c | ('a' - 'A'), 'a', 'z'));
+    return qe_digit_value(c) < 36;
 }
 static inline int qe_isalnum_(int c) {
-    return (qe_inrange(c, '0', '9') ||
-            qe_inrange(c | ('a' - 'A'), 'a', 'z') ||
-            c == '_');
+    return (qe_digit_value(c) < 36) || (c == '_');
 }
 static inline int qe_isword(int c) {
     /* XXX: any unicode char >= 128 is considered as word. */
@@ -484,7 +484,6 @@
 
 void get_str(const char **pp, char *buf, int buf_size, const char *stop);
 int css_get_enum(const char *str, const char *enum_str);
-int to_hex(int key);
 
 extern QEColor const xterm_colors[];
 /* XXX: should have a more generic API with precomputed mapping scales */

Index: search.c
===================================================================
RCS file: /sources/qemacs/qemacs/search.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- search.c    21 Apr 2017 14:44:15 -0000      1.15
+++ search.c    27 Mar 2019 07:43:56 -0000      1.16
@@ -2,7 +2,7 @@
  * QEmacs, tiny but powerful multimode editor
  *
  * Copyright (c) 2000-2002 Fabrice Bellard.
- * Copyright (c) 2000-2017 Charlie Gordon.
+ * Copyright (c) 2000-2019 Charlie Gordon.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -263,8 +263,8 @@
         c = v;
         if (len < countof(is->search_u32)) {
             if (max_nibble) {
-                h = to_hex(c);
-                if (h >= 0) {
+                h = qe_digit_value(c);
+                if (h < 16) {
                     hc = (hc << 4) | h;
                     if (++hex_nibble == max_nibble) {
                         is->search_u32[len++] = hc;
@@ -622,8 +622,8 @@
                 }
                 break;
             }
-            h = to_hex(c);
-            if (h >= 0) {
+            h = qe_digit_value(c);
+            if (h < 16) {
                 hc = (hc << 4) | h;
                 if (++hex_nibble == max_nibble) {
                     buf[len++] = hc;

Index: util.c
===================================================================
RCS file: /sources/qemacs/qemacs/util.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- util.c      29 May 2017 06:21:42 -0000      1.84
+++ util.c      27 Mar 2019 07:43:56 -0000      1.85
@@ -1205,17 +1205,15 @@
     return out->len - start;
 }
 
-int to_hex(int c)
-{
-    /* Only ASCII supported */
-    if (c >= '0' && c <= '9')
-        return c - '0';
-    if (c >= 'a' && c <= 'f')
-        return c - 'a' + 10;
-    if (c >= 'A' && c <= 'F')
-        return c - 'A' + 10;
-    return -1;
-}
+unsigned char const qe_digit_value__[128] = {
+#define REPEAT16(x)  x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x
+    REPEAT16(255), REPEAT16(255), REPEAT16(255),
+    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
+    255, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 255, 255, 255, 255, 255,
+    255, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 255, 255, 255, 255, 255,
+};
 
 #if 1
 /* Should move all this to a separate source file color.c */
@@ -1915,14 +1913,14 @@
         switch (len) {
         case 3:
             for (i = 0; i < 3; i++) {
-                v = to_hex(*p++);
+                v = qe_digit_value(*p++);
                 rgba[i] = v | (v << 4);
             }
             break;
         case 6:
             for (i = 0; i < 3; i++) {
-                v = to_hex(*p++) << 4;
-                v |= to_hex(*p++);
+                v = qe_digit_value(*p++) << 4;
+                v |= qe_digit_value(*p++);
                 rgba[i] = v;
             }
             break;



reply via email to

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