Use auto to reduce some verbosity.
This commit is contained in:
@@ -190,7 +190,7 @@ namespace glbarcode
|
||||
{
|
||||
|
||||
/* determine width and establish horizontal scale, based on original cooked data */
|
||||
double dataSize = double( cookedData.size() );
|
||||
auto dataSize = double( cookedData.size() );
|
||||
double minL;
|
||||
if ( !checksum() )
|
||||
{
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace glbarcode
|
||||
|
||||
|
||||
/* now traverse the code string and draw each bar */
|
||||
int nBarsSpaces = int( codedData.size() - 1 ); /* coded data has dummy "0" on end. */
|
||||
auto nBarsSpaces = int( codedData.size() - 1 ); /* coded data has dummy "0" on end. */
|
||||
|
||||
double xModules = 0;
|
||||
for ( int i = 0; i < nBarsSpaces; i += 2 )
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace glbarcode
|
||||
{
|
||||
init();
|
||||
|
||||
BarcodeTypeMap::iterator i = mBarcodeTypeMap.find( typeId );
|
||||
auto i = mBarcodeTypeMap.find( typeId );
|
||||
|
||||
return ( i != mBarcodeTypeMap.end() );
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace glbarcode
|
||||
{
|
||||
init();
|
||||
|
||||
BarcodeTypeMap::iterator i = mBarcodeTypeMap.find( typeId );
|
||||
auto i = mBarcodeTypeMap.find( typeId );
|
||||
|
||||
if( i != mBarcodeTypeMap.end() )
|
||||
{
|
||||
|
||||
@@ -31,23 +31,23 @@ void glbarcode::Renderer::render( double w, double h, const std::list<DrawingPri
|
||||
|
||||
for ( primitive = primitives.begin(); primitive != primitives.end(); primitive++ )
|
||||
{
|
||||
if ( DrawingPrimitiveLine* line = dynamic_cast<DrawingPrimitiveLine*>(*primitive) )
|
||||
if ( auto* line = dynamic_cast<DrawingPrimitiveLine*>(*primitive) )
|
||||
{
|
||||
drawLine( line->x(), line->y(), line->w(), line->h() );
|
||||
}
|
||||
else if ( DrawingPrimitiveBox* box = dynamic_cast<DrawingPrimitiveBox*>(*primitive) )
|
||||
else if ( auto* box = dynamic_cast<DrawingPrimitiveBox*>(*primitive) )
|
||||
{
|
||||
drawBox( box->x(), box->y(), box->w(), box->h() );
|
||||
}
|
||||
else if ( DrawingPrimitiveText* text = dynamic_cast<DrawingPrimitiveText*>(*primitive) )
|
||||
else if ( auto* text = dynamic_cast<DrawingPrimitiveText*>(*primitive) )
|
||||
{
|
||||
drawText( text->x(), text->y(), text->size(), text->text() );
|
||||
}
|
||||
else if ( DrawingPrimitiveRing* ring = dynamic_cast<DrawingPrimitiveRing*>(*primitive) )
|
||||
else if ( auto* ring = dynamic_cast<DrawingPrimitiveRing*>(*primitive) )
|
||||
{
|
||||
drawRing( ring->x(), ring->y(), ring->r(), ring->w() );
|
||||
}
|
||||
else if ( DrawingPrimitiveHexagon* hex = dynamic_cast<DrawingPrimitiveHexagon*>(*primitive) )
|
||||
else if ( auto* hex = dynamic_cast<DrawingPrimitiveHexagon*>(*primitive) )
|
||||
{
|
||||
drawHexagon( hex->x(), hex->y(), hex->h() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user