From 0108aa1183d3c6a56ad39c8764087a8daa41fbc4 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 12 Apr 2013 16:50:28 +0000 Subject: [PATCH] Minor changes: remove use of 'auto', plug obscure memory leak, update copyright. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21136 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- StandAlone/StandAlone.cpp | 4 ++-- glslang/Include/ConstantUnion.h | 2 ++ glslang/MachineIndependent/IntermTraverse.cpp | 2 ++ glslang/MachineIndependent/ParseHelper.cpp | 4 ++-- glslang/MachineIndependent/RemoveTree.cpp | 2 ++ glslang/MachineIndependent/SymbolTable.h | 2 ++ glslang/MachineIndependent/glslang.l | 4 +++- 7 files changed, 15 insertions(+), 5 deletions(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index e7d080083..2f384d132 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -257,8 +257,8 @@ bool CompileFile(const char *fileName, ShHandle compiler, int debugOptions, cons return false; #ifdef MEASURE_MEMORY - for (int i = 0; i < 1000; ++i) { - for (int j = 0; j < 100; ++j) + for (int i = 0; i < 10; ++i) { + for (int j = 0; j < 1000; ++j) #endif ret = ShCompile(compiler, data, OutputMultipleStrings, EShOptNone, resources, debugOptions, 100, false, EShMsgDefault); #ifdef MEASURE_MEMORY diff --git a/glslang/Include/ConstantUnion.h b/glslang/Include/ConstantUnion.h index e792c7526..7fd7ca891 100644 --- a/glslang/Include/ConstantUnion.h +++ b/glslang/Include/ConstantUnion.h @@ -1,5 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +//Copyright (C) 2013 LunarG, Inc. +// //All rights reserved. // //Redistribution and use in source and binary forms, with or without diff --git a/glslang/MachineIndependent/IntermTraverse.cpp b/glslang/MachineIndependent/IntermTraverse.cpp index 8b8d18864..9b2153882 100644 --- a/glslang/MachineIndependent/IntermTraverse.cpp +++ b/glslang/MachineIndependent/IntermTraverse.cpp @@ -1,5 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +//Copyright (C) 2013 LunarG, Inc. +// //All rights reserved. // //Redistribution and use in source and binary forms, with or without diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 033a8c1cb..c40787964 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1576,7 +1576,7 @@ void TParseContext::addBlock(int line, TPublicType& publicType, const TString& b void TParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode) { - auto switchSequence = switchSequenceStack.back(); + TIntermSequence* switchSequence = switchSequenceStack.back(); if (statements) { if (switchSequence->size() == 0) { @@ -1605,7 +1605,7 @@ TIntermNode* TParseContext::addSwitch(int line, TIntermTyped* expression, TInter } // If there is nothing to do, drop the switch but still execute the expression - auto switchSequence = switchSequenceStack.back(); + TIntermSequence* switchSequence = switchSequenceStack.back(); if (switchSequence->size() == 0) return expression; diff --git a/glslang/MachineIndependent/RemoveTree.cpp b/glslang/MachineIndependent/RemoveTree.cpp index e4f4dc662..2b1d8f971 100644 --- a/glslang/MachineIndependent/RemoveTree.cpp +++ b/glslang/MachineIndependent/RemoveTree.cpp @@ -1,5 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +//Copyright (C) 2013 LunarG, Inc. +// //All rights reserved. // //Redistribution and use in source and binary forms, with or without diff --git a/glslang/MachineIndependent/SymbolTable.h b/glslang/MachineIndependent/SymbolTable.h index e7a76cdb9..f6a500fab 100644 --- a/glslang/MachineIndependent/SymbolTable.h +++ b/glslang/MachineIndependent/SymbolTable.h @@ -1,5 +1,7 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +//Copyright (C) 2013 LunarG, Inc. +// //All rights reserved. // //Redistribution and use in source and binary forms, with or without diff --git a/glslang/MachineIndependent/glslang.l b/glslang/MachineIndependent/glslang.l index e4e01a244..bcb579bd9 100644 --- a/glslang/MachineIndependent/glslang.l +++ b/glslang/MachineIndependent/glslang.l @@ -516,8 +516,10 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon argv[0][len] == '\t' || argv[0][len] == '\n' || argv[0][len] == '\r') { - if (++len >= strLen[0]) + if (++len >= strLen[0]) { + delete writeablePreamble; return 0; + } } if (*cpp->PaStrLen > 0) {