7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 09:51:43 +00:00

Be consistent about using nullptr instead of 0

0 can be too easily overloaded into an int, so ensure we use nullptr
when we mean pointers.
This commit is contained in:
Ian McInerney 2021-04-22 22:20:34 +01:00
parent fcca4bc3e6
commit ecd9bf696e
41 changed files with 169 additions and 169 deletions

View File

@ -51,7 +51,7 @@ public:
* @param aParent the parent creator of this canvas.
* @param aAttribList a list of openGL options created by #OGL_ATT_LIST::GetAttributesList.
*/
C3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = 0,
C3D_MODEL_VIEWER( wxWindow* aParent, const int* aAttribList = nullptr,
S3D_CACHE* aCacheManager = nullptr );
~C3D_MODEL_VIEWER();

View File

@ -30,7 +30,7 @@
#include <wx/log.h>
#include <map>
OBJECT_2D_STATS *OBJECT_2D_STATS::s_instance = 0;
OBJECT_2D_STATS *OBJECT_2D_STATS::s_instance = nullptr;
OBJECT_2D::OBJECT_2D( OBJECT_2D_TYPE aObjType, const BOARD_ITEM& aBoardItem )

View File

@ -486,7 +486,7 @@ void MODEL_3D::DrawBbox() const
reinterpret_cast<const void*>( offsetof( VERTEX, m_color ) ) );
glDrawElements( GL_LINES, bbox_idx_count, m_bbox_index_buffer_type,
reinterpret_cast<const void*>( 0 ) );
reinterpret_cast<const void*>( NULL ) );
}

View File

@ -112,19 +112,19 @@ TRIANGLE_DISPLAY_LIST::TRIANGLE_DISPLAY_LIST( unsigned int aNrReservedTriangles
TRIANGLE_DISPLAY_LIST::~TRIANGLE_DISPLAY_LIST()
{
delete m_layer_top_segment_ends;
m_layer_top_segment_ends = 0;
m_layer_top_segment_ends = nullptr;
delete m_layer_top_triangles;
m_layer_top_triangles = 0;
m_layer_top_triangles = nullptr;
delete m_layer_middle_contourns_quads;
m_layer_middle_contourns_quads = 0;
m_layer_middle_contourns_quads = nullptr;
delete m_layer_bot_triangles;
m_layer_bot_triangles = 0;
m_layer_bot_triangles = nullptr;
delete m_layer_bot_segment_ends;
m_layer_bot_segment_ends = 0;
m_layer_bot_segment_ends = nullptr;
}

View File

@ -996,10 +996,10 @@ bool RENDER_3D_LEGACY::initializeOpenGL()
m_circleTexture = OglLoadTexture( *circleImageBlured );
delete circleImageBlured;
circleImageBlured = 0;
circleImageBlured = nullptr;
delete circleImage;
circleImage = 0;
circleImage = nullptr;
init_lights();

View File

@ -401,7 +401,7 @@ int DIALOG_SHIM::ShowQuasiModal()
{
void*& m_what;
NULLER( void*& aPtr ) : m_what( aPtr ) {}
~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
} clear_this( (void*&) m_qmodal_loop );
// release the mouse if it's currently captured as the window having it
@ -465,11 +465,11 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
else
m_qmodal_loop->ScheduleExit( 0 );
m_qmodal_loop = NULL;
m_qmodal_loop = nullptr;
}
delete m_qmodal_parent_disabler;
m_qmodal_parent_disabler = 0;
m_qmodal_parent_disabler = nullptr;
Show( false );
}

View File

