diff options
author | glx <glx@openttd.org> | 2019-12-17 18:57:53 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-21 20:13:03 +0100 |
commit | 11f178a312d1a601aa14f9188f05f4a4cd033cf9 (patch) | |
tree | dfc50d0f6714abfae49305d70842856ec9d75f8e | |
parent | d8a1be48cd60c690235de175e9a044b95f92ea28 (diff) | |
download | openttd-11f178a312d1a601aa14f9188f05f4a4cd033cf9.tar.xz |
Codechange: Replace FOR_ALL_STORAGES with range-based for loops
-rw-r--r-- | src/newgrf_storage.h | 3 | ||||
-rw-r--r-- | src/saveload/storage_sl.cpp | 4 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/newgrf_storage.h b/src/newgrf_storage.h index 153d4c91d..61206a587 100644 --- a/src/newgrf_storage.h +++ b/src/newgrf_storage.h @@ -230,7 +230,4 @@ struct PersistentStorage : PersistentStorageArray<int32, 256>, PersistentStorage assert_compile(cpp_lengthof(OldPersistentStorage, storage) <= cpp_lengthof(PersistentStorage, storage)); -#define FOR_ALL_STORAGES_FROM(var, start) FOR_ALL_ITEMS_FROM(PersistentStorage, storage_index, var, start) -#define FOR_ALL_STORAGES(var) FOR_ALL_STORAGES_FROM(var, 0) - #endif /* NEWGRF_STORAGE_H */ diff --git a/src/saveload/storage_sl.cpp b/src/saveload/storage_sl.cpp index 8c8a96915..7abe396f3 100644 --- a/src/saveload/storage_sl.cpp +++ b/src/saveload/storage_sl.cpp @@ -36,10 +36,8 @@ static void Load_PSAC() /** Save persistent storage data. */ static void Save_PSAC() { - PersistentStorage *ps; - /* Write the industries */ - FOR_ALL_STORAGES(ps) { + for (PersistentStorage *ps : PersistentStorage::Iterate()) { ps->ClearChanges(); SlSetArrayIndex(ps->index); SlObject(ps, _storage_desc); |