APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1524316496 -3600
# Sat Apr 21 14:14:56 2018 +0100
# Node ID 1df45726e0d6d45a816063328bd8e85c7ba701cc
# Parent 78f89a29541b08276b6c8f4c4fca00e2fb6ab7eb
Fix the build with g++ 6.
src/ChangeLog addition:
2018-04-21 Aidan Kehoe <kehoea(a)parhasard.net>
* gccache-x.c (gc_cache_hash):
* gccache-x.c (x_gc_cache_lookup):
Add a couple of casts here to placate the C++ compiler.
* text.c (rep_bytes_by_first_byte):
Don't use hexadecimal notation for 0xDEADBEEF in this table,
that causes a compile problem with C++ on a thirty-two bit
machine.
diff -r 78f89a29541b -r 1df45726e0d6 src/ChangeLog
--- a/src/ChangeLog Mon Apr 16 09:39:19 2018 +0100
+++ b/src/ChangeLog Sat Apr 21 14:14:56 2018 +0100
@@ -1,3 +1,13 @@
+2018-04-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * gccache-x.c (gc_cache_hash):
+ * gccache-x.c (x_gc_cache_lookup):
+ Add a couple of casts here to placate the C++ compiler.
+ * text.c (rep_bytes_by_first_byte):
+ Don't use hexadecimal notation for 0xDEADBEEF in this table,
+ that causes a compile problem with C++ on a thirty-two bit
+ machine.
+
2018-04-16 Aidan Kehoe <kehoea(a)parhasard.net>
* fileio.c (Finsert_file_contents_internal):
diff -r 78f89a29541b -r 1df45726e0d6 src/gccache-x.c
--- a/src/gccache-x.c Mon Apr 16 09:39:19 2018 +0100
+++ b/src/gccache-x.c Sat Apr 21 14:14:56 2018 +0100
@@ -70,7 +70,8 @@
static Hashcode
gc_cache_hash (const Hash_Table_Test * UNUSED (http), Lisp_Object arg)
{
- const struct gcv_and_mask *gcvm = GET_VOID_FROM_LISP (arg);
+ const struct gcv_and_mask *gcvm
+ = (const struct gcv_and_mask *) GET_VOID_FROM_LISP (arg);
EMACS_UINT *longs = (EMACS_UINT *) &gcvm->gcv;
Hashcode hash = gcvm->mask;
unsigned i;
@@ -218,7 +219,7 @@
e = find_htentry (STORE_VOID_IN_LISP (&gcvm), XHASH_TABLE (cache->table));
if (!HTENTRY_CLEAR_P (e))
{
- cell = GET_VOID_FROM_LISP (e->value);
+ cell = (struct gc_cache_cell *) GET_VOID_FROM_LISP (e->value);
/* Found a cell. */
#ifdef DEBUG_GC_CACHE
diff -r 78f89a29541b -r 1df45726e0d6 src/text.c
--- a/src/text.c Mon Apr 16 09:39:19 2018 +0100
+++ b/src/text.c Sat Apr 21 14:14:56 2018 +0100
@@ -1285,23 +1285,40 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- /* 0x80 - 0xbf are not valid first bytes */
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
- 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF,
+ /* 0x80 - 0xbf are not valid first bytes. A bare 0xDEADBEEF or
+ DEADBEEF_CONSTANT without the cast runs foul of the C++ compiler. */
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT),
/* 0xc0 - 0xdf for 2-byte sequences */
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -1312,7 +1329,8 @@
0xfc - 0xfd for 6-byte sequences;
0xfe, 0xff not allowed
*/
- 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0xDEADBEEF, 0xDEADBEEF
+ 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6,
+ (Bytecount) (DEADBEEF_CONSTANT), (Bytecount) (DEADBEEF_CONSTANT)
};
#else
/* #### Maybe this table should be derived programmatically, at least
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)