From 745de17c41ea9780a74b5565ebe8b02d576ab609 Mon Sep 17 00:00:00 2001 From: Kp Date: Mon, 13 Jul 2015 01:09:36 +0000 Subject: [PATCH] Use T::index_type for highest_valid --- common/include/highest_valid.h | 4 ++-- common/main/object.h | 1 + common/main/segment.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/include/highest_valid.h b/common/include/highest_valid.h index 175f44a5e..6ef9f35db 100644 --- a/common/include/highest_valid.h +++ b/common/include/highest_valid.h @@ -2,7 +2,7 @@ #include #include -template +template struct highest_valid_t { struct iterator : std::iterator @@ -36,7 +36,7 @@ struct highest_valid_t }; template -highest_valid_t highest_valid(T &t, std::size_t start = 0) +highest_valid_t highest_valid(T &t, typename T::index_type start = 0) { return {t, start}; } diff --git a/common/main/object.h b/common/main/object.h index d71961980..3513b99f6 100644 --- a/common/main/object.h +++ b/common/main/object.h @@ -395,6 +395,7 @@ struct obj_position struct object_array_t : array { + typedef uint16_t index_type; int highest; #define Highest_object_index Objects.highest typedef array array_t; diff --git a/common/main/segment.h b/common/main/segment.h index 12f91e131..881fa0179 100644 --- a/common/main/segment.h +++ b/common/main/segment.h @@ -186,6 +186,7 @@ struct group struct segment_array_t : public array { + typedef uint16_t index_type; unsigned highest; #define Highest_segment_index Segments.highest typedef array array_t;