[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Sun, 27 Nov 2011 12:00:34 +0000 (12:00 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 27 Nov 2011 12:00:34 +0000 (12:00 +0000)
Get rid of the ugly LIST_FOR_EACH macro.

svn path=/trunk/; revision=54507

reactos/base/setup/usetup/partlist.c
reactos/base/setup/usetup/usetup.h

index 5109caf..2a9b493 100644 (file)
@@ -1281,6 +1281,7 @@ PrintDiskData (PPARTLIST List,
                PDISKENTRY DiskEntry)
 {
   PPARTENTRY PartEntry;
+  PLIST_ENTRY Entry;
   CHAR LineBuffer[128];
   COORD coPos;
   DWORD Written;
@@ -1365,8 +1366,11 @@ PrintDiskData (PPARTLIST List,
   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 @@ PrintDiskData (PPARTLIST List,
                             0);
     }
 
+    Entry = Entry->Flink;
   }
 
   /* Print separator line */
@@ -1596,11 +1601,16 @@ DrawPartitionList (PPARTLIST List)
   /* 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;
   }
 }
 
index 33b4b4e..9f66bd6 100644 (file)
@@ -167,11 +167,6 @@ typedef enum _PAGE_NUMBER
 #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;\