Fix some g++4.9 CE.

GitOrigin-RevId: 0d4ed1e684fd623a7ab5849e4f0f7ec2fd182694
This commit is contained in:
levlam 2019-02-13 02:29:52 +03:00
parent ce7c9feef1
commit 8c3eb953ae
8 changed files with 19 additions and 17 deletions

View File

@ -11,7 +11,7 @@ const sleep = ms => new Promise(res => setTimeout(res, ms));
* TDLib can be used from javascript through the [JSON](https://github.com/tdlib/td#using-json) interface.
* This is a convenient wrapper around it.
* Internally it uses TDLib built with emscripten as asm.js or WebAssembly. All work happens in a WebWorker.
* TdClient itself just sends queries to WebWorker, recieve updates and results from WebWorker.
* TdClient itself just sends queries to WebWorker, receive updates and results from WebWorker.
*
* <br><br>
* Differences from TDLib API<br>

View File

@ -136,7 +136,7 @@ std::pair<DocumentsManager::DocumentType, FileId> DocumentsManager::on_get_docum
if (animated != nullptr || default_document_type == DocumentType::Animation) {
document_type = DocumentType::Animation;
file_type = FileType::Animation;
default_extension = "mp4";
default_extension = Slice("mp4");
} else if (audio != nullptr || default_document_type == DocumentType::Audio ||
default_document_type == DocumentType::VoiceNote) {
bool is_voice_note = default_document_type == DocumentType::VoiceNote;
@ -146,17 +146,17 @@ std::pair<DocumentsManager::DocumentType, FileId> DocumentsManager::on_get_docum
if (is_voice_note) {
document_type = DocumentType::VoiceNote;
file_type = FileType::VoiceNote;
default_extension = "oga";
default_extension = Slice("oga");
file_name.clear();
} else {
document_type = DocumentType::Audio;
file_type = FileType::Audio;
default_extension = "mp3";
default_extension = Slice("mp3");
}
} else if (sticker != nullptr || default_document_type == DocumentType::Sticker) {
document_type = DocumentType::Sticker;
file_type = FileType::Sticker;
default_extension = "webp";
default_extension = Slice("webp");
owner_dialog_id = DialogId();
file_name.clear();
has_webp_thumbnail = td_->stickers_manager_->has_webp_thumbnail(sticker);
@ -177,7 +177,7 @@ std::pair<DocumentsManager::DocumentType, FileId> DocumentsManager::on_get_docum
document_type = DocumentType::Video;
file_type = FileType::Video;
}
default_extension = "mp4";
default_extension = Slice("mp4");
}
} else if (type_attributes >= 2) {
LOG(WARNING) << "Receive document with more than 1 type attribute: animated = " << to_string(animated)

View File

@ -954,14 +954,14 @@ void Session::connection_open_finish(ConnectionInfo *info,
Slice mode_name;
if (mode_ == Mode::Tcp) {
mode = mtproto::SessionConnection::Mode::Tcp;
mode_name = "Tcp";
mode_name = Slice("Tcp");
} else {
if (info->connection_id == 0) {
mode = mtproto::SessionConnection::Mode::Http;
mode_name = "Http";
mode_name = Slice("Http");
} else {
mode = mtproto::SessionConnection::Mode::HttpLongPoll;
mode_name = "HttpLongPoll";
mode_name = Slice("HttpLongPoll");
}
}
auto name = PSTRING() << get_name() << "::Connect::" << mode_name << "::" << raw_connection->debug_str_;

View File

@ -5,6 +5,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/actor/impl/Actor-decl.h"
#include "td/actor/impl/ActorId-decl.h"
#include "td/actor/impl/EventFull-decl.h"

View File

@ -691,10 +691,10 @@ Status HttpReader::parse_head(MutableSlice head) {
parser.skip('\n');
content_length_ = 0;
content_type_ = "application/octet-stream";
content_type_ = Slice("application/octet-stream");
content_type_lowercased_ = content_type_.str();
transfer_encoding_ = "";
content_encoding_ = "";
transfer_encoding_ = Slice();
content_encoding_ = Slice();
query_->keep_alive_ = false;
query_->headers_.clear();

View File

@ -114,7 +114,7 @@ Result<HttpUrl> parse_url(MutableSlice url, HttpUrl::Protocol default_protocol)
query.remove_suffix(1);
}
if (query.empty()) {
query = "/";
query = Slice("/");
}
string query_str;
if (query[0] != '/') {

View File

@ -7,6 +7,7 @@
#include "td/utils/check.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
namespace td {
namespace detail {

View File

@ -217,13 +217,13 @@ class DefaultLog : public LogInterface {
switch (log_level) {
case VERBOSITY_NAME(FATAL):
case VERBOSITY_NAME(ERROR):
color = TC_RED;
color = Slice(TC_RED);
break;
case VERBOSITY_NAME(WARNING):
color = TC_YELLOW;
color = Slice(TC_YELLOW);
break;
case VERBOSITY_NAME(INFO):
color = TC_CYAN;
color = Slice(TC_CYAN);
break;
}
TsCerr() << color << slice << TC_EMPTY;