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
8318878c
Commit
8318878c
authored
Jul 14, 2015
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile errors: about 25 .PpError didn't compile, need to be .ppError.
parent
4a22f9a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
PpScanner.cpp
glslang/MachineIndependent/preprocessor/PpScanner.cpp
+25
-25
No files found.
glslang/MachineIndependent/preprocessor/PpScanner.cpp
View file @
8318878c
...
...
@@ -138,7 +138,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
}
ch
=
getChar
();
}
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
len
=
1
;
str_len
=
1
;
}
...
...
@@ -150,7 +150,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
if
(
ch
==
'e'
||
ch
==
'E'
)
{
HasDecimalOrExponent
=
true
;
if
(
len
>=
TPpToken
::
maxTokenLength
)
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
len
=
1
;
str_len
=
1
;
}
else
{
...
...
@@ -169,13 +169,13 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
str
[
len
++
]
=
(
char
)
ch
;
ch
=
getChar
();
}
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
len
=
1
;
str_len
=
1
;
}
}
}
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"bad character in float exponent"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"bad character in float exponent"
,
""
,
""
);
}
}
}
...
...
@@ -187,7 +187,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
if
(
ch
==
'l'
||
ch
==
'L'
)
{
parseContext
.
doubleCheck
(
ppToken
->
loc
,
"double floating-point suffix"
);
if
(
!
HasDecimalOrExponent
)
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal needs a decimal point or exponent"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal needs a decimal point or exponent"
,
""
,
""
);
int
ch2
=
getChar
();
if
(
ch2
!=
'f'
&&
ch2
!=
'F'
)
{
ungetChar
();
...
...
@@ -198,7 +198,7 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
str
[
len
++
]
=
(
char
)
ch2
;
isDouble
=
1
;
}
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
len
=
1
,
str_len
=
1
;
}
}
...
...
@@ -207,11 +207,11 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
if
(
!
parseContext
.
relaxedErrors
())
parseContext
.
profileRequires
(
ppToken
->
loc
,
~
EEsProfile
,
120
,
nullptr
,
"floating-point suffix"
);
if
(
!
HasDecimalOrExponent
)
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal needs a decimal point or exponent"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal needs a decimal point or exponent"
,
""
,
""
);
if
(
len
<
TPpToken
::
maxTokenLength
)
str
[
len
++
]
=
(
char
)
ch
;
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"float literal too long"
,
""
,
""
);
len
=
1
,
str_len
=
1
;
}
}
else
...
...
@@ -276,7 +276,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
ch
=
pp
->
getChar
();
}
else
{
if
(
!
AlreadyComplained
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"name too long"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"name too long"
,
""
,
""
);
AlreadyComplained
=
1
;
}
ch
=
pp
->
getChar
();
...
...
@@ -319,11 +319,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
}
else
if
(
ch
>=
'a'
&&
ch
<=
'f'
)
{
ii
=
ch
-
'a'
+
10
;
}
else
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"bad digit in hexidecimal literal"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"bad digit in hexidecimal literal"
,
""
,
""
);
ival
=
(
ival
<<
4
)
|
ii
;
}
else
{
if
(
!
AlreadyComplained
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"hexidecimal literal too big"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"hexidecimal literal too big"
,
""
,
""
);
AlreadyComplained
=
1
;
}
ival
=
0xffffffff
;
...
...
@@ -333,7 +333,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
(
ch
>=
'A'
&&
ch
<=
'F'
)
||
(
ch
>=
'a'
&&
ch
<=
'f'
));
}
else
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"bad digit in hexidecimal literal"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"bad digit in hexidecimal literal"
,
""
,
""
);
}
if
(
ch
==
'u'
||
ch
==
'U'
)
{
if
(
len
<
TPpToken
::
maxTokenLength
)
...
...
@@ -361,7 +361,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if
(
len
<
TPpToken
::
maxTokenLength
)
ppToken
->
name
[
len
++
]
=
(
char
)
ch
;
else
if
(
!
AlreadyComplained
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
AlreadyComplained
=
1
;
}
if
(
ival
<=
0x1fffffff
)
{
...
...
@@ -379,7 +379,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if
(
len
<
TPpToken
::
maxTokenLength
)
ppToken
->
name
[
len
++
]
=
(
char
)
ch
;
else
if
(
!
AlreadyComplained
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
AlreadyComplained
=
1
;
}
ch
=
pp
->
getChar
();
...
...
@@ -390,7 +390,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
// wasn't a float, so must be octal...
if
(
nonOctal
)
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"octal literal digit too large"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"octal literal digit too large"
,
""
,
""
);
if
(
ch
==
'u'
||
ch
==
'U'
)
{
if
(
len
<
TPpToken
::
maxTokenLength
)
...
...
@@ -401,7 +401,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
ppToken
->
name
[
len
]
=
'\0'
;
if
(
octalOverflow
)
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"octal literal too big"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"octal literal too big"
,
""
,
""
);
ppToken
->
ival
=
(
int
)
ival
;
...
...
@@ -419,7 +419,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
if
(
len
<
TPpToken
::
maxTokenLength
)
ppToken
->
name
[
len
++
]
=
(
char
)
ch
;
else
if
(
!
AlreadyComplained
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"numeric literal too long"
,
""
,
""
);
AlreadyComplained
=
1
;
}
ch
=
pp
->
getChar
();
...
...
@@ -444,7 +444,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
for
(
int
i
=
0
;
i
<
numericLen
;
i
++
)
{
ch
=
ppToken
->
name
[
i
]
-
'0'
;
if
((
ival
>
oneTenthMaxInt
)
||
(
ival
==
oneTenthMaxInt
&&
ch
>
remainderMaxInt
))
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"numeric literal too big"
,
""
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"numeric literal too big"
,
""
,
""
);
ival
=
0xFFFFFFFFu
;
break
;
}
else
...
...
@@ -627,14 +627,14 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
do
{
while
(
ch
!=
'*'
)
{
if
(
ch
==
EOF
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"EOF in comment"
,
"comment"
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"EOF in comment"
,
"comment"
,
""
);
return
endOfInput
;
}
ch
=
pp
->
getChar
();
}
ch
=
pp
->
getChar
();
if
(
ch
==
EOF
)
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"EOF in comment"
,
"comment"
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"EOF in comment"
,
"comment"
,
""
);
return
endOfInput
;
}
}
while
(
ch
!=
'/'
);
...
...
@@ -663,7 +663,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
ppToken
->
atom
=
pp
->
LookUpAddString
(
tokenText
);
return
CPP_STRCONSTANT
;
}
else
{
pp
->
parseContext
.
P
pError
(
ppToken
->
loc
,
"end of line in string"
,
"string"
,
""
);
pp
->
parseContext
.
p
pError
(
ppToken
->
loc
,
"end of line in string"
,
"string"
,
""
);
return
CPP_ERROR_SY
;
}
}
...
...
@@ -700,7 +700,7 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
}
continue
;
}
else
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"preprocessor directive cannot be preceded by another token"
,
"#"
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"preprocessor directive cannot be preceded by another token"
,
"#"
,
""
);
return
nullptr
;
}
}
...
...
@@ -719,10 +719,10 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
token
==
CPP_FLOATCONSTANT
||
token
==
CPP_DOUBLECONSTANT
)
tokenString
=
ppToken
->
name
;
else
if
(
token
==
CPP_STRCONSTANT
)
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"string literals not supported"
,
"
\"\"
"
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"string literals not supported"
,
"
\"\"
"
,
""
);
tokenString
=
nullptr
;
}
else
if
(
token
==
'\''
)
{
parseContext
.
P
pError
(
ppToken
->
loc
,
"character literals not supported"
,
"
\'
"
,
""
);
parseContext
.
p
pError
(
ppToken
->
loc
,
"character literals not supported"
,
"
\'
"
,
""
);
tokenString
=
nullptr
;
}
else
tokenString
=
GetAtomString
(
token
);
...
...
@@ -740,7 +740,7 @@ const char* TPpContext::tokenize(TPpToken* ppToken)
void
TPpContext
::
missingEndifCheck
()
{
if
(
ifdepth
>
0
)
parseContext
.
P
pError
(
parseContext
.
getCurrentLoc
(),
"missing #endif"
,
""
,
""
);
parseContext
.
p
pError
(
parseContext
.
getCurrentLoc
(),
"missing #endif"
,
""
,
""
);
}
}
// end namespace glslang
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