Skip to content

Commit

Permalink
removed unused writeable GP2 setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mrwonko committed Nov 7, 2015
1 parent 3b26abb commit 7a2962a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
16 changes: 5 additions & 11 deletions code/game/genericparser2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ CGPGroup::CGPGroup(const char *initName, CGPGroup *initParent) :
mSubGroups(0),
mInOrderSubGroups(0),
mCurrentSubGroup(0),
mParent(initParent),
mWriteable(false)
mParent(initParent)
{
}

Expand Down Expand Up @@ -543,7 +542,6 @@ void CGPGroup::Clean(void)
mPairs = mInOrderPairs = mCurrentPair = 0;
mSubGroups = mInOrderSubGroups = mCurrentSubGroup = 0;
mParent = 0;
mWriteable = false;
}

CGPGroup *CGPGroup::Duplicate(CTextPool **textPool, CGPGroup *initParent)
Expand Down Expand Up @@ -727,7 +725,6 @@ bool CGPGroup::Parse(char **dataPtr, CTextPool **textPool)
if (Q_stricmp(token, "{") == 0)
{ // new sub group
newSubGroup = AddGroup(lastToken, textPool);
newSubGroup->SetWriteable(mWriteable);
if (!newSubGroup->Parse(dataPtr, textPool))
{
return false;
Expand Down Expand Up @@ -840,8 +837,7 @@ const char *CGPGroup::FindPairValue(const char *key, const char *defaultVal)


CGenericParser2::CGenericParser2(void) :
mTextPool(0),
mWriteable(false)
mTextPool(0)
{
}

Expand All @@ -850,7 +846,7 @@ CGenericParser2::~CGenericParser2(void)
Clean();
}

bool CGenericParser2::Parse(char **dataPtr, bool cleanFirst, bool writeable)
bool CGenericParser2::Parse(char **dataPtr, bool cleanFirst)
{
CTextPool *topPool;

Expand All @@ -864,8 +860,6 @@ bool CGenericParser2::Parse(char **dataPtr, bool cleanFirst, bool writeable)
mTextPool = new CTextPool;
}

SetWriteable(writeable);
mTopLevel.SetWriteable(writeable);
topPool = mTextPool;
bool ret = mTopLevel.Parse(dataPtr, &topPool);
return ret;
Expand Down Expand Up @@ -896,12 +890,12 @@ bool CGenericParser2::Write(CTextPool *textPool)
// C++ users should just use the objects as normally and not call these routines below
//
// CGenericParser2 (void *) routines
TGenericParser2 GP_Parse(char **dataPtr, bool cleanFirst, bool writeable)
TGenericParser2 GP_Parse(char **dataPtr, bool cleanFirst)
{
CGenericParser2 *parse;

parse = new CGenericParser2;
if (parse->Parse(dataPtr, cleanFirst, writeable))
if (parse->Parse(dataPtr, cleanFirst))
{
return parse;
}
Expand Down
12 changes: 4 additions & 8 deletions code/game/genericparser2.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ class CGPGroup : public CGPObject
CGPGroup *mSubGroups, *mInOrderSubGroups;
CGPGroup *mCurrentSubGroup;
CGPGroup *mParent;
bool mWriteable;

void SortObject(CGPObject *object, CGPObject **unsortedList, CGPObject **sortedList,
CGPObject **lastObject);
Expand All @@ -141,7 +140,6 @@ class CGPGroup : public CGPObject
void Clean(void);
CGPGroup *Duplicate(CTextPool **textPool = 0, CGPGroup *initParent = 0);

void SetWriteable(const bool writeable) { mWriteable = writeable; }
CGPValue *GetPairs(void) { return mPairs; }
CGPValue *GetInOrderPairs(void) { return mInOrderPairs; }
CGPGroup *GetSubGroups(void) { return mSubGroups; }
Expand All @@ -164,19 +162,17 @@ class CGenericParser2
private:
CGPGroup mTopLevel;
CTextPool *mTextPool;
bool mWriteable;

public:
CGenericParser2(void);
~CGenericParser2(void);

void SetWriteable(const bool writeable) { mWriteable = writeable; }
CGPGroup *GetBaseParseGroup(void) { return &mTopLevel; }

bool Parse(char **dataPtr, bool cleanFirst = true, bool writeable = false);
bool Parse(char *dataPtr, bool cleanFirst = true, bool writeable = false)
bool Parse(char **dataPtr, bool cleanFirst = true);
bool Parse(char *dataPtr, bool cleanFirst = true)
{
return Parse(&dataPtr, cleanFirst, writeable);
return Parse(&dataPtr, cleanFirst);
}
void Clean(void);

Expand All @@ -194,7 +190,7 @@ typedef void *TGPGroup;
typedef void *TGPValue;

// CGenericParser2 (void *) routines
TGenericParser2 GP_Parse(char **dataPtr, bool cleanFirst, bool writeable);
TGenericParser2 GP_Parse(char **dataPtr, bool cleanFirst);
void GP_Clean(TGenericParser2 GP2);
void GP_Delete(TGenericParser2 *GP2);
TGPGroup GP_GetBaseParseGroup(TGenericParser2 GP2);
Expand Down

0 comments on commit 7a2962a

Please sign in to comment.