Commit 1fabc0f6 by John Kessenich Committed by GitHub

Merge pull request #548 from baldurk/vs2010-compile-fixes

VS2010 compile fixes
parents bf8a6ef7 486d9e44
......@@ -75,6 +75,7 @@ public:
#if !defined (use_cpp11)
#include <cstdio>
#include <cstdint>
namespace spv {
class spirvbin_t : public spirvbin_base_t
......
......@@ -797,7 +797,7 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
spvutils::HexFloat<spvutils::FloatProxy<float>> fVal(f16);
spvutils::HexFloat<spvutils::FloatProxy<spvutils::Float16>> f16Val(0);
fVal.castTo(f16Val, spvutils::round_direction::kToZero);
fVal.castTo(f16Val, spvutils::kRoundToZero);
unsigned value = f16Val.value().getAsFloat().get_value();
......
......@@ -673,11 +673,11 @@ void CompileAndLinkShaderFiles()
// they are all getting linked together.)
glslang::TWorkItem* workItem;
while (Worklist.remove(workItem)) {
ShaderCompUnit compUnit = {
ShaderCompUnit compUnit(
FindLanguage(workItem->name),
workItem->name,
ReadFileData(workItem->name.c_str())
};
);
if (! compUnit.text) {
usage();
......
......@@ -68,6 +68,10 @@ inline long long int strtoll (const char* str, char** endptr, int base)
{
return _strtoi64(str, endptr, base);
}
inline unsigned long long int strtoull (const char* str, char** endptr, int base)
{
return _strtoui64(str, endptr, base);
}
inline long long int atoll (const char* str)
{
return strtoll(str, NULL, 10);
......
......@@ -361,7 +361,7 @@ const TFunction* TParseContextBase::selectFunction(
return viableCandidates.front();
// 4. find best...
auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2){
auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool {
// is call -> can2 better than call -> can1 for any parameter
bool hasBetterParam = false;
for (int param = 0; param < call.getParamCount(); ++param) {
......
......@@ -4873,7 +4873,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu
symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn);
// can 'from' convert to 'to'?
const auto convertible = [this](const TType& from, const TType& to) {
const auto convertible = [this](const TType& from, const TType& to) -> bool {
if (from == to)
return true;
if (from.isArray() || to.isArray() || ! from.sameElementShape(to))
......@@ -4884,7 +4884,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu
// Is 'to2' a better conversion than 'to1'?
// Ties should not be considered as better.
// Assumes 'convertible' already said true.
const auto better = [](const TType& from, const TType& to1, const TType& to2) {
const auto better = [](const TType& from, const TType& to1, const TType& to2) -> bool {
// 1. exact match
if (from == to2)
return from != to1;
......
......@@ -1330,7 +1330,7 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
const auto getMember = [&](bool flatten, TIntermTyped* node,
const TVector<TVariable*>& memberVariables, int member,
TOperator op, const TType& memberType) {
TOperator op, const TType& memberType) -> TIntermTyped * {
TIntermTyped* subTree;
if (flatten)
subTree = intermediate.addSymbol(*memberVariables[member]);
......@@ -3037,7 +3037,7 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
// space
unsigned int setNumber;
const auto crackSpace = [&]() {
const auto crackSpace = [&]() -> bool {
const int spaceLen = 5;
if (spaceDesc->size() < spaceLen + 1)
return false;
......@@ -4233,7 +4233,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn);
// can 'from' convert to 'to'?
const auto convertible = [this](const TType& from, const TType& to) {
const auto convertible = [this](const TType& from, const TType& to) -> bool {
if (from == to)
return true;
......@@ -4260,7 +4260,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
// Is 'to2' a better conversion than 'to1'?
// Ties should not be considered as better.
// Assumes 'convertible' already said true.
const auto better = [](const TType& from, const TType& to1, const TType& to2) {
const auto better = [](const TType& from, const TType& to1, const TType& to2) -> bool {
// exact match is always better than mismatch
if (from == to2)
return from != to1;
......@@ -4287,7 +4287,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFu
// - 32 vs. 64 bit (or width in general)
// - bool vs. non bool
// - signed vs. not signed
const auto linearize = [](const TBasicType& basicType) {
const auto linearize = [](const TBasicType& basicType) -> int {
switch (basicType) {
case EbtBool: return 1;
case EbtInt: return 10;
......
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