Skip to content

Commit

Permalink
Merge branch 'refactor/tokenizer' into autobuild/tokenizer
Browse files Browse the repository at this point in the history
  • Loading branch information
c-lipka committed May 23, 2018
2 parents 1ea91bd + af7e2a8 commit ae2ae6a
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 250 deletions.
58 changes: 28 additions & 30 deletions source/base/fileinputoutput.cpp
Expand Up @@ -511,37 +511,35 @@ POV_OFF_T IMemStream::tellg() const


bool IMemStream::seekg(POV_OFF_T posi, unsigned int whence) bool IMemStream::seekg(POV_OFF_T posi, unsigned int whence)
{ {
if(!fail) // Any seek operation renders the end-of-file status and unget buffer's content obsolete.
{ fail = false;
// Any seek operation renders the unget buffer's content obsolete. mUngetBuffer = EOF;
mUngetBuffer = EOF;


switch(whence) switch(whence)
{ {
case seek_set: case seek_set:
if (posi < formalStart) if (posi < formalStart)
fail = true; fail = true;
else if (posi - formalStart <= size) else if (posi - formalStart <= size)
pos = posi - formalStart; pos = posi - formalStart;
else else
fail = true; fail = true;
break; break;
case seek_cur: case seek_cur:
if ((posi <= size) && (pos <= size-posi)) if ((posi <= size) && (pos <= size-posi))
pos += posi; pos += posi;
else else
fail = true; fail = true;
break; break;
case seek_end: case seek_end:
if (posi <= size) if (posi <= size)
pos = size - posi; pos = size - posi;
else else
fail = true; fail = true;
break; break;
default: default:
POV_ASSERT(false); POV_ASSERT(false);
break; break;
}
} }
return !fail; return !fail;
} }
Expand Down
2 changes: 1 addition & 1 deletion source/base/version.h
Expand Up @@ -100,7 +100,7 @@
/// where `N` is a serial number starting at 1 in each phase, `TIME` is the number of minutes /// 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 /// since 2000-01-01 00:00, and `FEATURE` is an arbitrary alphanumeric moniker for a particular
/// experimental feature. /// experimental feature.
#define POV_RAY_PRERELEASE "x.tokenizer.9999" #define POV_RAY_PRERELEASE "x.tokenizer.9673626"


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

0 comments on commit ae2ae6a

Please sign in to comment.