Skip to content

Commit

Permalink
Merge branch 'master' into autobuild/alpha_v380
Browse files Browse the repository at this point in the history
  • Loading branch information
c-lipka committed Jan 14, 2019
2 parents b431bb2 + b5c0c83 commit 7c8814c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
20 changes: 12 additions & 8 deletions source/base/pov_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2019 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -39,6 +39,10 @@
// Module config header file must be the first file included within POV-Ray unit header files
#include "base/configbase.h"

// C++ standard header files
#include <stdexcept>
#include <string>

namespace pov_base
{

Expand Down Expand Up @@ -121,15 +125,15 @@ enum
/**
* POV-Ray exception class.
*/
class Exception : public runtime_error
class Exception : public std::runtime_error
{
public:
/**
* Create a new exception without location information.
* @param str Error message string.
*/
Exception(const char *str) throw() :
runtime_error(str), xfunction(nullptr), xfile(nullptr), xline(0), xcode(0),
std::runtime_error(str), xfunction(nullptr), xfile(nullptr), xline(0), xcode(0),
xcodevalid(false), xfrontendnotified(false)
{}

Expand All @@ -140,7 +144,7 @@ class Exception : public runtime_error
* @param li `__LINE__`
* @param err Error number.
*/
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) { }
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) { }

/**
* Create a new exception with code, location information, and an explicit message.
Expand All @@ -149,7 +153,7 @@ class Exception : public runtime_error
* @param li `__LINE__`
* @param str Error message string.
*/
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) { }
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) { }

/**
* Create a new exception with code, location information, and an explicit message.
Expand All @@ -158,7 +162,7 @@ class Exception : public runtime_error
* @param li `__LINE__`
* @param str Error message string.
*/
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) { }
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) { }

/**
* Create a new exception with code, location information, and an explicit message.
Expand All @@ -168,7 +172,7 @@ class Exception : public runtime_error
* @param err Error number.
* @param str Error message string.
*/
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) { }
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) { }

/**
* Create a new exception with code, location information, and an explicit message.
Expand All @@ -178,7 +182,7 @@ class Exception : public runtime_error
* @param err Error number.
* @param str Error message string.
*/
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) { }
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) { }

/**
* Destructor.
Expand Down
2 changes: 1 addition & 1 deletion source/base/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
/// where `N` is a serial number starting at 1 in each phase, `TIME` is the number of minutes
/// since 2000-01-01 00:00, and `FEATURE` is an arbitrary alphanumeric moniker for a particular
/// experimental feature.
#define POV_RAY_PRERELEASE "alpha.10011104"
#define POV_RAY_PRERELEASE "alpha.10013324"

#if defined(DOXYGEN) && !defined(POV_RAY_PRERELEASE)
// Work around doxygen being unable to document undefined macros.
Expand Down
4 changes: 2 additions & 2 deletions source/core/shape/truetype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ bool ProcessFormat4Glyph(TrueTypeFont *ffile, GlyphIndex& glyphIndex, int cmapId

if (cmap4Info->idRangeOffset[i] == 0)
{
glyphIndex = search_codepoint + cmap4Info->idDelta[i];
glyphIndex = (search_codepoint + cmap4Info->idDelta[i]) & 0xFFFF;
}
else
{
Expand All @@ -1674,7 +1674,7 @@ bool ProcessFormat4Glyph(TrueTypeFont *ffile, GlyphIndex& glyphIndex, int cmapId
glyphIndex = READUSHORT(*ffile->file);

if (glyphIndex != 0)
glyphIndex += cmap4Info->idDelta[i];
glyphIndex = (glyphIndex + cmap4Info->idDelta[i]) & 0xFFFF;
}
}
break;
Expand Down
6 changes: 3 additions & 3 deletions source/parser/parser_functions_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ using namespace pov;

FUNCTION_PTR Parser::Parse_Function(void)
{
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
FUNCTION_PTR ptr = new FUNCTION;
ExprNode *expression = nullptr;
FunctionCode function;

Expand Down Expand Up @@ -134,7 +134,7 @@ FUNCTION_PTR Parser::Parse_Function(void)

FUNCTION_PTR Parser::Parse_FunctionContent(void)
{
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
FUNCTION_PTR ptr = new FUNCTION;
ExprNode *expression = nullptr;
FunctionCode function;

Expand Down Expand Up @@ -212,7 +212,7 @@ void Parser::Parse_FunctionOrContentList(GenericScalarFunctionPtr* apFn, unsigne

FUNCTION_PTR Parser::Parse_DeclareFunction(TokenId *token_id, const char *fn_name, bool is_local)
{
FUNCTION_PTR ptr = (FUNCTION_PTR)POV_MALLOC(sizeof(FUNCTION), "Function ID");
FUNCTION_PTR ptr = new FUNCTION;
ExprNode *expression = nullptr;
FunctionCode function;

Expand Down
13 changes: 5 additions & 8 deletions source/parser/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,14 +701,11 @@ UCS2String Scanner::BufferedSource::GetInputStreamName() const
bool Scanner::BufferedSource::SeekAndRefill(POV_OFF_T pos)
{
mBuffer.Clear();
if (mBase != pos)
{
bool seekOk = mpStream->seekg(pos);
mBase = mpStream->tellg();
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
if (!seekOk)
return false; // TODO - Maybe report issue via an exception.
}
bool seekOk = mpStream->seekg(pos);
mBase = mpStream->tellg();
POV_PARSER_ASSERT((mBase == pos) || !seekOk);
if (!seekOk)
return false; // TODO - Maybe report issue via an exception.
mExhausted = false;
(void)RefillBuffer();
return true;
Expand Down

0 comments on commit 7c8814c

Please sign in to comment.