Store item in List rather than pointer to item
This commit is contained in:
parent
f5c6a35cef
commit
6251fee3ff
@ -13,7 +13,7 @@ struct Acpi
|
||||
/**
|
||||
* List of ACPI tables.
|
||||
*/
|
||||
private static __gshared List!Header tables;
|
||||
private static __gshared List!(Header *) tables;
|
||||
|
||||
enum uint XSDT_SIGNATURE = signature("XSDT");
|
||||
|
||||
|
@ -13,7 +13,7 @@ struct List(T)
|
||||
/**
|
||||
* Linked list item.
|
||||
*/
|
||||
T * item;
|
||||
T item;
|
||||
|
||||
/**
|
||||
* Next list entry.
|
||||
@ -23,7 +23,7 @@ struct List(T)
|
||||
/**
|
||||
* Add an item to this linked list.
|
||||
*/
|
||||
public void add(T * item)
|
||||
public void add(T item)
|
||||
{
|
||||
List!T * last_entry = last_entry();
|
||||
List!T * new_entry = A1.allocate!(List!T)();
|
||||
@ -34,7 +34,7 @@ struct List(T)
|
||||
/**
|
||||
* Allow foreach iteration across a List.
|
||||
*/
|
||||
public int opApply(scope int delegate(T *) dg)
|
||||
public int opApply(scope int delegate(ref T) dg)
|
||||
{
|
||||
List!T * entry = &this;
|
||||
while (entry.next != null)
|
||||
|
@ -235,7 +235,7 @@ struct Pci
|
||||
/**
|
||||
* Store a list of discovered PCI devices.
|
||||
*/
|
||||
public static __gshared List!Device devices;
|
||||
public static __gshared List!(Device *) devices;
|
||||
|
||||
private static uint read_config_register(Address address, uint register_id)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user