Skip to content

Commit 7c8814c

Browse files
committed
Merge branch 'master' into autobuild/alpha_v380
2 parents b431bb2 + b5c0c83 commit 7c8814c

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
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.

source/base/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
/// where `N` is a serial number starting at 1 in each phase, `TIME` is the number of minutes
101101
/// since 2000-01-01 00:00, and `FEATURE` is an arbitrary alphanumeric moniker for a particular
102102
/// experimental feature.
103-
#define POV_RAY_PRERELEASE "alpha.10011104"
103+
#define POV_RAY_PRERELEASE "alpha.10013324"
104104

105105
#if defined(DOXYGEN) && !defined(POV_RAY_PRERELEASE)
106106
// Work around doxygen being unable to document undefined macros.

source/core/shape/truetype.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ bool ProcessFormat4Glyph(TrueTypeFont *ffile, GlyphIndex& glyphIndex, int cmapId
16571657

16581658
if (cmap4Info->idRangeOffset[i] == 0)
16591659
{
1660-
glyphIndex = search_codepoint + cmap4Info->idDelta[i];
1660+
glyphIndex = (search_codepoint + cmap4Info->idDelta[i]) & 0xFFFF;
16611661
}
16621662
else
16631663
{
@@ -1674,7 +1674,7 @@ bool ProcessFormat4Glyph(TrueTypeFont *ffile, GlyphIndex& glyphIndex, int cmapId
16741674
glyphIndex = READUSHORT(*ffile->file);
16751675

16761676
if (glyphIndex != 0)
1677-
glyphIndex += cmap4Info->idDelta[i];
1677+
glyphIndex = (glyphIndex + cmap4Info->idDelta[i]) & 0xFFFF;
16781678
}
16791679
}
16801680
break;

source/parser/parser_functions_utilities.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ using namespace pov;
8484

8585
FUNCTION_PTR Parser::Parse_Function(void)
8686
{
87-
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
87+
FUNCTION_PTR ptr = new FUNCTION;
8888
ExprNode *expression = nullptr;
8989
FunctionCode function;
9090

@@ -134,7 +134,7 @@ FUNCTION_PTR Parser::Parse_Function(void)
134134

135135
FUNCTION_PTR Parser::Parse_FunctionContent(void)
136136
{
137-
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
137+
FUNCTION_PTR ptr = new FUNCTION;
138138
ExprNode *expression = nullptr;
139139
FunctionCode function;
140140

@@ -212,7 +212,7 @@ void Parser::Parse_FunctionOrContentList(GenericScalarFunctionPtr* apFn, unsigne
212212

213213
FUNCTION_PTR Parser::Parse_DeclareFunction(TokenId *token_id, const char *fn_name, bool is_local)
214214
{
215-
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
215+
FUNCTION_PTR ptr = new FUNCTION;
216216
ExprNode *expression = nullptr;
217217
FunctionCode function;
218218

source/parser/scanner.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,11 @@ UCS2String Scanner::BufferedSource::GetInputStreamName() const
701701
bool Scanner::BufferedSource::SeekAndRefill(POV_OFF_T pos)
702702
{
703703
mBuffer.Clear();
704-
if (mBase != pos)
705-
{
706-
bool seekOk = mpStream->seekg(pos);
707-
mBase = mpStream->tellg();
708-
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
709-
if (!seekOk)
710-
return false; // TODO - Maybe report issue via an exception.
711-
}
704+
bool seekOk = mpStream->seekg(pos);
705+
mBase = mpStream->tellg();
706+
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
707+
if (!seekOk)
708+
return false; // TODO - Maybe report issue via an exception.
712709
mExhausted = false;
713710
(void)RefillBuffer();
714711
return true;

0 commit comments

Comments
 (0)