Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync externals #225

Merged
merged 4 commits into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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