diff options
author | joerg <joerg@pkgsrc.org> | 2013-09-17 21:12:25 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2013-09-17 21:12:25 +0000 |
commit | cf8c21761004bd5c66572f0eceed2b0c51bdd7cd (patch) | |
tree | 9593abf85310a4da1b07d24ec90f1d7a407a0dfe /ham/fldigi/patches | |
parent | 2c9969e79f0233e04e3334eb0a51ea1457cea6b9 (diff) | |
download | pkgsrc-cf8c21761004bd5c66572f0eceed2b0c51bdd7cd.tar.gz |
Don't depend on implicit boolean conversion for streams.
Fix a header guard to reduce warnings.
Diffstat (limited to 'ham/fldigi/patches')
-rw-r--r-- | ham/fldigi/patches/patch-src_include_logsupport.h | 11 | ||||
-rw-r--r-- | ham/fldigi/patches/patch-src_include_strutil.h | 50 |
2 files changed, 61 insertions, 0 deletions
diff --git a/ham/fldigi/patches/patch-src_include_logsupport.h b/ham/fldigi/patches/patch-src_include_logsupport.h new file mode 100644 index 00000000000..8e86da7268c --- /dev/null +++ b/ham/fldigi/patches/patch-src_include_logsupport.h @@ -0,0 +1,11 @@ +$NetBSD: patch-src_include_logsupport.h,v 1.1 2013/09/17 21:12:25 joerg Exp $ + +--- src/include/logsupport.h.orig 2013-09-17 19:27:33.000000000 +0000 ++++ src/include/logsupport.h +@@ -1,5 +1,5 @@ + #ifndef SUPPORT_H +-#define SUPPORT_h ++#define SUPPORT_H + + #include <string> + diff --git a/ham/fldigi/patches/patch-src_include_strutil.h b/ham/fldigi/patches/patch-src_include_strutil.h new file mode 100644 index 00000000000..42fdce7d35d --- /dev/null +++ b/ham/fldigi/patches/patch-src_include_strutil.h @@ -0,0 +1,50 @@ +$NetBSD: patch-src_include_strutil.h,v 1.1 2013/09/17 21:12:25 joerg Exp $ + +--- src/include/strutil.h.orig 2013-09-17 19:23:48.000000000 +0000 ++++ src/include/strutil.h +@@ -207,7 +207,8 @@ inline bool read_until_delim( char delim + /// Reads a string up to the given delimiter. + inline bool read_until_delim( char delim, std::istream & istrm, std::string & ref ) + { +- return std::getline( istrm, ref, delim ); ++ std::getline( istrm, ref, delim ); ++ return istrm.good() || istrm.eof(); + } + + /// For reading from a string with tokens separated by a char. Used to load CSV files. +@@ -220,7 +221,7 @@ bool read_until_delim( char delim, std:: + } + imemstream sstrm( parsed_str ); + sstrm >> ref ; +- return sstrm ; ++ return sstrm.good() || sstrm.eof(); + } + + /// Same, with a default value if there is nothing to read. +@@ -237,7 +238,7 @@ bool read_until_delim( char delim, std:: + } + imemstream sstrm( parsed_str ); + sstrm >> ref ; +- return sstrm ; ++ return sstrm.good() || sstrm.eof(); + } + + /// For reading from a string with tokens separated by a char to a fixed-size array. +@@ -246,7 +247,7 @@ bool read_until_delim( char delim, std:: + { + istrm.getline( ref, DtTyp< Tp >::Size, delim ); + // Should we return an error if buffer is too small? +- return istrm ; ++ return istrm.good() || istrm.eof(); + } + + /// Same, with a default value if there is nothing to read. Fixed-size array. +@@ -259,7 +260,7 @@ bool read_until_delim( char delim, std:: + strncpy( ref, dflt, DtTyp< Tp >::Size - 1 ); + } + // Should we return an error if buffer is too small? +- return istrm; ++ return istrm.good() || istrm.eof(); + } + + // ---------------------------------------------------------------------------- |