Skip to content

Commit

Permalink
Use Loki::EmptyType instead of Loki::NullType
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegeri committed Sep 16, 2018
1 parent 918218f commit d5d013d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/xrGame/alife_registry_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RegistryHelper
}

template <>
static void Load<Loki::NullType>(TContainer* self, IReader& reader)
static void Load<Loki::EmptyType>(TContainer* self, IReader& reader)
{
}

Expand All @@ -64,7 +64,7 @@ class RegistryHelper
}

template <>
static void Save<Loki::NullType>(TContainer* self, IWriter& writer)
static void Save<Loki::EmptyType>(TContainer* self, IWriter& writer)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/base_client_classes_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct heritage
{
};

typedef Loki::Typelist<_1, Loki::Typelist<_2, Loki::NullType>> tl;
typedef Loki::Typelist<_1, Loki::Typelist<_2, Loki::EmptyType>> tl;
typedef typename Loki::TL::Erase<tl, Loki::EmptyType>::Result pure_tl;
typedef typename Loki::GenLinearHierarchy<pure_tl, linear_registrator> result;
};
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/game_state_accumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class game_state_accumulator : public game_events_handler
template <typename TypeListElement>
void init_acpv_list();
template <>
void init_acpv_list<Loki::NullType>(){};
void init_acpv_list<Loki::EmptyType>(){};

void update_average_values();
void update_accumulative_values();
Expand Down
6 changes: 3 additions & 3 deletions src/xrServerEntities/smart_cast_impl0.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ struct CTypeHelper
};

template <>
struct add<Loki::NullType>
struct add<Loki::EmptyType>
{
typedef Loki::Typelist<Loki::Typelist<T, Loki::Typelist<P, Loki::NullType>>, List> result;
typedef Loki::Typelist<Loki::Typelist<T, Loki::Typelist<P, Loki::EmptyType>>, List> result;
};

typedef typename add<List>::result result;
};
};

#define cast_type_list Loki::NullType
#define cast_type_list Loki::EmptyType
#define add_to_cast_list(B, A) typedef SmartDynamicCast::CTypeHelper<cast_type_list, A, B>::result TypeList_##A##B
#define save_cast_list(B, A) TypeList_##A##B

Expand Down
40 changes: 20 additions & 20 deletions src/xrServerEntities/smart_cast_impl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct exists
};

template <>
struct iterator<Loki::NullType>
struct iterator<Loki::EmptyType>
{
enum
{
Expand All @@ -83,7 +83,7 @@ struct merge
};

template <>
struct iterator<Loki::NullType>
struct iterator<Loki::EmptyType>
{
typedef List2 result;
};
Expand Down Expand Up @@ -116,9 +116,9 @@ struct has_conversion
};

template <>
struct search_base<Loki::NullType>
struct search_base<Loki::EmptyType>
{
typedef Loki::NullType result;
typedef Loki::EmptyType result;
};

template <typename T>
Expand Down Expand Up @@ -149,7 +149,7 @@ struct has_conversion
};

template <>
struct search_conversion<Loki::NullType>
struct search_conversion<Loki::EmptyType>
{
enum
{
Expand Down Expand Up @@ -197,7 +197,7 @@ struct has_any_conversion
};

template <>
struct iterator<Loki::NullType>
struct iterator<Loki::EmptyType>
{
enum
{
Expand Down Expand Up @@ -233,14 +233,14 @@ struct CMatcher
template <bool>
struct _selector
{
typedef Loki::Typelist<typename PrevHead::Head, Loki::Typelist<Target, Loki::NullType>> result;
typedef Loki::Typelist<typename PrevHead::Head, Loki::Typelist<Target, Loki::EmptyType>> result;
};

template <>
struct _selector<false>
{
typedef Loki::Typelist<typename PrevHead::Head,
Loki::Typelist<Head, Loki::Typelist<Target, Loki::NullType>>>
Loki::Typelist<Head, Loki::Typelist<Target, Loki::EmptyType>>>
result;
};

Expand All @@ -258,7 +258,7 @@ struct CMatcher
};

template <>
struct CMatchHelper3<Loki::NullType>
struct CMatchHelper3<Loki::EmptyType>
{
typedef typename CMatchHelper<typename T::Tail>::result result;
};
Expand Down Expand Up @@ -290,9 +290,9 @@ struct CMatcher
};

template <>
struct CMatchHelper<Loki::NullType>
struct CMatchHelper<Loki::EmptyType>
{
typedef Loki::NullType result;
typedef Loki::EmptyType result;
};

typedef typename CMatchHelper<cast_type_list>::result result;
Expand Down Expand Up @@ -326,7 +326,7 @@ struct conversion_sequence
typedef search_result result;
};

typedef typename selector<is_type<Loki::NullType, search_result>::value>::result result;
typedef typename selector<is_type<Loki::EmptyType, search_result>::value>::result result;
};

template <bool>
Expand All @@ -346,7 +346,7 @@ struct conversion_sequence
typedef typename list_iterator<Tail>::result result;
};

typedef typename _selector<!is_type<Loki::NullType, helper_result>::value>::result result;
typedef typename _selector<!is_type<Loki::EmptyType, helper_result>::value>::result result;
};

template <>
Expand All @@ -369,7 +369,7 @@ struct conversion_sequence
typedef typename list_iterator<Tail>::result result;
};

typedef typename _selector2<!is_type<Loki::NullType, helper_result>::value>::result result;
typedef typename _selector2<!is_type<Loki::EmptyType, helper_result>::value>::result result;
};

template <>
Expand All @@ -386,9 +386,9 @@ struct conversion_sequence
};

template <>
struct list_iterator<Loki::NullType>
struct list_iterator<Loki::EmptyType>
{
typedef Loki::NullType result;
typedef Loki::EmptyType result;
};

template <int length>
Expand All @@ -410,7 +410,7 @@ struct conversion_sequence
typedef typename list_iterator<cast_type_list>::result result;
};

typedef typename _selector<!is_type<Loki::NullType, nearest>::value>::result result;
typedef typename _selector<!is_type<Loki::EmptyType, nearest>::value>::result result;
};

template <>
Expand All @@ -422,7 +422,7 @@ struct conversion_sequence
template <>
struct selector<0>
{
typedef Loki::NullType result;
typedef Loki::EmptyType result;
};

typedef typename selector<max_length>::result result;
Expand Down Expand Up @@ -451,7 +451,7 @@ struct CSmartCaster
};

template <>
struct CHelper<Loki::NullType>
struct CHelper<Loki::EmptyType>
{
IC static Target* smart_cast(Head* p) { return (SmartDynamicCast::smart_cast<Target>(p)); }
};
Expand All @@ -474,7 +474,7 @@ struct CSmartMatcher
}

template <>
IC static T1* smart_cast<Loki::NullType>(T2* p)
IC static T1* smart_cast<Loki::EmptyType>(T2* p)
{
#ifdef SHOW_SMART_CAST_UNOPTIMIZED_CASES
#pragma todo("Dima to all : this smart_cast is not optimized!")
Expand Down

0 comments on commit d5d013d

Please sign in to comment.