Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the gcc 9.1 failing to compile with the patch supplied in the c…
…omments
- Loading branch information
1 parent
405ee61
commit 2796b11
Showing
3 changed files
with
74 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- ddd-3.3.12-orig/ddd/strclass.C | ||
+++ ddd-3.3.12/ddd/strclass.C | ||
index 7ef16fa..faea640 100644 | ||
--- i/ddd/strclass.h | ||
+++ w/ddd/strclass.h | ||
@@ -810,10 +810,10 @@ public: | ||
friend int split(const string& x, string *res, int maxn, | ||
const regex& sep); | ||
|
||
- friend string common_prefix(const string& x, const string& y, | ||
- int startpos = 0); | ||
- friend string common_suffix(const string& x, const string& y, | ||
- int startpos = -1); | ||
+ inline string common_prefix(const string& x, const string& y); | ||
+ friend string common_prefix(const string& x, const string& y, int startpos); | ||
+ inline string common_suffix(const string& x, const string& y); | ||
+ friend string common_suffix(const string& x, const string& y, int startpos); | ||
friend string replicate(char c, int n); | ||
friend string replicate(const string& y, int n); | ||
friend string join(const string *src, int n, const string& sep); | ||
@@ -863,9 +863,10 @@ public: | ||
friend inline std::ostream& operator<<(std::ostream& s, const subString& x); | ||
friend std::istream& operator>>(std::istream& s, string& x); | ||
|
||
- friend int readline(std::istream& s, string& x, | ||
- char terminator = '\n', | ||
- int discard_terminator = 1); | ||
+ inline int readline(std::istream& s, string& x); | ||
+ inline int readline(std::istream& s, string& x, char terminator); | ||
+ friend int readline(std::istream& s, string& x, char terminator, | ||
+ int discard_terminator); | ||
|
||
// Status | ||
unsigned int length() const; | ||
@@ -1456,6 +1457,16 @@ inline string operator + (char x, const subString& y) | ||
string r; cat(x, y, r); return r; | ||
} | ||
|
||
+inline string common_prefix(const string& x, const string& y) | ||
+{ | ||
+ return common_prefix(x, y, 0); | ||
+} | ||
+ | ||
+inline string common_suffix(const string& x, const string& y) | ||
+{ | ||
+ return common_suffix(x, y, -1); | ||
+} | ||
+ | ||
inline string reverse(const string& x) | ||
{ | ||
string r; r.rep = string_Sreverse(x.rep, r.rep); return r; | ||
@@ -1476,6 +1487,16 @@ inline string capitalize(const string& x) | ||
string r; r.rep = string_Scapitalize(x.rep, r.rep); return r; | ||
} | ||
|
||
+inline int readline(std::istream& s, string& x) | ||
+{ | ||
+ return readline(s, x, '\n', 1); | ||
+} | ||
+ | ||
+inline int readline(std::istream& s, string& x, char terminator) | ||
+{ | ||
+ return readline(s, x, terminator, 1); | ||
+} | ||
+ | ||
// prepend | ||
|
||
inline string& string::prepend(const string& y) |