@ -71,10 +71,10 @@ void DSNLEXER::init()
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
FILE* aFile, const wxString& aFilename ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
start( nullptr ),
next( nullptr ),
limit( nullptr ),
reader( nullptr ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
@ -87,10 +87,10 @@ DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
const std::string& aClipboardTxt, const wxString& aSource ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
start( nullptr ),
next( nullptr ),
limit( nullptr ),
reader( nullptr ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
@ -104,10 +104,10 @@ DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
DSNLEXER::DSNLEXER( const KEYWORD* aKeywordTable, unsigned aKeywordCount,
LINE_READER* aLineReader ) :
iOwnReaders( false ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
start( nullptr ),
next( nullptr ),
limit( nullptr ),
reader( nullptr ),
keywords( aKeywordTable ),
keywordCount( aKeywordCount )
{
@ -121,10 +121,10 @@ static const KEYWORD empty_keywords[1] = {};
DSNLEXER::DSNLEXER( const std::string& aSExpression, const wxString& aSource ) :
iOwnReaders( true ),
start( NULL ),
next( NULL ),
limit( NULL ),
reader( NULL ),
start( nullptr ),
next( nullptr ),
limit( nullptr ),
reader( nullptr ),
keywords( empty_keywords ),
keywordCount( 0 )
{
@ -198,7 +198,7 @@ void DSNLEXER::PushReader( LINE_READER* aLineReader )
LINE_READER* DSNLEXER::PopReader()
{
LINE_READER* ret = 0;
LINE_READER* ret = nullptr;
if( readerStack.size() )
{
@ -216,7 +216,7 @@ LINE_READER* DSNLEXER::PopReader()
}
else
{
reader = 0;
reader = nullptr;
start = dummy;
limit = dummy;
}
@ -778,7 +778,7 @@ exit: // single point of exit, no returns elsewhere please.
wxArrayString* DSNLEXER::ReadCommentLines()
{
wxArrayString* ret = 0;
wxArrayString* ret = nullptr;
bool cmt_setting = SetCommentsAreTokens( true );
int tok = NextTok();

View File

@ -37,7 +37,7 @@ FILTER_READER::FILTER_READER( LINE_READER& aReader ) :
// is not owned here.
delete [] m_line;
m_line = 0;
m_line = nullptr;
}
@ -45,7 +45,7 @@ FILTER_READER::~FILTER_READER()
{
// Our 'm_line' points to aReader's, and he will delete that buffer.
// Prevent subsequent call to ~LINE_READER() from deleting a buffer we do not own.
m_line = 0;
m_line = nullptr;
}
@ -62,7 +62,7 @@ char* FILTER_READER::ReadLine()
m_line = reader.Line();
m_length = reader.Length();
return m_length ? m_line : NULL;
return m_length ? m_line : nullptr;
}
@ -103,5 +103,5 @@ char* WHITESPACE_FILTER_READER::ReadLine()
m_line = s;
m_length = reader.Length();
return m_length ? m_line : NULL;
return m_length ? m_line : nullptr;
}

View File

@ -196,7 +196,7 @@ void GPU_CACHED_MANAGER::EndDrawing()
glBufferData( GL_ELEMENT_ARRAY_BUFFER, m_indicesSize * sizeof( int ), (GLvoid*) m_indices.get(),
GL_DYNAMIC_DRAW );
glDrawElements( GL_TRIANGLES, m_indicesSize, GL_UNSIGNED_INT, 0 );
glDrawElements( GL_TRIANGLES, m_indicesSize, GL_UNSIGNED_INT, NULL );
#ifdef __WXDEBUG__
wxLogTrace( traceGalProfile, wxT( "Cached manager size: %d" ), m_indicesSize );

View File

@ -47,7 +47,7 @@ int KIWAY::m_kiface_version[KIWAY_FACE_COUNT];
KIWAY::KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop ):
m_program( aProgram ), m_ctl( aCtlBits ), m_top( 0 )
m_program( aProgram ), m_ctl( aCtlBits ), m_top( nullptr )
{
SetTop( aTop ); // hook player_destroy_handler() into aTop.

View File

@ -45,10 +45,10 @@ KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType
long aStyle, const wxString& aWdoName ) :
EDA_BASE_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aWdoName, aKiway ),
m_modal( false ),
m_modal_loop( 0 ),
m_modal_resultant_parent( 0 )
m_modal_loop( nullptr ),
m_modal_resultant_parent( nullptr ),
m_modal_ret_val( false )
{
m_modal_ret_val = 0;
}
@ -57,8 +57,8 @@ KIWAY_PLAYER::KIWAY_PLAYER( wxWindow* aParent, wxWindowID aId, const wxString& a
const wxString& aWdoName ) :
EDA_BASE_FRAME( aParent, (FRAME_T) aId, aTitle, aPos, aSize, aStyle, aWdoName, nullptr ),
m_modal( false ),
m_modal_loop( 0 ),
m_modal_resultant_parent( 0 ),
m_modal_loop( nullptr ),
m_modal_resultant_parent( nullptr ),
m_modal_ret_val( false )
{
}
@ -92,7 +92,7 @@ bool KIWAY_PLAYER::ShowModal( wxString* aResult, wxWindow* aResultantFocusWindow
{
void*& m_what;
NULLER( void*& aPtr ) : m_what( aPtr ) {}
~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
~NULLER() { m_what = nullptr; } // indeed, set it to NULL on destruction
} clear_this( (void*&) m_modal_loop );
@ -166,7 +166,7 @@ void KIWAY_PLAYER::DismissModal( bool aRetVal, const wxString& aResult )
if( m_modal_loop )
{
m_modal_loop->Exit();
m_modal_loop = 0; // this marks it as dismissed.
m_modal_loop = nullptr; // this marks it as dismissed.
}
Show( false );

View File

@ -59,7 +59,7 @@ const char* EndsWithRev( const char* start, const char* tail, char separator )
}
}
return 0;
return nullptr;
}

