From 07c81db79a3a6fe917007444f0d4fb9559ea40bf Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 26 Jan 2016 13:24:15 +0300 Subject: [PATCH] removed interfaces pointer by default from BasicInterface --- Telegram/SourceFiles/layout.h | 2 +- Telegram/SourceFiles/structs.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index c7303adc95..f4bead1ec0 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -270,7 +270,7 @@ public: class OverviewItemInfo : public BasicInterface { public: - OverviewItemInfo() : _top(0) { + OverviewItemInfo(Interfaces *) : _top(0) { } int32 top() const { return _top; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index cdb0fe83b3..6bfa3bb701 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -39,7 +39,7 @@ template struct InterfaceWrapTemplate { static const int Size = CeilDivideMinimumOne::Result * sizeof(uint64); static void Construct(void *location, Interfaces *interfaces) { - (new (location) Type())->interfaces = interfaces; + new (location) Type(interfaces); } static void Destruct(void *location) { ((Type*)location)->~Type(); @@ -72,6 +72,14 @@ public: static const uint64 Bit() { return (1 << Index()); } + +}; + +template +class BasicInterfaceWithPointer : public BasicInterface { +public: + BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { + } Interfaces *interfaces = 0; };