Author: ekohl
Date: Sun Nov 27 12:00:34 2011
New Revision: 54507
URL:
http://svn.reactos.org/svn/reactos?rev=54507&view=rev
Log:
[USETUP]
Get rid of the ugly LIST_FOR_EACH macro.
Modified:
trunk/reactos/base/setup/usetup/partlist.c
trunk/reactos/base/setup/usetup/usetup.h
Modified: trunk/reactos/base/setup/usetup/partlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/partlist…
==============================================================================
--- trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/partlist.c [iso-8859-1] Sun Nov 27 12:00:34 2011
@@ -1281,6 +1281,7 @@
PDISKENTRY DiskEntry)
{
PPARTENTRY PartEntry;
+ PLIST_ENTRY Entry;
CHAR LineBuffer[128];
COORD coPos;
DWORD Written;
@@ -1365,8 +1366,11 @@
PrintEmptyLine (List);
/* Print partition lines*/
- LIST_FOR_EACH(PartEntry, &DiskEntry->PartListHead, PARTENTRY, ListEntry)
- {
+ Entry = DiskEntry->PartListHead.Flink;
+ while (Entry != &DiskEntry->PartListHead)
+ {
+ PartEntry = CONTAINING_RECORD(Entry, PARTENTRY, ListEntry);
+
/* Print disk entry */
for (i=0; i<4; i++)
{
@@ -1389,6 +1393,7 @@
0);
}
+ Entry = Entry->Flink;
}
/* Print separator line */
@@ -1596,11 +1601,16 @@
/* print list entries */
List->Line = - List->Offset;
- LIST_FOR_EACH(DiskEntry, &List->DiskListHead, DISKENTRY, ListEntry)
- {
+ Entry = List->DiskListHead.Flink;
+ while (Entry != &List->DiskListHead)
+ {
+ DiskEntry = CONTAINING_RECORD (Entry, DISKENTRY, ListEntry);
+
/* Print disk entry */
PrintDiskData (List,
DiskEntry);
+
+ Entry = Entry->Flink;
}
}
Modified: trunk/reactos/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.h…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.h [iso-8859-1] Sun Nov 27 12:00:34 2011
@@ -167,11 +167,6 @@
#define POPUP_WAIT_ANY_KEY 1
#define POPUP_WAIT_ENTER 2
-#define LIST_FOR_EACH(elem, list, type, field) \
- for ((elem) = CONTAINING_RECORD((list)->Flink, type, field); \
- &(elem)->field != (list) || (elem == NULL); \
- (elem) = CONTAINING_RECORD((elem)->field.Flink, type, field))
-
#define InsertAscendingList(ListHead, NewEntry, Type, ListEntryField, SortField)\
{\
PLIST_ENTRY current;\