Skip to content

Commit 49f5f0c

Browse files
authored
Add gcc6 to the test matrix and fix resulting warnings. (#647)
1 parent c1224b4 commit 49f5f0c

6 files changed

Lines changed: 14 additions & 20 deletions

File tree

.travis.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ addons:
2727
- g++-4.8
2828
- gcc-5
2929
- g++-5
30+
- gcc-6
31+
- g++-6
3032
- libboost1.55-all-dev
3133
- libtiff4-dev
3234
- llvm-3.4-dev
@@ -124,20 +126,20 @@ matrix:
124126
- os: osx
125127
compiler: clang
126128
env: OIIOBRANCH=release USE_CPP11=1
127-
# Temporary: try head of RB-1.6
129+
# Linux only: test gcc 6 (catch new warnings hot off the presses) and
130+
# also use a higher SIMD level, avx and f16c, to make sure all is well.
131+
# TravisCI's OSX images don't yet support avx/f16c, so we only do this
132+
# on Linux for now, but eventually we'll want to separate these concerns
133+
# into separate tests.
128134
- os: linux
129135
dist: trusty
130136
compiler: gcc
131-
env: OIIOBRANCH=RB-1.6 USE_CPP11=1
132-
# Linux only: test gcc 5 (sometimes it has new warnings that weren't
133-
# issues for gcc 4.x or clang) and also use a higher SIMD level, avx and
134-
# f16c, to make sure all is well. TravisCI's OSX images don't yet
135-
# support avx/f16c, so we only do this on Linux for now, but eventually
136-
# we'll want to separate these concerns into separate tests.
137+
env: WHICHGCC=6 USE_SIMD=avx,f16c
138+
# Linux only: test gcc 5
137139
- os: linux
138140
dist: trusty
139141
compiler: gcc
140-
env: WHICHGCC=5 USE_SIMD=avx,f16c
142+
env: WHICHGCC=5
141143
# One more, just for the heck of it, turn all SIMD off. I guess this
142144
# should/could be both platforms, but in the interest of making the
143145
# tests go faster, don't bother doing it on OSX.

src/liboslexec/dictionary.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,6 @@ ShadingContext::free_dict_resources ()
455455
}
456456

457457

458-
#define USTR(cstr) (*((ustring *)&cstr))
459-
#define TYPEDESC(x) (*(TypeDesc *)&x)
460-
461458

462459
OSL_SHADEOP int osl_dict_find_iis (void *sg_, int nodeID, void *query)
463460
{

src/liboslexec/llvm_ops.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ void * __dso_handle = 0; // necessary to avoid linkage issues in bitcode
138138
#define DVEC(x) (*(Dual2<Vec3> *)x)
139139
#define COL(x) (*(Color3 *)x)
140140
#define DCOL(x) (*(Dual2<Color3> *)x)
141-
#define TYPEDESC(x) (*(TypeDesc *)&x)
142141

143142

144143
#ifndef OSL_SHADEOP
@@ -823,5 +822,3 @@ OSL_SHADEOP int osl_raytype_bit (void *sg_, int bit)
823822
ShaderGlobals *sg = (ShaderGlobals *)sg_;
824823
return (sg->raytype & bit) != 0;
825824
}
826-
827-

src/liboslexec/opmessage.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ OSL_NAMESPACE_ENTER
5050
namespace pvt {
5151

5252

53-
#define USTR(cstr) (*((ustring *)&cstr))
54-
5553
OSL_SHADEOP void
5654
osl_setmessage (ShaderGlobals *sg, const char *name_, long long type_, void *val, int layeridx, const char* sourcefile_, int sourceline)
5755
{
5856
const ustring &name (USTR(name_));
5957
const ustring &sourcefile (USTR(sourcefile_));
6058
// recreate TypeDesc -- we just crammed it into an int!
61-
TypeDesc type (*(TypeDesc *)&type_);
59+
TypeDesc type = TYPEDESC(type_);
6260
bool is_closure = (type.basetype == TypeDesc::UNKNOWN); // secret code for closure
6361
if (is_closure)
6462
type.basetype = TypeDesc::PTR; // for closures, we store a pointer
@@ -105,7 +103,7 @@ osl_getmessage (ShaderGlobals *sg, const char *source_, const char *name_,
105103
const ustring &sourcefile (USTR(sourcefile_));
106104

107105
// recreate TypeDesc -- we just crammed it into an int!
108-
TypeDesc type (*(TypeDesc *)&type_);
106+
TypeDesc type = TYPEDESC(type_);
109107
bool is_closure = (type.basetype == TypeDesc::UNKNOWN); // secret code for closure
110108
if (is_closure)
111109
type.basetype = TypeDesc::PTR; // for closures, we store a pointer

src/liboslexec/oslexec_pvt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ struct AttributeNeeded {
216216
#define DVEC(x) (*(Dual2<Vec3> *)x)
217217
#define COL(x) (*(Color3 *)x)
218218
#define DCOL(x) (*(Dual2<Color3> *)x)
219-
#define TYPEDESC(x) (*(TypeDesc *)&x)
219+
#define TYPEDESC(x) OIIO::bit_cast<long long,TypeDesc>(x)
220220

221221

222222

src/testrender/sampling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ struct Sampler {
193193
if (ii & 1)
194194
rz ^= uint32_t(v2 >> 31);
195195

196-
return Vec3((sx + jx) / AA, (sy + jy) / AA, rz * 2.3283063e-10f);
196+
return Vec3((sx + jx) / AA, (sy + jy) / AA, rz * 2.3283063e-10f);
197197
}
198198

199199
private:

0 commit comments

Comments
 (0)