Fixed warnings

remotes/origin/Deprecated_master_20th_November_2022
Robert Osfield 8 years ago
parent fb4f7a025b
commit 4a6fb5a49a

@ -195,8 +195,8 @@ ConvertFromInventor::restructure(void* data, SoCallbackAction* action,
}
///////////////////////////////////////////////////////////
SoCallbackAction::Response
ConvertFromInventor::restructurePreNode(void* data, SoCallbackAction* action,
const SoNode* node)
ConvertFromInventor::restructurePreNode(void* data, SoCallbackAction* /*action*/,
const SoNode* /*node*/)
{
std::vector<std::vector<int> > &stack = *((std::vector<std::vector<int> >*)data);
@ -206,7 +206,7 @@ ConvertFromInventor::restructurePreNode(void* data, SoCallbackAction* action,
}
////////////////////////////////////////////////////////////////////
SoCallbackAction::Response
ConvertFromInventor::restructurePostNode(void* data, SoCallbackAction* action,
ConvertFromInventor::restructurePostNode(void* data, SoCallbackAction* /*action*/,
const SoNode* node)
{
std::vector<std::vector<int> > &stack = *((std::vector<std::vector<int> >*)data);
@ -507,7 +507,7 @@ ConvertFromInventor::ivPushState(const SoCallbackAction *action,
///////////////////////////////////////////////////////////////////
void
ConvertFromInventor::ivPopState(const SoCallbackAction *action,
const SoNode *initiator)
const SoNode * /*initiator*/)
{
bool multipop;
do {
@ -1117,14 +1117,14 @@ SbBool SoTexture2Osg::readInstance(SoInput *in, unsigned short flags)
{
// create options and read the file
osgDB::ReaderWriter::Options *options = createOptions();
osg::ref_ptr<osg::Image> image = loadImage(filename.getValue().getString(), options);
osg::ref_ptr<osg::Image> limage = loadImage(filename.getValue().getString(), options);
if (image.valid())
if (limage.valid())
{
// get image dimensions and data
int nc = osg::Image::computeNumComponents(image->getPixelFormat());
SbVec2s size(image->s(), image->t());
unsigned char *bytes = image->data();
int nc = osg::Image::computeNumComponents(limage->getPixelFormat());
SbVec2s size(limage->s(), limage->t());
unsigned char *bytes = limage->data();
// disable notification on image while setting data from filename
// as a notify will cause a filename.setDefault(TRUE)
@ -1325,9 +1325,9 @@ ConvertFromInventor::postTexture(void* data, SoCallbackAction *,
SoTexture2 *t = (SoTexture2*)node;
SbVec2s size;
int nc;
const unsigned char *data = t->image.getValue(size, nc);
const unsigned char *ldata = t->image.getValue(size, nc);
texturingEnabled = t->filename.getValue().getLength() ||
(data && size != SbVec2s(0,0));
(ldata && size != SbVec2s(0,0));
}
#ifdef __COIN__
@ -1509,7 +1509,7 @@ ConvertFromInventor::preLight(void* data, SoCallbackAction* action,
}
///////////////////////////////////////////////////////////////////
SoCallbackAction::Response
ConvertFromInventor::preEnvironment(void* data, SoCallbackAction* action,
ConvertFromInventor::preEnvironment(void* data, SoCallbackAction* /*action*/,
const SoNode* node)
{
#ifdef DEBUG_IV_PLUGIN
@ -1557,7 +1557,7 @@ convertShader(osg::Shader::Type osgShaderType,
#endif // INVENTOR_SHADERS_AVAILABLE
///////////////////////////////////////////////////////////////////
SoCallbackAction::Response
ConvertFromInventor::preShaderProgram(void* data, SoCallbackAction* action,
ConvertFromInventor::preShaderProgram(void* data, SoCallbackAction* /*action*/,
const SoNode* node)
{
#ifdef DEBUG_IV_PLUGIN
@ -1980,7 +1980,7 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode,
}
///////////////////////////////////////////////////////////////////
SoCallbackAction::Response
ConvertFromInventor::preInfo(void* data, SoCallbackAction* action,
ConvertFromInventor::preInfo(void* /*data*/, SoCallbackAction* /*action*/,
const SoNode* node)
{
#ifdef DEBUG_IV_PLUGIN

@ -249,7 +249,7 @@ void osgArray2ivMField_template(const osg::Array *array, fieldClass &field, int
template<typename ivType, typename osgType, int shift>
void osgArray2ivMField_composite_template_worker(ivType *dest, osgType *src, int num, int numItemsUntilMinusOne = 0)
void osgArray2ivMField_composite_template_worker(ivType *dest, osgType *src, int num, int /*numItemsUntilMinusOne*/ = 0)
{
for (int i=0; i<num; i++, src+=shift)
dest[i] = ivType(src);
@ -257,7 +257,7 @@ void osgArray2ivMField_composite_template_worker(ivType *dest, osgType *src, int
template<>
void osgArray2ivMField_composite_template_worker<SbColor, GLubyte, 4>(SbColor *dest, GLubyte *src, int num, int numItemsUntilMinusOne)
void osgArray2ivMField_composite_template_worker<SbColor, GLubyte, 4>(SbColor *dest, GLubyte *src, int num, int /*numItemsUntilMinusOne*/)
{
for (int i=0; i<num; i++, src+=4)
dest[i].setValue(src[0]/255.f, src[1]/255.f, src[2]/255.f);
@ -265,7 +265,7 @@ void osgArray2ivMField_composite_template_worker<SbColor, GLubyte, 4>(SbColor *d
template<>
void osgArray2ivMField_composite_template_worker<SbVec3f, float, 2>(SbVec3f *dest, float *src, int num, int numItemsUntilMinusOne)
void osgArray2ivMField_composite_template_worker<SbVec3f, float, 2>(SbVec3f *dest, float *src, int num, int /*numItemsUntilMinusOne*/)
{
for (int i=0; i<num; i++, src+=2)
dest[i].setValue(src[0], src[1], 0.f);
@ -273,7 +273,7 @@ void osgArray2ivMField_composite_template_worker<SbVec3f, float, 2>(SbVec3f *des
template<typename fieldClass, typename ivType, typename osgType, int shift>
void osgArray2ivMField_composite_template(const osg::Array *array, fieldClass &field, int startIndex = 0, int stopIndex = 0, int numItemsUntilMinusOne = 0)
void osgArray2ivMField_composite_template(const osg::Array *array, fieldClass &field, int startIndex = 0, int stopIndex = 0, int /*numItemsUntilMinusOne*/ = 0)
{
int num = array->getNumElements();
if (startIndex!=0 || stopIndex!=0) {
@ -296,7 +296,7 @@ void osgArray2ivMField_composite_template(const osg::Array *array, fieldClass &f
template<typename fieldClass, typename ivType, typename osgType, int numComponents>
void osgArray2ivMField_pack_template(const osg::Array *array, fieldClass &field,
osgType mul, osgType max, osgType min,
int startIndex = 0, int stopIndex = 0, int numItemsUntilMinusOne = 0)
int startIndex = 0, int stopIndex = 0, int /*numItemsUntilMinusOne*/ = 0)
{
int i,num = array->getNumElements();
if (startIndex!=0 || stopIndex!=0) {
@ -1292,11 +1292,11 @@ static bool processPrimitiveSet(const deprecated_osg::Geometry *g, const osg::Pr
case GL_LINE_STRIP:
if (drawArrayLengths) {
((SoLineSet*)shape)->numVertices.setNum(drawArrayLengthsElems);
int i=0;
int li=0;
for (osg::DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr, i++)
((SoLineSet*)shape)->numVertices.set1Value(i, *primItr);
++primItr, li++)
((SoLineSet*)shape)->numVertices.set1Value(li, *primItr);
} else {
((SoLineSet*)shape)->numVertices.setNum(1);
((SoLineSet*)shape)->numVertices.set1Value(0, elementsCount);
@ -1320,11 +1320,11 @@ static bool processPrimitiveSet(const deprecated_osg::Geometry *g, const osg::Pr
case GL_TRIANGLE_STRIP:
if (drawArrayLengths) {
((SoTriangleStripSet*)shape)->numVertices.setNum(drawArrayLengthsElems);
int i=0;
int li=0;
for (osg::DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr, i++)
((SoTriangleStripSet*)shape)->numVertices.set1Value(i, *primItr);
++primItr, li++)
((SoTriangleStripSet*)shape)->numVertices.set1Value(li, *primItr);
} else {
((SoTriangleStripSet*)shape)->numVertices.setNum(1);
((SoTriangleStripSet*)shape)->numVertices.set1Value(0, elementsCount);
@ -1339,11 +1339,11 @@ static bool processPrimitiveSet(const deprecated_osg::Geometry *g, const osg::Pr
assert(elementsCount % 2 == 0 && "elementsCount is not multiple of 2.");
if (drawArrayLengths) {
((SoTriangleStripSet*)shape)->numVertices.setNum(drawArrayLengthsElems);
int i=0;
int li=0;
for (osg::DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr, i++)
((SoTriangleStripSet*)shape)->numVertices.set1Value(i, *primItr);
++primItr, li++)
((SoTriangleStripSet*)shape)->numVertices.set1Value(li, *primItr);
} else {
((SoTriangleStripSet*)shape)->numVertices.setNum(1);
((SoTriangleStripSet*)shape)->numVertices.set1Value(0, elementsCount);
@ -1367,11 +1367,11 @@ static bool processPrimitiveSet(const deprecated_osg::Geometry *g, const osg::Pr
case GL_POLYGON:
if (drawArrayLengths) {
((SoFaceSet*)shape)->numVertices.setNum(drawArrayLengthsElems);
int i=0;
int li=0;
for (osg::DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr, i++)
((SoFaceSet*)shape)->numVertices.set1Value(i, *primItr);
++primItr, li++)
((SoFaceSet*)shape)->numVertices.set1Value(li, *primItr);
} else {
((SoFaceSet*)shape)->numVertices.setNum(1);
((SoFaceSet*)shape)->numVertices.set1Value(0, elementsCount);
@ -1507,12 +1507,16 @@ void ConvertToInventor::processGeometry(const deprecated_osg::Geometry *g, Inven
if (ivState->osgMaterial == NULL ||
ivState->osgMaterial->getColorMode() == osg::Material::DIFFUSE ||
ivState->osgMaterial->getColorMode() == osg::Material::AMBIENT_AND_DIFFUSE)
{
osgArray2ivMField(g->getColorArray(), *colorField);
else; // FIXME: implement some workaround for non-diffuse cases?
}
else
{ // FIXME: implement some workaround for non-diffuse cases?
// note: Warning was already shown in createInventorState().
// note2: There is no effect to convert SoMaterial::[ambient|specular|emissive]color
// here because Inventor does not set them per-vertex (performance reasons). See
// Inventor documentation for more details.
}
}
@ -1797,7 +1801,7 @@ void ConvertToInventor::processShapeDrawable(const osg::ShapeDrawable *d, Invent
virtual void apply(const osg::CompositeShape&) { warnNonSupported(); }
InventorState *ivState;
MyShapeVisitor(InventorState *ivState) { this->ivState = ivState; }
MyShapeVisitor(InventorState * in_ivState) { ivState = in_ivState; }
} shapeVisitor(ivState);
// convert ShapeDrawable

@ -72,7 +72,7 @@ void ReaderWriterIV::initInventor() const
}
static void errorCallback(const SoError *error, void *data)
static void errorCallback(const SoError *error, void * /*data*/)
{
// note: Coin and SGI Inventor puts "Inventor read error..." or "Coin warning..."
// introduction string to the error message, so we do not prepend the error message
@ -260,7 +260,7 @@ ReaderWriterIV::readNode(std::istream& fin,
osgDB::ReaderWriter::WriteResult
ReaderWriterIV::writeNode(const osg::Node& node, const std::string& fileName,
const osgDB::ReaderWriter::Options* options) const
const osgDB::ReaderWriter::Options* /*options*/) const
{
// accept extension
std::string ext = osgDB::getLowerCaseFileExtension(fileName);

Loading…
Cancel
Save