commit:     763cc65174197beee59a0d1fa56011c6d4a23cf5
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Thu Sep  7 09:13:26 2023 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Sep  7 09:13:26 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=763cc651

sci-biology/elph: Fix C++17 does not allow register storage class

Closes: https://github.com/gentoo/gentoo/pull/32664
Closes: https://bugs.gentoo.org/898116
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../{elph-1.0.1-r2.ebuild => elph-1.0.1-r3.ebuild} |   7 +-
 .../files/elph-1.0.1-drop-register-keyword.patch   | 102 +++++++++++++++++++++
 2 files changed, 107 insertions(+), 2 deletions(-)

diff --git a/sci-biology/elph/elph-1.0.1-r2.ebuild 
b/sci-biology/elph/elph-1.0.1-r3.ebuild
similarity index 78%
rename from sci-biology/elph/elph-1.0.1-r2.ebuild
rename to sci-biology/elph/elph-1.0.1-r3.ebuild
index 66309522b312..6cfc05845358 100644
--- a/sci-biology/elph/elph-1.0.1-r2.ebuild
+++ b/sci-biology/elph/elph-1.0.1-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -14,7 +14,10 @@ LICENSE="Artistic"
 SLOT="0"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
 
-PATCHES=( "${FILESDIR}"/${PN}-1.0.1-fix-build-system.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.0.1-fix-build-system.patch
+       "${FILESDIR}"/${PN}-1.0.1-drop-register-keyword.patch
+)
 
 src_configure() {
        tc-export CC CXX

diff --git a/sci-biology/elph/files/elph-1.0.1-drop-register-keyword.patch 
b/sci-biology/elph/files/elph-1.0.1-drop-register-keyword.patch
new file mode 100644
index 000000000000..c05a280d4679
--- /dev/null
+++ b/sci-biology/elph/files/elph-1.0.1-drop-register-keyword.patch
@@ -0,0 +1,102 @@
+Bug: https://bugs.gentoo.org/898116
+
+--- a/GBase.cpp
++++ b/GBase.cpp
+@@ -208,8 +208,8 @@ char* rstrstr(char* rstart, char *lend, char* substr) {  
/*like strstr, but star
+ 
+ //hash function used for strings in GHash
+ int strhash(const char* str){
+-  register int h=0;
+-  register int g;
++  int h=0;
++  int g;
+   while (*str) {
+     h=(h<<4)+*str++;
+     g=h&0xF0000000;
+--- a/GString.cpp
++++ b/GString.cpp
+@@ -364,8 +364,8 @@ GString& GString::appendfmt(const char *fmt,...) {
+   }
+ 
+ GString& GString::trim(char c) {
+- register int istart;
+- register int iend;
++ int istart;
++ int iend;
+  for (istart=0; istart<length() && chars()[istart]==c;istart++);
+  if (istart==length()) {
+        make_unique(); //edit operation ahead
+@@ -384,8 +384,8 @@ GString& GString::trim(char c) {
+  }
+ 
+ GString& GString::trim(char* c) {
+- register int istart;
+- register int iend;
++ int istart;
++ int iend;
+  for (istart=0; istart<length() && strchr(c, chars()[istart])!=NULL 
;istart++);
+  if (istart==length()) {
+         replace_data(0); //string was entirely trimmed
+@@ -405,7 +405,7 @@ GString& GString::trim(char* c) {
+ GString& GString::trimR(char c) {
+  //only trim the right end
+  //register int istart;
+- register int iend;
++ int iend;
+  for (iend=length()-1; iend>=0 && chars()[iend]==c;iend--);
+  if (iend==-1) {
+        replace_data(0); //string was entirely trimmed
+@@ -423,7 +423,7 @@ GString& GString::trimR(char c) {
+  }
+ 
+ GString& GString::trimR(char* c) {
+- register int iend;
++ int iend;
+  for (iend=length()-1; iend>=0 && strchr(c,chars()[iend])!=NULL;iend--);
+  if (iend==-1) {
+        replace_data(0); //string was entirely trimmed
+@@ -440,7 +440,7 @@ GString& GString::trimR(char* c) {
+  }
+ 
+ GString& GString::trimL(char c) {
+- register int istart;
++ int istart;
+  for (istart=0; istart<length() && chars()[istart]==c;istart++);
+  if (istart==length()) {
+        replace_data(0); //string was entirely trimmed
+@@ -457,7 +457,7 @@ GString& GString::trimL(char c) {
+  }
+ 
+ GString& GString::trimL(char* c) {
+- register int istart;
++ int istart;
+  for (istart=0; istart<length() && strchr(c,chars()[istart])!=NULL;istart++);
+  if (istart==length()) {
+        replace_data(0); //string was entirely trimmed
+@@ -598,7 +598,7 @@ bool GString::is_space() const {
+     if (my_data == &null_data)
+         return false;
+ 
+-    for (register const char *p = chars(); *p; p++)
++    for (const char *p = chars(); *p; p++)
+         if (!isspace(*p))
+             return false;
+ 
+@@ -889,7 +889,7 @@ GString& GString::append(const GString& s) {
+ 
+ GString& GString::upper() {
+   make_unique(); //edit operation ahead
+-  for (register char *p = chrs(); *p; p++)
++  for (char *p = chrs(); *p; p++)
+             *p = (char) toupper(*p);
+ 
+     return *this;
+@@ -900,7 +900,7 @@ GString& GString::upper() {
+ GString& GString::lower() {
+     make_unique();
+ 
+-    for (register char *p = chrs(); *p; p++)
++    for (char *p = chrs(); *p; p++)
+           *p = (char) tolower(*p);
+ 
+     return *this;

Reply via email to