From 70a7d1bc7ce53d9e9de6775e390b153d7d02b6e5 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Mon, 21 Sep 2020 12:19:49 +0100 Subject: [PATCH] Cleanup variable usage and assignment in gerber reader --- gerbview/rs274x.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gerbview/rs274x.cpp b/gerbview/rs274x.cpp index 9ea76a8612..8c824362b6 100644 --- a/gerbview/rs274x.cpp +++ b/gerbview/rs274x.cpp @@ -271,9 +271,10 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff, case 'M': // Sequence code (followed by one digit: the sequence len) // (sometimes found after the X,Y sequence) // Obscure option - code = *aText++; + aText++; + code = *aText; - if( ( *aText >= '0' ) && ( *aText<= '9' ) ) + if( ( code >= '0' ) && ( code <= '9' ) ) aText++; // skip the digit break; @@ -343,7 +344,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff, break; case MIRROR_IMAGE: // command %MIA0B0*%, %MIA0B1*%, %MIA1B0*%, %MIA1B1*% - m_MirrorA = m_MirrorB = 0; + m_MirrorA = m_MirrorB = false; while( *aText && *aText != '*' ) {