From 48dc3d069512d4fdcdc425422f5d51fcbd0c9ee5 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Fri, 25 Jan 2008 15:13:57 +0000 Subject: [PATCH] COLLECTOR::BasePtr() --- include/class_collector.h | 11 +++++++++++ pcbnew/specctra_export.cpp | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/class_collector.h b/include/class_collector.h index f4fd77a2ec..40fb61c0fd 100644 --- a/include/class_collector.h +++ b/include/class_collector.h @@ -131,6 +131,17 @@ public: return NULL; } + /** + * Function BasePtr + * returns the address of the first element in the array. Only call this + * if there is at least one element in the vector m_List, otherwise a + * C++ exception should get thrown. + */ + EDA_BaseStruct* const* BasePtr() const + { + return &m_List[0]; + } + /** * Function SetScanTypes diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index e14c8290b6..c3c0d7a6ee 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -242,8 +242,7 @@ static void makePADSTACKs( BOARD* aBoard, TYPE_COLLECTOR& aPads, { if( aPads.GetCount() ) { -#warning "uncomment next line asap" -//JPC qsort( (void*) aPads.BasePtr(), aPads.GetCount(), sizeof(D_PAD*), Pad_list_Sort_by_Shapes ); + qsort( (void*) aPads.BasePtr(), aPads.GetCount(), sizeof(D_PAD*), Pad_list_Sort_by_Shapes ); } D_PAD* old_pad = NULL;