View File

@ -219,7 +219,7 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl
}
// not found, search fall back table(s), if any
} while( ( cur = cur->fallBack ) != 0 );
} while( ( cur = cur->fallBack ) != nullptr );
return nullptr; // not found
}
@ -255,7 +255,7 @@ const LIB_TABLE_ROW* LIB_TABLE::FindRowByURI( const wxString& aURI )
}
// not found, search fall back table(s), if any
} while( ( cur = cur->fallBack ) != 0 );
} while( ( cur = cur->fallBack ) != nullptr );
return nullptr; // not found
}
@ -281,7 +281,7 @@ std::vector<wxString> LIB_TABLE::GetLogicalLibs()
}
}
} while( ( cur = cur->fallBack ) != 0 );
} while( ( cur = cur->fallBack ) != nullptr );
ret.reserve( unique.size() );

View File

@ -108,8 +108,8 @@ LANGUAGE_DESCR LanguagesList[] =
PGM_BASE::PGM_BASE()
{
m_pgm_checker = NULL;
m_locale = NULL;
m_pgm_checker = nullptr;
m_locale = nullptr;
m_Printing = false;
m_ModalDialogCount = 0;
@ -131,10 +131,10 @@ void PGM_BASE::Destroy()
{
// unlike a normal destructor, this is designed to be called more than once safely:
delete m_pgm_checker;
m_pgm_checker = 0;
m_pgm_checker = nullptr;
delete m_locale;
m_locale = 0;
m_locale = nullptr;
}

View File

@ -91,8 +91,8 @@ static bool polyCompare( const std::vector<wxPoint>& aPolygon,
GERBER_PLOTTER::GERBER_PLOTTER()
{
workFile = NULL;
finalFile = NULL;
workFile = nullptr;
finalFile = nullptr;
m_currentApertureIdx = -1;
m_apertureAttribute = 0;
@ -205,7 +205,7 @@ void GERBER_PLOTTER::formatNetAttribute( GBR_NETLIST_METADATA* aData )
// print a Gerber net attribute record.
// it is added to the object attributes dictionary
// On file, only modified or new attributes are printed.
if( aData == NULL )
if( aData == nullptr )
return;
if( !m_useNetAttributes )
@ -253,7 +253,7 @@ bool GERBER_PLOTTER::StartPlot()
m_outputFile = workFile;
wxASSERT( m_outputFile );
if( m_outputFile == NULL )
if( m_outputFile == nullptr )
return false;
for( unsigned ii = 0; ii < m_headerExtraLines.GetCount(); ii++ )
@ -386,7 +386,7 @@ bool GERBER_PLOTTER::EndPlot()
fclose( workFile );
fclose( finalFile );
::wxRemoveFile( m_workFilename );
m_outputFile = 0;
m_outputFile = nullptr;
return true;
}

View File

@ -115,7 +115,7 @@ bool PDF_PLOTTER::OpenFile( const wxString& aFullFilename )
// Open the PDF file in binary mode
m_outputFile = wxFopen( m_filename, wxT( "wb" ) );
if( m_outputFile == NULL )
if( m_outputFile == nullptr )
return false ;
return true;
@ -543,7 +543,7 @@ void PDF_PLOTTER::closePdfStream()
// We are done with the temporary file, junk it
fclose( workFile );
workFile = 0;
workFile = nullptr;
::wxRemoveFile( workFilename );
unsigned out_count;

View File

@ -55,7 +55,7 @@ PLOTTER::PLOTTER( )
m_plotMirror = false; // Plot mirror option flag
m_mirrorIsHorizontal = true;
m_yaxisReversed = false;
m_outputFile = 0;
m_outputFile = nullptr;
m_colorMode = false; // Starts as a BW plot
m_negativeMode = false;
// Temporary init to avoid not initialized vars, will be set later

View File

@ -83,22 +83,22 @@ public:
m_filterCtrl->SetValidator( *m_filterValidator );
mainSizer->Add( m_filterCtrl, 0, wxEXPAND, 0 );
m_listBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, 0,
m_listBox = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr,
wxLB_SINGLE|wxLB_NEEDED_SB );
mainSizer->Add( m_listBox, 0, wxEXPAND|wxTOP, 2 );
SetSizer( mainSizer );
Layout();
Connect( wxEVT_IDLE, wxIdleEventHandler( NET_SELECTOR_COMBOPOPUP::onIdle ), NULL, this );
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR_COMBOPOPUP::onKeyDown ), NULL, this );
Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( NET_SELECTOR_COMBOPOPUP::onMouseClick ), NULL, this );
m_listBox->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( NET_SELECTOR_COMBOPOPUP::onMouseClick ), NULL, this );
m_filterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onFilterEdit ), NULL, this );
m_filterCtrl->Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onEnter ), NULL, this );
Connect( wxEVT_IDLE, wxIdleEventHandler( NET_SELECTOR_COMBOPOPUP::onIdle ), nullptr, this );
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR_COMBOPOPUP::onKeyDown ), nullptr, this );
Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( NET_SELECTOR_COMBOPOPUP::onMouseClick ), nullptr, this );
m_listBox->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( NET_SELECTOR_COMBOPOPUP::onMouseClick ), nullptr, this );
m_filterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onFilterEdit ), nullptr, this );
m_filterCtrl->Connect( wxEVT_TEXT_ENTER, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onEnter ), nullptr, this );
// <enter> in a ListBox comes in as a double-click on GTK
m_listBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onEnter ), NULL, this );
m_listBox->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onEnter ), nullptr, this );
return true;
}
@ -548,13 +548,13 @@ NET_SELECTOR::NET_SELECTOR( wxWindow *parent, wxWindowID id, const wxPoint &pos,
m_netSelectorPopup = new NET_SELECTOR_COMBOPOPUP();
SetPopupControl( m_netSelectorPopup );
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
}
NET_SELECTOR::~NET_SELECTOR()
{
Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), NULL, this );
Disconnect( wxEVT_CHAR_HOOK, wxKeyEventHandler( NET_SELECTOR::onKeyDown ), nullptr, this );
}

