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
200b2734
Commit
200b2734
authored
Dec 12, 2012
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring up to date with VS 10 express.
git-svn-id:
https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@19945
e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent
a0af473a
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
96 additions
and
77 deletions
+96
-77
StandAlone.sln
StandAlone.sln
+18
-21
StandAlone.cpp
StandAlone/StandAlone.cpp
+3
-2
Common.h
glslang/Include/Common.h
+5
-4
InfoSink.h
glslang/Include/InfoSink.h
+5
-5
Initialize.cpp
glslang/MachineIndependent/Initialize.cpp
+14
-13
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+5
-4
PoolAlloc.cpp
glslang/MachineIndependent/PoolAlloc.cpp
+3
-2
SymbolTable.cpp
glslang/MachineIndependent/SymbolTable.cpp
+3
-2
glslang.l
glslang/MachineIndependent/glslang.l
+2
-2
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+17
-12
parseConst.cpp
glslang/MachineIndependent/parseConst.cpp
+9
-6
atom.c
glslang/MachineIndependent/preprocessor/atom.c
+2
-0
cpp.c
glslang/MachineIndependent/preprocessor/cpp.c
+2
-0
scanner.c
glslang/MachineIndependent/preprocessor/scanner.c
+2
-0
tokens.c
glslang/MachineIndependent/preprocessor/tokens.c
+6
-4
No files found.
StandAlone.sln
View file @
200b2734
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests - StandAlone", "StandAlone.vcproj", "{660D0A05-69A9-4F09-9664-02FBEB08FAE2}"
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StandAlone", "StandAlone.vcxproj", "{660D0A05-69A9-4F09-9664-02FBEB08FAE2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "
Targets - glslang (generic)", "glslang.vc
proj", "{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "
glslang", "glslang.vcx
proj", "{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = UserM_Debug
ConfigName.1 = UserM_Release
GlobalSection(SolutionConfiguration
Platforms
) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.0 = {3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.ActiveCfg = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Debug|Win32.Build.0 = Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.ActiveCfg = Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.Release|Win32.Build.0 = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.ActiveCfg = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Debug|Win32.Build.0 = Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.ActiveCfg = Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.UserM_Debug.ActiveCfg = UserM_Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.UserM_Debug.Build.0 = UserM_Debug|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.UserM_Release.ActiveCfg = UserM_Release|Win32
{660D0A05-69A9-4F09-9664-02FBEB08FAE2}.UserM_Release.Build.0 = UserM_Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.UserM_Debug.ActiveCfg = UserM_Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.UserM_Debug.Build.0 = UserM_Debug|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.UserM_Release.ActiveCfg = UserM_Release|Win32
{3B146CC5-B2B8-4573-9D46-6139E2EDFEA3}.UserM_Release.Build.0 = UserM_Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
StandAlone/StandAlone.cpp
View file @
200b2734
...
...
@@ -284,13 +284,14 @@ void usage()
# define MAX_SOURCE_STRINGS 5
char
**
ReadFileData
(
char
*
fileName
)
{
FILE
*
in
=
fopen
(
fileName
,
"r"
);
FILE
*
in
;
int
errorCode
=
fopen_s
(
&
in
,
fileName
,
"r"
);
char
*
fdata
;
int
count
=
0
;
char
**
return_data
=
(
char
**
)
malloc
(
MAX_SOURCE_STRINGS
+
1
);
//return_data[MAX_SOURCE_STRINGS]=NULL;
if
(
!
in
)
{
if
(
errorCode
)
{
printf
(
"Error: unable to open input file: %s
\n
"
,
fileName
);
return
0
;
}
...
...
glslang/Include/Common.h
View file @
200b2734
...
...
@@ -158,7 +158,7 @@ inline const TString String(const int i, const int base = 10)
char
text
[
16
];
// 32 bit ints are at most 10 digits in base 10
#ifdef _WIN32
itoa
(
i
,
text
,
base
);
_itoa_s
(
i
,
text
,
base
);
#else
// we assume base 10 for all cases
sprintf
(
text
,
"%d"
,
i
);
...
...
@@ -172,15 +172,16 @@ const unsigned int SourceLocStringShift = 16;
__inline
TPersistString
FormatSourceLoc
(
const
TSourceLoc
loc
)
{
char
locText
[
64
];
const
int
maxSize
=
64
;
char
locText
[
maxSize
];
int
string
=
loc
>>
SourceLocStringShift
;
int
line
=
loc
&
SourceLocLineMask
;
if
(
line
)
sprintf
(
locText
,
"%d:%d"
,
string
,
line
);
sprintf
_s
(
locText
,
maxSize
,
"%d:%d"
,
string
,
line
);
else
sprintf
(
locText
,
"%d:? "
,
string
);
sprintf
_s
(
locText
,
maxSize
,
"%d:? "
,
string
);
return
TPersistString
(
locText
);
}
...
...
glslang/Include/InfoSink.h
View file @
200b2734
...
...
@@ -72,11 +72,11 @@ public:
TInfoSinkBase
&
operator
<<
(
const
char
*
s
)
{
append
(
s
);
return
*
this
;
}
TInfoSinkBase
&
operator
<<
(
int
n
)
{
append
(
String
(
n
));
return
*
this
;
}
TInfoSinkBase
&
operator
<<
(
const
unsigned
int
n
)
{
append
(
String
(
n
));
return
*
this
;
}
TInfoSinkBase
&
operator
<<
(
float
n
)
{
c
har
buf
[
40
];
sprintf
(
buf
,
(
fabs
(
n
)
>
1e-8
&&
fabs
(
n
)
<
1e8
)
||
n
==
0
.
0
f
?
"%f"
:
"%g"
,
n
);
append
(
buf
);
return
*
this
;
}
TInfoSinkBase
&
operator
<<
(
float
n
)
{
c
onst
int
size
=
40
;
char
buf
[
size
];
sprintf_s
(
buf
,
size
,
(
fabs
(
n
)
>
1e-8
&&
fabs
(
n
)
<
1e8
)
||
n
==
0
.
0
f
?
"%f"
:
"%g"
,
n
);
append
(
buf
);
return
*
this
;
}
TInfoSinkBase
&
operator
+
(
const
TPersistString
&
t
)
{
append
(
t
);
return
*
this
;
}
TInfoSinkBase
&
operator
+
(
const
TString
&
t
)
{
append
(
t
);
return
*
this
;
}
TInfoSinkBase
&
operator
<<
(
const
TString
&
t
)
{
append
(
t
);
return
*
this
;
}
...
...
glslang/MachineIndependent/Initialize.cpp
View file @
200b2734
...
...
@@ -728,41 +728,42 @@ void TBuiltIns::initialize(const TBuiltInResource &resources)
// Implementation dependent constants. The example values below
// are the minimum values allowed for these maximums.
//
char
builtInConstant
[
80
];
sprintf
(
builtInConstant
,
"const int gl_MaxLights = %d;"
,
resources
.
maxLights
);
// GL 1.0
const
int
maxSize
=
80
;
char
builtInConstant
[
maxSize
];
sprintf_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxLights = %d;"
,
resources
.
maxLights
);
// GL 1.0
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxClipPlanes = %d;"
,
resources
.
maxClipPlanes
);
// GL 1.0
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxClipPlanes = %d;"
,
resources
.
maxClipPlanes
);
// GL 1.0
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxTextureUnits = %d;"
,
resources
.
maxTextureUnits
);
// GL 1.2
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxTextureUnits = %d;"
,
resources
.
maxTextureUnits
);
// GL 1.2
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxTextureCoords = %d;"
,
resources
.
maxTextureCoords
);
// ARB_fragment_program
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxTextureCoords = %d;"
,
resources
.
maxTextureCoords
);
// ARB_fragment_program
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxVertexAttribs = %d;"
,
resources
.
maxVertexAttribs
);
// ARB_vertex_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxVertexAttribs = %d;"
,
resources
.
maxVertexAttribs
);
// ARB_vertex_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxVertexUniformComponents = %d;"
,
resources
.
maxVertexUniformComponents
);
// ARB_vertex_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxVertexUniformComponents = %d;"
,
resources
.
maxVertexUniformComponents
);
// ARB_vertex_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxVaryingFloats = %d;"
,
resources
.
maxVaryingFloats
);
// ARB_vertex_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxVaryingFloats = %d;"
,
resources
.
maxVaryingFloats
);
// ARB_vertex_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxVertexTextureImageUnits = %d;"
,
resources
.
maxVertexTextureImageUnits
);
// ARB_vertex_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxVertexTextureImageUnits = %d;"
,
resources
.
maxVertexTextureImageUnits
);
// ARB_vertex_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxCombinedTextureImageUnits = %d;"
,
resources
.
maxCombinedTextureImageUnits
);
// ARB_vertex_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxCombinedTextureImageUnits = %d;"
,
resources
.
maxCombinedTextureImageUnits
);
// ARB_vertex_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxTextureImageUnits = %d;"
,
resources
.
maxTextureImageUnits
);
// ARB_fragment_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxTextureImageUnits = %d;"
,
resources
.
maxTextureImageUnits
);
// ARB_fragment_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxFragmentUniformComponents = %d;"
,
resources
.
maxFragmentUniformComponents
);
// ARB_fragment_shader
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxFragmentUniformComponents = %d;"
,
resources
.
maxFragmentUniformComponents
);
// ARB_fragment_shader
s
.
append
(
TString
(
builtInConstant
));
sprintf
(
builtInConstant
,
"const int gl_MaxDrawBuffers = %d;"
,
resources
.
maxDrawBuffers
);
// proposed ARB_draw_buffers
sprintf
_s
(
builtInConstant
,
maxSize
,
"const int gl_MaxDrawBuffers = %d;"
,
resources
.
maxDrawBuffers
);
// proposed ARB_draw_buffers
s
.
append
(
TString
(
builtInConstant
));
//
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
200b2734
...
...
@@ -203,12 +203,13 @@ void TParseContext::recover()
void
C_DECL
TParseContext
::
error
(
TSourceLoc
nLine
,
const
char
*
szReason
,
const
char
*
szToken
,
const
char
*
szExtraInfoFormat
,
...)
{
char
szExtraInfo
[
400
];
const
int
maxSize
=
400
;
char
szExtraInfo
[
maxSize
];
va_list
marker
;
va_start
(
marker
,
szExtraInfoFormat
);
_vsnprintf
(
szExtraInfo
,
sizeof
(
szExtraInfo
),
szExtraInfoFormat
,
marker
);
_vsnprintf
_s
(
szExtraInfo
,
maxSize
,
sizeof
(
szExtraInfo
),
szExtraInfoFormat
,
marker
);
/* VC++ format: file(linenum) : error #: 'token' : extrainfo */
infoSink
.
info
.
prefix
(
EPrefixError
);
...
...
@@ -1126,8 +1127,8 @@ TIntermTyped* TParseContext::addConstructor(TIntermNode* node, const TType* type
newNode
=
constructBuiltIn
(
type
,
op
,
*
p
,
node
->
getLine
(),
true
);
if
(
newNode
)
{
sequenceVector
.
erase
(
p
);
sequenceVector
.
insert
(
p
,
newNode
);
p
=
sequenceVector
.
erase
(
p
);
p
=
sequenceVector
.
insert
(
p
,
newNode
);
}
}
...
...
glslang/MachineIndependent/PoolAlloc.cpp
View file @
200b2734
...
...
@@ -193,11 +193,12 @@ void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, ch
{
for
(
int
x
=
0
;
x
<
guardBlockSize
;
x
++
)
{
if
(
blockMem
[
x
]
!=
val
)
{
const
int
maxSize
=
80
;
char
assertMsg
[
80
];
// We don't print the assert message. It's here just to be helpful.
sprintf
(
assertMsg
,
"PoolAlloc: Damage %s %lu byte allocation at 0x%p
\n
"
,
locText
,
size
,
data
());
sprintf
_s
(
assertMsg
,
maxSize
,
"PoolAlloc: Damage %s %lu byte allocation at 0x%p
\n
"
,
locText
,
size
,
data
());
assert
(
0
&&
"PoolAlloc: Damage in guard block"
);
}
}
...
...
glslang/MachineIndependent/SymbolTable.cpp
View file @
200b2734
...
...
@@ -81,8 +81,9 @@ void TType::buildMangledName(TString& mangledName)
mangledName
+=
static_cast
<
char
>
(
'0'
+
getNominalSize
());
if
(
isArray
())
{
char
buf
[
10
];
sprintf
(
buf
,
"%d"
,
arraySize
);
const
int
maxSize
=
10
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"%d"
,
arraySize
);
mangledName
+=
'['
;
mangledName
+=
buf
;
mangledName
+=
']'
;
...
...
glslang/MachineIndependent/glslang.l
View file @
200b2734
...
...
@@ -59,7 +59,7 @@ O [0-7]
#include <stdio.h>
#include <stdlib.h>
#include "ParseHelper.h"
#include "glslang_tab.h"
#include "glslang_tab.
cpp.
h"
/* windows only pragma */
#ifdef _MSC_VER
...
...
@@ -84,7 +84,7 @@ TSourceLoc yylineno;
%option noyywrap
%option never-interactive
%option outfile="
G
en_glslang.cpp"
%option outfile="
g
en_glslang.cpp"
%x FIELDS
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
200b2734
...
...
@@ -55,19 +55,21 @@ public:
TString
TType
::
getCompleteString
()
const
{
char
buf
[
100
];
const
int
maxSize
=
100
;
char
buf
[
maxSize
];
char
*
p
=
&
buf
[
0
];
char
*
end
=
&
buf
[
maxSize
];
if
(
qualifier
!=
EvqTemporary
&&
qualifier
!=
EvqGlobal
)
p
+=
sprintf
(
p
,
"%s "
,
getQualifierString
());
p
+=
sprintf
_s
(
p
,
end
-
p
,
"%s "
,
getQualifierString
());
if
(
array
)
p
+=
sprintf
(
p
,
"array of "
);
p
+=
sprintf
_s
(
p
,
end
-
p
,
"array of "
);
if
(
matrix
)
p
+=
sprintf
(
p
,
"%dX%d matrix of "
,
size
,
size
);
p
+=
sprintf
_s
(
p
,
end
-
p
,
"%dX%d matrix of "
,
size
,
size
);
else
if
(
size
>
1
)
p
+=
sprintf
(
p
,
"%d-component vector of "
,
size
);
p
+=
sprintf
_s
(
p
,
end
-
p
,
"%d-component vector of "
,
size
);
sprintf
(
p
,
"%s"
,
getBasicString
());
sprintf
_s
(
p
,
end
-
p
,
"%s"
,
getBasicString
());
return
TString
(
buf
);
}
...
...
@@ -101,8 +103,9 @@ void OutputSymbol(TIntermSymbol* node, TIntermTraverser* it)
OutputTreeText
(
oit
->
infoSink
,
node
,
oit
->
depth
);
char
buf
[
100
];
sprintf
(
buf
,
"'%s' (%s)
\n
"
,
const
int
maxSize
=
100
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"'%s' (%s)
\n
"
,
node
->
getSymbol
().
c_str
(),
node
->
getCompleteString
().
c_str
());
...
...
@@ -380,16 +383,18 @@ void OutputConstantUnion(TIntermConstantUnion* node, TIntermTraverser* it)
break
;
case
EbtFloat
:
{
char
buf
[
300
];
sprintf
(
buf
,
"%f (%s)"
,
node
->
getUnionArrayPointer
()[
i
].
getFConst
(),
"const float"
);
const
int
maxSize
=
300
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"%f (%s)"
,
node
->
getUnionArrayPointer
()[
i
].
getFConst
(),
"const float"
);
out
.
debug
<<
buf
<<
"
\n
"
;
}
break
;
case
EbtInt
:
{
char
buf
[
300
];
sprintf
(
buf
,
"%d (%s)"
,
node
->
getUnionArrayPointer
()[
i
].
getIConst
(),
"const int"
);
const
int
maxSize
=
300
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"%d (%s)"
,
node
->
getUnionArrayPointer
()[
i
].
getIConst
(),
"const int"
);
out
.
debug
<<
buf
<<
"
\n
"
;
break
;
...
...
glslang/MachineIndependent/parseConst.cpp
View file @
200b2734
...
...
@@ -80,8 +80,9 @@ bool ParseBinary(bool /* preVisit */, TIntermBinary* node, TIntermTraverser* it)
TQualifier
qualifier
=
node
->
getType
().
getQualifier
();
if
(
qualifier
!=
EvqConst
)
{
char
buf
[
200
];
sprintf
(
buf
,
"'constructor' : assigning non-constant to %s"
,
oit
->
type
.
getCompleteString
().
c_str
());
const
int
maxSize
=
200
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"'constructor' : assigning non-constant to %s"
,
oit
->
type
.
getCompleteString
().
c_str
());
oit
->
infoSink
.
info
.
message
(
EPrefixError
,
buf
,
node
->
getLine
());
oit
->
error
=
true
;
return
false
;
...
...
@@ -96,8 +97,9 @@ bool ParseUnary(bool /* preVisit */, TIntermUnary* node, TIntermTraverser* it)
{
TConstTraverser
*
oit
=
static_cast
<
TConstTraverser
*>
(
it
);
char
buf
[
200
];
sprintf
(
buf
,
"'constructor' : assigning non-constant to '%s'"
,
oit
->
type
.
getCompleteString
().
c_str
());
const
int
maxSize
=
200
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"'constructor' : assigning non-constant to '%s'"
,
oit
->
type
.
getCompleteString
().
c_str
());
oit
->
infoSink
.
info
.
message
(
EPrefixError
,
buf
,
node
->
getLine
());
oit
->
error
=
true
;
return
false
;
...
...
@@ -108,8 +110,9 @@ bool ParseAggregate(bool /* preVisit */, TIntermAggregate* node, TIntermTraverse
TConstTraverser
*
oit
=
static_cast
<
TConstTraverser
*>
(
it
);
if
(
!
node
->
isConstructor
()
&&
node
->
getOp
()
!=
EOpComma
)
{
char
buf
[
200
];
sprintf
(
buf
,
"'constructor' : assigning non-constant to '%s'"
,
oit
->
type
.
getCompleteString
().
c_str
());
const
int
maxSize
=
200
;
char
buf
[
maxSize
];
sprintf_s
(
buf
,
maxSize
,
"'constructor' : assigning non-constant to '%s'"
,
oit
->
type
.
getCompleteString
().
c_str
());
oit
->
infoSink
.
info
.
message
(
EPrefixError
,
buf
,
node
->
getLine
());
oit
->
error
=
true
;
return
false
;
...
...
glslang/MachineIndependent/preprocessor/atom.c
View file @
200b2734
...
...
@@ -79,6 +79,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// atom.c
//
#define _CRT_SECURE_NO_WARNINGS
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
...
...
glslang/MachineIndependent/preprocessor/cpp.c
View file @
200b2734
...
...
@@ -78,6 +78,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// cpp.c
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
...
...
glslang/MachineIndependent/preprocessor/scanner.c
View file @
200b2734
...
...
@@ -78,6 +78,8 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// scanner.c
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
...
...
glslang/MachineIndependent/preprocessor/tokens.c
View file @
200b2734
...
...
@@ -77,6 +77,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// tokens.c
//
#define _CRT_SECURE_NO_WARNINGS
#include <assert.h>
#include <stdlib.h>
...
...
@@ -437,6 +438,7 @@ void UngetToken(int token, yystypepp * yylvalpp) {
void
DumpTokenStream
(
FILE
*
fp
,
TokenStream
*
s
,
yystypepp
*
yylvalpp
)
{
int
token
;
const
int
maxSize
=
100
;
char
str
[
100
];
if
(
fp
==
0
)
fp
=
stdout
;
...
...
@@ -445,10 +447,10 @@ void DumpTokenStream(FILE *fp, TokenStream *s, yystypepp * yylvalpp) {
switch
(
token
)
{
case
CPP_IDENTIFIER
:
case
CPP_TYPEIDENTIFIER
:
sprintf
(
str
,
"%s "
,
GetAtomString
(
atable
,
yylvalpp
->
sc_ident
));
sprintf
_s
(
str
,
maxSize
,
"%s "
,
GetAtomString
(
atable
,
yylvalpp
->
sc_ident
));
break
;
case
CPP_STRCONSTANT
:
sprintf
(
str
,
"
\"
%s
\"
"
,
GetAtomString
(
atable
,
yylvalpp
->
sc_ident
));
sprintf
_s
(
str
,
maxSize
,
"
\"
%s
\"
"
,
GetAtomString
(
atable
,
yylvalpp
->
sc_ident
));
break
;
case
CPP_FLOATCONSTANT
:
//printf("%g9.6 ", yylvalpp->sc_fval);
...
...
@@ -458,9 +460,9 @@ void DumpTokenStream(FILE *fp, TokenStream *s, yystypepp * yylvalpp) {
break
;
default:
if
(
token
>=
127
)
sprintf
(
str
,
"%s "
,
GetAtomString
(
atable
,
token
));
sprintf
_s
(
str
,
maxSize
,
"%s "
,
GetAtomString
(
atable
,
token
));
else
sprintf
(
str
,
"%c"
,
token
);
sprintf
_s
(
str
,
maxSize
,
"%c"
,
token
);
break
;
}
CPPDebugLogMsg
(
str
);
...
...
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