Decrease compiler warning thresholds and fix outstanding warnings.

Note: this round fixes clang / gcc -Wetra warnings. More fixing remains for icc -w3 errors.
This commit is contained in:
manuelk 2014-05-15 13:34:32 -07:00
parent efc8cddb18
commit 5ff9edf4f9
30 changed files with 93 additions and 99 deletions

View File

@ -118,8 +118,12 @@ set(OSD_COMPILER_FLAGS)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANGCC OR CMAKE_COMPILER_IS_ICC )
# Turn on all warnings
list(APPEND OSD_COMPILER_FLAGS -Wall)
if(CMAKE_COMPILER_IS_ICC)
list(APPEND OSD_COMPILER_FLAGS -w3)
else()
list(APPEND OSD_COMPILER_FLAGS -Wall -Wextra)
endif()
# HBR uses the offsetof macro on a templated struct, which appears
# to spurriously set off this warning in both gccc and Clang
list(APPEND OSD_COMPILER_FLAGS -Wno-invalid-offsetof)

View File

@ -223,11 +223,9 @@ checkGLErrors(std::string const & where = "")
{
GLuint err;
while ((err = glGetError()) != GL_NO_ERROR) {
/*
std::cerr << "GL error: "
<< (where.empty() ? "" : where + " ")
<< err << "\n";
*/
}
}
@ -966,7 +964,7 @@ display() {
glFinish();
checkGLErrors("display leave");
//checkGLErrors("display leave");
}
//------------------------------------------------------------------------------
@ -1000,7 +998,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow *, int button, int state, int mods) {
mouse(GLFWwindow *, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -1060,7 +1058,7 @@ int windowClose() {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {
@ -1113,7 +1111,7 @@ callbackDisplayStyle(int b)
}
static void
callbackAdaptive(bool checked, int a)
callbackAdaptive(bool checked, int /* a */)
{
if (OpenSubdiv::OsdGLDrawContext::SupportsAdaptiveTessellation()) {
g_adaptive = checked;

View File

@ -99,7 +99,7 @@ MyDrawDelegate::Bind(OpenSubdiv::OsdUtilMeshBatchBase<MyDrawContext> *batch, Eff
}
void
MyDrawDelegate::Unbind(OpenSubdiv::OsdUtilMeshBatchBase<MyDrawContext> *batch, EffectHandle const &effect) {
MyDrawDelegate::Unbind(OpenSubdiv::OsdUtilMeshBatchBase<MyDrawContext> */* batch */, EffectHandle const &/* effect */) {
}
void

View File

@ -278,11 +278,9 @@ checkGLErrors(std::string const & where = "")
{
GLuint err;
while ((err = glGetError()) != GL_NO_ERROR) {
/*
std::cerr << "GL error: "
<< (where.empty() ? "" : where + " ")
<< err << "\n";
*/
}
}
@ -637,7 +635,7 @@ display() {
g_hud.Flush();
}
checkGLErrors("display leave");
//checkGLErrors("display leave");
glFinish();
}
@ -672,7 +670,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow *, int button, int state, int mods) {
mouse(GLFWwindow *, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -736,7 +734,7 @@ int windowClose() {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {

View File

@ -910,7 +910,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow *, int button, int state, int mods) {
mouse(GLFWwindow *, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -976,7 +976,7 @@ setSamples(bool add)
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {
@ -1014,28 +1014,28 @@ callbackLevel(int l)
//------------------------------------------------------------------------------
static void
callbackAnimate(bool checked, int m)
callbackAnimate(bool checked, int /* m */)
{
g_moveScale = checked;
}
//------------------------------------------------------------------------------
static void
callbackFreeze(bool checked, int f)
callbackFreeze(bool checked, int /* f */)
{
g_freeze = checked;
}
//------------------------------------------------------------------------------
static void
callbackDisplayCageVertices(bool checked, int d)
callbackDisplayCageVertices(bool checked, int /* d */)
{
g_drawCageVertices = checked;
}
//------------------------------------------------------------------------------
static void
callbackDisplayCageEdges(bool checked, int d)
callbackDisplayCageEdges(bool checked, int /* d */)
{
g_drawCageEdges = checked;
}

View File

@ -882,7 +882,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow *, int button, int state, int mods) {
mouse(GLFWwindow *, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -940,7 +940,7 @@ setSamples(bool add)
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {
@ -993,28 +993,28 @@ callbackLevel(int l)
//------------------------------------------------------------------------------
static void
callbackAnimate(bool checked, int m)
callbackAnimate(bool checked, int /* m */)
{
g_moveScale = checked;
}
//------------------------------------------------------------------------------
static void
callbackFreeze(bool checked, int f)
callbackFreeze(bool checked, int /* f */)
{
g_freeze = checked;
}
//------------------------------------------------------------------------------
static void
callbackDisplayCageVertices(bool checked, int d)
callbackDisplayCageVertices(bool checked, int /* d */)
{
g_drawCageVertices = checked;
}
//------------------------------------------------------------------------------
static void
callbackDisplayCageEdges(bool checked, int d)
callbackDisplayCageEdges(bool checked, int /* d */)
{
g_drawCageEdges = checked;
}

View File

@ -161,11 +161,9 @@ checkGLErrors(std::string const & where = "")
{
GLuint err;
while ((err = glGetError()) != GL_NO_ERROR) {
/*
std::cerr << "GL error: "
<< (where.empty() ? "" : where + " ")
<< err << "\n";
*/
}
}
@ -843,7 +841,7 @@ display() {
glFinish();
checkGLErrors("display leave");
//checkGLErrors("display leave");
#if GLFW_VERSION_MAJOR>=3
glfwSwapBuffers(g_window);
@ -969,7 +967,7 @@ drawStroke(int x, int y)
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT |
GL_TEXTURE_FETCH_BARRIER_BIT);
checkGLErrors("display leave");
//checkGLErrors("display leave");
}
//------------------------------------------------------------------------------
@ -1014,7 +1012,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow * w, int button, int state, int mods) {
mouse(GLFWwindow * w, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -1097,7 +1095,7 @@ toggleFullScreen() {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {
@ -1125,7 +1123,7 @@ callbackWireframe(int b)
}
static void
callbackDisplay(bool checked, int n)
callbackDisplay(bool /* checked */, int n)
{
if (n == 0) g_displayColor = !g_displayColor;
else if (n == 1) g_displayDisplacement = !g_displayDisplacement;

View File

@ -1995,7 +1995,7 @@ screenshot(int multiplier=4) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR >= 3
mouse(GLFWwindow *, int button, int state, int mods)
mouse(GLFWwindow *, int button, int state, int /* mods */)
#else
mouse(int button, int state)
#endif
@ -2252,7 +2252,7 @@ toggleFullScreen()
//------------------------------------------------------------------------------
void
#if GLFW_VERSION_MAJOR >= 3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods)
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */)
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event)

View File

@ -116,7 +116,7 @@ idle()
}
int main(int argc, char ** argv)
int main(int /* argc */, char ** /* argv */)
{
//
// Setup GLFW, glew and some initial GL state

View File

@ -481,11 +481,9 @@ checkGLErrors(std::string const & where = "")
{
GLuint err;
while ((err = glGetError()) != GL_NO_ERROR) {
/*
std::cerr << "GL error: "
<< (where.empty() ? "" : where + " ")
<< err << "\n";
*/
}
}
@ -1182,7 +1180,7 @@ display() {
glFinish();
checkGLErrors("display leave");
//checkGLErrors("display leave");
}
//------------------------------------------------------------------------------
@ -1216,7 +1214,7 @@ motion(int x, int y) {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
mouse(GLFWwindow *, int button, int state, int mods) {
mouse(GLFWwindow *, int button, int state, int /* mods */) {
#else
mouse(int button, int state) {
#endif
@ -1328,7 +1326,7 @@ rebuildOsdMesh()
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR>=3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods) {
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */) {
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event) {
@ -1389,7 +1387,7 @@ callbackLevel(int l)
}
static void
callbackSlider(float value, int data)
callbackSlider(float value, int /* data */)
{
g_numInstances = (int)value;
rebuildInstances();
@ -1403,7 +1401,7 @@ callbackDisplayStyle(int b)
}
static void
callbackAdaptive(bool checked, int a)
callbackAdaptive(bool checked, int /* a */)
{
if (OpenSubdiv::OsdGLDrawContext::SupportsAdaptiveTessellation()) {
g_adaptive = checked;

View File

@ -1121,7 +1121,7 @@ motion(int x, int y)
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR >= 3
mouse(GLFWwindow *, int button, int state, int mods)
mouse(GLFWwindow *, int button, int state, int /* mods */)
#else
mouse(int button, int state)
#endif
@ -1194,7 +1194,7 @@ toggleFullScreen() {
//------------------------------------------------------------------------------
static void
#if GLFW_VERSION_MAJOR >= 3
keyboard(GLFWwindow *, int key, int scancode, int event, int mods)
keyboard(GLFWwindow *, int key, int /* scancode */, int event, int /* mods */)
#else
#define GLFW_KEY_ESCAPE GLFW_KEY_ESC
keyboard(int key, int event)
@ -1245,7 +1245,7 @@ callbackModel(int m)
}
static void
callbackAdaptive(bool checked, int a)
callbackAdaptive(bool checked, int /* a */)
{
if (OpenSubdiv::OsdGLDrawContext::SupportsAdaptiveTessellation()) {
g_adaptive = checked;
@ -1261,7 +1261,7 @@ callbackBoundary(int b)
}
static void
callbackPropagateCorners(bool b, int button)
callbackPropagateCorners(bool b, int /* button */)
{
g_fvarPropagateCorners = b;
rebuildOsdMesh();

View File

@ -701,7 +701,7 @@ FarMeshFactory<T,U>::isLoop(HbrMesh<T> const * mesh) {
}
template <class T, class U> void
copyVertex( T & dest, U const & src ) {
copyVertex( T & /* dest */, U const & /* src */ ) {
}
template <class T> void
@ -760,7 +760,7 @@ FarMeshFactory<T,U>::Create( bool requireFVarData ) {
FarPatchTablesFactory<T> factory(GetHbrMesh(), _numFaces, _remapTable);
// XXXX: currently PatchGregory shader supports up to 29 valence
result->_patchTables = factory.Create(GetMaxLevel()+1, _maxValence, _numPtexFaces, fvarwidth);
result->_patchTables = factory.Create(_maxValence, _numPtexFaces, fvarwidth);
} else {
result->_patchTables = FarPatchTablesFactory<T>::Create(GetHbrMesh(), _facesList, _remapTable, _firstlevel, _patchType, _numPtexFaces, fvarwidth );

View File

@ -67,8 +67,6 @@ protected:
/// \brief Returns a feature-adaptive FarPatchTables instance
///
/// @param maxlevel Highest level of refinement processed
///
/// @param maxvalence Maximum vertex valence in the mesh
///
/// @param numPtexFaces Number of ptex faces
@ -77,7 +75,7 @@ protected:
///
/// @return A new instance of FarPatchTables
///
FarPatchTables * Create( int maxlevel, int maxvalence, int numPtexFaces=0, int fvarWidth=0 );
FarPatchTables * Create(int maxvalence, int numPtexFaces=0, int fvarWidth=0 );
typedef std::vector<std::vector< HbrFace<T> *> > FacesList;
@ -710,9 +708,9 @@ FarPatchTablesFactory<T>::pushPatchArray( FarPatchTables::Descriptor desc,
}
}
// Uniform mesh factory
// Feature adaptive mesh factory
template <class T> FarPatchTables *
FarPatchTablesFactory<T>::Create( int maxlevel, int maxvalence, int numPtexFaces, int fvarwidth ) {
FarPatchTablesFactory<T>::Create(int maxvalence, int numPtexFaces, int fvarwidth ) {
static const unsigned int remapRegular [16] = {5,6,10,9,4,0,1,2,3,7,11,15,14,13,12,8};
static const unsigned int remapRegularBoundary[12] = {1,2,6,5,0,3,7,11,10,9,8,4};

View File

@ -211,7 +211,7 @@ template <class T> void
FarStencilTables::_Update( T const *controlValues,
float const * weights,
T *values,
int stride ) const {
int /* stride */ ) const {
int const * index = &_indices.at(0);

View File

@ -562,16 +562,16 @@ public:
///
/// @param weight The interpolation weight
///
void AddVaryingWithWeight(FarStencilFactoryVertex const & src, float weight, void * =0 ) { }
void AddVaryingWithWeight(FarStencilFactoryVertex const & /* src */, float /* weight */, void * =0 ) { }
/// \brief Hbr template vertex class API: edits are not supported yet
///
void ApplyVertexEdit(OpenSubdiv::HbrVertexEdit<FarStencilFactoryVertex> const & edit) { }
void ApplyVertexEdit(OpenSubdiv::HbrVertexEdit<FarStencilFactoryVertex> const & /* edit */) { }
/// \brief Hbr template vertex class API: edits are not supported yet
///
void ApplyMovingVertexEdit(const OpenSubdiv::HbrMovingVertexEdit<FarStencilFactoryVertex> &) { }
/// \brief Hbr template vertex class API: edits are not supported yet
///
void ApplyMovingVertexEdit(const OpenSubdiv::HbrMovingVertexEdit<FarStencilFactoryVertex> &) { }
private:
template <class T> friend class FarStencilTablesFactory<T>::Patch;

View File

@ -51,7 +51,7 @@ private:
Uninitialize();
}
HbrFVarData(const HbrFVarData &data) {}
HbrFVarData(const HbrFVarData &/* data */) {}
public:

View File

@ -59,7 +59,7 @@ private:
{
}
HbrHalfedge(const HbrHalfedge &e) {}
HbrHalfedge(const HbrHalfedge &/* edge */) {}
~HbrHalfedge();

View File

@ -61,10 +61,10 @@ public:
virtual HbrVertex<T>* Subdivide(HbrMesh<T>* mesh, HbrHalfedge<T>* edge);
virtual HbrVertex<T>* Subdivide(HbrMesh<T>* mesh, HbrVertex<T>* vertex);
virtual bool VertexIsExtraordinary(HbrMesh<T> const * mesh, HbrVertex<T>* vertex) { return vertex->GetValence() != 6; }
virtual bool VertexIsExtraordinary(HbrMesh<T> const * /* mesh */, HbrVertex<T>* vertex) { return vertex->GetValence() != 6; }
virtual bool FaceIsExtraordinary(HbrMesh<T> const * /* mesh */, HbrFace<T>* face) { return face->GetNumVertices() != 3; }
virtual int GetFaceChildrenCount(int nvertices) const { return 4; }
virtual int GetFaceChildrenCount(int /* nvertices */) const { return 4; }
private:
@ -735,7 +735,7 @@ HbrLoopSubdivision<T>::HasLimit(HbrMesh<T>* mesh, HbrHalfedge<T>* edge) {
template <class T>
bool
HbrLoopSubdivision<T>::HasLimit(HbrMesh<T>* mesh, HbrVertex<T>* vertex) {
HbrLoopSubdivision<T>::HasLimit(HbrMesh<T>* /* mesh */, HbrVertex<T>* vertex) {
vertex->GuaranteeNeighbors();
switch (vertex->GetMask(false)) {
case HbrVertex<T>::k_Smooth:
@ -773,7 +773,7 @@ HbrLoopSubdivision<T>::HasLimit(HbrMesh<T>* mesh, HbrVertex<T>* vertex) {
template <class T>
HbrVertex<T>*
HbrLoopSubdivision<T>::Subdivide(HbrMesh<T>* mesh, HbrFace<T>* face) {
HbrLoopSubdivision<T>::Subdivide(HbrMesh<T>* /* mesh */, HbrFace<T>* /* face */) {
// In loop subdivision, faces never subdivide
assert(0);
return 0;

View File

@ -33,7 +33,7 @@ namespace OPENSUBDIV_VERSION {
OsdCLGLVertexBuffer::OsdCLGLVertexBuffer(int numElements,
int numVertices,
cl_context clContext)
cl_context /* clContext */)
: _numElements(numElements), _numVertices(numVertices),
_vbo(0), _clQueue(0), _clMemory(0), _clMapped(false) {

View File

@ -31,7 +31,7 @@ namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
OsdCLVertexBuffer::OsdCLVertexBuffer(int numElements, int numVertices,
cl_context clContext)
cl_context /* clContext */)
: _numElements(numElements), _numVertices(numVertices),
_clQueue(NULL), _clMemory(NULL) {
@ -74,7 +74,7 @@ OsdCLVertexBuffer::GetNumVertices() const {
}
cl_mem
OsdCLVertexBuffer::BindCLBuffer(cl_command_queue queue) {
OsdCLVertexBuffer::BindCLBuffer(cl_command_queue /* queue */) {
return _clMemory;
}

View File

@ -232,7 +232,7 @@ _CompileShader(
OsdGLDrawConfig *
OsdGLDrawRegistryBase::_CreateDrawConfig(
OsdDrawContext::PatchDescriptor const & desc,
OsdDrawContext::PatchDescriptor const & /* desc */,
OsdGLDrawSourceConfig const * sconfig)
{
assert(sconfig);

View File

@ -145,8 +145,8 @@ protected:
return new ConfigType();
}
virtual ConfigType * _CreateDrawConfig(DescType const & desc,
SourceConfigType const * sconfig) {
virtual ConfigType * _CreateDrawConfig(DescType const & /* desc */,
SourceConfigType const * /* sconfig */) {
return NULL;
}
@ -154,7 +154,7 @@ protected:
return new SourceConfigType();
}
virtual SourceConfigType * _CreateDrawSourceConfig(DescType const & desc) {
virtual SourceConfigType * _CreateDrawSourceConfig(DescType const & /* desc */) {
return NULL;
}

View File

@ -444,8 +444,8 @@ OsdGLSLTransformFeedbackKernelBundle::ApplyLoopVertexVerticesKernelA(
void
OsdGLSLTransformFeedbackKernelBundle::ApplyEditAdd(
GLuint vertexBuffer, GLuint varyingBuffer,
int vertexOffset, int varyingOffset,
GLuint /* vertexBuffer */, GLuint /* varyingBuffer */,
int /* vertexOffset */, int /* varyingOffset */,
int primvarOffset, int primvarWidth,
int offset, int tableOffset, int start, int end) {

View File

@ -131,7 +131,7 @@ OsdPtexMipmapTextureLoader::Block::guttering(OsdPtexMipmapTextureLoader *loader,
// seamless mipmap only works with square faces.
if (loader->getCornerPixel(accumPixel, numchannels,
this->index, edge, bpp, this->ulog2-level)) {
this->index, edge, this->ulog2-level)) {
// case1, case 2
if (edge == 1 || edge == 2) du += width;
if (edge == 2 || edge == 3) dv += height;
@ -661,7 +661,7 @@ OsdPtexMipmapTextureLoader::sampleNeighbor(unsigned char *border, int face,
bool
OsdPtexMipmapTextureLoader::getCornerPixel(float *resultPixel, int numchannels,
int face, int edge,
int bpp, int8_t reslog2)
int8_t reslog2)
{
const Ptex::FaceInfo &fi = _ptex->getFaceInfo(face);

View File

@ -135,7 +135,7 @@ private:
void optimizePacking(int maxNumPages, size_t targetMemory);
int getLevelDiff(int face, int edge);
bool getCornerPixel(float *resultPixel, int numchannels,
int face, int edge, int bpp, int8_t res);
int face, int edge, int8_t res);
void sampleNeighbor(unsigned char *border,
int face, int edge, int length, int bpp);
int resampleBorder(int face, int edgeId, unsigned char *result,

View File

@ -41,13 +41,13 @@ class OsdVertex {
public:
OsdVertex() {}
OsdVertex(int index) {}
OsdVertex(int /* index */) {}
OsdVertex(OsdVertex const & src) {}
OsdVertex(OsdVertex const & /* src */) {}
void AddWithWeight(OsdVertex const & i, float weight, void * = 0) {}
void AddWithWeight(OsdVertex const & /* i */, float /* weight */, void * = 0) {}
void AddVaryingWithWeight(const OsdVertex & i, float weight, void * = 0) {}
void AddVaryingWithWeight(const OsdVertex & /* i */, float /* weight */, void * = 0) {}
void Clear(void * = 0) {}

View File

@ -173,21 +173,21 @@ OsdUtilAdaptiveEvaluator::SetCoarsePositions(
bool
OsdUtilAdaptiveEvaluator::Refine(
int numThreads, string *errorMessage)
int numThreads, string */* errorMessage */)
{
const FarMesh<OsdVertex> *fmesh = _refiner->GetFarMesh();
#ifdef OPENSUBDIV_HAS_OPENMP
if (numThreads > 1) {
#ifdef OPENSUBDIV_HAS_OPENMP
OsdOmpComputeController ompComputeController(numThreads);
ompComputeController.Refine(_computeContext,
fmesh->GetKernelBatches(),
_vertexBuffer, _vvBuffer);
return true;
#endif
}
#endif
OsdCpuComputeController cpuComputeController;
cpuComputeController.Refine(_computeContext,

View File

@ -202,7 +202,7 @@ bool
OsdUtilSubdivTopology::ParseFromObjString(
char const * shapestr, int axis,
vector<float> *pointPositions,
std::string *errorMessage)
std::string * /* errorMessage */)
{
char * str=const_cast<char *>(shapestr), line[256];
bool done = false;
@ -351,7 +351,7 @@ OsdUtilTagData::AddCrease(int *indices, int numIndices,
// Either "normal" or "chaikin"
bool
OsdUtilTagData::AddCreaseMethod(const std::string &value)
OsdUtilTagData::AddCreaseMethod(const std::string & /* value */)
{
return true;
}
@ -360,7 +360,7 @@ OsdUtilTagData::AddCreaseMethod(const std::string &value)
// 1 == OpenSubdiv::HbrMesh<T>::k_InterpolateBoundaryEdgeAndCorner
// 2 == OpenSubdiv::HbrMesh<T>::k_InterpolateBoundaryEdgeOnly
bool
OsdUtilTagData::AddInterpolateBoundary(int value)
OsdUtilTagData::AddInterpolateBoundary(int /* value */)
{
return true;

View File

@ -202,21 +202,21 @@ OsdUtilUniformEvaluator::SetCoarseVVData(
bool
OsdUtilUniformEvaluator::Refine(
int numThreads, string *errorMessage)
int numThreads, string */* errorMessage */)
{
const FarMesh<OsdVertex> *fmesh = _refiner->GetFarMesh();
#ifdef OPENSUBDIV_HAS_OPENMP
if (numThreads > 1) {
#ifdef OPENSUBDIV_HAS_OPENMP
OsdOmpComputeController ompComputeController(numThreads);
ompComputeController.Refine(_computeContext,
fmesh->GetKernelBatches(),
_vertexBuffer, _vvBuffer);
return true;
#endif
}
#endif
OsdCpuComputeController cpuComputeController;
cpuComputeController.Refine(_computeContext,

View File

@ -92,7 +92,7 @@ struct shape {
std::string genShape(char const * name) const;
std::string genObj(char const * name) const;
std::string genObj() const;
std::string genRIB() const;
@ -229,7 +229,7 @@ std::string shape::genShape(char const * name) const {
}
//------------------------------------------------------------------------------
std::string shape::genObj(char const * name) const {
std::string shape::genObj() const {
std::stringstream sh;
sh<<"# This file uses centimeters as units for non-parametric coordinates.\n\n";
@ -750,7 +750,7 @@ createMesh( Scheme scheme=kCatmark, int fvarwidth=0) {
//------------------------------------------------------------------------------
template <class T> void
createVertices( shape const * sh, OpenSubdiv::HbrMesh<T> * mesh, std::vector<float> * verts ) {
createVerticesWithPositions(shape const * sh, OpenSubdiv::HbrMesh<T> * mesh) {
T v;
for(int i=0;i<sh->getNverts(); i++ ) {
@ -761,7 +761,7 @@ createVertices( shape const * sh, OpenSubdiv::HbrMesh<T> * mesh, std::vector<flo
//------------------------------------------------------------------------------
template <class T> void
createVertices( shape const * sh, OpenSubdiv::HbrMesh<T> * mesh, std::vector<float> & verts ) {
createVertices(shape const * sh, OpenSubdiv::HbrMesh<T> * mesh) {
T v;
for(int i=0;i<sh->getNverts(); i++ )
@ -778,7 +778,7 @@ copyVertexPositions( shape const * sh, OpenSubdiv::HbrMesh<T> * mesh, std::vecto
std::copy(sh->verts.begin(), sh->verts.end(), verts.begin());
// Sometimes Hbr dupes some vertices during Mesh::Finish() and our example
// Sometimes Hbr dupes some vertices during Mesh::Finish() and our example
// code uses those vertices to draw coarse control cages and such
std::vector<std::pair<int, int> > const splits = mesh->GetSplitVertices();
for (int i=0; i<(int)splits.size(); ++i) {
@ -913,7 +913,7 @@ simpleHbr(char const * shapestr, Scheme scheme, std::vector<float> * verts=0, bo
OpenSubdiv::HbrMesh<T> * mesh = createMesh<T>(scheme, fvarwidth);
createVertices<T>(sh, mesh, verts);
createVerticesWithPositions<T>(sh, mesh);
createTopology<T>(sh, mesh, scheme);
@ -938,7 +938,7 @@ simpleHbr(char const * shapestr, Scheme scheme, std::vector<float> & verts, bool
OpenSubdiv::HbrMesh<T> * mesh = createMesh<T>(scheme, fvarwidth);
createVertices<T>(sh, mesh, verts);
createVertices<T>(sh, mesh);
createTopology<T>(sh, mesh, scheme);