Permalink
Browse files

Addressing minor issues caught by clang static analysis

  • Loading branch information...
1 parent afefd29 commit f1fbf4f4cb62d6f0f173bdb1d4589f37727e47b4 @andrewfb andrewfb committed Apr 17, 2013
Showing with 6 additions and 5 deletions.
  1. +3 −2 blocks/Cairo/src/Cairo.cpp
  2. +2 −2 samples/VoronoiGpu/src/VoronoiGpu.cpp
  3. +1 −1 samples/waterSim/src/waterSimApp.cpp
@@ -784,8 +784,9 @@ FontFace::FontFace( cairo_font_face_t *aCairoFontFace ) : mCairoFontFace( aCairo
FontFace::FontFace( const std::string &faceName )
{
#if defined( CAIRO_HAS_QUARTZ_FONT )
- CFStringRef nameRef = CFStringCreateWithCString( kCFAllocatorDefault, faceName.c_str(), kCFStringEncodingUTF8 );
- CGFontRef fontRef = CGFontCreateWithFontName( nameRef );
+ mCairoFontFace = NULL; // in case we throw below
+ CFStringRef nameRef = ::CFStringCreateWithCString( kCFAllocatorDefault, faceName.c_str(), kCFStringEncodingUTF8 );
+ CGFontRef fontRef = ::CGFontCreateWithFontName( nameRef );
if( ! fontRef )
throw FontInvalidNameExc();
mCairoFontFace = cairo_quartz_font_face_create_for_cgfont( fontRef );
@@ -93,7 +93,7 @@ ci::Surface32f calcDiscreteVoronoiGpu( const std::vector<ci::Vec2i> &points, int
// ping-pong between the two FBOs
voronoiShader.bind();
voronoiShader.uniform( "tex0", 0 );
- int curFbo;
+ int curFbo = 0;
int numPasses = log2ceil( std::max( width, height ) );
for( int pass = 1; pass <= numPasses; ++pass ) {
voronoiShader.uniform( "sampleScale", Vec2f( 1, 1 ) * (float)( 1 << ( numPasses - pass ) ) );
@@ -135,7 +135,7 @@ ci::Channel32f calcDistanceMapGpu( const vector<Vec2i> &points, int width, int h
// ping-pong between the two FBOs
voronoiShader.bind();
voronoiShader.uniform( "tex0", 0 );
- int curFbo;
+ int curFbo = 0;
int numPasses = log2ceil( std::max( width, height ) );
for( int pass = 1; pass <= numPasses; ++pass ) {
voronoiShader.uniform( "sampleScale", Vec2f( 1, 1 ) * (float)( 1 << ( numPasses - pass ) ) );
@@ -98,7 +98,7 @@ void init_water_drop( Grid &grid, Particles &particles, int na, int nb, int drop
project(grid, x, y, phi, -0.75*grid.h/na, center);
phi=fluidphi(grid, x, y, dropType, center );
project(grid, x, y, phi, -0.75*grid.h/na, center);
- phi=fluidphi(grid, x, y, dropType, center );
+ /*phi=fluidphi(grid, x, y, dropType, center );*/
}
particles.add_particle( Vec2f(x,y), Vec2f(0,0) );

0 comments on commit f1fbf4f

Please sign in to comment.