Commit c6b3b3c7 by maxvujovic@gmail.com

Fix the compiler warnings on WebKit ports when updating ANGLE in WebKit.

Remove the varargs used for extra info formatting in the error() and warning() methods of ParseHelper. Use std::stringstream for formatting instead. Review URL: http://codereview.appspot.com/6310067/ git-svn-id: https://angleproject.googlecode.com/svn/trunk@1170 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 432d6fc4
......@@ -2235,6 +2235,8 @@ TString OutputHLSL::typeString(const TType &type)
return "samplerCUBE";
case EbtSamplerExternalOES:
return "sampler2D";
default:
break;
}
}
......
......@@ -69,9 +69,9 @@ struct TParseContext {
TInfoSink& infoSink() { return diagnostics.infoSink(); }
void error(TSourceLoc loc, const char *reason, const char* token,
const char* extraInfoFormat, ...);
const char* extraInfo="");
void warning(TSourceLoc loc, const char* reason, const char* token,
const char* extraInfoFormat, ...);
const char* extraInfo="");
void trace(const char* str);
void recover();
......
......@@ -205,7 +205,7 @@ O [0-7]
0[xX]{H}+ { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
0{O}+ { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
0{D}+ { context->error(yylineno, "Invalid Octal number.", yytext, "", ""); context->recover(); return 0;}
0{D}+ { context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;}
{D}+ { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
{D}+{E} { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
......@@ -295,20 +295,20 @@ void CPPDebugLogMsg(const char *msg)
void CPPWarningToInfoLog(const char *msg)
{
SETUP_CONTEXT(cpp);
context->warning(yylineno, msg, "", "");
context->warning(yylineno, msg, "");
}
void CPPShInfoLogMsg(const char *msg)
{
SETUP_CONTEXT(cpp);
context->error(yylineno, msg, "", "");
context->error(yylineno, msg, "");
context->recover();
}
void CPPErrorToInfoLog(const char *msg)
{
SETUP_CONTEXT(cpp);
context->error(yylineno, msg, "", "");
context->error(yylineno, msg, "");
context->recover();
}
......@@ -371,7 +371,7 @@ void HandlePragma(const char **tokens, int numTokens)
context->handlePragmaDirective(yylineno, tokens[0], tokens[2]);
}
void StoreStr(char *string)
void StoreStr(const char *string)
{
SETUP_CONTEXT(cpp);
TString strSrc;
......@@ -450,9 +450,9 @@ void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) {
context->error(yylineno, reason, "unexpected EOF", "");
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext, "");
context->error(yylineno, reason, yytext);
}
context->recover();
}
......
......@@ -1550,7 +1550,7 @@ YY_RULE_SETUP
YY_BREAK
case 101:
YY_RULE_SETUP
{ context->error(yylineno, "Invalid Octal number.", yytext, "", ""); context->recover(); return 0;}
{ context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;}
YY_BREAK
case 102:
YY_RULE_SETUP
......@@ -2971,20 +2971,20 @@ void CPPDebugLogMsg(const char *msg)
void CPPWarningToInfoLog(const char *msg)
{
SETUP_CONTEXT(cpp);
context->warning(yylineno, msg, "", "");
context->warning(yylineno, msg, "");
}
void CPPShInfoLogMsg(const char *msg)
{
SETUP_CONTEXT(cpp);
context->error(yylineno, msg, "", "");
context->error(yylineno, msg, "");
context->recover();
}
void CPPErrorToInfoLog(const char *msg)
{
SETUP_CONTEXT(cpp);
context->error(yylineno, msg, "", "");
context->error(yylineno, msg, "");
context->recover();
}
......@@ -3047,7 +3047,7 @@ void HandlePragma(const char **tokens, int numTokens)
context->handlePragmaDirective(yylineno, tokens[0], tokens[2]);
}
void StoreStr(char *string)
void StoreStr(const char *string)
{
SETUP_CONTEXT(cpp);
TString strSrc;
......@@ -3126,9 +3126,9 @@ void yyerror(TParseContext* context, const char* reason) {
struct yyguts_t* yyg = (struct yyguts_t*) context->scanner;
if (context->AfterEOF) {
context->error(yylineno, reason, "unexpected EOF", "");
context->error(yylineno, reason, "unexpected EOF");
} else {
context->error(yylineno, reason, yytext, "");
context->error(yylineno, reason, yytext);
}
context->recover();
}
......
......@@ -531,6 +531,7 @@ public:
postVisit(postVisit),
rightToLeft(rightToLeft),
depth(0) {}
virtual ~TIntermTraverser() {};
virtual void visitSymbol(TIntermSymbol*) {}
virtual void visitConstantUnion(TIntermConstantUnion*) {}
......
......@@ -308,7 +308,7 @@ struct AtomTable_Rec {
int size;
};
static AtomTable latable = { { 0 } };
static AtomTable latable = { { NULL, 0, 0 }, { NULL, 0, 0, {0} }, NULL, NULL, 0, 0 };
AtomTable *atable = &latable;
static int AddAtomFixed(AtomTable *atable, const char *s, int atom);
......
......@@ -884,10 +884,10 @@ void FreeMacro(MacroSymbol *s) {
}
void PredefineIntMacro(const char *name, int value) {
SourceLoc location = {0};
SourceLoc location = {0, 0};
Symbol *symbol = NULL;
MacroSymbol macro = {0};
yystypepp val = {0};
MacroSymbol macro = {0, NULL, NULL, 0, 0};
yystypepp val = {0, 0.0, 0, {0}};
int atom = 0;
macro.body = NewTokenStream(name, macros->pool);
......
......@@ -73,8 +73,8 @@ void CPPShInfoLogMsg(const char*); // Store cpp Err Msg into Sh.Info.Lo
void CPPWarningToInfoLog(const char *msg); // Prints warning messages into info log
void HandlePragma(const char**, int numTokens); // #pragma directive container.
void ResetTString(void); // #error Message as TString.
void CPPErrorToInfoLog(const char*); // Stick all cpp errors into Sh.Info.log .
void StoreStr(char*); // Store the TString in Parse Context.
void CPPErrorToInfoLog(const char*); // Stick all cpp errors into Sh.Info.log.
void StoreStr(const char*); // Store the TString in Parse Context.
void SetLineNumber(int); // Set line number.
void SetStringNumber(int); // Set string number.
int GetLineNumber(void); // Get the current String Number.
......
......@@ -84,6 +84,8 @@
// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
#if defined(__GNUC__)
// Triggered by the auto-generated pplval variable.
#pragma GCC diagnostic ignored "-Wuninitialized"
#elif defined(_MSC_VER)
#pragma warning(disable: 4065 4701)
#endif
......@@ -467,9 +469,9 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
0, 85, 85, 92, 93, 96, 99, 102, 105, 108,
111, 114, 117, 120, 123, 126, 129, 132, 135, 138,
151, 164, 167, 170, 173, 176, 179
0, 87, 87, 94, 95, 98, 101, 104, 107, 110,
113, 116, 119, 122, 125, 128, 131, 134, 137, 140,
153, 166, 169, 172, 175, 178, 181
};
#endif
......
......@@ -21,6 +21,8 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser.
// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
#if defined(__GNUC__)
// Triggered by the auto-generated pplval variable.
#pragma GCC diagnostic ignored "-Wuninitialized"
#elif defined(_MSC_VER)
#pragma warning(disable: 4065 4701)
#endif
......
......@@ -519,6 +519,11 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
#include "Diagnostics.h"
#include "Token.h"
#if defined(__GNUC__)
// Triggered by the auto-generated yy_fatal_error function.
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#endif
typedef std::string YYSTYPE;
typedef pp::SourceLocation YYLTYPE;
......
......@@ -28,6 +28,11 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
#include "Diagnostics.h"
#include "Token.h"
#if defined(__GNUC__)
// Triggered by the auto-generated yy_fatal_error function.
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
#endif
typedef std::string YYSTYPE;
typedef pp::SourceLocation YYLTYPE;
......
......@@ -75,7 +75,7 @@ static int eof_scan(InputSrc *is, yystypepp * yylvalpp)
static void noop(InputSrc *in, int ch, yystypepp * yylvalpp) {}
static InputSrc eof_inputsrc = { 0, &eof_scan, &eof_scan, &noop };
static InputSrc eof_inputsrc = { 0, &eof_scan, &eof_scan, &noop, 0, 0 };
static int byte_scan(InputSrc *, yystypepp * yylvalpp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment