Skip to content

Commit b3b6d16

Browse files
Merge pull request #323 from ngageoint/sync_externals
Sync externals
2 parents 405185a + b09804f commit b3b6d16

9 files changed

Lines changed: 594 additions & 503 deletions

File tree

externals/coda-oss/modules/c++/math.linear/tests/test_line_2d.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ TEST_CASE(testVertical)
7070
math::linear::Line2D vertLine2(P1, P2);
7171
TEST_EXCEPTION(vertLine.intersection(vertLine2));
7272

73-
// Intersecting a horizontal line should give (vertLine.xIntercept, \
73+
// Intersecting a horizontal line should give (vertLine.xIntercept,
7474
// horiLine.yIntercept)
7575
math::linear::Line2D::Point P3(5,5);
7676
math::linear::Line2D::Point P4(6,5);

externals/coda-oss/modules/c++/mt/tests/ThreadGroupAffinityTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class MyRunTask : public Runnable
7474
}
7575

7676
private:
77-
size_t mThread;
77+
sys::AtomicCounter::ValueType mThread;
7878
sys::Mutex mMutex;
7979
sys::AtomicCounter& mThreadCounter;
8080
};

externals/coda-oss/modules/c++/numpyutils/source/numpyutils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
* for the source and some discussion
3232
*/
3333
#if PY_MAJOR_VERSION >= 3
34-
int init_numpy()
34+
void* init_numpy()
3535
{
3636
import_array();
37+
return nullptr;
3738
}
3839
#else
3940
void init_numpy()

externals/coda-oss/modules/c++/str/include/str/Convert.h

Lines changed: 80 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,57 @@
2323
#ifndef __STR_CONVERT_H__
2424
#define __STR_CONVERT_H__
2525

26-
#include <string>
26+
#include <import/except.h>
27+
#include <cerrno>
2728
#include <complex>
29+
#include <cstdlib>
30+
#include <iomanip>
31+
#include <iostream>
2832
#include <limits>
2933
#include <ostream>
3034
#include <sstream>
31-
#include <iomanip>
35+
#include <string>
3236
#include <typeinfo>
33-
#include <iostream>
34-
#include <cstdlib>
35-
#include <cerrno>
36-
#include <limits>
37-
#include <import/except.h>
3837

