forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
partial merge bitcoin#19761: improve sed robustness by not using sed
- Loading branch information
Showing
15 changed files
with
404 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
commit 3311d68f11d1697565401eee6efc85c34f022ea7 | ||
Author: fanquake <fanquake@gmail.com> | ||
Date: Mon Aug 17 20:03:56 2020 +0800 | ||
|
||
Fix C++11 compatibility | ||
|
||
diff --git a/dbinc/atomic.h b/dbinc/atomic.h | ||
index 0034dcc..7c11d4a 100644 | ||
--- a/dbinc/atomic.h | ||
+++ b/dbinc/atomic.h | ||
@@ -70,7 +70,7 @@ typedef struct { | ||
* These have no memory barriers; the caller must include them when necessary. | ||
*/ | ||
#define atomic_read(p) ((p)->value) | ||
-#define atomic_init(p, val) ((p)->value = (val)) | ||
+#define atomic_init_db(p, val) ((p)->value = (val)) | ||
|
||
#ifdef HAVE_ATOMIC_SUPPORT | ||
|
||
@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val; | ||
#define atomic_inc(env, p) __atomic_inc(p) | ||
#define atomic_dec(env, p) __atomic_dec(p) | ||
#define atomic_compare_exchange(env, p, o, n) \ | ||
- __atomic_compare_exchange((p), (o), (n)) | ||
+ __atomic_compare_exchange_db((p), (o), (n)) | ||
static inline int __atomic_inc(db_atomic_t *p) | ||
{ | ||
int temp; | ||
@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p) | ||
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html | ||
* which configure could be changed to use. | ||
*/ | ||
-static inline int __atomic_compare_exchange( | ||
+static inline int __atomic_compare_exchange_db( | ||
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) | ||
{ | ||
atomic_value_t was; | ||
@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange( | ||
#define atomic_dec(env, p) (--(p)->value) | ||
#define atomic_compare_exchange(env, p, oldval, newval) \ | ||
(DB_ASSERT(env, atomic_read(p) == (oldval)), \ | ||
- atomic_init(p, (newval)), 1) | ||
+ atomic_init_db(p, (newval)), 1) | ||
#else | ||
#define atomic_inc(env, p) __atomic_inc(env, p) | ||
#define atomic_dec(env, p) __atomic_dec(env, p) | ||
diff --git a/mp/mp_fget.c b/mp/mp_fget.c | ||
index 5fdee5a..0b75f57 100644 | ||
--- a/mp/mp_fget.c | ||
+++ b/mp/mp_fget.c | ||
@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */ | ||
|
||
/* Initialize enough so we can call __memp_bhfree. */ | ||
alloc_bhp->flags = 0; | ||
- atomic_init(&alloc_bhp->ref, 1); | ||
+ atomic_init_db(&alloc_bhp->ref, 1); | ||
#ifdef DIAGNOSTIC | ||
if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { | ||
__db_errx(env, | ||
@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */ | ||
MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, | ||
PROT_READ); | ||
|
||
- atomic_init(&alloc_bhp->ref, 1); | ||
+ atomic_init_db(&alloc_bhp->ref, 1); | ||
MUTEX_LOCK(env, alloc_bhp->mtx_buf); | ||
alloc_bhp->priority = bhp->priority; | ||
alloc_bhp->pgno = bhp->pgno; | ||
diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c | ||
index 34467d2..f05aa0c 100644 | ||
--- a/mp/mp_mvcc.c | ||
+++ b/mp/mp_mvcc.c | ||
@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp) | ||
#else | ||
memcpy(frozen_bhp, bhp, SSZA(BH, buf)); | ||
#endif | ||
- atomic_init(&frozen_bhp->ref, 0); | ||
+ atomic_init_db(&frozen_bhp->ref, 0); | ||
if (mutex != MUTEX_INVALID) | ||
frozen_bhp->mtx_buf = mutex; | ||
else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, | ||
@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp) | ||
#endif | ||
alloc_bhp->mtx_buf = mutex; | ||
MUTEX_LOCK(env, alloc_bhp->mtx_buf); | ||
- atomic_init(&alloc_bhp->ref, 1); | ||
+ atomic_init_db(&alloc_bhp->ref, 1); | ||
F_CLR(alloc_bhp, BH_FROZEN); | ||
} | ||
|
||
diff --git a/mp/mp_region.c b/mp/mp_region.c | ||
index e6cece9..ddbe906 100644 | ||
--- a/mp/mp_region.c | ||
+++ b/mp/mp_region.c | ||
@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) | ||
MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) | ||
return (ret); | ||
SH_TAILQ_INIT(&htab[i].hash_bucket); | ||
- atomic_init(&htab[i].hash_page_dirty, 0); | ||
+ atomic_init_db(&htab[i].hash_page_dirty, 0); | ||
} | ||
|
||
/* | ||
@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) | ||
hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID : | ||
mtx_base + i; | ||
SH_TAILQ_INIT(&hp->hash_bucket); | ||
- atomic_init(&hp->hash_page_dirty, 0); | ||
+ atomic_init_db(&hp->hash_page_dirty, 0); | ||
#ifdef HAVE_STATISTICS | ||
hp->hash_io_wait = 0; | ||
hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; | ||
diff --git a/mutex/mut_method.c b/mutex/mut_method.c | ||
index 2588763..5c6d516 100644 | ||
--- a/mutex/mut_method.c | ||
+++ b/mutex/mut_method.c | ||
@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval) | ||
MUTEX_LOCK(env, mtx); | ||
ret = atomic_read(v) == oldval; | ||
if (ret) | ||
- atomic_init(v, newval); | ||
+ atomic_init_db(v, newval); | ||
MUTEX_UNLOCK(env, mtx); | ||
|
||
return (ret); | ||
diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c | ||
index f3922e0..e40fcdf 100644 | ||
--- a/mutex/mut_tas.c | ||
+++ b/mutex/mut_tas.c | ||
@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags) | ||
|
||
#ifdef HAVE_SHARED_LATCHES | ||
if (F_ISSET(mutexp, DB_MUTEX_SHARED)) | ||
- atomic_init(&mutexp->sharecount, 0); | ||
+ atomic_init_db(&mutexp->sharecount, 0); | ||
else | ||
#endif | ||
if (MUTEX_INIT(&mutexp->tas)) { | ||
@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex) | ||
F_CLR(mutexp, DB_MUTEX_LOCKED); | ||
/* Flush flag update before zeroing count */ | ||
MEMBAR_EXIT(); | ||
- atomic_init(&mutexp->sharecount, 0); | ||
+ atomic_init_db(&mutexp->sharecount, 0); | ||
} else { | ||
DB_ASSERT(env, sharecount > 0); | ||
MEMBAR_EXIT(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
commit dbd95cdaefdea95307d004f019a1c394cf9389f0 | ||
Author: fanquake <fanquake@gmail.com> | ||
Date: Mon Aug 17 20:15:17 2020 +0800 | ||
|
||
Remove unused variable in Boost Process | ||
|
||
This causes issues with our linters / CI. | ||
|
||
Can be removed once depends Boost is 1.71.0 or later. | ||
|
||
diff --git a/boost/process/detail/posix/wait_group.hpp b/boost/process/detail/posix/wait_group.hpp | ||
index 9dc249803..2502d9772 100644 | ||
--- a/boost/process/detail/posix/wait_group.hpp | ||
+++ b/boost/process/detail/posix/wait_group.hpp | ||
@@ -137,7 +137,6 @@ inline bool wait_until( | ||
|
||
do | ||
{ | ||
- int ret_sig = 0; | ||
int status; | ||
if ((::waitpid(timeout_pid, &status, WNOHANG) != 0) | ||
&& (WIFEXITED(status) || WIFSIGNALED(status))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
commit 7b6eb33ecd88768b28c67ce5d2d68a7eed5936b6 | ||
Author: fanquake <fanquake@gmail.com> | ||
Date: Tue Aug 25 14:34:53 2020 +0800 | ||
|
||
Remove rule that causes inadvertant header regeneration | ||
|
||
Otherwise the makefile will needlessly attempt to re-generate the | ||
headers with gperf. This can be dropped once the upstream build is fixed. | ||
|
||
See #10851. | ||
|
||
diff --git a/src/Makefile.in b/src/Makefile.in | ||
index f4626ad..4ae1b00 100644 | ||
--- a/src/Makefile.in | ||
+++ b/src/Makefile.in | ||
@@ -903,7 +903,7 @@ fcobjshash.gperf: fcobjshash.gperf.h fcobjs.h | ||
' - > $@.tmp && \ | ||
mv -f $@.tmp $@ || ( $(RM) $@.tmp && false ) | ||
|
||
-fcobjshash.h: fcobjshash.gperf | ||
+fcobjshash.h: | ||
$(AM_V_GEN) $(GPERF) -m 100 $< > $@.tmp && \ | ||
mv -f $@.tmp $@ || ( $(RM) $@.tmp && false ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
commit 28165a9b078583dc8e9e5c344510e37582284cef | ||
Author: fanquake <fanquake@gmail.com> | ||
Date: Mon Aug 17 20:35:42 2020 +0800 | ||
|
||
Remove usage of CHAR_WIDTH | ||
|
||
CHAR_WIDTH which is reserved and clashes with glibc 2.25+ | ||
|
||
See #10851. | ||
|
||
diff --git a/fontconfig/fontconfig.h b/fontconfig/fontconfig.h | ||
index 5c72b22..843c532 100644 | ||
--- a/fontconfig/fontconfig.h | ||
+++ b/fontconfig/fontconfig.h | ||
@@ -128,7 +128,7 @@ typedef int FcBool; | ||
#define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION | ||
|
||
/* Adjust outline rasterizer */ | ||
-#define FC_CHAR_WIDTH "charwidth" /* Int */ | ||
+#define FC_CHARWIDTH "charwidth" /* Int */ | ||
#define FC_CHAR_HEIGHT "charheight"/* Int */ | ||
#define FC_MATRIX "matrix" /* FcMatrix */ | ||
|
||
diff --git a/src/fcobjs.h b/src/fcobjs.h | ||
index 1fc4f65..d27864b 100644 | ||
--- a/src/fcobjs.h | ||
+++ b/src/fcobjs.h | ||
@@ -51,7 +51,7 @@ FC_OBJECT (DPI, FcTypeDouble, NULL) | ||
FC_OBJECT (RGBA, FcTypeInteger, NULL) | ||
FC_OBJECT (SCALE, FcTypeDouble, NULL) | ||
FC_OBJECT (MINSPACE, FcTypeBool, NULL) | ||
-FC_OBJECT (CHAR_WIDTH, FcTypeInteger, NULL) | ||
+FC_OBJECT (CHARWIDTH, FcTypeInteger, NULL) | ||
FC_OBJECT (CHAR_HEIGHT, FcTypeInteger, NULL) | ||
FC_OBJECT (MATRIX, FcTypeMatrix, NULL) | ||
FC_OBJECT (CHARSET, FcTypeCharSet, FcCompareCharSet) | ||
diff --git a/src/fcobjshash.gperf b/src/fcobjshash.gperf | ||
index 80a0237..eb4ad84 100644 | ||
--- a/src/fcobjshash.gperf | ||
+++ b/src/fcobjshash.gperf | ||
@@ -44,7 +44,7 @@ int id; | ||
"rgba",FC_RGBA_OBJECT | ||
"scale",FC_SCALE_OBJECT | ||
"minspace",FC_MINSPACE_OBJECT | ||
-"charwidth",FC_CHAR_WIDTH_OBJECT | ||
+"charwidth",FC_CHARWIDTH_OBJECT | ||
"charheight",FC_CHAR_HEIGHT_OBJECT | ||
"matrix",FC_MATRIX_OBJECT | ||
"charset",FC_CHARSET_OBJECT | ||
diff --git a/src/fcobjshash.h b/src/fcobjshash.h | ||
index 5a4d1ea..4e66bb0 100644 | ||
--- a/src/fcobjshash.h | ||
+++ b/src/fcobjshash.h | ||
@@ -284,7 +284,7 @@ FcObjectTypeLookup (register const char *str, register unsigned int len) | ||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str43,FC_CHARSET_OBJECT}, | ||
{-1}, | ||
#line 47 "fcobjshash.gperf" | ||
- {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHAR_WIDTH_OBJECT}, | ||
+ {(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str45,FC_CHARWIDTH_OBJECT}, | ||
#line 48 "fcobjshash.gperf" | ||
{(int)(long)&((struct FcObjectTypeNamePool_t *)0)->FcObjectTypeNamePool_str46,FC_CHAR_HEIGHT_OBJECT}, | ||
#line 55 "fcobjshash.gperf" |
Oops, something went wrong.