emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104441: * ccl.c (CCL_CODE_RANGE): Al


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104441: * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
Date: Mon, 30 May 2011 19:12:01 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104441
fixes bug(s): http://debbugs.gnu.org/8751
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2011-05-30 19:12:01 -0700
message:
  * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
  
  (CCL_CODE_MIN): New macro.
modified:
  src/ChangeLog
  src/ccl.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-05-30 16:09:29 +0000
+++ b/src/ChangeLog     2011-05-31 02:12:01 +0000
@@ -1,3 +1,8 @@
+2011-05-31  Paul Eggert  <address@hidden>
+
+       * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
+       (CCL_CODE_MIN): New macro.
+
 2011-05-30  Paul Eggert  <address@hidden>
 
        * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.

=== modified file 'src/ccl.c'
--- a/src/ccl.c 2011-05-27 21:24:11 +0000
+++ b/src/ccl.c 2011-05-31 02:12:01 +0000
@@ -79,9 +79,8 @@
 #define CCL_HEADER_EOF         1
 #define CCL_HEADER_MAIN                2
 
-/* CCL code is a sequence of 28-bit non-negative integers (i.e. the
-   MSB is always 0), each contains CCL command and/or arguments in the
-   following format:
+/* CCL code is a sequence of 28-bit integers.  Each contains a CCL
+   command and/or arguments in the following format:
 
        |----------------- integer (28-bit) ------------------|
        |------- 17-bit ------|- 3-bit --|- 3-bit --|- 5-bit -|
@@ -94,12 +93,14 @@
        |------------- constant or other args ----------------|
                      cccccccccccccccccccccccccccc
 
-   where, `cc...c' is a non-negative integer indicating constant value
-   (the left most `c' is always 0) or an absolute jump address, `RRR'
+   where `cc...c' is an integer indicating a constant value or an
+   absolute jump address.  The context determines whether `cc...c' is
+   considered to be unsigned, or a signed two's complement number.  `RRR'
    and `rrr' are CCL register number, `XXXXX' is one of the following
    CCL commands.  */
 
 #define CCL_CODE_MAX ((1 << (28 - 1)) - 1)
+#define CCL_CODE_MIN (-1 - CCL_CODE_MAX)
 
 /* CCL commands
 
@@ -756,7 +757,7 @@
   while (0)
 
 #define GET_CCL_CODE(code, ccl_prog, ic)                       \
-  GET_CCL_RANGE (code, ccl_prog, ic, 0, CCL_CODE_MAX)
+  GET_CCL_RANGE (code, ccl_prog, ic, CCL_CODE_MIN, CCL_CODE_MAX)
 
 #define GET_CCL_INT(var, ccl_prog, ic)                         \
   GET_CCL_RANGE (var, ccl_prog, ic, INT_MIN, INT_MAX)


reply via email to

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