Add patches

This commit is contained in:
Nicolas Chauvet 2019-07-11 17:45:35 +02:00
parent 1254b8ab56
commit 8ea6007f51
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From 7ce68c4bca7fd64c0073f1770c6b5761c03174f0 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Wed, 21 Mar 2018 21:30:31 +0000
Subject: [PATCH] ht: fix build failure on -funsigned-char platforms
powerpc (and arm) have 'char' == 'unsigned char' by default.
This causes build failures on c++11:
```
$ ./configure CFLAGS=-funsigned-char CXXFLAGS=-funsigned-char
$ make
g++ -DHAVE_CONFIG_H -I. -I./analyser -I./asm -I./info -I./io/posix -I./io -I./output -I./eval -I. -DNOMACROS -pipe -O3 -fomit-frame-pointer -Wall -fsigned-char -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c++14 -Woverloaded-virtual -Wnon-virtual-dtor -funsigned-char -MT htcoffhd.o -MD -MP -MF .deps/htcoffhd.Tpo -c -o htcoffhd.o htcoffhd.cc
htcoffhd.cc:93:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
};
^
htcoffhd.cc:131:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
};
```
Use 'signed char' explicitly to maintain existing behavior.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
httag.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/httag.h b/httag.h
index 7f5da1c..83e5c22 100644
--- a/httag.h
+++ b/httag.h
@@ -69,7 +69,7 @@ struct ht_tag_flags {
} PACKED;
struct ht_tag_flags_s {
- char bitidx;
+ signed char bitidx;
const char *desc;
} PACKED;

14
ht-2.1.0-gcc8.patch Normal file
View File

@ -0,0 +1,14 @@
diff -up ht-2.1.0/htapp.cc.ambigus ht-2.1.0/htapp.cc
--- ht-2.1.0/htapp.cc.ambigus 2014-09-14 17:55:26.000000000 +0200
+++ ht-2.1.0/htapp.cc 2019-07-11 17:26:21.766503998 +0200
@@ -3021,8 +3021,8 @@ void do_modal_resize()
static uint isqr(uint u)
{
- uint a = 2;
- uint b = u/a;
+ int a = 2;
+ int b = u/a;
while (abs(a - b) > 1) {
a = (a+b)/2;
b = u/a;