Encapsulate warnings like errors. Add warning for missing #version.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22041 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
a622cf2dc5
commit
c59d0cd9e6
6 changed files with 55 additions and 45 deletions
|
|
@ -207,7 +207,6 @@ void C_DECL TParseContext::error(TSourceLoc nLine, const char *szReason, const c
|
|||
|
||||
safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, marker);
|
||||
|
||||
/* VC++ format: file(linenum) : error #: 'token' : extrainfo */
|
||||
infoSink.info.prefix(EPrefixError);
|
||||
infoSink.info.location(nLine);
|
||||
infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n";
|
||||
|
|
@ -217,6 +216,27 @@ void C_DECL TParseContext::error(TSourceLoc nLine, const char *szReason, const c
|
|||
++numErrors;
|
||||
}
|
||||
|
||||
void C_DECL TParseContext::warn(TSourceLoc nLine, const char *szReason, const char *szToken,
|
||||
const char *szExtraInfoFormat, ...)
|
||||
{
|
||||
if (messages & EShMsgSuppressWarnings)
|
||||
return;
|
||||
|
||||
const int maxSize = GlslangMaxTokenLength + 200;
|
||||
char szExtraInfo[maxSize];
|
||||
va_list marker;
|
||||
|
||||
va_start(marker, szExtraInfoFormat);
|
||||
|
||||
safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, marker);
|
||||
|
||||
infoSink.info.prefix(EPrefixWarning);
|
||||
infoSink.info.location(nLine);
|
||||
infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n";
|
||||
|
||||
va_end(marker);
|
||||
}
|
||||
|
||||
TIntermTyped* TParseContext::handleVariable(int line, TSymbol* symbol, TString* string)
|
||||
{
|
||||
TIntermTyped* node = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue