fix shadowed local variables

This commit is contained in:
jean-pierre charras 2016-11-25 18:17:34 +01:00
parent bcfc1e7a3f
commit 30df041de6
3 changed files with 15 additions and 11 deletions

View File

@ -1314,7 +1314,7 @@ int OPENGL_GAL::drawBitmapChar( unsigned long aChar )
const float XOFF = glyph->minx;
// adjust for height rounding
const float round_adjust = ( glyph->maxy - glyph->miny )
const float round_adjust = ( glyph->maxy - glyph->miny )
- float( glyph->atlas_h - font_information.smooth_pixels * 2 );
const float top_adjust = font_information.max_y - glyph->maxy;
const float YOFF = round_adjust + top_adjust;
@ -1383,20 +1383,24 @@ void OPENGL_GAL::drawBitmapOverbar( double aLength, double aHeight )
Restore();
}
const bitmap_glyph* OPENGL_GAL::lookupGlyph( unsigned int codepoint ) const
const bitmap_glyph* OPENGL_GAL::lookupGlyph( unsigned int aCodepoint ) const
{
#ifdef BITMAP_FONT_USE_SPANS
auto *end = font_codepoint_spans + sizeof( font_codepoint_spans ) / sizeof( bitmap_span );
auto ptr = std::upper_bound( font_codepoint_spans, end, codepoint,
[]( unsigned int codepoint, const bitmap_span& span ) {
auto ptr = std::upper_bound( font_codepoint_spans, end, aCodepoint,
[]( unsigned int codepoint, const bitmap_span& span )
{
return codepoint < span.end;
}
);
if( ptr != end && ptr->start <= codepoint ) {
unsigned int index = codepoint - ptr->start + ptr->cumulative;
if( ptr != end && ptr->start <= aCodepoint )
{
unsigned int index = aCodepoint - ptr->start + ptr->cumulative;
return &font_codepoint_infos[index];
} else {
}
else
{
return nullptr;
}
#else

View File

@ -380,7 +380,7 @@ private:
*/
std::pair<VECTOR2D, float> computeBitmapTextSize( const wxString& aText ) const;
const bitmap_glyph* lookupGlyph( unsigned int codepoint ) const;
const bitmap_glyph* lookupGlyph( unsigned int aCodepoint ) const;
// Event handling
/**

View File

@ -2549,7 +2549,7 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer )
{
std::string builder;
int bracketNesting = 1; // we already saw the opening T_LEFT
T tok = T_NONE;
tok = T_NONE;
while( bracketNesting!=0 && tok!=T_EOF )
{
@ -2563,9 +2563,9 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer )
if( bracketNesting >= 1 )
{
T prevTok = (T) PrevTok();
T previousTok = (T) PrevTok();
if( prevTok!=T_LEFT && prevTok!=T_circuit && tok!=T_RIGHT )
if( previousTok!=T_LEFT && previousTok!=T_circuit && tok!=T_RIGHT )
builder += ' ';
if( tok==T_STRING )