3938
namespace str
4039
{
40+
template <typename T>
41+
int getPrecision(const T& type);
4142

42-
template<typename T> int getPrecision(const T& type);
43-
template<typename T> int getPrecision(const std::complex<T>& type);
43+
template <typename T>
44+
int getPrecision(const std::complex<T>& type);
4445

45-
template<typename T> std::string toString(const T& value)
46+
template <typename T>
47+
std::string toString(const T& value)
4648
{
4749
std::ostringstream buf;
4850
buf.precision(getPrecision(value));
4951
buf << std::boolalpha << value;
5052
return buf.str();
5153
}
5254

53-
template<> std::string toString(const uint8_t& value);
55+
template <>
56+
std::string toString(const uint8_t& value);
5457

55-
template<> std::string toString(const int8_t& value);
58+
template <>
59+
std::string toString(const int8_t& value);
5660

57-
template<typename T> std::string toString(const T& real, const T& imag)
61+
template <typename T>
62+
std::string toString(const T& real, const T& imag)
5863
{
5964
return toString(std::complex<T>(real, imag));
6065
}
6166

62-
template<typename T> T toType(const std::string& s)
67+
template <typename T>
68+
T toType(const std::string& s)
6369
{
6470
if (s.empty())
65-
throw except::BadCastException(except::Context(__FILE__, __LINE__,
66-
std::string(""), std::string(""), std::string("Empty string")));
71+
throw except::BadCastException(
72+
except::Context(__FILE__,
73+
__LINE__,
74+
std::string(""),
75+
std::string(""),
76+
std::string("Empty string")));
6777

6878
T value;
6979

@@ -73,26 +83,32 @@ template<typename T> T toType(const std::string& s)
7383

7484
if (buf.fail())
7585
{
76-
throw except::BadCastException(except::Context(__FILE__, __LINE__,
77-
std::string(""), std::string(""),
78-
std::string("Conversion failed: '")
79-
+ s + std::string("' -> ") + typeid(T).name()));
86+
throw except::BadCastException(
87+
except::Context(__FILE__,
88+
__LINE__,
89+
std::string(""),
90+
std::string(""),
91+
std::string("Conversion failed: '") + s +
92+
std::string("' -> ") +
93+
typeid(T).name()));
8094
}
8195

8296
return value;
8397
}
8498

85-
template<> bool toType<bool> (const std::string& s);
86-
template<> std::string toType<std::string> (const std::string& s);
99+
template <>
100+
bool toType<bool>(const std::string& s);
101+
template <>
102+
std::string toType<std::string>(const std::string& s);
87103

88104
/**
89105
* strtoll wrapper for msvc compatibility.
90106
*/
91-
long long strtoll(const char *str, char **endptr, int base);
107+
long long strtoll(const char* str, char** endptr, int base);
92108
/**
93109
* strtoull wrapper for msvc compatibility.
94110
*/
95-
unsigned long long strtoull(const char *str, char **endptr, int base);
111+
unsigned long long strtoull(const char* str, char** endptr, int base);
96112

97113
/**
98114
* Convert a string containing a number in any base to a numerical type.
@@ -102,7 +118,8 @@ unsigned long long strtoull(const char *str, char **endptr, int base);
102118
* @return a numberical representation of the number
103119
* @throw BadCastException thrown if cast cannot be performed.
104120
*/
105-
template<typename T> T toType(const std::string& s, int base)
121+
template <typename T>
122+
T toType(const std::string& s, int base)
106123
{
107124
char* end;
108125
errno = 0;
@@ -113,8 +130,8 @@ template<typename T> T toType(const std::string& s, int base)
113130
if (std::numeric_limits<T>::is_signed)
114131
{
115132
const long long longRes = str::strtoll(str, &end, base);
116-
if (longRes < std::numeric_limits<T>::min() ||
117-
longRes > std::numeric_limits<T>::max())
133+
if (longRes < static_cast<long long>(std::numeric_limits<T>::min()) ||
134+
longRes > static_cast<long long>(std::numeric_limits<T>::max()))
118135
{
119136
overflow = true;
120137
}
@@ -123,25 +140,36 @@ template<typename T> T toType(const std::string& s, int base)
123140
else
124141
{
125142
const unsigned long long longRes = str::strtoull(str, &end, base);
126-
if (longRes < std::numeric_limits<T>::min() ||
127-
longRes > std::numeric_limits<T>::max())
143+
if (longRes < static_cast<unsigned long long>(
144+
std::numeric_limits<T>::min()) ||
145+
longRes > static_cast<unsigned long long>(
146+
std::numeric_limits<T>::max()))
128147
{
129148
overflow = true;
130149
}
131150
res = static_cast<T>(longRes);
132151
}
133152

134153
if (overflow || errno == ERANGE)
135-
throw except::BadCastException(except::Context(__FILE__, __LINE__,
136-
std::string(""), std::string(""),
137-
std::string("Overflow: '")
138-
+ s + std::string("' -> ") + typeid(T).name()));
139-
// If the end pointer is at the start of the string, we didn't convert anything.
154+
throw except::BadCastException(
155+
except::Context(__FILE__,
156+
__LINE__,
157+
std::string(""),
158+
std::string(""),
159+
std::string("Overflow: '") + s +
160+
std::string("' -> ") +
161+
typeid(T).name()));
162+
// If the end pointer is at the start of the string, we didn't convert
163+
// anything.
140164
else if (end == str)
141-
throw except::BadCastException(except::Context(__FILE__, __LINE__,
142-
std::string(""), std::string(""),
143-
std::string("Conversion failed: '")
144-
+ s + std::string("' -> ") + typeid(T).name()));
165+
throw except::BadCastException(
166+
except::Context(__FILE__,
167+
__LINE__,
168+
std::string(""),
169+
std::string(""),
170+
std::string("Conversion failed: '") + s +
171+
std::string("' -> ") +
172+
typeid(T).name()));
145173

146174
return res;
147175
}
@@ -153,18 +181,26 @@ template<typename T> T toType(const std::string& s, int base)
153181
* @return The integer argument required by ios::precision() to represent
154182
* this type.
155183
*/
156-
template<typename T> int getPrecision(const T& )
184+
template <typename T>
185+
int getPrecision(const T&)
157186
{
158187
return 0;
159188
}
160-
template<typename T> int getPrecision(const std::complex<T>& type)
189+
190+
template <typename T>
191+
int getPrecision(const std::complex<T>& type)
161192
{
162193
return getPrecision(type.real());
163194
}
164195

165-
template<> int getPrecision(const float& type);
166-
template<> int getPrecision(const double& type);
167-
template<> int getPrecision(const long double& type);
196+
template <>
197+
int getPrecision(const float& type);
198+
199+
template <>
200+
int getPrecision(const double& type);
201+
202+
template <>
203+
int getPrecision(const long double& type);
168204

169205
/** Generic casting routine; used by explicitly overloaded
170206
conversion operators.
@@ -174,12 +210,11 @@ template<> int getPrecision(const long double& type);
174210
to the desired type, if possible.
175211
@throw BadCastException thrown if cast cannot be performed.
176212
*/
177-
template<typename T>
213+
template <typename T>
178214
T generic_cast(const std::string& value)
179215
{
180216
return str::toType<T>(value);
181217
}
182-
183218
}
184219

185220
#endif
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
import os
22

3+
34
def options(opt):
45
opt.recurse()
56

7+
68
def configure(conf):
7-
conf.env.append_value('INCLUDES_UNITTEST', os.path.join(conf.path.abspath(), 'include'))
9+
conf.env.append_value('INCLUDES_UNITTEST',
10+
os.path.join(conf.path.abspath(), 'include'))
811
conf.recurse()
912

13+
1014
def build(bld):
1115
bld.recurse()
16+
testHeader = bld.path.make_node('include/TestCase.h')
17+
bld.install_files(dest=bld.env['install_includedir'],
18+
files=testHeader)
19+
1220

1321
def distclean(context):
1422
context.recurse()

externals/coda-oss/modules/drivers/numpy/wscript

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
import os, sys
2-
from os.path import join, exists
31
from waflib import Options
4-
from waflib.TaskGen import feature, before, task_gen
52

63
build = distclean = lambda x: None
74

5+
86
def options(opt):
9-
opt.add_option('--disable-numpy', action='store_false', dest='enable_numpy', default=True,
7+
opt.add_option('--disable-numpy', action='store_false',
8+
dest='enable_numpy', default=True,
109
help='Turn off Numpy C headers/libs')
1110

12-
def configure(conf):
11+
12+
def configure(conf):
1313
if Options.options.enable_numpy and \
14-
hasattr(Options.options, 'python') and Options.options.python:
14+
hasattr(Options.options, 'python') and Options.options.python:
1515
# a little magic borrowed from python-config and extended for numpy and -L flags
1616
try:
17-
from distutils import sysconfig
1817
import numpy.distutils
19-
import os
20-
18+
2119
np_info = numpy.distutils.misc_util.get_info('npymath')
2220

2321
warningmessage = ""
@@ -31,11 +29,11 @@ def configure(conf):
3129

3230
conf.check(uselib_store='NUMPY',
3331
use='PYEXT',
34-
lib='npymath',
35-
header_name=['Python.h','numpy/arrayobject.h'],
32+
lib='npymath',
33+
header_name=['Python.h', 'numpy/arrayobject.h'],
3634
includes=inc_dir,
3735
libpath=lib_dir,
38-
msg='Checking for library numpy' + warningmessage,
36+
msg='Checking for library numpy' + warningmessage,
3937
mandatory=True)
4038

4139
conf.undefine("HAVE_NUMPY_ARRAYOBJECT_H")

externals/nitro/modules/c/nitf/shared/RSMIDA.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static nitf_TREDescription description[] = {
112112
{NITF_BCS_A, 21, "Illum Elevation Angle Coeff Per Row-Col", "IERC" },
113113
{NITF_BCS_A, 21, "Illum Elevation Angle Coeff Per Col^2", "IECC" },
114114

115-
{NITF_BCS_A, 21, "Illum Azimuth Angle Const", "IE0" },
115+
{NITF_BCS_A, 21, "Illum Azimuth Angle Const", "IA0" },
116116
{NITF_BCS_A, 21, "Illum Azimuth Angle Coeff Per Row", "IAR" },
117117
{NITF_BCS_A, 21, "Illum Azimuth Angle Coeff Per Col", "IAC" },
118118

0 commit comments

Comments
 (0)