From 60d81afd02a53224afcde3d389c776c51f54cee9 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sat, 23 Feb 2013 15:53:04 -0500 Subject: [PATCH 1/3] ptexTextureLoader: Fix a few compiler warnings --- opensubdiv/osd/ptexTextureLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opensubdiv/osd/ptexTextureLoader.cpp b/opensubdiv/osd/ptexTextureLoader.cpp index 90e69cd6..10be66be 100755 --- a/opensubdiv/osd/ptexTextureLoader.cpp +++ b/opensubdiv/osd/ptexTextureLoader.cpp @@ -418,7 +418,7 @@ OsdPtexTextureLoader::OptimizePacking( int maxnumpages ) } // note: at least 2*GUTTER_WIDTH of margin required for each page to fit - _pagesize += GetPageMargin(); + _pagesize += (unsigned short)GetPageMargin(); // grow the pagesize to make sure the optimization will not exceed the maximum // number of pages allowed @@ -439,7 +439,7 @@ OsdPtexTextureLoader::OptimizePacking( int maxnumpages ) // traverse existing pages for a suitable slot --------------- bool added=false; for( unsigned long int p=firstslot; p<_pages.size(); ++p ) - if( (added=_pages[p]->addBlock( b, GetGutterWidth() )) ) { + if( (added=_pages[p]->addBlock( b, GetGutterWidth() )) == true ) { break; } From df95968142070804f5e113b939ad2a9fd858083d Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sat, 23 Feb 2013 15:53:04 -0500 Subject: [PATCH 2/3] hdr_reader: Fix a few compiler warnings --- examples/common/hdr_reader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/common/hdr_reader.cpp b/examples/common/hdr_reader.cpp index 8497feb6..d79373c8 100644 --- a/examples/common/hdr_reader.cpp +++ b/examples/common/hdr_reader.cpp @@ -77,7 +77,7 @@ readLine(unsigned char *line, int length, FILE *fp) if (c > 128) { // runlength c &= 127; - int value = getc(fp); + unsigned char value = (unsigned char)getc(fp); while (c--) { line[x*4+i] = value; x++; @@ -85,7 +85,8 @@ readLine(unsigned char *line, int length, FILE *fp) } else { // non- runlength while (c--) { - line[x*4+i] = getc(fp); + unsigned char value = (unsigned char)getc(fp); + line[x*4+i] = value; x++; } } From 1c9cb040959b7690f8218fbbdeed6f77ce7edc4c Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sat, 23 Feb 2013 18:39:56 -0500 Subject: [PATCH 3/3] far: Fix compiler warnings --- opensubdiv/far/meshFactory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensubdiv/far/meshFactory.h b/opensubdiv/far/meshFactory.h index bb0167b5..8103e1ae 100644 --- a/opensubdiv/far/meshFactory.h +++ b/opensubdiv/far/meshFactory.h @@ -488,7 +488,7 @@ FarMeshFactory::refineAdaptive( HbrMesh * mesh, int maxIsolate ) { for (int k=0; kGetVertex(k) ); } - if (not (childedge = childvert->GetNextEdge(childedge))) + if ((childedge = childvert->GetNextEdge(childedge)) == NULL) break; } }