Fixed warnings

This commit is contained in:
Robert Osfield
2008-12-18 15:49:44 +00:00
parent 4de4375fce
commit 6055dee411
25 changed files with 157 additions and 99 deletions

View File

@@ -54,7 +54,8 @@ lib3ds_byte_read(FILE *f)
Lib3dsByte b;
ASSERT(f);
fread(&b,1,1,f);
int result = fread(&b,1,1,f);
if (result==0) return 0;
return(b);
}
@@ -73,7 +74,9 @@ lib3ds_word_read(FILE *f)
Lib3dsWord w;
ASSERT(f);
fread(b,2,1,f);
int result = fread(b,2,1,f);
if (result==0) return 0;
w=((Lib3dsWord)b[1] << 8) |
((Lib3dsWord)b[0]);
return(w);
@@ -96,7 +99,9 @@ lib3ds_dword_read(FILE *f)
Lib3dsDword d;
ASSERT(f);
fread(b,4,1,f);
int result = fread(b,4,1,f);
if (result==0) return 0;
d=((Lib3dsDword)b[3] << 24) |
((Lib3dsDword)b[2] << 16) |
((Lib3dsDword)b[1] << 8) |
@@ -120,7 +125,9 @@ lib3ds_intb_read(FILE *f)
Lib3dsIntb b;
ASSERT(f);
fread(&b,1,1,f);
int result = fread(&b,1,1,f);
if (result==0) return 0;
return(b);
}
@@ -140,7 +147,8 @@ lib3ds_intw_read(FILE *f)
Lib3dsByte b[2];
ASSERT(f);
fread(b,2,1,f);
int result = fread(b,2,1,f);
if (result==0) return 0;
if (s_requiresByteSwap)
{
@@ -166,7 +174,8 @@ lib3ds_intd_read(FILE *f)
Lib3dsByte b[4];
ASSERT(f);
fread(b,4,1,f);
int result = fread(b,4,1,f);
if (result==0) return 0;
if (s_requiresByteSwap)
{
@@ -192,7 +201,8 @@ lib3ds_float_read(FILE *f)
Lib3dsByte b[4];
ASSERT(f);
fread(b,4,1,f);
int result = fread(b,4,1,f);
if (result==0) return 0;
if (s_requiresByteSwap)
{
@@ -434,18 +444,30 @@ lib3ds_intd_write(Lib3dsIntd d, FILE *f)
*
* \return True on success, False otherwise.
*/
Lib3dsBool
lib3ds_float_write(Lib3dsFloat l, FILE *f)
{
Lib3dsByte b[4];
Lib3dsDword d;
ASSERT(f);
d=*((Lib3dsDword*)&l);
b[3]=(Lib3dsByte)(((Lib3dsDword)d & 0xFF000000) >> 24);
b[2]=(Lib3dsByte)(((Lib3dsDword)d & 0x00FF0000) >> 16);
b[1]=(Lib3dsByte)(((Lib3dsDword)d & 0x0000FF00) >> 8);
b[0]=(Lib3dsByte)(((Lib3dsDword)d & 0x000000FF));
Lib3dsByte b[4];
Lib3dsByte* ptr = (Lib3dsByte*) (&l);
if (s_requiresByteSwap)
{
b[3] = *ptr++;
b[2] = *ptr++;
b[1] = *ptr++;
b[0] = *ptr++;
}
else
{
b[0] = *ptr++;
b[1] = *ptr++;
b[2] = *ptr++;
b[3] = *ptr++;
}
if (fwrite(b,4,1,f)!=1) {
return(LIB3DS_FALSE);
}

View File

@@ -83,7 +83,10 @@ lib3ds_viewport_read(Lib3dsViewport *viewport, FILE *f)
lib3ds_vector_read(viewport->layout.viewL[cur].center,f);
viewport->layout.viewL[cur].horiz_angle=lib3ds_float_read(f);
viewport->layout.viewL[cur].vert_angle=lib3ds_float_read(f);
fread(viewport->layout.viewL[cur].camera,11,1,f);
int result = fread(viewport->layout.viewL[cur].camera,11,1,f);
if (result==0) return (LIB3DS_FALSE);
++cur;
}
break;
@@ -157,7 +160,8 @@ lib3ds_viewport_read(Lib3dsViewport *viewport, FILE *f)
case LIB3DS_VIEW_CAMERA:
{
viewport->default_view.type=LIB3DS_VIEW_TYPE_CAMERA;
fread(viewport->default_view.camera,11,1,f);
int result = fread(viewport->default_view.camera,11,1,f);
if (result==0) return (LIB3DS_FALSE);
}
break;
default:
@@ -249,7 +253,8 @@ lib3ds_viewport_write(Lib3dsViewport *viewport, FILE *f)
lib3ds_vector_write(viewport->layout.viewL[i].center,f);
lib3ds_float_write(viewport->layout.viewL[i].horiz_angle,f);
lib3ds_float_write(viewport->layout.viewL[i].vert_angle,f);
fwrite(viewport->layout.viewL[i].camera,11,1,f);
int result = fwrite(viewport->layout.viewL[i].camera,11,1,f);
if (result==0) return (LIB3DS_FALSE);
}
if (!lib3ds_chunk_write_end(&c,f)) {
@@ -345,7 +350,8 @@ lib3ds_viewport_write(Lib3dsViewport *viewport, FILE *f)
c.chunk=LIB3DS_VIEW_CAMERA;
c.size=17;
lib3ds_chunk_write(&c,f);
fwrite(viewport->default_view.camera,1,11,f);
int result = fwrite(viewport->default_view.camera,1,11,f);
if (result==0) return (LIB3DS_FALSE);
}
break;
}

View File

@@ -1168,7 +1168,8 @@ readObject(std::istream& stream, FileData& fileData, const osg::Matrix& parentTr
std::string texname = readString(stream);
// strip absolute paths
if (texname[0] == '/' || isalpha(texname[0]) && texname[1] == ':') {
if (texname[0] == '/' ||
(isalpha(texname[0]) && texname[1] == ':')) {
std::string::size_type p = texname.rfind('\\');
if (p != std::string::npos)
texname = texname.substr(p+1, std::string::npos);

View File

@@ -249,17 +249,17 @@ void VBSPGeometry::createDispSurface(Face & face, DisplaceInfo & dispInfo)
Vec3 texV;
float texVOffset;
float texVScale;
unsigned int i, j, k;
int i, j, k;
double dist, minDist;
int minIndex;
int minIndex = 0;
osg::Vec3 temp;
int edgeIndex;
int currentSurfEdge;
Edge currentEdge;
osg::Vec3 currentVertex;
osg::Vec3 vertices[4];
unsigned int firstVertex;
unsigned int numEdgeVertices;
int firstVertex;
int numEdgeVertices;
double subdivideScale;
osg::Vec3 leftEdge, rightEdge;
osg::Vec3 leftEdgeStep, rightEdgeStep;

View File

@@ -355,11 +355,11 @@ void VBSPReader::processDispVerts(std::istream & str, int offset, int length)
std::string VBSPReader::getToken(std::string str, const char * delim,
std::string::size_type & index)
{
std::string::size_type start, end;
std::string token;
// Look for the first non-occurrence of the delimiters
start = str.find_first_not_of(" \t\n\r\"", index);
std::string::size_type start = str.find_first_not_of(" \t\n\r\"", index);
std::string::size_type end = std::string::npos;
if (start != std::string::npos)
{
// From there, look for the first occurrence of a delimiter
@@ -627,7 +627,6 @@ ref_ptr<StateSet> VBSPReader::readMaterialFile(std::string materialName)
bool found = false;
ref_ptr<StateSet> stateSet;
std::string shaderName;
osg::Image * texImage = 0;
std::string texName;
std::string tex2Name;
ref_ptr<Texture> texture;

View File

@@ -272,10 +272,12 @@ osgDB::ReaderWriter::ReadResult ReaderWriterCURL::readFile(ObjectType objectType
//Setting Proxy by OSG Options
if(!optProxy.empty())
{
if(!optProxyPort.empty())
proxyAddress = optProxy + ":" + optProxyPort;
else
proxyAddress = optProxy + ":8080"; //Port not found, using default
}
}
std::string fileName;

View File

@@ -258,13 +258,13 @@ public:
_string(""),
_point1(0,0,0),
_point2(0,0,0),
_ocs(0,0,1),
_height(1),
_xscale(1),
_rotation(0),
_flags(0),
_hjustify(0),
_vjustify(0),
_ocs(0,0,1) {}
_vjustify(0) {}
virtual ~dxfText() {}
virtual dxfBasicEntity* create() { return new dxfText; }

View File

@@ -171,7 +171,7 @@ class Logos: public osg::Drawable
bool hasLogos()
{
int n = 0;
for( int i = Center; i <= last_position; i++ )
for( int i = Center; i < last_position; i++ )
n += logos[i].size();
return (n != 0);
}

View File

@@ -67,11 +67,23 @@ U4 read_U4(Iter &it)
return u4;
}
template<typename D, typename S>
D changeType4(S src)
{
D dest;
char* dest_ptr = reinterpret_cast<char*>(&dest);
char* src_ptr = reinterpret_cast<char*>(&src);
for(int i=0; i<4; ++i)
{
*dest_ptr = *src_ptr;
}
return dest;
}
template<class Iter>
F4 read_F4(Iter &it)
{
U4 u4 = read_U4(it);
return *reinterpret_cast<F4 *>(&u4);
return changeType4<F4, U4>(read_U4(it));
}
template<class Iter>

View File

@@ -41,6 +41,7 @@
#include "old_Lwo2.h"
#include "old_Lwo2Layer.h"
#include "lwo2read.h"
Lwo2::Lwo2():
_current_layer(0),
@@ -77,7 +78,7 @@ Lwo2::ReadFile( const string& filename )
// checking EA-IFF85 format
// http://www.lightwave3d.com/developer/75lwsdk/docs/filefmts/eaiff85.html
if (_read_long() != tag_FORM)
if (_read_uint() != tag_FORM)
{
notify(INFO) << "File '" << filename << "' is not IFF format file." << std::endl;
_fin.close();
@@ -88,12 +89,12 @@ Lwo2::ReadFile( const string& filename )
notify(INFO) << "Detected EA-IFF85 format" << std::endl;
}
unsigned long form_size = _read_long();
unsigned int form_size = _read_uint();
notify(INFO) << "Form size: " << form_size << std::endl;
// checking LWO2 format
// http://www.lightwave3d.com/developer/75lwsdk/docs/filefmts/lwo2.html
if (_read_long() != tag_LWO2)
if (_read_uint() != tag_LWO2)
{
unsigned long make_id(const char*);
notify(INFO) << "File '" << filename << "' is not LWO2 format file." << std::endl;
@@ -112,8 +113,8 @@ Lwo2::ReadFile( const string& filename )
// main loop for reading tags
while (read_bytes < form_size && !_fin.eof())
{
current_tag_name = _read_long();
current_tag_size = _read_long();
current_tag_name = _read_uint();
current_tag_size = _read_uint();
read_bytes += 8 + current_tag_size + current_tag_size % 2;
_print_tag(current_tag_name, current_tag_size);
@@ -176,8 +177,8 @@ Lwo2::_read_char()
return static_cast<unsigned char>(c);
}
unsigned long
Lwo2::_read_long()
unsigned int
Lwo2::_read_uint()
{
return
(_read_char() << 24) |
@@ -197,8 +198,7 @@ Lwo2::_read_short()
float
Lwo2::_read_float()
{
unsigned long x = _read_long();
return *(float*)&x;
return lwo2::changeType4<float, unsigned int>(_read_uint());
}
// read null terminated string
@@ -316,7 +316,7 @@ void Lwo2::_read_points(unsigned long size)
void Lwo2::_read_vertex_mapping(unsigned long size)
{
unsigned int type = _read_long();
unsigned int type = _read_uint();
size -= 4;
_print_type(type);
@@ -364,7 +364,7 @@ void Lwo2::_read_vertex_mapping(unsigned long size)
void
Lwo2::_read_polygons(unsigned long size)
{
unsigned int type = _read_long();
unsigned int type = _read_uint();
size -= 4;
_print_type(type);
@@ -408,7 +408,7 @@ Lwo2::_read_polygons(unsigned long size)
void Lwo2::_read_polygon_tag_mapping(unsigned long size)
{
unsigned int type = _read_long();
unsigned int type = _read_uint();
size -= 4;
_print_type(type);
@@ -441,7 +441,7 @@ void Lwo2::_read_polygon_tag_mapping(unsigned long size)
void Lwo2::_read_polygons_mapping(unsigned long size)
{
unsigned int type = _read_long();
unsigned int type = _read_uint();
size -= 4;
_print_type(type);
@@ -503,14 +503,14 @@ void Lwo2::_read_polygons_mapping(unsigned long size)
void
Lwo2::_read_image_definition(unsigned long size)
{
unsigned int index = _read_long();
unsigned int index = _read_uint();
size -= 4;
notify(DEBUG_INFO) << " index \t" << index << std::endl;
unsigned int type;
while (size > 0)
{
type = _read_long();
type = _read_uint();
size -= 4;
_print_type(type);
@@ -557,7 +557,7 @@ void Lwo2::_read_surface(unsigned long size)
while (size > 0 && !_fin.eof())
{
current_tag_name = _read_long();
current_tag_name = _read_uint();
size -= 4;
current_tag_size = _read_short();
size -= 2;
@@ -572,7 +572,7 @@ void Lwo2::_read_surface(unsigned long size)
size -= blok_size;
while (blok_size > 0)
{
current_tag_name = _read_long();
current_tag_name = _read_uint();
blok_size -= 4;
current_tag_size = _read_short();
blok_size -= 2;
@@ -599,7 +599,7 @@ void Lwo2::_read_surface(unsigned long size)
while(imap_size > 0)
{
current_tag_name = _read_long();
current_tag_name = _read_uint();
imap_size -= 4;
current_tag_size = _read_short();
imap_size -= 2;

View File

@@ -69,7 +69,7 @@ class Lwo2
unsigned char _read_char();
unsigned short _read_short();
unsigned long _read_long();
unsigned int _read_uint();
float _read_float();
string& _read_string(string&);

View File

@@ -17,6 +17,9 @@
*/
#include "old_lw.h"
#include "lwo2read.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@@ -80,10 +83,10 @@ static gint32 read_long(FILE *f)
return (read_char(f)<<24) | (read_char(f)<<16) | (read_char(f)<<8) | read_char(f);
}
static GLfloat read_float(FILE *f)
{
gint32 x = read_long(f);
return *(GLfloat*)&x;
return lwo2::changeType4<GLfloat, gint32>(read_long(f));
}
static gint read_string(FILE *f, char *s)

View File

@@ -173,7 +173,11 @@ load_md2 (const char *filename, const osgDB::ReaderWriter::Options* options)
}
#else
mapbase = malloc (st.st_size);
read (file_fd, mapbase, st.st_size);
if (read(file_fd, mapbase, st.st_size)==0)
{
close (file_fd);
return NULL;
}
#endif
if (g_md2NormalsArray == NULL) {

View File

@@ -213,7 +213,6 @@ public:
{
osg::Geometry* geom = new osg::Geometry;
unsigned int total = 0;
for (int i = 0; i < mpolygon->getNumGeometries(); i++ )
{
OGRGeometry* ogrGeom = mpolygon->getGeometryRef(i);
@@ -233,7 +232,6 @@ public:
if (!geom->getVertexArray())
{ // no yet data we put the first in
osg::Vec3Array* arraySrc = static_cast<osg::Vec3Array*>(geom->getVertexArray());
geom->setVertexArray(geometry->getVertexArray());
geom->setPrimitiveSetList(geometry->getPrimitiveSetList());

View File

@@ -24,17 +24,17 @@ osgDB::RegisterDotOsgWrapperProxy ShadowMap_Proxy
ShadowMap_writeLocalData
);
bool ShadowMap_readLocalData(osg::Object& obj, osgDB::Input &fr)
bool ShadowMap_readLocalData(osg::Object& /*obj*/, osgDB::Input &/*fr*/)
{
osgShadow::ShadowMap& ss = static_cast<osgShadow::ShadowMap&>(obj);
// osgShadow::ShadowMap& ss = static_cast<osgShadow::ShadowMap&>(obj);
bool itAdvanced = false;
return itAdvanced;
}
bool ShadowMap_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
bool ShadowMap_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/)
{
const osgShadow::ShadowMap& ss = static_cast<const osgShadow::ShadowMap &>(obj);
// const osgShadow::ShadowMap& ss = static_cast<const osgShadow::ShadowMap &>(obj);
return true;
}

View File

@@ -24,17 +24,17 @@ osgDB::RegisterDotOsgWrapperProxy ShadowTechnique_Proxy
ShadowTechnique_writeLocalData
);
bool ShadowTechnique_readLocalData(osg::Object& obj, osgDB::Input &fr)
bool ShadowTechnique_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/)
{
osgShadow::ShadowTechnique& ss = static_cast<osgShadow::ShadowTechnique&>(obj);
//osgShadow::ShadowTechnique& ss = static_cast<osgShadow::ShadowTechnique&>(obj);
bool itAdvanced = false;
return itAdvanced;
}
bool ShadowTechnique_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
bool ShadowTechnique_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/)
{
const osgShadow::ShadowTechnique& ss = static_cast<const osgShadow::ShadowTechnique &>(obj);
//const osgShadow::ShadowTechnique& ss = static_cast<const osgShadow::ShadowTechnique &>(obj);
return true;
}

View File

@@ -24,17 +24,17 @@ osgDB::RegisterDotOsgWrapperProxy ShadowTexture_Proxy
ShadowTexture_writeLocalData
);
bool ShadowTexture_readLocalData(osg::Object& obj, osgDB::Input &fr)
bool ShadowTexture_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/)
{
osgShadow::ShadowTexture& ss = static_cast<osgShadow::ShadowTexture&>(obj);
// osgShadow::ShadowTexture& ss = static_cast<osgShadow::ShadowTexture&>(obj);
bool itAdvanced = false;
return itAdvanced;
}
bool ShadowTexture_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
bool ShadowTexture_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/)
{
const osgShadow::ShadowTexture& ss = static_cast<const osgShadow::ShadowTexture &>(obj);
// const osgShadow::ShadowTexture& ss = static_cast<const osgShadow::ShadowTexture &>(obj);
return true;
}

View File

@@ -24,17 +24,17 @@ osgDB::RegisterDotOsgWrapperProxy ShadowVolume_Proxy
ShadowVolume_writeLocalData
);
bool ShadowVolume_readLocalData(osg::Object& obj, osgDB::Input &fr)
bool ShadowVolume_readLocalData(osg::Object& /*obj*/, osgDB::Input& /*fr*/)
{
osgShadow::ShadowVolume& ss = static_cast<osgShadow::ShadowVolume&>(obj);
// osgShadow::ShadowVolume& ss = static_cast<osgShadow::ShadowVolume&>(obj);
bool itAdvanced = false;
return itAdvanced;
}
bool ShadowVolume_writeLocalData(const osg::Object& obj, osgDB::Output& fw)
bool ShadowVolume_writeLocalData(const osg::Object& /*obj*/, osgDB::Output& /*fw*/)
{
const osgShadow::ShadowVolume& ss = static_cast<const osgShadow::ShadowVolume &>(obj);
// const osgShadow::ShadowVolume& ss = static_cast<const osgShadow::ShadowVolume &>(obj);
return true;
}

View File

@@ -73,9 +73,11 @@ class sgReaderWriterOSGTGZ : public osgDB::ReaderWriter
mkdir( dirname, 0700 );
#endif
system( command );
if ( system( command ) ) {
return ReadResult::FILE_NOT_HANDLED;
}
osg::Group *grp = new osg::Group;
osg::ref_ptr<osg::Group> grp = new osg::Group;
osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = options ? static_cast<osgDB::ReaderWriter::Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new osgDB::ReaderWriter::Options;
local_options->getDatabasePathList().push_front(dirname);
@@ -97,12 +99,13 @@ class sgReaderWriterOSGTGZ : public osgDB::ReaderWriter
// note, is this the right command for windows?
// is there any way of overiding the Y/N option? RO.
sprintf( command, "erase %s", dirname );
system( command );
#else
sprintf( command, "rm -rf %s", dirname );
system( command );
#endif
if ( system( command ) ) {
return ReadResult::FILE_NOT_HANDLED;
}
if( grp->getNumChildren() == 0 )
{
@@ -110,7 +113,7 @@ class sgReaderWriterOSGTGZ : public osgDB::ReaderWriter
return ReadResult::FILE_NOT_HANDLED;
}
return grp;
return grp.get();
}

View File

@@ -31,9 +31,12 @@ class CairoImage : public osg::Referenced
_context(0) {}
void create(unsigned int width, unsigned int height)
void create(int width, int height)
{
if (_image->data() && width==_image->s() && height==_image->t()) return;
if (_image->data() && width==_image->s() && height==_image->t())
{
return;
}
osg::notify(osg::NOTICE)<<"Create cario surface/context "<<width<<", "<<height<<std::endl;
@@ -208,7 +211,8 @@ class PopplerPdfImage : public osgWidget::PdfImage
cairo_restore(_cairoImage->getContext());
dirty();
return true;
}

View File

@@ -692,7 +692,7 @@ PolygonM::~PolygonM()
delete[] parts;
delete[] points;
delete[] mArray;
};
}
bool PolygonM::read( int fd )

View File

@@ -84,9 +84,11 @@ class ReaderWriterTGZ : public osgDB::ReaderWriter
osg::notify(osg::NOTICE)<<"Running command '"<<command<<"'"<<std::endl;
system( command );
int result = system( command );
if (result!=0) return ReadResult::ERROR_IN_READING_FILE;
osg::Group *grp = new osg::Group;
osg::ref_ptr<osg::Group> grp = new osg::Group;
osg::notify(osg::NOTICE)<<"Done"<<std::endl;
@@ -124,15 +126,16 @@ class ReaderWriterTGZ : public osgDB::ReaderWriter
sprintf( command, "rm -rf %s", dirname );
#endif
osg::notify(osg::NOTICE)<<"Running command '"<<command<<"'"<<std::endl;
system( command );
result = system( command );
if (result!=0) return ReadResult::ERROR_IN_READING_FILE;
if( grp->getNumChildren() == 0 )
{
grp->unref();
return ReadResult::FILE_NOT_HANDLED;
}
return grp;
return grp.get();
}

View File

@@ -286,6 +286,7 @@ bool LibVncImage::sendPointerEvent(int x, int y, int buttonMask)
SendPointerEvent(_client ,x, y, buttonMask);
return true;
}
return false;
}
bool LibVncImage::sendKeyEvent(int key, bool keyDown)
@@ -295,6 +296,7 @@ bool LibVncImage::sendKeyEvent(int key, bool keyDown)
SendKeyEvent(_client, key, keyDown ? TRUE : FALSE);
return true;
}
return false;
}

View File

@@ -327,8 +327,8 @@ class ReaderWriterXine : public osgDB::ReaderWriter
if(user_home)
{
char* cfgfile = NULL;
asprintf(&(cfgfile), "%s/.xine/config", user_home);
xine_config_load(_xine, cfgfile);
int result = asprintf(&(cfgfile), "%s/.xine/config", user_home);
if (result>0) xine_config_load(_xine, cfgfile);
}
xine_init(_xine);

View File

@@ -71,11 +71,6 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
fileName.c_str(), dirname);
}
osg::notify(osg::NOTICE)<<"Running command '"<<command<<"'"<<std::endl;
if ( system( command ) ) {
return ReadResult::FILE_NOT_HANDLED;
}
#else
sprintf( dirname, "/tmp/.zip%06d", getpid());
mkdir( dirname, 0700 );
@@ -84,10 +79,14 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
"unzip %s -d %s",
fileName.c_str(), dirname);
system( command );
#endif
osg::Group *grp = new osg::Group;
osg::notify(osg::INFO)<<"Running command '"<<command<<"'"<<std::endl;
if ( system( command ) ) {
return ReadResult::FILE_NOT_HANDLED;
}
osg::ref_ptr<osg::Group> grp = new osg::Group;
osg::ref_ptr<osgDB::ReaderWriter::Options> local_options = options ? static_cast<osgDB::ReaderWriter::Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new osgDB::ReaderWriter::Options;
local_options->getDatabasePathList().push_front(dirname);
@@ -117,20 +116,20 @@ class ReaderWriterZIP : public osgDB::ReaderWriter
// note, is this the right command for windows?
// is there any way of overiding the Y/N option? RO.
sprintf( command, "erase /S /Q \"%s\"", dirname );
system( command );
int result = system( command );
#else
sprintf( command, "rm -rf %s", dirname );
system( command );
int result = system( command );
#endif
if (result!=0) return ReadResult::ERROR_IN_READING_FILE;
if( grp->getNumChildren() == 0 )
{
grp->unref();
return ReadResult::FILE_NOT_HANDLED;
}
return grp;
return grp.get();
}
};