Skip to content
Snippets Groups Projects
Commit bbba707b authored by Rene Brun's avatar Rene Brun
Browse files

Remove the "extern C" declaration for the static function Compare.

Declare a pointer CompareItems to the function Compare inside the Sort function.
This was the only way to compile under VC++.


git-svn-id: http://root.cern.ch/svn/root/trunk@4438 27541ba8-7e3a-0410-8455-c3a389f83636
parent a803346a
No related branches found
No related tags found
No related merge requests found
// @(#)root/gui:$Name: $:$Id: TGListTree.cxx,v 1.9 2001/11/12 14:17:02 rdm Exp $
// @(#)root/gui:$Name: $:$Id: TGListTree.cxx,v 1.10 2002/05/01 20:09:43 brun Exp $
// Author: Fons Rademakers 25/02/98
/*************************************************************************
......@@ -1028,12 +1028,8 @@ Int_t TGListTree::ReparentChildren(TGListTreeItem *item,
return 0;
}
extern "C" {
static Int_t CompareItems(const void *item1, const void *item2);
}
//______________________________________________________________________________
static Int_t CompareItems(const void *item1, const void *item2)
static Int_t Compare(const void *item1, const void *item2)
{
return strcmp((*((TGListTreeItem **) item1))->GetText(),
(*((TGListTreeItem **) item2))->GetText());
......@@ -1066,8 +1062,11 @@ Int_t TGListTree::Sort(TGListTreeItem *item)
count++;
first = first->fNextsibling;
}
Int_t (*CompareItems)(const void *item1, const void *item2);
CompareItems = ::Compare;
::qsort(list, count, sizeof(TGListTreeItem*), ::CompareItems);
::qsort(list, count, sizeof(TGListTreeItem*), CompareItems);
list[0]->fPrevsibling = 0;
for (i = 0; i < count; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment