Skip to content

Commit 87e7a0b

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
throw() -> noexcept
1 parent ef830f9 commit 87e7a0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+236
-233
lines changed

Externals/NVTT/src/nvcore/Memory.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ namespace nv
2828

2929
// Override new/delete
3030

31-
inline void * operator new (size_t size) throw()
31+
inline void * operator new (size_t size) noexcept
3232
{
3333
return nv::mem::malloc(size);
3434
}
3535

36-
inline void operator delete (void *p) throw()
36+
inline void operator delete (void *p) noexcept
3737
{
3838
nv::mem::free(p);
3939
}
4040

41-
inline void * operator new [] (size_t size) throw()
41+
inline void * operator new [] (size_t size) noexcept
4242
{
4343
return nv::mem::malloc(size);
4444
}
4545

46-
inline void operator delete [] (void * p) throw()
46+
inline void operator delete [] (void * p) noexcept
4747
{
4848
nv::mem::free(p);
4949
}
@@ -139,7 +139,7 @@ void* operator new(std::size_t sz) throw (std::bad_alloc)
139139
gNewCounter++;
140140
return result;
141141
}
142-
void operator delete(void* p) throw()
142+
void operator delete(void* p) noexcept
143143
{
144144
if (p == NULL)
145145
return;
@@ -150,7 +150,7 @@ void operator delete(void* p) throw()
150150
/* These are the 'nothrow' versions of the above operators.
151151
The system version will try to call a std::new_handler if they
152152
fail, but your overriding versions are not required to do this. */
153-
void* operator new(std::size_t sz, const std::nothrow_t&) throw()
153+
void* operator new(std::size_t sz, const std::nothrow_t&) noexcept
154154
{
155155
try {
156156
void * result = ::operator new (sz); // calls our overridden operator new
@@ -159,7 +159,7 @@ void* operator new(std::size_t sz, const std::nothrow_t&) throw()
159159
return NULL;
160160
}
161161
}
162-
void operator delete(void* p, const std::nothrow_t&) throw()
162+
void operator delete(void* p, const std::nothrow_t&) noexcept
163163
{
164164
::operator delete (p);
165165
}

src/utils/xrMiscMath/quaternion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ template Dquaternion& Dquaternion::set(const _matrix<double>& M);
161161
// quaternion non-member functions
162162

163163
/* Commented out, since it's currently unused (only use is commented out in xrPhysics)
164-
void twoq_2w(const Fquaternion& q1, const Fquaternion& q2, float dt, Fvector& w) throw()
164+
void twoq_2w(const Fquaternion& q1, const Fquaternion& q2, float dt, Fvector& w) noexcept
165165
{
166166
//
167167
// w= 2/dt*arccos(q1.w*q2.w+ q1.v.dotproduct(q2.v))

src/xrCDB/xrCDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class XRCDB_API MODEL : Noncopyable
9090
u32 memory();
9191

9292
private:
93-
void syncronize_impl() const throw();
93+
void syncronize_impl() const;
9494
};
9595

9696
// Collider result

src/xrCommon/math_funcs_inline.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ inline double _cos(double x) { return cos(x); }
1717
inline bool fsimilar(float a, float b, float cmp = EPS) { return _abs(a-b)<cmp; }
1818
inline bool dsimilar(double a, double b, double cmp = EPS) { return _abs(a-b)<cmp; }
1919

20-
inline bool fis_zero(float val, float cmp = EPS_S) throw() { return _abs(val) < cmp; }
21-
inline bool dis_zero(double val, double cmp = EPS_S) throw() { return _abs(val) < cmp; }
20+
inline bool fis_zero(float val, float cmp = EPS_S) noexcept { return _abs(val) < cmp; }
21+
inline bool dis_zero(double val, double cmp = EPS_S) noexcept { return _abs(val) < cmp; }
2222

2323
// degree to radians and vice-versa
2424
ICF float deg2rad(float val) { return val*M_PI / 180; }

src/xrCore/Threading/Event.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
#include "Event.hpp"
33
#include <windows.h>
44

5-
Event::Event() { handle = (void*)CreateEvent(NULL, FALSE, FALSE, NULL); }
6-
Event::~Event() { CloseHandle(handle); }
7-
void Event::Reset() { ResetEvent(handle); }
8-
void Event::Set() { SetEvent(handle); }
9-
void Event::Wait() const { WaitForSingleObject(handle, INFINITE); }
10-
bool Event::Wait(u32 millisecondsTimeout) const
5+
Event::Event() noexcept { handle = (void*)CreateEvent(NULL, FALSE, FALSE, NULL); }
6+
Event::~Event() noexcept { CloseHandle(handle); }
7+
void Event::Reset() noexcept { ResetEvent(handle); }
8+
void Event::Set() noexcept { SetEvent(handle); }
9+
void Event::Wait() const noexcept { WaitForSingleObject(handle, INFINITE); }
10+
bool Event::Wait(u32 millisecondsTimeout) const noexcept
1111
{
1212
return WaitForSingleObject(handle, millisecondsTimeout) != WAIT_TIMEOUT;
1313
}

src/xrCore/Threading/Event.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ class XRCORE_API Event
77
void* handle;
88

99
public:
10-
Event() throw();
11-
~Event() throw();
10+
Event() noexcept;
11+
~Event() noexcept;
1212

1313
// Reset the event to the unsignalled state.
14-
void Reset() throw();
14+
void Reset() noexcept;
1515
// Set the event to the signalled state.
16-
void Set() throw();
16+
void Set() noexcept;
1717
// Wait indefinitely for the object to become signalled.
18-
void Wait() const throw();
18+
void Wait() const noexcept;
1919
// Wait, with a time limit, for the object to become signalled.
20-
bool Wait(u32 millisecondsTimeout) const throw();
20+
bool Wait(u32 millisecondsTimeout) const noexcept;
2121

22-
void* GetHandle() const throw() { return handle; }
22+
void* GetHandle() const noexcept { return handle; }
2323
};

src/xrCore/_color.h

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ IC s32 clamp_to_8bit(const s32 val) throw()
1515

1616
// XXX: maybe make functions constexpr
1717
// maps unsigned 8 bits/channel to D3DCOLOR
18-
ICF u32 color_argb(u32 a, u32 r, u32 g, u32 b) throw()
18+
ICF u32 color_argb(u32 a, u32 r, u32 g, u32 b) noexcept
1919
{ return ((a & 0xff) << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff); }
20-
ICF u32 color_rgba(u32 r, u32 g, u32 b, u32 a) throw()
20+
ICF u32 color_rgba(u32 r, u32 g, u32 b, u32 a) noexcept
2121
{ return color_argb(a, r, g, b); }
22-
ICF u32 color_argb_f(f32 a, f32 r, f32 g, f32 b) throw()
22+
ICF u32 color_argb_f(f32 a, f32 r, f32 g, f32 b) noexcept
2323
{
2424
#if 0
2525
s32 _r = clampr(iFloor(r*255.f), 0, 255);
@@ -34,13 +34,13 @@ ICF u32 color_argb_f(f32 a, f32 r, f32 g, f32 b) throw()
3434
#endif
3535
return color_argb(_a, _r, _g, _b);
3636
}
37-
ICF u32 color_rgba_f(f32 r, f32 g, f32 b, f32 a) throw()
37+
ICF u32 color_rgba_f(f32 r, f32 g, f32 b, f32 a) noexcept
3838
{ return color_argb_f(a, r, g, b); }
3939
ICF u32 color_xrgb(u32 r, u32 g, u32 b) { return color_argb(0xff, r, g, b); }
40-
ICF u32 color_get_R(u32 rgba) throw() { return ((rgba >> 16) & 0xff); }
41-
ICF u32 color_get_G(u32 rgba) throw() { return ((rgba >> 8) & 0xff); }
42-
ICF u32 color_get_B(u32 rgba) throw() { return (rgba & 0xff); }
43-
ICF u32 color_get_A(u32 rgba) throw() { return (rgba >> 24); }
40+
ICF u32 color_get_R(u32 rgba) noexcept { return ((rgba >> 16) & 0xff); }
41+
ICF u32 color_get_G(u32 rgba) noexcept { return ((rgba >> 8) & 0xff); }
42+
ICF u32 color_get_B(u32 rgba) noexcept { return (rgba & 0xff); }
43+
ICF u32 color_get_A(u32 rgba) noexcept { return (rgba >> 24); }
4444
ICF u32 subst_alpha(u32 rgba, u32 a) { return (rgba & ~color_rgba(0, 0, 0, 0xff)) | color_rgba(0, 0, 0, a); }
4545
ICF u32 bgr2rgb(u32 bgr) { return color_rgba(color_get_B(bgr), color_get_G(bgr), color_get_R(bgr), 0); }
4646
ICF u32 rgb2bgr(u32 rgb) { return bgr2rgb(rgb); }
@@ -49,7 +49,7 @@ struct Fcolor
4949
{
5050
float r, g, b, a;
5151

52-
Fcolor& set(u32 dw) throw()
52+
Fcolor& set(u32 dw) noexcept
5353
{
5454
const float f = float(1.0) / float(255.0);
5555
a = f * float((dw >> 24) & 0xff);
@@ -66,16 +66,16 @@ struct Fcolor
6666
a = _a;
6767
return *this;
6868
};
69-
Fcolor& set(const Fcolor& rhs) throw()
69+
Fcolor& set(const Fcolor& rhs) noexcept
7070
{
7171
r = rhs.r;
7272
g = rhs.g;
7373
b = rhs.b;
7474
a = rhs.a;
7575
return *this;
7676
}
77-
u32 get() const throw() { return color_rgba_f(r, g, b, a); }
78-
u32 get_windows() const throw() // Get color as a Windows DWORD value.
77+
u32 get() const noexcept { return color_rgba_f(r, g, b, a); }
78+
u32 get_windows() const noexcept // Get color as a Windows DWORD value.
7979
{
8080
u8 _a, _r, _g, _b;
8181
_a = u8(a*255.f);
@@ -84,7 +84,7 @@ struct Fcolor
8484
_b = u8(b*255.f);
8585
return (u32)(_a << 24) | (_b << 16) | (_g << 8) | _r;
8686
}
87-
Fcolor& set_windows(u32 dw) throw() // Set color from a Windows DWORD color value.
87+
Fcolor& set_windows(u32 dw) noexcept // Set color from a Windows DWORD color value.
8888
{
8989
const float f = 1.0f / 255.0f;
9090
a = f * (float)(u8)(dw >> 24);
@@ -93,21 +93,21 @@ struct Fcolor
9393
r = f * (float)(u8)(dw >> 0);
9494
return *this;
9595
}
96-
Fcolor& adjust_contrast(float f) throw() // >1 - contrast will be increased
96+
Fcolor& adjust_contrast(float f) noexcept // >1 - contrast will be increased
9797
{
9898
r = 0.5f + f * (r - 0.5f);
9999
g = 0.5f + f * (g - 0.5f);
100100
b = 0.5f + f * (b - 0.5f);
101101
return *this;
102102
}
103-
Fcolor& adjust_contrast(const Fcolor& in, float f) throw() // >1 - contrast will be increased
103+
Fcolor& adjust_contrast(const Fcolor& in, float f) noexcept // >1 - contrast will be increased
104104
{
105105
r = 0.5f + f * (in.r - 0.5f);
106106
g = 0.5f + f * (in.g - 0.5f);
107107
b = 0.5f + f * (in.b - 0.5f);
108108
return *this;
109109
}
110-
Fcolor& adjust_saturation(float s) throw()
110+
Fcolor& adjust_saturation(float s) noexcept
111111
{
112112
// Approximate values for each component's contribution to luminance.
113113
// Based upon the NTSC standard described in ITU-R Recommendation BT.709.
@@ -117,7 +117,7 @@ struct Fcolor
117117
b = grey + s * (b - grey);
118118
return *this;
119119
}
120-
Fcolor& adjust_saturation(const Fcolor& in, float s) throw()
120+
Fcolor& adjust_saturation(const Fcolor& in, float s) noexcept
121121
{
122122
// Approximate values for each component's contribution to luminance.
123123
// Based upon the NTSC standard described in ITU-R Recommendation BT.709.
@@ -127,31 +127,31 @@ struct Fcolor
127127
b = grey + s * (in.b - grey);
128128
return *this;
129129
}
130-
Fcolor& modulate(Fcolor& in) throw() { r *= in.r; g *= in.g; b *= in.b; a *= in.a; return *this; }
131-
Fcolor& modulate(const Fcolor& in1, const Fcolor& in2) throw() { r = in1.r*in2.r; g = in1.g*in2.g; b = in1.b*in2.b; a = in1.a*in2.a; return *this; }
132-
Fcolor& negative(const Fcolor& in) throw() { r = 1.0f - in.r; g = 1.0f - in.g; b = 1.0f - in.b; a = 1.0f - in.a; return *this; }
133-
Fcolor& negative() throw() { r = 1.0f - r; g = 1.0f - g; b = 1.0f - b; a = 1.0f - a; return *this; }
134-
Fcolor& sub_rgb(float s) throw() { r -= s; g -= s; b -= s; return *this; }
135-
Fcolor& add_rgb(float s) throw() { r += s; g += s; b += s; return *this; }
136-
Fcolor& add_rgba(float s) throw() { r += s; g += s; b += s; a += s; return *this; }
137-
Fcolor& mul_rgba(float s) throw() { r *= s; g *= s; b *= s; a *= s; return *this; }
138-
Fcolor& mul_rgb(float s) throw() { r *= s; g *= s; b *= s; return *this; }
139-
Fcolor& mul_rgba(const Fcolor& c, float s) throw() { r = c.r*s; g = c.g*s; b = c.b*s; a = c.a*s; return *this; }
140-
Fcolor& mul_rgb(const Fcolor& c, float s) throw() { r = c.r*s; g = c.g*s; b = c.b*s; return *this; }
130+
Fcolor& modulate(Fcolor& in) noexcept { r *= in.r; g *= in.g; b *= in.b; a *= in.a; return *this; }
131+
Fcolor& modulate(const Fcolor& in1, const Fcolor& in2) noexcept { r = in1.r*in2.r; g = in1.g*in2.g; b = in1.b*in2.b; a = in1.a*in2.a; return *this; }
132+
Fcolor& negative(const Fcolor& in) noexcept { r = 1.0f - in.r; g = 1.0f - in.g; b = 1.0f - in.b; a = 1.0f - in.a; return *this; }
133+
Fcolor& negative() noexcept { r = 1.0f - r; g = 1.0f - g; b = 1.0f - b; a = 1.0f - a; return *this; }
134+
Fcolor& sub_rgb(float s) noexcept { r -= s; g -= s; b -= s; return *this; }
135+
Fcolor& add_rgb(float s) noexcept { r += s; g += s; b += s; return *this; }
136+
Fcolor& add_rgba(float s) noexcept { r += s; g += s; b += s; a += s; return *this; }
137+
Fcolor& mul_rgba(float s) noexcept { r *= s; g *= s; b *= s; a *= s; return *this; }
138+
Fcolor& mul_rgb(float s) noexcept { r *= s; g *= s; b *= s; return *this; }
139+
Fcolor& mul_rgba(const Fcolor& c, float s) noexcept { r = c.r*s; g = c.g*s; b = c.b*s; a = c.a*s; return *this; }
140+
Fcolor& mul_rgb(const Fcolor& c, float s) noexcept { r = c.r*s; g = c.g*s; b = c.b*s; return *this; }
141141

142142
// SQ magnitude
143-
float magnitude_sqr_rgb() const throw() { return r * r + g * g + b * b;}
143+
float magnitude_sqr_rgb() const noexcept { return r * r + g * g + b * b;}
144144
// magnitude
145-
float magnitude_rgb() const throw() { return _sqrt(magnitude_sqr_rgb()); }
146-
float intensity() const throw()
145+
float magnitude_rgb() const noexcept { return _sqrt(magnitude_sqr_rgb()); }
146+
float intensity() const noexcept
147147
{
148148
// XXX: Use the component percentages from adjust_saturation()?
149149
return (r + g + b) / 3.f;
150150
}
151151
// Normalize
152-
Fcolor& normalize_rgb() throw() { VERIFY( magnitude_sqr_rgb() > EPS_S); return mul_rgb( 1.f / magnitude_rgb()); }
153-
Fcolor& normalize_rgb(const Fcolor& c) throw() { VERIFY(c.magnitude_sqr_rgb() > EPS_S); return mul_rgb(c, 1.f / c.magnitude_rgb()); }
154-
Fcolor& lerp(const Fcolor& c1, const Fcolor& c2, float t) throw()
152+
Fcolor& normalize_rgb() noexcept { VERIFY( magnitude_sqr_rgb() > EPS_S); return mul_rgb( 1.f / magnitude_rgb()); }
153+
Fcolor& normalize_rgb(const Fcolor& c) noexcept { VERIFY(c.magnitude_sqr_rgb() > EPS_S); return mul_rgb(c, 1.f / c.magnitude_rgb()); }
154+
Fcolor& lerp(const Fcolor& c1, const Fcolor& c2, float t) noexcept
155155
{
156156
float invt = 1.f - t;
157157
r = c1.r*invt + c2.r*t;
@@ -160,15 +160,15 @@ struct Fcolor
160160
a = c1.a*invt + c2.a*t;
161161
return *this;
162162
}
163-
Fcolor& lerp(const Fcolor& c1, const Fcolor& c2, const Fcolor& c3, float t) throw()
163+
Fcolor& lerp(const Fcolor& c1, const Fcolor& c2, const Fcolor& c3, float t) noexcept
164164
{
165165
if (t>.5f)
166166
return lerp(c2, c3, t*2.f - 1.f);
167167
else
168168
return lerp(c1, c2, t*2.f);
169169
}
170-
bool similar_rgba(const Fcolor& v, float E = EPS_L) const throw() { return _abs(r - v.r) < E && _abs(g - v.g) < E && _abs(b - v.b) < E && _abs(a - v.a) < E; }
171-
bool similar_rgb (const Fcolor& v, float E = EPS_L) const throw() { return _abs(r - v.r) < E && _abs(g - v.g) < E && _abs(b - v.b) < E; }
170+
bool similar_rgba(const Fcolor& v, float E = EPS_L) const noexcept { return _abs(r - v.r) < E && _abs(g - v.g) < E && _abs(b - v.b) < E && _abs(a - v.a) < E; }
171+
bool similar_rgb (const Fcolor& v, float E = EPS_L) const noexcept { return _abs(r - v.r) < E && _abs(g - v.g) < E && _abs(b - v.b) < E; }
172172
};
173173

174-
IC bool _valid(const Fcolor& c) throw() { return _valid(c.r) && _valid(c.g) && _valid(c.b) && _valid(c.a); }
174+
IC bool _valid(const Fcolor& c) noexcept { return _valid(c.r) && _valid(c.g) && _valid(c.b) && _valid(c.a); }

src/xrCore/_fbox.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class _box3
2828
};
2929
};
3030

31-
bool is_valid() const throw() { return (x2 >= x1) && (y2 >= y1) && (z2 >= z1); }
32-
const T* data() const throw() { return &vMin.x; }
31+
bool is_valid() const noexcept { return (x2 >= x1) && (y2 >= y1) && (z2 >= z1); }
32+
const T* data() const noexcept { return &vMin.x; }
3333

3434
SelfRef set(const Tvector& _min, const Tvector& _max)
3535
{

0 commit comments

Comments
 (0)