Skip to content

Commit

Permalink
Merge da1b43a into 19e8c86
Browse files Browse the repository at this point in the history
  • Loading branch information
crackedmind authored Mar 12, 2018
2 parents 19e8c86 + da1b43a commit 754e8c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.10)
project(telegram-desktop)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cotire/CMake;${PROJECT_SOURCE_DIR}/modules/")
Expand Down
8 changes: 0 additions & 8 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -641,14 +641,6 @@ if(NOT WIN32)
set_flag_if_supported(Telegram WNCE -Wno-c++1z-extensions)
endif()

# Enable C++17 support for msvc (@todo this should be done in cmake - see ver 3.10 or above)
if(WIN32)
target_compile_options(Telegram PRIVATE
/std:c++latest
/EHsc # Catch C++ exceptions only, extern C functions never throw a C++ exception.
)
endif()

target_compile_definitions(Telegram PRIVATE ${FFMPEG_DEFINITIONS})

target_link_libraries(Telegram
Expand Down
10 changes: 5 additions & 5 deletions Telegram/SourceFiles/base/observer.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,27 +415,27 @@ class Variable {
class Subscriber {
protected:
template <typename EventType, typename Handler, typename Lambda>
int subscribe(base::Observable<EventType, Handler> &observable, Lambda &&handler) {
size_t subscribe(base::Observable<EventType, Handler> &observable, Lambda &&handler) {
_subscriptions.push_back(observable.add_subscription(std::forward<Lambda>(handler)));
return _subscriptions.size();
}

template <typename EventType, typename Handler, typename Lambda>
int subscribe(base::Observable<EventType, Handler> *observable, Lambda &&handler) {
size_t subscribe(base::Observable<EventType, Handler> *observable, Lambda &&handler) {
return subscribe(*observable, std::forward<Lambda>(handler));
}

template <typename Type, typename Lambda>
int subscribe(const base::Variable<Type> &variable, Lambda &&handler) {
size_t subscribe(const base::Variable<Type> &variable, Lambda &&handler) {
return subscribe(variable.changed(), std::forward<Lambda>(handler));
}

template <typename Type, typename Lambda>
int subscribe(const base::Variable<Type> *variable, Lambda &&handler) {
size_t subscribe(const base::Variable<Type> *variable, Lambda &&handler) {
return subscribe(variable->changed(), std::forward<Lambda>(handler));
}

void unsubscribe(int index) {
void unsubscribe(size_t index) {
if (!index) return;
auto count = static_cast<int>(_subscriptions.size());
Assert(index > 0 && index <= count);
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/base/runtime_composer.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ class RuntimeComposer {
return &ZeroRuntimeComposerMetadata;
}

void *_dataptrunsafe(int skip) const {
void *_dataptrunsafe(size_t skip) const {
return (char*)_data + skip;
}
void *_dataptr(int skip) const {
void *_dataptr(size_t skip) const {
return (skip >= sizeof(_meta())) ? _dataptrunsafe(skip) : nullptr;
}
const RuntimeComposerMetadata *&_meta() const {
Expand Down
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/mtproto/auth_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AuthKey {
}

void write(QDataStream &to) const {
to.writeRawData(reinterpret_cast<const char*>(_key.data()), _key.size());
to.writeRawData(reinterpret_cast<const char*>(_key.data()), static_cast<int>(_key.size()));
}

bool equals(const std::shared_ptr<AuthKey> &other) const {
Expand Down

0 comments on commit 754e8c1

Please sign in to comment.