From 53be8f939be7726a4983dd161dcf4eca30f2ca1a Mon Sep 17 00:00:00 2001 From: JonathanMeans Date: Thu, 12 Apr 2018 08:37:45 -0400 Subject: [PATCH 1/2] Squashed 'externals/coda-oss/' changes from 3a5d8bb..3ac2993 3ac2993 Merge pull request #250 from mdaus/reBuildFix e1462de Add comment 781efbd Fix buggy interaction with re, string interpolation, and Windows paths f726d4b Merge pull request #249 from mdaus/range_equality_operator 3cd882e Added equality/inequality operators git-subtree-dir: externals/coda-oss git-subtree-split: 3ac29931aa12629864dff34dff5d3f202b97ed30 --- build/build.py | 11 ++++++++--- modules/c++/types/include/types/Range.h | 26 +++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/build/build.py b/build/build.py index fcbba5b32..54b7455d2 100644 --- a/build/build.py +++ b/build/build.py @@ -1630,9 +1630,14 @@ def handleDefsFile(input, output, path, defs, chmod=None, conf=None): v = defs[k] if v is None: v = '' - code = re.sub(r'#undef %s(\s*\n)' % k, r'#define %s %s\1' % (k,v), code) - code = re.sub(r'#define %s 0(\s*\n)' % k, r'#define %s %s\1' % (k,v), code) - code = re.sub(r'(#undef[^\n\/\**]*)(\/\*.+\*\/)?(\n)', r'/* \1 */\3', code) + code = re.sub(r'#undef %s(\s*\n)' % k, + lambda x: '#define %s %s\n' % (k,v), code) + code = re.sub(r'#define %s 0(\s*\n)' % k, + lambda x: '#define %s %s\n' % (k,v), code) + + # comment out remaining #undef lines + code = re.sub(r'(#undef[^\n\/\**]*)(\/\*.+\*\/)?(\n)', + r'/* \1 */\3', code) file = open(outfile, 'w') file.write(code) file.close() diff --git a/modules/c++/types/include/types/Range.h b/modules/c++/types/include/types/Range.h index 46d5ebed3..332ddd02c 100644 --- a/modules/c++/types/include/types/Range.h +++ b/modules/c++/types/include/types/Range.h @@ -84,7 +84,8 @@ struct Range bool containsAll(size_t startElement, size_t numElements) const { return (numElements == 0 || - (contains(startElement) && contains(startElement + numElements - 1))); + (contains(startElement) && + contains(startElement + numElements - 1))); } /*! @@ -100,7 +101,7 @@ struct Range startElementToTest + numElementsToTest; // Ranges do not intersect - if(mStartElement >= endElementToTest || + if (mStartElement >= endElementToTest || endElement() <= startElementToTest) { return 0; @@ -117,6 +118,27 @@ struct Range { return (mNumElements == 0); } + + /*! + * \param rhs Range to compare with + * + * \return True if ranges match, false otherwise + */ + bool operator==(const Range& rhs) const + { + return (mStartElement == rhs.mStartElement && + mNumElements == rhs.mNumElements); + } + + /*! + * \param rhs Range to compare with + * + * \return False if ranges match, true otherwise + */ + bool operator!=(const Range& rhs) const + { + return !(*this == rhs); + } }; } From 1658e1890978c6378650cce47e631c067e29f7f2 Mon Sep 17 00:00:00 2001 From: JonathanMeans Date: Thu, 12 Apr 2018 08:38:02 -0400 Subject: [PATCH 2/2] Squashed 'externals/nitro/' changes from 148851b..43bcaad 43bcaad Merge pull request #79 from mdaus/added-include-guard d6f16d0 Added include guard git-subtree-dir: externals/nitro git-subtree-split: 43bcaad3d76089111e6577839a058f38fcb94ca4 --- modules/c++/nitf/include/nitf/ByteProvider.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/c++/nitf/include/nitf/ByteProvider.hpp b/modules/c++/nitf/include/nitf/ByteProvider.hpp index 208e00638..4023b6f5b 100644 --- a/modules/c++/nitf/include/nitf/ByteProvider.hpp +++ b/modules/c++/nitf/include/nitf/ByteProvider.hpp @@ -19,6 +19,8 @@ * see . * */ +#ifndef __NITF_BYTE_PROVIDER_HPP__ +#define __NITF_BYTE_PROVIDER_HPP__ #include #include @@ -316,3 +318,5 @@ class ByteProvider nitf::Off mFileNumBytes; }; } + +#endif