Skip to content

Commit 64e6987

Browse files
committed
[base] Some code cleanup in pov_err.h.
1 parent 6e3888d commit 64e6987

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

source/base/pov_err.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// @parblock
99
///
1010
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
11-
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
11+
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
1212
///
1313
/// POV-Ray is free software: you can redistribute it and/or modify
1414
/// it under the terms of the GNU Affero General Public License as
@@ -39,6 +39,10 @@
3939
// Module config header file must be the first file included within POV-Ray unit header files
4040
#include "base/configbase.h"
4141

42+
// C++ standard header files
43+
#include <stdexcept>
44+
#include <string>
45+
4246
namespace pov_base
4347
{
4448

@@ -121,15 +125,15 @@ enum
121125
/**
122126
* POV-Ray exception class.
123127
*/
124-
class Exception : public runtime_error
128+
class Exception : public std::runtime_error
125129
{
126130
public:
127131
/**
128132
* Create a new exception without location information.
129133
* @param str Error message string.
130134
*/
131135
Exception(const char *str) throw() :
132-
runtime_error(str), xfunction(nullptr), xfile(nullptr), xline(0), xcode(0),
136+
std::runtime_error(str), xfunction(nullptr), xfile(nullptr), xline(0), xcode(0),
133137
xcodevalid(false), xfrontendnotified(false)
134138
{}
135139

@@ -140,7 +144,7 @@ class Exception : public runtime_error
140144
* @param li `__LINE__`
141145
* @param err Error number.
142146
*/
143-
Exception(const char *fn, const char *fi, unsigned int li, int err) throw() : runtime_error(Exception::lookup_code(err, fi, li)), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
147+
Exception(const char *fn, const char *fi, unsigned int li, int err) throw() : std::runtime_error(Exception::lookup_code(err, fi, li)), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
144148

145149
/**
146150
* Create a new exception with code, location information, and an explicit message.
@@ -149,7 +153,7 @@ class Exception : public runtime_error
149153
* @param li `__LINE__`
150154
* @param str Error message string.
151155
*/
152-
Exception(const char *fn, const char *fi, unsigned int li, const char *str) throw() : runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(0), xcodevalid(false), xfrontendnotified(false) { }
156+
Exception(const char *fn, const char *fi, unsigned int li, const char *str) throw() : std::runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(0), xcodevalid(false), xfrontendnotified(false) { }
153157

154158
/**
155159
* Create a new exception with code, location information, and an explicit message.
@@ -158,7 +162,7 @@ class Exception : public runtime_error
158162
* @param li `__LINE__`
159163
* @param str Error message string.
160164
*/
161-
Exception(const char *fn, const char *fi, unsigned int li, const string& str) throw() : runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(0), xcodevalid(false), xfrontendnotified(false) { }
165+
Exception(const char *fn, const char *fi, unsigned int li, const string& str) throw() : std::runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(0), xcodevalid(false), xfrontendnotified(false) { }
162166

163167
/**
164168
* Create a new exception with code, location information, and an explicit message.
@@ -168,7 +172,7 @@ class Exception : public runtime_error
168172
* @param err Error number.
169173
* @param str Error message string.
170174
*/
171-
Exception(const char *fn, const char *fi, unsigned int li, int err, const char *str) throw() : runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
175+
Exception(const char *fn, const char *fi, unsigned int li, int err, const char *str) throw() : std::runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
172176

173177
/**
174178
* Create a new exception with code, location information, and an explicit message.
@@ -178,7 +182,7 @@ class Exception : public runtime_error
178182
* @param err Error number.
179183
* @param str Error message string.
180184
*/
181-
Exception(const char *fn, const char *fi, unsigned int li, int err, const string& str) throw() : runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
185+
Exception(const char *fn, const char *fi, unsigned int li, int err, const string& str) throw() : std::runtime_error(str), xfunction(fn), xfile(fi), xline(li), xcode(err), xcodevalid(true), xfrontendnotified(false) { }
182186

183187
/**
184188
* Destructor.

0 commit comments

Comments
 (0)