Seems LLVM > 3.5 is still not supported so there's no point continuing with this until that's fixed.
75 lines
3.6 KiB
Diff
75 lines
3.6 KiB
Diff
From ffc29ce77e83fc312b97e424a64a1bd2a7f01d39 Mon Sep 17 00:00:00 2001
|
|
From: Ray Donnelly <mingw.android@gmail.com>
|
|
Date: Sun, 11 Oct 2015 22:20:32 +0100
|
|
Subject: [PATCH 3/3] Fix unsigned/signed compares
|
|
|
|
---
|
|
src/liboslexec/shadeimage.cpp | 2 +-
|
|
src/liboslexec/shadingsys.cpp | 10 +++++-----
|
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/liboslexec/shadeimage.cpp b/src/liboslexec/shadeimage.cpp
|
|
index 3e9c244..10a85e3 100644
|
|
--- a/src/liboslexec/shadeimage.cpp
|
|
+++ b/src/liboslexec/shadeimage.cpp
|
|
@@ -198,7 +198,7 @@ shade_image (ShadingSystem &shadingsys, ShaderGroup &group,
|
|
for (int c = 0; c < tvals; ++c)
|
|
p[chan++] = ((const float *)data)[c];
|
|
} else if (t.basetype == TypeDesc::INT) {
|
|
- for (int c = 0; c < t.numelements()*t.aggregate; ++c)
|
|
+ for (size_t c = 0; c < t.numelements()*t.aggregate; ++c)
|
|
p[chan++] = ((const int *)data)[c];
|
|
}
|
|
// N.B. Drop any outputs that aren't float- or int-based
|
|
diff --git a/src/liboslexec/shadingsys.cpp b/src/liboslexec/shadingsys.cpp
|
|
index d21f0a3..15046dd 100644
|
|
--- a/src/liboslexec/shadingsys.cpp
|
|
+++ b/src/liboslexec/shadingsys.cpp
|
|
@@ -1298,14 +1298,14 @@ ShadingSystemImpl::getattribute (ShaderGroup *group, string_view name,
|
|
}
|
|
if (name == "num_entry_layers" && type.basetype == TypeDesc::INT) {
|
|
size_t n = 0;
|
|
- for (size_t i = 0; i < group->nlayers(); ++i)
|
|
+ for (size_t i = 0; i < (size_t)group->nlayers(); ++i)
|
|
n += group->layer(i)->entry_layer();
|
|
*(int *)val = n;
|
|
return true;
|
|
}
|
|
if (name == "entry_layers" && type.basetype == TypeDesc::STRING) {
|
|
size_t n = 0;
|
|
- for (size_t i = 0; i < group->nlayers() && i < type.numelements(); ++i)
|
|
+ for (size_t i = 0; i < (size_t)group->nlayers() && i < type.numelements(); ++i)
|
|
if (group->layer(i)->entry_layer())
|
|
((ustring *)val)[n++] = (*group)[i]->layername();
|
|
for (size_t i = n; i < type.numelements(); ++i)
|
|
@@ -2097,7 +2097,7 @@ ShadingSystemImpl::ShaderGroupBegin (string_view groupname,
|
|
}
|
|
// Zero-pad if we parsed fewer values than we needed
|
|
intvals.resize (type.numelements()*type.aggregate, 0);
|
|
- ASSERT (type.numelements()*type.aggregate == int(intvals.size()));
|
|
+ ASSERT (type.numelements()*type.aggregate == intvals.size());
|
|
Parameter (paramname, type, &intvals[0], lockgeom);
|
|
} else if (type.basetype == TypeDesc::FLOAT) {
|
|
floatvals.clear ();
|
|
@@ -2117,7 +2117,7 @@ ShadingSystemImpl::ShaderGroupBegin (string_view groupname,
|
|
}
|
|
// Zero-pad if we parsed fewer values than we needed
|
|
floatvals.resize (type.numelements()*type.aggregate, 0);
|
|
- ASSERT (type.numelements()*type.aggregate == int(floatvals.size()));
|
|
+ ASSERT (type.numelements()*type.aggregate == floatvals.size());
|
|
Parameter (paramname, type, &floatvals[0], lockgeom);
|
|
} else if (type.basetype == TypeDesc::STRING) {
|
|
stringvals.clear ();
|
|
@@ -2147,7 +2147,7 @@ ShadingSystemImpl::ShaderGroupBegin (string_view groupname,
|
|
}
|
|
// Zero-pad if we parsed fewer values than we needed
|
|
stringvals.resize (type.numelements()*type.aggregate, ustring());
|
|
- ASSERT (type.numelements()*type.aggregate == int(stringvals.size()));
|
|
+ ASSERT (type.numelements()*type.aggregate == stringvals.size());
|
|
Parameter (paramname, type, &stringvals[0], lockgeom);
|
|
}
|
|
|
|
--
|
|
2.6.0
|
|
|