1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
|
diff --git a/include/GLSLANG/ShaderLang.h b/include/GLSLANG/ShaderLang.h
index e750e32..7d3f415 100644
--- a/include/GLSLANG/ShaderLang.h
+++ b/include/GLSLANG/ShaderLang.h
@@ -25,7 +25,7 @@
#include <stddef.h>
-#include "KHR/khrplatform.h"
+#include "khrplatform.h"
#include <map>
#include <string>
diff --git a/src/common/mathutil.h b/src/common/mathutil.h
index 9f5c9fd..7959da8 100644
--- a/src/common/mathutil.h
+++ b/src/common/mathutil.h
@@ -478,7 +478,7 @@ inline unsigned int average(unsigned int a, unsigned int b)
inline signed int average(signed int a, signed int b)
{
- return ((long long)a + (long long)b) / 2;
+ return (signed int)((long long)a + (long long)b) / 2;
}
inline float average(float a, float b)
diff --git a/src/common/version.h b/src/common/version.h
index 758c78d..2a44709 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -7,7 +7,7 @@
#ifndef COMMON_VERSION_H_
#define COMMON_VERSION_H_
-#include "id/commit.h"
+#include "commit.h"
#define ANGLE_MAJOR_VERSION 2
#define ANGLE_MINOR_VERSION 1
diff --git a/src/compiler/preprocessor/ExpressionParser.cpp b/src/compiler/preprocessor/ExpressionParser.cpp
index 683195c..851183e 100644
--- a/src/compiler/preprocessor/ExpressionParser.cpp
+++ b/src/compiler/preprocessor/ExpressionParser.cpp
@@ -1,5 +1,7 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
+/* Apple Note: For the avoidance of doubt, Apple elects to distribute this file under the terms of the BSD license. */
+
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
index 75df434..dd9d41a 100644
--- a/src/compiler/preprocessor/Tokenizer.cpp
+++ b/src/compiler/preprocessor/Tokenizer.cpp
@@ -6,6 +6,11 @@
//
// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
+// This file was edited anyways to ignore clang warnings.
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma GCC diagnostic ignored "-Wunneeded-internal-declaration"
+#endif
diff --git a/src/compiler/translator/CallDAG.cpp b/src/compiler/translator/CallDAG.cpp
index 1d1eb8b..95dbea1 100644
--- a/src/compiler/translator/CallDAG.cpp
+++ b/src/compiler/translator/CallDAG.cpp
@@ -71,10 +71,10 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
record.callees.reserve(data.callees.size());
for (auto &callee : data.callees)
{
- record.callees.push_back(callee->index);
+ record.callees.push_back(static_cast<int>(callee->index));
}
- (*idToIndex)[data.node->getFunctionId()] = data.index;
+ (*idToIndex)[data.node->getFunctionId()] = static_cast<int>(data.index);
}
}
diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp
index 8b5b12f..5c029ba 100644
--- a/src/compiler/translator/Compiler.cpp
+++ b/src/compiler/translator/Compiler.cpp
@@ -528,15 +528,15 @@ bool TCompiler::checkCallDepth()
infoSink.info << "Call stack too deep (larger than " << maxCallStackDepth
<< ") with the following call chain: " << record.name;
- int currentFunction = i;
+ signed long long currentFunction = i;
int currentDepth = depth;
while (currentFunction != -1)
{
- infoSink.info << " -> " << mCallDag.getRecordFromIndex(currentFunction).name;
+ infoSink.info << " -> " << mCallDag.getRecordFromIndex(static_cast<size_t>(currentFunction)).name;
int nextFunction = -1;
- for (auto& calleeIndex : mCallDag.getRecordFromIndex(currentFunction).callees)
+ for (auto& calleeIndex : mCallDag.getRecordFromIndex(static_cast<size_t>(currentFunction)).callees)
{
if (depths[calleeIndex] == currentDepth - 1)
{
@@ -558,7 +558,7 @@ bool TCompiler::checkCallDepth()
bool TCompiler::tagUsedFunctions()
{
// Search from main, starting from the end of the DAG as it usually is the root.
- for (int i = mCallDag.size(); i-- > 0;)
+ for (size_t i = mCallDag.size(); i--;)
{
if (mCallDag.getRecordFromIndex(i).name == "main(")
{
diff --git a/src/compiler/translator/ParseContext.cpp b/src/compiler/translator/ParseContext.cpp
index cd7ffc4..1cd787c 100644
--- a/src/compiler/translator/ParseContext.cpp
+++ b/src/compiler/translator/ParseContext.cpp
@@ -511,7 +511,7 @@ bool TParseContext::constructorErrorCheck(const TSourceLoc& line, TIntermNode* n
{
if (type->isUnsizedArray())
{
- type->setArraySize(function.getParamCount());
+ type->setArraySize(static_cast<int>(function.getParamCount()));
}
else if (static_cast<size_t>(type->getArraySize()) != function.getParamCount())
{
diff --git a/src/compiler/translator/VariableInfo.cpp b/src/compiler/translator/VariableInfo.cpp
index 808db95..1aa9e59 100644
--- a/src/compiler/translator/VariableInfo.cpp
+++ b/src/compiler/translator/VariableInfo.cpp
@@ -55,7 +55,7 @@ void ExpandVariable(const ShaderVariable &variable,
{
if (variable.isArray())
{
- for (size_t elementIndex = 0; elementIndex < variable.elementCount(); elementIndex++)
+ for (unsigned int elementIndex = 0; elementIndex < variable.elementCount(); elementIndex++)
{
std::string lname = name + ::ArrayString(elementIndex);
std::string lmappedName = mappedName + ::ArrayString(elementIndex);
diff --git a/src/compiler/translator/blocklayout.cpp b/src/compiler/translator/blocklayout.cpp
index 7c74105..7cc6315 100644
--- a/src/compiler/translator/blocklayout.cpp
+++ b/src/compiler/translator/blocklayout.cpp
@@ -27,7 +27,7 @@ BlockMemberInfo BlockLayoutEncoder::encodeType(GLenum type, unsigned int arraySi
getBlockLayoutInfo(type, arraySize, isRowMajorMatrix, &arrayStride, &matrixStride);
- const BlockMemberInfo memberInfo(mCurrentOffset * BytesPerComponent, arrayStride * BytesPerComponent, matrixStride * BytesPerComponent, isRowMajorMatrix);
+ const BlockMemberInfo memberInfo(static_cast<int>(mCurrentOffset * BytesPerComponent), arrayStride * BytesPerComponent, matrixStride * BytesPerComponent, isRowMajorMatrix);
advanceOffset(type, arraySize, isRowMajorMatrix, arrayStride, matrixStride);
diff --git a/src/compiler/translator/glslang_tab.cpp b/src/compiler/translator/glslang_tab.cpp
index 03cef93..6fb0d46 100644
--- a/src/compiler/translator/glslang_tab.cpp
+++ b/src/compiler/translator/glslang_tab.cpp
@@ -1,5 +1,7 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
+/* Apple Note: For the avoidance of doubt, Apple elects to distribute this file under the terms of the BSD license. */
+
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
diff --git a/src/libANGLE/Config.cpp b/src/libANGLE/Config.cpp
index 1b1fc50..2a68d5b 100644
--- a/src/libANGLE/Config.cpp
+++ b/src/libANGLE/Config.cpp
@@ -64,7 +64,7 @@ Config::Config()
EGLint ConfigSet::add(const Config &config)
{
// Set the config's ID to a small number that starts at 1 ([EGL 1.5] section 3.4)
- EGLint id = mConfigs.size() + 1;
+ EGLint id = static_cast<EGLint>(mConfigs.size() + 1);
Config copyConfig(config);
copyConfig.configID = id;
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 545284a..c8ea993 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -838,7 +838,7 @@ void Context::getIntegerv(GLenum pname, GLint *params)
case GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: *params = mCaps.maxTransformFeedbackInterleavedComponents; break;
case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: *params = mCaps.maxTransformFeedbackSeparateAttributes; break;
case GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: *params = mCaps.maxTransformFeedbackSeparateComponents; break;
- case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = mCaps.compressedTextureFormats.size(); break;
+ case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = static_cast<GLint>(mCaps.compressedTextureFormats.size()); break;
case GL_MAX_SAMPLES_ANGLE: *params = mCaps.maxSamples; break;
case GL_MAX_VIEWPORT_DIMS:
{
@@ -853,13 +853,13 @@ void Context::getIntegerv(GLenum pname, GLint *params)
*params = mResetStrategy;
break;
case GL_NUM_SHADER_BINARY_FORMATS:
- *params = mCaps.shaderBinaryFormats.size();
+ *params = static_cast<GLint>(mCaps.shaderBinaryFormats.size());
break;
case GL_SHADER_BINARY_FORMATS:
std::copy(mCaps.shaderBinaryFormats.begin(), mCaps.shaderBinaryFormats.end(), params);
break;
case GL_NUM_PROGRAM_BINARY_FORMATS:
- *params = mCaps.programBinaryFormats.size();
+ *params = static_cast<GLint>(mCaps.programBinaryFormats.size());
break;
case GL_PROGRAM_BINARY_FORMATS:
std::copy(mCaps.programBinaryFormats.begin(), mCaps.programBinaryFormats.end(), params);
@@ -939,19 +939,19 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_COMPRESSED_TEXTURE_FORMATS:
{
*type = GL_INT;
- *numParams = mCaps.compressedTextureFormats.size();
+ *numParams = static_cast<unsigned int>(mCaps.compressedTextureFormats.size());
}
return true;
case GL_PROGRAM_BINARY_FORMATS_OES:
{
*type = GL_INT;
- *numParams = mCaps.programBinaryFormats.size();
+ *numParams = static_cast<unsigned int>(mCaps.programBinaryFormats.size());
}
return true;
case GL_SHADER_BINARY_FORMATS:
{
*type = GL_INT;
- *numParams = mCaps.shaderBinaryFormats.size();
+ *numParams = static_cast<unsigned int>(mCaps.shaderBinaryFormats.size());
}
return true;
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index faee83c..3870e69 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -269,7 +269,7 @@ bool Framebuffer::hasEnabledColorAttachment() const
{
for (size_t colorAttachment = 0; colorAttachment < mData.mColorAttachments.size(); ++colorAttachment)
{
- if (isEnabledColorAttachment(colorAttachment))
+ if (static_cast<unsigned int>(isEnabledColorAttachment(colorAttachment)))
{
return true;
}
@@ -287,7 +287,7 @@ bool Framebuffer::usingExtendedDrawBuffers() const
{
for (size_t colorAttachment = 1; colorAttachment < mData.mColorAttachments.size(); ++colorAttachment)
{
- if (isEnabledColorAttachment(colorAttachment))
+ if (static_cast<unsigned int>(isEnabledColorAttachment(colorAttachment)))
{
return true;
}
diff --git a/src/libANGLE/ImageIndex.cpp b/src/libANGLE/ImageIndex.cpp
index ac7302d..538258f 100644
--- a/src/libANGLE/ImageIndex.cpp
+++ b/src/libANGLE/ImageIndex.cpp
@@ -35,7 +35,7 @@ ImageIndex ImageIndex::Make2D(GLint mipIndex)
ImageIndex ImageIndex::MakeCube(GLenum target, GLint mipIndex)
{
ASSERT(gl::IsCubeMapTextureTarget(target));
- return ImageIndex(target, mipIndex, CubeMapTextureTargetToLayerIndex(target));
+ return ImageIndex(target, mipIndex, static_cast<int>(CubeMapTextureTargetToLayerIndex(target)));
}
ImageIndex ImageIndex::Make2DArray(GLint mipIndex, GLint layerIndex)
@@ -50,7 +50,7 @@ ImageIndex ImageIndex::Make3D(GLint mipIndex, GLint layerIndex)
ImageIndex ImageIndex::MakeGeneric(GLenum target, GLint mipIndex)
{
- GLint layerIndex = IsCubeMapTextureTarget(target) ? CubeMapTextureTargetToLayerIndex(target) : ENTIRE_LEVEL;
+ GLint layerIndex = IsCubeMapTextureTarget(target) ? static_cast<GLint>(CubeMapTextureTargetToLayerIndex(target)) : ENTIRE_LEVEL;
return ImageIndex(target, mipIndex, layerIndex);
}
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index e215379..42f09b9 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -483,7 +483,7 @@ Error Program::saveBinary(GLenum *binaryFormat, void *binary, GLsizei bufSize, G
return error;
}
- GLsizei streamLength = stream.length();
+ GLsizei streamLength = static_cast<GLsizei>(stream.length());
const void *streamData = stream.data();
if (streamLength > bufSize)
@@ -645,7 +645,7 @@ void Program::getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length,
if (length)
{
- *length = strlen(name);
+ *length = static_cast<GLsizei>(strlen(name));
}
}
@@ -762,7 +762,7 @@ void Program::getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, G
if (length)
{
- *length = strlen(name);
+ *length = static_cast<GLsizei>(strlen(name));
}
}
@@ -790,7 +790,7 @@ GLint Program::getActiveUniformCount()
{
if (mLinked)
{
- return mProgram->getUniforms().size();
+ return static_cast<GLint>(mProgram->getUniforms().size());
}
else
{
@@ -804,7 +804,7 @@ GLint Program::getActiveUniformMaxLength()
if (mLinked)
{
- unsigned int numUniforms = mProgram->getUniforms().size();
+ unsigned int numUniforms = static_cast<unsigned int>(mProgram->getUniforms().size());
for (unsigned int uniformIndex = 0; uniformIndex < numUniforms; uniformIndex++)
{
if (!mProgram->getUniforms()[uniformIndex]->name.empty())
@@ -1042,7 +1042,7 @@ void Program::updateSamplerMapping()
GLuint Program::getActiveUniformBlockCount()
{
- return mProgram->getUniformBlocks().size();
+ return static_cast<GLuint>(mProgram->getUniformBlocks().size());
}
void Program::getActiveUniformBlockName(GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) const
@@ -1065,7 +1065,7 @@ void Program::getActiveUniformBlockName(GLuint uniformBlockIndex, GLsizei bufSiz
if (length)
{
- *length = strlen(uniformBlockName);
+ *length = static_cast<GLsizei>(strlen(uniformBlockName));
}
}
}
@@ -1111,13 +1111,13 @@ GLint Program::getActiveUniformBlockMaxLength()
if (mLinked)
{
- unsigned int numUniformBlocks = mProgram->getUniformBlocks().size();
+ unsigned int numUniformBlocks = static_cast<unsigned int>(mProgram->getUniformBlocks().size());
for (unsigned int uniformBlockIndex = 0; uniformBlockIndex < numUniformBlocks; uniformBlockIndex++)
{
const UniformBlock &uniformBlock = *mProgram->getUniformBlocks()[uniformBlockIndex];
if (!uniformBlock.name.empty())
{
- const int length = uniformBlock.name.length() + 1;
+ const int length = static_cast<int>(uniformBlock.name.length() + 1);
// Counting in "[0]".
const int arrayLength = (uniformBlock.isArrayElement() ? 3 : 0);
@@ -1466,7 +1466,7 @@ bool Program::areMatchingInterfaceBlocks(gl::InfoLog &infoLog, const sh::Interfa
infoLog.append("Layout qualifiers differ for interface block '%s' between vertex and fragment shaders", blockName);
return false;
}
- const unsigned int numBlockMembers = vertexInterfaceBlock.fields.size();
+ const unsigned int numBlockMembers = static_cast<unsigned int>(vertexInterfaceBlock.fields.size());
for (unsigned int blockMemberIndex = 0; blockMemberIndex < numBlockMembers; blockMemberIndex++)
{
const sh::InterfaceBlockField &vertexMember = vertexInterfaceBlock.fields[blockMemberIndex];
@@ -1510,7 +1510,7 @@ bool Program::linkValidateVariablesBase(InfoLog &infoLog, const std::string &var
infoLog.append("Structure lengths for %s differ between vertex and fragment shaders", variableName.c_str());
return false;
}
- const unsigned int numMembers = vertexVariable.fields.size();
+ const unsigned int numMembers = static_cast<unsigned int>(vertexVariable.fields.size());
for (unsigned int memberIndex = 0; memberIndex < numMembers; memberIndex++)
{
const sh::ShaderVariable &vertexMember = vertexVariable.fields[memberIndex];
diff --git a/src/libANGLE/Renderbuffer.cpp b/src/libANGLE/Renderbuffer.cpp
index 85b920b..34cc365 100644
--- a/src/libANGLE/Renderbuffer.cpp
+++ b/src/libANGLE/Renderbuffer.cpp
@@ -42,8 +42,8 @@ Error Renderbuffer::setStorage(GLenum internalformat, size_t width, size_t heigh
return error;
}
- mWidth = width;
- mHeight = height;
+ mWidth = static_cast<GLsizei>(width);
+ mHeight = static_cast<GLsizei>(height);
mInternalFormat = internalformat;
mSamples = 0;
@@ -58,10 +58,10 @@ Error Renderbuffer::setStorageMultisample(size_t samples, GLenum internalformat,
return error;
}
- mWidth = width;
- mHeight = height;
+ mWidth = static_cast<GLsizei>(width);
+ mHeight = static_cast<GLsizei>(height);
mInternalFormat = internalformat;
- mSamples = samples;
+ mSamples = static_cast<GLsizei>(samples);
return Error(GL_NO_ERROR);
}
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index 7af4ff3..5106e95 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -66,7 +66,7 @@ void Shader::setSource(GLsizei count, const char *const *string, const GLint *le
int Shader::getInfoLogLength() const
{
- return mShader->getInfoLog().empty() ? 0 : (mShader->getInfoLog().length() + 1);
+ return mShader->getInfoLog().empty() ? 0 : static_cast<int>(mShader->getInfoLog().length() + 1);
}
void Shader::getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
@@ -89,12 +89,12 @@ void Shader::getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
int Shader::getSourceLength() const
{
- return mSource.empty() ? 0 : (mSource.length() + 1);
+ return mSource.empty() ? 0 : static_cast<int>(mSource.length() + 1);
}
int Shader::getTranslatedSourceLength() const
{
- return mShader->getTranslatedSource().empty() ? 0 : (mShader->getTranslatedSource().length() + 1);
+ return mShader->getTranslatedSource().empty() ? 0 : static_cast<int>(mShader->getTranslatedSource().length() + 1);
}
void Shader::getSourceImpl(const std::string &source, GLsizei bufSize, GLsizei *length, char *buffer)
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index f731774..f6837f4 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -569,7 +569,7 @@ void State::setActiveSampler(unsigned int active)
unsigned int State::getActiveSampler() const
{
- return mActiveSampler;
+ return static_cast<unsigned int>(mActiveSampler);
}
void State::setSamplerTexture(GLenum type, Texture *texture)
@@ -1192,7 +1192,7 @@ void State::getIntegerv(const gl::Data &data, GLenum pname, GLint *params)
case GL_UNPACK_ROW_LENGTH: *params = mUnpack.rowLength; break;
case GL_GENERATE_MIPMAP_HINT: *params = mGenerateMipmapHint; break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: *params = mFragmentShaderDerivativeHint; break;
- case GL_ACTIVE_TEXTURE: *params = (mActiveSampler + GL_TEXTURE0); break;
+ case GL_ACTIVE_TEXTURE: *params = static_cast<GLint>(mActiveSampler + GL_TEXTURE0); break;
case GL_STENCIL_FUNC: *params = mDepthStencil.stencilFunc; break;
case GL_STENCIL_REF: *params = mStencilRef; break;
case GL_STENCIL_VALUE_MASK: *params = clampToInt(mDepthStencil.stencilMask); break;
@@ -1316,19 +1316,19 @@ void State::getIntegerv(const gl::Data &data, GLenum pname, GLint *params)
break;
case GL_TEXTURE_BINDING_2D:
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
- *params = getSamplerTextureId(mActiveSampler, GL_TEXTURE_2D) ;
+ *params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler), GL_TEXTURE_2D) ;
break;
case GL_TEXTURE_BINDING_CUBE_MAP:
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
- *params = getSamplerTextureId(mActiveSampler, GL_TEXTURE_CUBE_MAP);
+ *params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler), GL_TEXTURE_CUBE_MAP);
break;
case GL_TEXTURE_BINDING_3D:
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
- *params = getSamplerTextureId(mActiveSampler, GL_TEXTURE_3D);
+ *params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler), GL_TEXTURE_3D);
break;
case GL_TEXTURE_BINDING_2D_ARRAY:
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
- *params = getSamplerTextureId(mActiveSampler, GL_TEXTURE_2D_ARRAY);
+ *params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler), GL_TEXTURE_2D_ARRAY);
break;
case GL_UNIFORM_BUFFER_BINDING:
*params = mGenericUniformBuffer.id();
diff --git a/src/libANGLE/Surface.cpp b/src/libANGLE/Surface.cpp
index c42b69d..9742f5d 100644
--- a/src/libANGLE/Surface.cpp
+++ b/src/libANGLE/Surface.cpp
@@ -135,12 +135,12 @@ EGLint Surface::isFixedSize() const
EGLint Surface::getWidth() const
{
- return mFixedSize ? mFixedWidth : mImplementation->getWidth();
+ return mFixedSize ? static_cast<EGLint>(mFixedWidth) : mImplementation->getWidth();
}
EGLint Surface::getHeight() const
{
- return mFixedSize ? mFixedHeight : mImplementation->getHeight();
+ return mFixedSize ? static_cast<EGLint>(mFixedHeight) : mImplementation->getHeight();
}
Error Surface::bindTexImage(gl::Texture *texture, EGLint buffer)
diff --git a/src/libANGLE/Texture.cpp b/src/libANGLE/Texture.cpp
index 1ab5c7d..437ba0d 100644
--- a/src/libANGLE/Texture.cpp
+++ b/src/libANGLE/Texture.cpp
@@ -266,7 +266,7 @@ Error Texture::setStorage(GLenum target, size_t levels, GLenum internalFormat, c
releaseTexImage();
- mImmutableLevelCount = levels;
+ mImmutableLevelCount = static_cast<GLsizei>(levels);
clearImageDescs();
setImageDescChain(levels, size, internalFormat);
@@ -295,16 +295,16 @@ void Texture::setImageDescChain(size_t levels, Extents baseSize, GLenum sizedInt
{
for (size_t level = 0; level < levels; level++)
{
- Extents levelSize(std::max<size_t>(baseSize.width >> level, 1),
- std::max<size_t>(baseSize.height >> level, 1),
- (mTarget == GL_TEXTURE_2D_ARRAY) ? baseSize.depth : std::max<size_t>(baseSize.depth >> level, 1));
+ Extents levelSize(std::max<int>(baseSize.width >> level, 1),
+ std::max<int>(baseSize.height >> level, 1),
+ (mTarget == GL_TEXTURE_2D_ARRAY) ? baseSize.depth : std::max<int>(baseSize.depth >> level, 1));
ImageDesc levelInfo(levelSize, sizedInternalFormat);
if (mTarget == GL_TEXTURE_CUBE_MAP)
{
for (size_t face = FirstCubeMapTextureTarget; face <= LastCubeMapTextureTarget; face++)
{
- setImageDesc(face, level, levelInfo);
+ setImageDesc(static_cast<GLenum>(face), level, levelInfo);
}
}
else
@@ -571,12 +571,12 @@ Texture::SamplerCompletenessCache::SamplerCompletenessCache()
GLsizei Texture::getAttachmentWidth(const gl::FramebufferAttachment::Target &target) const
{
- return getWidth(target.textureIndex().type, target.textureIndex().mipIndex);
+ return static_cast<GLsizei>(getWidth(target.textureIndex().type, target.textureIndex().mipIndex));
}
GLsizei Texture::getAttachmentHeight(const gl::FramebufferAttachment::Target &target) const
{
- return getHeight(target.textureIndex().type, target.textureIndex().mipIndex);
+ return static_cast<GLsizei>(getHeight(target.textureIndex().type, target.textureIndex().mipIndex));
}
GLenum Texture::getAttachmentInternalFormat(const gl::FramebufferAttachment::Target &target) const
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 1896138..2a288a2 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -174,7 +174,7 @@ bool ValidMipLevel(const Context *context, GLenum target, GLint level)
default: UNREACHABLE();
}
- return level <= gl::log2(maxDimension);
+ return level <= gl::log2(static_cast<int>(maxDimension));
}
bool ValidImageSize(const Context *context, GLenum target, GLint level,
|