Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
cfd643e4
Commit
cfd643e4
authored
Mar 08, 2013
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another round of gcc/g++ fixes.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20819
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
37827023
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
131 additions
and
44 deletions
+131
-44
Makefile
OGLCompilersDLL/Makefile
+4
-5
Makefile
StandAlone/Makefile
+1
-1
StandAlone.cpp
StandAlone/StandAlone.cpp
+32
-2
Makefile
glslang/GenericCodeGen/Makefile
+3
-1
ConstantUnion.h
glslang/Include/ConstantUnion.h
+7
-0
PoolAlloc.h
glslang/Include/PoolAlloc.h
+1
-0
Types.h
glslang/Include/Types.h
+3
-1
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+3
-0
Intermediate.cpp
glslang/MachineIndependent/Intermediate.cpp
+4
-0
Makefile
glslang/MachineIndependent/Makefile
+8
-6
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+2
-0
ShaderLang.cpp
glslang/MachineIndependent/ShaderLang.cpp
+1
-1
SymbolTable.cpp
glslang/MachineIndependent/SymbolTable.cpp
+2
-0
Versions.cpp
glslang/MachineIndependent/Versions.cpp
+1
-0
glslang.l
glslang/MachineIndependent/glslang.l
+2
-0
glslang.y
glslang/MachineIndependent/glslang.y
+13
-1
Makefile
glslang/MachineIndependent/preprocessor/Makefile
+3
-3
cpp.c
glslang/MachineIndependent/preprocessor/cpp.c
+4
-0
cpp.h
glslang/MachineIndependent/preprocessor/cpp.h
+13
-8
memory.c
glslang/MachineIndependent/preprocessor/memory.c
+1
-1
scanner.c
glslang/MachineIndependent/preprocessor/scanner.c
+1
-1
scanner.h
glslang/MachineIndependent/preprocessor/scanner.h
+8
-0
symbols.c
glslang/MachineIndependent/preprocessor/symbols.c
+2
-2
tokens.c
glslang/MachineIndependent/preprocessor/tokens.c
+9
-7
Makefile
glslang/OSDependent/Linux/Makefile
+3
-4
No files found.
OGLCompilersDLL/Makefile
View file @
cfd643e4
INCLUDE
=
-I
.
-I
../glslang
-I
../glslang/Include
-I
../glslang/OSDependent/Linux
-I
../glslang/MachineIndependent
WARNINGS
=
-Wall
-Wwrite-strings
-Wpointer-arith
-Wcast-align
-Wstrict-prototypes
\
-Wnested-externs
DEFINE
=
-Dlinux
-D__i386__
CPP
=
g++
CPPOPTIONS
=
-O3
-Wno-deprecated
-D_ALT_NS
=
1
CPPOPTIONS
=
-g
-Wno-deprecated
-D_ALT_NS
=
1
CPPFLAGS
=
$(CPPOPTIONS)
$(
DEFINE)
$(
INCLUDE)
CPPOPTIONS
=
-O3
-Wno-deprecated
-D_ALT_NS
=
1
-fPIC
CPPOPTIONS
=
-g
-Wno-deprecated
-D_ALT_NS
=
1
-fPIC
CPPFLAGS
=
$(CPPOPTIONS)
$(INCLUDE)
#
# Linking related
...
...
StandAlone/Makefile
View file @
cfd643e4
...
...
@@ -17,7 +17,7 @@ SHAREDOBJECT:
cd
$(OBJECTPATH)
;
make all
%.o
:
%.cpp
$(CC)
-c
$<
$(CC)
-
g
-
c
$<
#
# Cleanup
...
...
StandAlone/StandAlone.cpp
View file @
cfd643e4
...
...
@@ -36,6 +36,7 @@
#include "./../glslang/Include/ShHandle.h"
#include "./../glslang/Public/ShaderLang.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>
#ifdef _WIN32
...
...
@@ -283,17 +284,46 @@ void usage()
}
#ifndef _WIN32
#include <errno.h>
int
fopen_s
(
FILE
**
pFile
,
const
char
*
filename
,
const
char
*
mode
)
{
if
(
!
pFile
||
!
filename
||
!
mode
)
{
return
EINVAL
;
}
FILE
*
f
=
fopen
(
filename
,
mode
);
if
(
!
f
)
{
if
(
errno
!=
0
)
{
return
errno
;
}
else
{
return
ENOENT
;
}
}
*
pFile
=
f
;
return
0
;
}
#endif
//
// Malloc a string of sufficient size and read a string into it.
//
# define MAX_SOURCE_STRINGS 5
char
**
ReadFileData
(
const
char
*
fileName
)
{
FILE
*
in
;
int
errorCode
=
fopen_s
(
&
in
,
fileName
,
"r"
);
char
*
fdata
;
int
count
=
0
;
char
**
return_data
=
(
char
**
)
malloc
(
MAX_SOURCE_STRINGS
+
1
);
const
int
maxSourceStrings
=
5
;
char
**
return_data
=
(
char
**
)
malloc
(
maxSourceStrings
+
1
);
//return_data[MAX_SOURCE_STRINGS]=NULL;
if
(
errorCode
)
{
...
...
glslang/GenericCodeGen/Makefile
View file @
cfd643e4
...
...
@@ -5,6 +5,8 @@ AR=ar
SRCS
=
CodeGen.cpp Link.cpp
CPPFLAGS
=
-fPIC
default
:
all
all
:
libCodeGen.a
...
...
@@ -13,7 +15,7 @@ libCodeGen.a : $(OBJECTS)
ranlib
$@
%.o
:
%.cpp
$(CC)
-c
$<
$(CC)
-c
$
(CPPFLAGS)
$
<
#
# Cleanup
...
...
glslang/Include/ConstantUnion.h
View file @
cfd643e4
...
...
@@ -108,6 +108,11 @@ public:
return
true
;
break
;
case
EbtUint
:
if
(
constant
.
uConst
==
uConst
)
return
true
;
break
;
case
EbtFloat
:
if
(
constant
.
fConst
==
fConst
)
return
true
;
...
...
@@ -123,6 +128,8 @@ public:
return
true
;
break
;
default
:
assert
(
false
&&
"Default missing"
);
}
return
false
;
...
...
glslang/Include/PoolAlloc.h
View file @
cfd643e4
...
...
@@ -62,6 +62,7 @@
//
#include <stddef.h>
#include <string.h>
#include <vector>
// If we are using guard blocks, we must track each indivual
...
...
glslang/Include/Types.h
View file @
cfd643e4
...
...
@@ -110,6 +110,7 @@ struct TSampler {
case
EbtFloat
:
break
;
case
EbtInt
:
s
.
append
(
"i"
);
break
;
case
EbtUint
:
s
.
append
(
"u"
);
break
;
default
:
break
;
// some compilers want this
}
if
(
image
)
s
.
append
(
"image"
);
...
...
@@ -122,6 +123,7 @@ struct TSampler {
case
EsdCube
:
s
.
append
(
"Cube"
);
break
;
case
EsdRect
:
s
.
append
(
"2DRect"
);
break
;
case
EsdBuffer
:
s
.
append
(
"Buffer"
);
break
;
default
:
break
;
// some compilers want this
}
if
(
ms
)
s
.
append
(
"MS"
);
...
...
@@ -453,7 +455,7 @@ public:
}
}
TString
TType
::
getCompleteString
()
const
TString
getCompleteString
()
const
{
const
int
maxSize
=
200
;
char
buf
[
maxSize
];
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
cfd643e4
...
...
@@ -1318,6 +1318,9 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
case
EShLangTessEvaluation
:
case
EShLangGeometry
:
// TODO: support these stages
default
:
assert
(
false
&&
"Language not supported"
);
break
;
}
...
...
glslang/MachineIndependent/Intermediate.cpp
View file @
cfd643e4
...
...
@@ -93,6 +93,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn
case
EOpMul
:
if
(
left
->
getType
().
getBasicType
()
==
EbtStruct
||
left
->
getType
().
getBasicType
()
==
EbtBool
||
left
->
getType
().
isArray
())
return
0
;
default
:
break
;
// some compilers want this
}
//
...
...
@@ -218,6 +219,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode,
case
EOpNegative
:
if
(
child
->
getType
().
getBasicType
()
==
EbtStruct
||
child
->
getType
().
isArray
())
return
0
;
default
:
break
;
// some compilers want this
}
//
...
...
@@ -229,6 +231,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode,
case
EOpConstructBool
:
newType
=
EbtBool
;
break
;
case
EOpConstructFloat
:
newType
=
EbtFloat
;
break
;
case
EOpConstructDouble
:
newType
=
EbtDouble
;
break
;
default
:
break
;
// some compilers want this
}
if
(
newType
!=
EbtVoid
)
{
...
...
@@ -249,6 +252,7 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermNode* childNode,
case
EOpConstructFloat
:
case
EOpConstructDouble
:
return
child
;
default
:
break
;
// some compilers want this
}
TIntermConstantUnion
*
childTempConstant
=
0
;
...
...
glslang/MachineIndependent/Makefile
View file @
cfd643e4
...
...
@@ -11,13 +11,13 @@ LIBCODEGEN=./../GenericCodeGen/libCodeGen.a
OBJECTS
=
Initialize.o IntermTraverse.o
\
Intermediate.o ParseHelper.o PoolAlloc.o QualifierAlive.o
\
RemoveTree.o ShaderLang.o intermOut.o parseConst.o SymbolTable.o
\
InfoSink.o
InfoSink.o
Versions.o Constant.o
SRCS
=
gen_glslang.cpp gen_glslang_tab.cpp Initialize.cpp IntermTraverse.cpp
\
Intermediate.cpp ParseHelper.cpp PoolAlloc.cp QualifierAlive.cpp
\
RemoveTree.cpp ShaderLang.cpp SymbolTable.cpp intermOut.cpp
\
parseConst.cpp InfoSink.cpp
CPPFLAGS
=
$(DEFINE)
$(INCLUDE)
parseConst.cpp InfoSink.cpp
Versions.cpp Constant.cpp
CPPFLAGS
=
$(DEFINE)
$(INCLUDE)
-fPIC
SHAREDOBJECT
=
./lib/libglslang.so
default
:
all
...
...
@@ -26,13 +26,13 @@ all: $(SHAREDOBJECT)
$(SHAREDOBJECT)
:
gen_glslang.o gen_glslang_tab.o $(OBJECTS)
\
$(LIBPREPROCESSOR) $(LIBCODEGEN) $(LIBOSDEPENDENT) $(LIBINITIALISATION)
$(CC)
-fPIC
-shared
-
lc
-o
$@
$(OBJECTS)
$(LIBPREPROCESSOR)
$(LIBCODEGEN)
$(LIBOSDEPENDENT)
$(LIBINITIALISATION)
gen_glslang.o gen_glslang_tab.o
$(CC)
-fPIC
-shared
-
o
$@
-rdynamic
-Wl
,-whole-archive
$(OBJECTS)
$(LIBPREPROCESSOR)
$(LIBCODEGEN)
$(LIBOSDEPENDENT)
$(LIBINITIALISATION)
gen_glslang.o gen_glslang_tab.o
-Wl
,-no-whole-archive
gen_glslang.o
:
gen_glslang.cpp glslang_tab.h
$(CC)
-c
$(INCLUDE)
gen_glslang.cpp
-o
$@
$(CC)
-
fPIC
-
c
$(INCLUDE)
gen_glslang.cpp
-o
$@
gen_glslang_tab.o
:
gen_glslang_tab.cpp
$(CC)
-c
$(INCLUDE)
gen_glslang_tab.cpp
-o
$@
$(CC)
-
fPIC
-
c
$(INCLUDE)
gen_glslang_tab.cpp
-o
$@
gen_glslang.cpp
:
glslang.l
@
echo
Generating gen_glslang.cpp
...
...
@@ -159,3 +159,5 @@ parseConst.o: ../Include/ConstantUnion.h ../Include/InfoSink.h
parseConst.o
:
localintermediate.h ../Include/intermediate.h
parseConst.o
:
../Public/ShaderLang.h
InfoSink.o
:
../Include/InfoSink.h
Versions.o
:
ParseHelper.h Versions.h ../Include/ShHandle.h SymbolTable.h localintermediate.h
Constant.o
:
localintermediate.h ../Include/intermediate.h ../Public/ShaderLang.h SymbolTable.h Versions.h
glslang/MachineIndependent/ParseHelper.cpp
View file @
cfd643e4
...
...
@@ -264,6 +264,7 @@ void TParseContext::variableErrorCheck(TIntermTyped*& nodePtr)
case
EvqPointCoord
:
profileRequires
(
symbol
->
getLine
(),
ENoProfile
,
120
,
0
,
"gl_PointCoord"
);
break
;
default
:
break
;
// some compilers want this
}
}
}
...
...
@@ -647,6 +648,7 @@ bool TParseContext::globalQualifierFixAndErrorCheck(int line, TQualifier& qualif
error
(
line
,
"cannot use 'inout' at global scope"
,
""
,
""
);
return
true
;
default
:
break
;
// some compilers want this
}
return
false
;
...
...
glslang/MachineIndependent/ShaderLang.cpp
View file @
cfd643e4
...
...
@@ -40,7 +40,7 @@
// This is the platform independent interface between an OGL driver
// and the shading language compiler/linker.
//
#include <string.h>
#include "SymbolTable.h"
#include "ParseHelper.h"
...
...
glslang/MachineIndependent/SymbolTable.cpp
View file @
cfd643e4
...
...
@@ -64,6 +64,7 @@ void TType::buildMangledName(TString& mangledName)
switch
(
sampler
.
type
)
{
case
EbtInt
:
mangledName
+=
"i"
;
break
;
case
EbtUint
:
mangledName
+=
"u"
;
break
;
default
:
break
;
// some compilers want this
}
if
(
sampler
.
image
)
mangledName
+=
"I"
;
...
...
@@ -80,6 +81,7 @@ void TType::buildMangledName(TString& mangledName)
case
EsdCube
:
mangledName
+=
"C"
;
break
;
case
EsdRect
:
mangledName
+=
"R2"
;
break
;
case
EsdBuffer
:
mangledName
+=
"B"
;
break
;
default
:
break
;
// some compilers want this
}
break
;
case
EbtStruct
:
...
...
glslang/MachineIndependent/Versions.cpp
View file @
cfd643e4
...
...
@@ -108,6 +108,7 @@ void TParseContext::profileRequires(int line, EProfile callingProfile, int minVe
case
EBhEnable
:
okay
=
true
;
break
;
default
:
break
;
// some compilers want this
}
}
...
...
glslang/MachineIndependent/glslang.l
View file @
cfd643e4
...
...
@@ -920,6 +920,8 @@ void updateExtensionBehavior(const char* extName, const char* behavior)
msg = TString("extension '") + extName + "' is not supported";
pc.infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
break;
default:
assert(0 && "unexpected behaviorVal");
}
return;
...
...
glslang/MachineIndependent/glslang.y
View file @
cfd643e4
...
...
@@ -669,6 +669,7 @@ function_identifier
case 2: op = EOpConstructMat2x2; break;
case 3: op = EOpConstructMat2x3; break;
case 4: op = EOpConstructMat2x4; break;
default: break; // some compilers want this
}
break;
case 3:
...
...
@@ -676,6 +677,7 @@ function_identifier
case 2: op = EOpConstructMat3x2; break;
case 3: op = EOpConstructMat3x3; break;
case 4: op = EOpConstructMat3x4; break;
default: break; // some compilers want this
}
break;
case 4:
...
...
@@ -683,8 +685,10 @@ function_identifier
case 2: op = EOpConstructMat4x2; break;
case 3: op = EOpConstructMat4x3; break;
case 4: op = EOpConstructMat4x4; break;
default: break; // some compilers want this
}
break;
default: break; // some compilers want this
}
} else {
switch($1.vectorSize) {
...
...
@@ -692,6 +696,7 @@ function_identifier
case 2: op = EOpConstructVec2; break;
case 3: op = EOpConstructVec3; break;
case 4: op = EOpConstructVec4; break;
default: break; // some compilers want this
}
}
break;
...
...
@@ -703,6 +708,7 @@ function_identifier
case 2: op = EOpConstructDMat2x2; break;
case 3: op = EOpConstructDMat2x3; break;
case 4: op = EOpConstructDMat2x4; break;
default: break; // some compilers want this
}
break;
case 3:
...
...
@@ -710,6 +716,7 @@ function_identifier
case 2: op = EOpConstructDMat3x2; break;
case 3: op = EOpConstructDMat3x3; break;
case 4: op = EOpConstructDMat3x4; break;
default: break; // some compilers want this
}
break;
case 4:
...
...
@@ -717,6 +724,7 @@ function_identifier
case 2: op = EOpConstructDMat4x2; break;
case 3: op = EOpConstructDMat4x3; break;
case 4: op = EOpConstructDMat4x4; break;
default: break; // some compilers want this
}
break;
}
...
...
@@ -726,6 +734,7 @@ function_identifier
case 2: op = EOpConstructDVec2; break;
case 3: op = EOpConstructDVec3; break;
case 4: op = EOpConstructDVec4; break;
default: break; // some compilers want this
}
}
break;
...
...
@@ -735,6 +744,7 @@ function_identifier
case 2: op = EOpConstructIVec2; break;
case 3: op = EOpConstructIVec3; break;
case 4: op = EOpConstructIVec4; break;
default: break; // some compilers want this
}
break;
case EbtBool:
...
...
@@ -743,8 +753,10 @@ function_identifier
case 2: op = EOpConstructBVec2; break;
case 3: op = EOpConstructBVec3; break;
case 4: op = EOpConstructBVec4; break;
default: break; // some compilers want this
}
break;
default: break; // some compilers want this
}
if (op == EOpNull) {
parseContext.error($1.line, "cannot construct this type", TType::getBasicString($1.type), "");
...
...
@@ -829,7 +841,7 @@ unary_expression
case EOpNegative: errorOp[0] = '-'; break;
case EOpLogicalNot: errorOp[0] = '!'; break;
case EOpBitwiseNot: errorOp[0] = '~'; break;
default: break;
default: break;
// some compilers want this
}
parseContext.unaryOpError($1.line, errorOp, $2->getCompleteString());
parseContext.recover();
...
...
glslang/MachineIndependent/preprocessor/Makefile
View file @
cfd643e4
INCLUDE
=
-I
../
CC
=
g
++
CC
=
g
cc
CPPFLAGS
=
$(DEFINE)
$(INCLUDE)
CPPFLAGS
=
$(DEFINE)
$(INCLUDE)
-fPIC
OBJECTS
=
atom.o cpp.o cppstruct.o memory.o scanner.o symbols.o tokens.o
AR
=
ar
...
...
@@ -14,7 +14,7 @@ libPreprocessor.a : $(OBJECTS)
ranlib
$@
%.o
:
%.c
$(CC)
$(CPPFLAGS)
-c
$<
$(CC)
-c
$(CPPFLAGS)
$<
#
# Cleanup
...
...
glslang/MachineIndependent/preprocessor/cpp.c
View file @
cfd643e4
...
...
@@ -128,6 +128,10 @@ static Scope *macros = 0;
static
SourceLoc
ifloc
;
/* outermost #if */
int
ChkCorrectElseNesting
(
void
);
int
PredefineMacro
(
char
*
);
void
FreeMacro
(
MacroSymbol
*
);
int
InitCPP
(
void
)
{
char
buffer
[
64
],
*
t
;
...
...
glslang/MachineIndependent/preprocessor/cpp.h
View file @
cfd643e4
...
...
@@ -85,12 +85,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "tokens.h"
#include "Versions.h"
int
InitCPP
(
void
);
int
FinalCPP
(
void
);
int
readCPPline
(
yystypepp
*
yylvalpp
);
int
MacroExpand
(
int
atom
,
yystypepp
*
yylvalpp
);
int
ChkCorrectElseNesting
(
void
);
typedef
struct
MacroSymbol
{
int
argc
;
int
*
args
;
...
...
@@ -99,8 +93,14 @@ typedef struct MacroSymbol {
unsigned
undef
:
1
;
}
MacroSymbol
;
void
FreeMacro
(
MacroSymbol
*
);
int
PredefineMacro
(
char
*
);
int
InitCPP
(
void
);
int
FinalCPP
(
void
);
int
readCPPline
(
yystypepp
*
yylvalpp
);
int
MacroExpand
(
int
atom
,
yystypepp
*
yylvalpp
);
#ifdef __cplusplus
extern
"C"
{
#endif
void
CPPDebugLogMsg
(
const
char
*
msg
);
// Prints information into debug log
void
CPPShInfoLogMsg
(
const
char
*
);
// Store cpp Err Msg into Sh.Info.Log
...
...
@@ -118,4 +118,9 @@ void SetProfile(EProfile);
void
updateExtensionBehavior
(
const
char
*
extName
,
const
char
*
behavior
);
int
FreeCPP
(
void
);
#ifdef __cplusplus
}
#endif
#endif // !(defined(__CPP_H)
glslang/MachineIndependent/preprocessor/memory.c
View file @
cfd643e4
...
...
@@ -79,7 +79,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include <string.h>
#ifdef _
_STDC99__
#ifdef _
WIN32
#include <stdint.h>
#elif defined (_WIN64)
typedef
unsigned
__int64
uintptr_t
;
...
...
glslang/MachineIndependent/preprocessor/scanner.c
View file @
cfd643e4
...
...
@@ -208,7 +208,7 @@ static void str_ungetch(StringInputSrc *in, int ch, yystypepp *type) {
int
ScanFromString
(
char
*
s
)
{
StringInputSrc
*
in
=
malloc
(
sizeof
(
StringInputSrc
));
StringInputSrc
*
in
=
(
StringInputSrc
*
)
malloc
(
sizeof
(
StringInputSrc
));
memset
(
in
,
0
,
sizeof
(
StringInputSrc
));
in
->
p
=
s
;
in
->
base
.
line
=
1
;
...
...
glslang/MachineIndependent/preprocessor/scanner.h
View file @
cfd643e4
...
...
@@ -87,6 +87,9 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "parser.h"
// Not really atom table stuff but needed first...
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
struct
SourceLoc_Rec
{
unsigned
short
file
,
line
;
...
...
@@ -114,5 +117,10 @@ void SetStringNumber(int);
void
IncLineNumber
(
void
);
void
DecLineNumber
(
void
);
int
FreeScanner
(
void
);
// Free the cpp scanner
#ifdef __cplusplus
}
#endif
#endif // !(defined(__SCANNER_H)
glslang/MachineIndependent/preprocessor/symbols.c
View file @
cfd643e4
...
...
@@ -94,7 +94,7 @@ Scope *CurrentScope = NULL;
Scope
*
GlobalScope
=
NULL
;
static
void
unlinkScope
(
void
*
_scope
)
{
Scope
*
scope
=
_scope
;
Scope
*
scope
=
(
Scope
*
)
_scope
;
if
(
scope
->
next
)
scope
->
next
->
prev
=
scope
->
prev
;
...
...
@@ -112,7 +112,7 @@ Scope *NewScopeInPool(MemoryPool *pool)
{
Scope
*
lScope
;
lScope
=
mem_Alloc
(
pool
,
sizeof
(
Scope
));
lScope
=
(
Scope
*
)
mem_Alloc
(
pool
,
sizeof
(
Scope
));
lScope
->
pool
=
pool
;
lScope
->
parent
=
NULL
;
lScope
->
funScope
=
NULL
;
...
...
glslang/MachineIndependent/preprocessor/tokens.c
View file @
cfd643e4
...
...
@@ -242,7 +242,7 @@ void DeleteTokenStream(TokenStream *pTok)
void
RecordToken
(
TokenStream
*
pTok
,
int
token
,
yystypepp
*
yylvalpp
)
{
const
char
*
s
;
unsigned
char
*
str
=
NULL
;
char
*
str
=
NULL
;
if
(
token
>
256
)
lAddByte
(
pTok
,
(
unsigned
char
)((
token
&
0x7f
)
+
0x80
));
...
...
@@ -259,10 +259,10 @@ void RecordToken(TokenStream *pTok, int token, yystypepp * yylvalpp)
break
;
case
CPP_FLOATCONSTANT
:
case
CPP_INTCONSTANT
:
str
=
yylvalpp
->
symbol_name
;
str
=
yylvalpp
->
symbol_name
;
while
(
*
str
){
lAddByte
(
pTok
,(
unsigned
char
)
*
str
);
*
str
++
;
lAddByte
(
pTok
,
(
unsigned
char
)
*
str
);
str
++
;
}
lAddByte
(
pTok
,
0
);
break
;
...
...
@@ -398,7 +398,7 @@ static int scan_token(TokenInputSrc *in, yystypepp * yylvalpp)
int
ReadFromTokenStream
(
TokenStream
*
ts
,
int
name
,
int
(
*
final
)(
CPPStruct
*
))
{
TokenInputSrc
*
in
=
malloc
(
sizeof
(
TokenInputSrc
));
TokenInputSrc
*
in
=
(
TokenInputSrc
*
)
malloc
(
sizeof
(
TokenInputSrc
));
memset
(
in
,
0
,
sizeof
(
TokenInputSrc
));
in
->
base
.
name
=
name
;
in
->
base
.
prev
=
cpp
->
currentInput
;
...
...
@@ -426,12 +426,14 @@ static int reget_token(UngotToken *t, yystypepp * yylvalpp)
return
token
;
}
typedef
int
(
*
scanFnPtr_t
)(
struct
InputSrc
*
,
yystypepp
*
);
void
UngetToken
(
int
token
,
yystypepp
*
yylvalpp
)
{
UngotToken
*
t
=
malloc
(
sizeof
(
UngotToken
));
UngotToken
*
t
=
(
UngotToken
*
)
malloc
(
sizeof
(
UngotToken
));
memset
(
t
,
0
,
sizeof
(
UngotToken
));
t
->
token
=
token
;
t
->
lval
=
*
yylvalpp
;
t
->
base
.
scan
=
(
void
*
)
reget_token
;
t
->
base
.
scan
=
(
scanFnPtr_t
)
reget_token
;
t
->
base
.
prev
=
cpp
->
currentInput
;
t
->
base
.
name
=
cpp
->
currentInput
->
name
;
t
->
base
.
line
=
cpp
->
currentInput
->
line
;
...
...
glslang/OSDependent/Linux/Makefile
View file @
cfd643e4
...
...
@@ -9,12 +9,11 @@
INCLUDE
=
-I
.
-I
../..
-I
../../Include
-I
../../../OGLCompilersDLL
WARNINGS
=
-Wall
-Wwrite-strings
-Wpointer-arith
-Wcast-align
-Wstrict-prototypes
\
-Wnested-externs
DEFINE
=
-Dlinux
-D__i386__
CPP
=
g++
CPPOPTIONS
=
-O3
-Wno-deprecated
-D_ALT_NS
=
1
CPPOPTIONS
=
-g
-Wno-deprecated
-D_ALT_NS
=
1
CPPFLAGS
=
$(CPPOPTIONS)
$(
DEFINE)
$(
INCLUDE)
CPPOPTIONS
=
-O3
-Wno-deprecated
-D_ALT_NS
=
1
-fPIC
CPPOPTIONS
=
-g
-Wno-deprecated
-D_ALT_NS
=
1
-fPIC
CPPFLAGS
=
$(CPPOPTIONS)
$(INCLUDE)
#
# Linking related
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment