Skip to content

Commit

Permalink
Merge pull request #225 from ngageoint/sync_externals
Browse files Browse the repository at this point in the history
Sync externals
  • Loading branch information
asylvest authored Apr 12, 2018
2 parents ca561c2 + 7a3936f commit de4ff65
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
11 changes: 8 additions & 3 deletions externals/coda-oss/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
26 changes: 24 additions & 2 deletions externals/coda-oss/modules/c++/types/include/types/Range.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}

/*!
Expand All @@ -100,7 +101,7 @@ struct Range
startElementToTest + numElementsToTest;

// Ranges do not intersect
if(mStartElement >= endElementToTest ||
if (mStartElement >= endElementToTest ||
endElement() <= startElementToTest)
{
return 0;
Expand All @@ -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);
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __NITF_BYTE_PROVIDER_HPP__
#define __NITF_BYTE_PROVIDER_HPP__

#include <vector>
#include <utility>
Expand Down Expand Up @@ -316,3 +318,5 @@ class ByteProvider
nitf::Off mFileNumBytes;
};
}

#endif

0 comments on commit de4ff65

Please sign in to comment.