Fix compilation with GCC7

This commit is contained in:
Michał Janiszewski authored and Michael Steenbeek committed 2017-04-24 11:34:56 +02:00
1 parent a16220ef82
commit 92aefb477f
3 files changed
+11 -11

No files matched your search

+4 -4
View File
@@ -1043,10 +1043,10 @@ void game_autosave()
rct2_time currentTime;
platform_get_time_local(&currentTime);
utf8 timeName[34];
snprintf(timeName, 34, "autosave_%d-%02d-%02d_%02d-%02d-%02d%s",
currentDate.year, currentDate.month, currentDate.day, currentTime.hour, currentTime.minute,currentTime.second,
fileExtension);
utf8 timeName[44];
snprintf(timeName, sizeof(timeName), "autosave_%04u-%02u-%02u_%02u-%02u-%02u%s",
currentDate.year, currentDate.month, currentDate.day, currentTime.hour,
currentTime.minute, currentTime.second, fileExtension);
limit_autosave_count(NUMBER_OF_AUTOSAVES_TO_KEEP);
+6 -6
View File
@@ -74,16 +74,16 @@ typedef struct file_info {
} file_info;
typedef struct rct2_date {
sint16 day;
sint16 month;
uint8 day;
uint8 month;
sint16 year;
sint16 day_of_week;
uint8 day_of_week;
} rct2_date;
typedef struct rct2_time {
sint16 hour;
sint16 minute;
sint16 second;
uint8 hour;
uint8 minute;
uint8 second;
} rct2_time;
typedef struct openrct2_cursor {
+1 -1
View File
@@ -482,7 +482,7 @@ private:
// Check if there are spare entries available
size_t maxEntries = (size_t)object_entry_group_counts[objectType];
if (entries->GetCount() < maxEntries)
if (entries != nullptr && entries->GetCount() < maxEntries)
{
entries->GetOrAddEntry(objectName);
}