From 24ad492a98dc99abfbf7523b50bbdb13274c097e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 17 Sep 2018 09:18:57 -0400 Subject: Hotfix/fixing warnings (#636) * * Remove dispose from IRInst * Use MemoryArena instead of MemoryPool * Make all IRInst not require Dtor - by having ref counted array store ptrs that need freeing * Increase block size - typically compilation is 2Mb of IR space(!) * Fix issues around StringRepresentation::equal because null has special meaning. * Don't bother to construct as String to compare StringRepresentation, just used UnownedStringSlice. * Added fromLiteral support to UnownedStringSlice and use instead of strlen version. * Use more conventional way to test StringRepresentation against a String. * Fix gcc/clang template problem with cast. * Fix warnings. --- examples/model-viewer/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/model-viewer/main.cpp b/examples/model-viewer/main.cpp index be2e6878f..c1f7980cf 100644 --- a/examples/model-viewer/main.cpp +++ b/examples/model-viewer/main.cpp @@ -576,7 +576,7 @@ struct ParameterBlockEncoder { assert(slangTypeLayout->getKind() == slang::TypeReflection::Kind::Struct); - auto slangField = slangTypeLayout->getFieldByIndex(fieldIndex); + auto slangField = slangTypeLayout->getFieldByIndex((unsigned int)fieldIndex); auto fieldUniformOffset = slangField->getOffset(); // TODO: this type needs to be extended to handle resource fields. @@ -881,7 +881,7 @@ RefPtr createEffectVaraint( int translationUnitIndex = spAddTranslationUnit(slangRequest, SLANG_SOURCE_LANGUAGE_SLANG, nullptr); spAddTranslationUnitSourceFile(slangRequest, translationUnitIndex, program->shaderModule->inputPath.c_str()); - int entryPointCont = program->entryPoints.size(); + const int entryPointCont = int(program->entryPoints.size()); for(int ii = 0; ii < entryPointCont; ++ii) { auto entryPoint = program->entryPoints[ii]; @@ -895,7 +895,7 @@ RefPtr createEffectVaraint( translationUnitIndex, entryPoint->name.c_str(), entryPoint->slangStage, - genericArgs.size(), + int(genericArgs.size()), genericArgs.data()); } @@ -1877,7 +1877,7 @@ struct LightEnv : public RefObject // The more interesting case is when we have a `LightArray`, // in which case we need to encode the first field (the light count)... // - lightTypeEncoder.writeField(0, lightTypeArray->lights.size()); + lightTypeEncoder.writeField(0, int32_t(lightTypeArray->lights.size())); // // ... followed by an array of values of type `L` in the second field. // We will only write to the first `lightCount` entries, which may be -- cgit v1.2.3