View File

@ -506,7 +506,7 @@ void LIB_PIN::printPinElectricalTypeName( const RENDER_SETTINGS* aSettings, wxPo
}
GRText( DC, txtpos, color, typeName, orient, wxSize( textSize, textSize ), hjustify,
GR_TEXT_VJUSTIFY_CENTER, pensize, false, false, 0 );
GR_TEXT_VJUSTIFY_CENTER, pensize, false, false, nullptr );
}

View File

@ -2243,7 +2243,7 @@ bool SCH_SEXPR_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
if( m_cache && m_cache->IsFile( aLibraryPath ) )
{
delete m_cache;
m_cache = 0;
m_cache = nullptr;
}
return true;

View File

@ -4388,7 +4388,7 @@ bool SCH_LEGACY_PLUGIN::DeleteSymbolLib( const wxString& aLibraryPath,
if( m_cache && m_cache->IsFile( aLibraryPath ) )
{
delete m_cache;
m_cache = 0;
m_cache = nullptr;
}
return true;

View File

@ -312,7 +312,7 @@ bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
m_Current_File = wxFopen( aFullFileName, "rt" );
if( m_Current_File == NULL )
if( m_Current_File == nullptr )
return false;
wxString msg;
@ -325,7 +325,7 @@ bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
while( true )
{
if( excellonReader.ReadLine() == 0 )
if( excellonReader.ReadLine() == nullptr )
break;
char* line = excellonReader.Line();
@ -383,7 +383,7 @@ bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
X2_ATTRIBUTE dummy;
char* text = (char*)file_attribute;
int dummyline = 0;
dummy.ParseAttribCmd( NULL, NULL, 0, text, dummyline );
dummy.ParseAttribCmd( nullptr, nullptr, 0, text, dummyline );
delete m_FileFunction;
m_FileFunction = new X2_ATTRIBUTE_FILEFUNCTION( dummy );
@ -395,7 +395,7 @@ bool EXCELLON_IMAGE::LoadFile( const wxString & aFullFileName )
bool EXCELLON_IMAGE::Execute_HEADER_And_M_Command( char*& text )
{
EXCELLON_CMD* cmd = NULL;
EXCELLON_CMD* cmd = nullptr;
wxString msg;
// Search command in list
@ -590,7 +590,7 @@ bool EXCELLON_IMAGE::readToolInformation( char*& aText )
// Remember: dcodes are >= FIRST_DCODE
D_CODE* dcode = GetDCODEOrCreate( iprm + FIRST_DCODE );
if( dcode == NULL )
if( dcode == nullptr )
return false;
// conv_scale = scaling factor from inch to Internal Unit
@ -717,7 +717,7 @@ bool EXCELLON_IMAGE::Select_Tool( char*& text )
m_Current_Tool = dcode_id;
D_CODE* currDcode = GetDCODEOrCreate( dcode_id, true );
if( currDcode == NULL && tool_id > 0 ) // if the definition is embedded, enter it
if( currDcode == nullptr && tool_id > 0 ) // if the definition is embedded, enter it
{
text = startline; // text starts at the beginning of the command
readToolInformation( text );
@ -737,7 +737,7 @@ bool EXCELLON_IMAGE::Select_Tool( char*& text )
bool EXCELLON_IMAGE::Execute_EXCELLON_G_Command( char*& text )
{
EXCELLON_CMD* cmd = NULL;
EXCELLON_CMD* cmd = nullptr;
bool success = false;
int id = DRILL_G_UNKNOWN;

View File

@ -86,19 +86,19 @@ void GERBER_LAYER::ResetDefaultValues()
GERBER_FILE_IMAGE::GERBER_FILE_IMAGE( int aLayer ) :
EDA_ITEM( (EDA_ITEM*)NULL, GERBER_IMAGE_T )
EDA_ITEM( nullptr, GERBER_IMAGE_T )
{
m_GraphicLayer = aLayer; // Graphic layer Number
m_IsVisible = true; // must be drawn
m_PositiveDrawColor = WHITE; // The color used to draw positive items for this image
m_Selected_Tool = 0;
m_FileFunction = NULL; // file function parameters
m_FileFunction = nullptr; // file function parameters
ResetDefaultValues();
for( unsigned ii = 0; ii < arrayDim( m_Aperture_List ); ii++ )
m_Aperture_List[ii] = 0;
m_Aperture_List[ii] = nullptr;
}
@ -128,14 +128,14 @@ D_CODE* GERBER_FILE_IMAGE::GetDCODEOrCreate( int aDCODE, bool aCreateIfNoExist )
// lazily create the D_CODE if it does not exist.
if( aCreateIfNoExist )
{
if( m_Aperture_List[ndx] == NULL )
if( m_Aperture_List[ndx] == nullptr )
m_Aperture_List[ndx] = new D_CODE( ndx + FIRST_DCODE );
}
return m_Aperture_List[ndx];
}
return NULL;
return nullptr;
}
@ -148,7 +148,7 @@ D_CODE* GERBER_FILE_IMAGE::GetDCODE( int aDCODE ) const
return m_Aperture_List[ndx];
}
return NULL;
return nullptr;
}
@ -162,7 +162,7 @@ APERTURE_MACRO* GERBER_FILE_IMAGE::FindApertureMacro( const APERTURE_MACRO& aLoo
return pam;
}
return NULL; // not found
return nullptr; // not found
}
@ -175,7 +175,7 @@ void GERBER_FILE_IMAGE::ResetDefaultValues()
m_ImageNegative = false; // true = Negative image
m_IsX2_file = false; // true only if a %TF, %TA or %TD command
delete m_FileFunction; // file function parameters
m_FileFunction = NULL;
m_FileFunction = nullptr;
m_MD5_value.Empty(); // MD5 value found in a %TF.MD5 command
m_PartString.Empty(); // string found in a %TF.Part command
m_hasNegativeItems = -1; // set to uninitialized
@ -218,7 +218,7 @@ void GERBER_FILE_IMAGE::ResetDefaultValues()
m_LastArcDataType = ARC_INFO_TYPE_NONE; // Extra coordinate info type for arcs
// (radius or IJ center coord)
m_LineNum = 0; // line number in file being read
m_Current_File = NULL; // Gerber file to read
m_Current_File = nullptr; // Gerber file to read
m_PolygonFillMode = false;
m_PolygonFillModeState = 0;
m_Selected_Tool = 0;
@ -274,7 +274,7 @@ void GERBER_FILE_IMAGE::InitToolTable()
{
for( int count = 0; count < TOOLS_MAX_COUNT; count++ )
{
if( m_Aperture_List[count] == NULL )
if( m_Aperture_List[count] == nullptr )
continue;
m_Aperture_List[count]->m_Num_Dcode = count + FIRST_DCODE;

View File

@ -45,7 +45,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
GERBER_FILE_IMAGE_LIST* images = GetImagesList();
GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
if( gerber != NULL )
if( gerber != nullptr )
{
Erase_Current_DrawLayer( false );
}
@ -126,7 +126,7 @@ bool GERBER_FILE_IMAGE::LoadGerberFile( const wxString& aFullFileName )
// Read the gerber file */
m_Current_File = wxFopen( aFullFileName, wxT( "rt" ) );
if( m_Current_File == 0 )
if( m_Current_File == nullptr )
return false;
m_FileName = aFullFileName;
@ -137,7 +137,7 @@ bool GERBER_FILE_IMAGE::LoadGerberFile( const wxString& aFullFileName )
while( true )
{
if( fgets( lineBuffer, GERBER_BUFZ, m_Current_File ) == NULL )
if( fgets( lineBuffer, GERBER_BUFZ, m_Current_File ) == nullptr )
break;
m_LineNum++;

View File

@ -179,7 +179,7 @@ bool GERBER_FILE_IMAGE::ReadRS274XCommand( char *aBuff, unsigned int aBuffSize,
}
// end of current line, read another one.
if( fgets( aBuff, aBuffSize, m_Current_File ) == NULL )
if( fgets( aBuff, aBuffSize, m_Current_File ) == nullptr )
{
// end of file
ok = false;
@ -712,7 +712,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
D_CODE* dcode;
dcode = GetDCODEOrCreate( code );
if( dcode == NULL )
if( dcode == nullptr )
break;
dcode->m_AperFunction = m_AperFunction;
@ -920,7 +920,7 @@ bool GERBER_FILE_IMAGE::GetEndOfBlock( char* aBuff, unsigned int aBuffSize, char
aText++;
}
if( fgets( aBuff, aBuffSize, gerber_file ) == NULL )
if( fgets( aBuff, aBuffSize, gerber_file ) == nullptr )
break;
m_LineNum++;
@ -944,8 +944,8 @@ char* GERBER_FILE_IMAGE::GetNextLine( char *aBuff, unsigned int aBuffSize, char*
break;
case 0: // End of text found in aBuff: Read a new string
if( fgets( aBuff, aBuffSize, aFile ) == NULL )
return NULL;
if( fgets( aBuff, aBuffSize, aFile ) == nullptr )
return nullptr;
m_LineNum++;
aText = aBuff;
@ -986,7 +986,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize,
aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
if( aText == NULL ) // End of File
if( aText == nullptr ) // End of File
return false;
// aText points the beginning of a new line.
@ -1011,7 +1011,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize,
am.m_localparamStack.push_back( AM_PARAM() );
AM_PARAM& param = am.m_localparamStack.back();
aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
if( aText == NULL) // End of File
if( aText == nullptr) // End of File
return false;
param.ReadParam( aText );
continue;
@ -1097,7 +1097,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize,
aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
if( aText == NULL) // End of File
if( aText == nullptr) // End of File
return false;
param.ReadParam( aText );
@ -1121,7 +1121,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize,
// in advance, i.e. be immediate.
wxASSERT( prim.params[1].IsImmediate() );
paramCount = (int) prim.params[1].GetValue( 0 ) * 2 + 1;
paramCount = (int) prim.params[1].GetValue( nullptr ) * 2 + 1;
for( int jj = 0; jj < paramCount && *aText != '*'; ++jj )
{
@ -1131,7 +1131,7 @@ bool GERBER_FILE_IMAGE::ReadApertureMacro( char *aBuff, unsigned int aBuffSize,
aText = GetNextLine( aBuff, aBuffSize, aText, gerber_file );
if( aText == NULL ) // End of File
if( aText == nullptr ) // End of File
return false;
param.ReadParam( aText );

Some files were not shown because too many files have changed in this diff Show More