From 8e09c4d75e26ed3fc165cd35fd1fc79614b1420e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 4 May 2016 16:22:54 +0000 Subject: Tox: - removed own logger - bootstrap splitted into two functions: udp and tcp git-svn-id: http://svn.miranda-ng.org/main/trunk@16801 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_avatars.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'protocols/Tox/src/tox_avatars.cpp') diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index 9b1e4a36dd..dad9aad980 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -27,17 +27,17 @@ void CToxProto::SetToxAvatar(const TCHAR* path) FILE *hFile = _tfopen(path, L"rb"); if (!hFile) { - logger->Log(__FUNCTION__": failed to open avatar file"); + debugLogA(__FUNCTION__": failed to open avatar file"); return; } fseek(hFile, 0, SEEK_END); - long length = ftell(hFile); + size_t length = ftell(hFile); rewind(hFile); if (length > TOX_MAX_AVATAR_SIZE) { fclose(hFile); - logger->Log(__FUNCTION__": new avatar size is excessive"); + debugLogA(__FUNCTION__": new avatar size is excessive"); return; } @@ -45,7 +45,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path) if (fread(data, sizeof(uint8_t), length, hFile) != length) { fclose(hFile); - logger->Log(__FUNCTION__": failed to read avatar file"); + debugLogA(__FUNCTION__": failed to read avatar file"); mir_free(data); return; } @@ -60,7 +60,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path) { db_free(&dbv); mir_free(data); - logger->Log(__FUNCTION__": new avatar is same with old"); + debugLogA(__FUNCTION__": new avatar is same with old"); return; } db_free(&dbv); @@ -79,7 +79,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path) if (friendNumber == UINT32_MAX) { mir_free(data); - logger->Log(__FUNCTION__": failed to set new avatar"); + debugLogA(__FUNCTION__": failed to set new avatar"); return; } @@ -88,7 +88,7 @@ void CToxProto::SetToxAvatar(const TCHAR* path) if (error != TOX_ERR_FILE_SEND_OK) { mir_free(data); - logger->Log(__FUNCTION__": failed to set new avatar"); + debugLogA(__FUNCTION__": failed to set new avatar"); return; } @@ -157,15 +157,15 @@ INT_PTR CToxProto::GetMyAvatar(WPARAM wParam, LPARAM lParam) INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam) { - logger->Log("CToxProto::SetMyAvatar: setting avatar"); + debugLogA(__FUNCTION__": setting avatar"); TCHAR *path = (TCHAR*)lParam; ptrT avatarPath(GetAvatarFilePath()); if (path != NULL) { - logger->Log("CToxProto::SetMyAvatar: copy new avatar"); + debugLogA(__FUNCTION__": copy new avatar"); if (!CopyFile(path, avatarPath, FALSE)) { - logger->Log("CToxProto::SetMyAvatar: failed to copy new avatar to avatar cache"); + debugLogA(__FUNCTION__": failed to copy new avatar to avatar cache"); return 0; } @@ -189,7 +189,7 @@ INT_PTR CToxProto::SetMyAvatar(WPARAM, LPARAM lParam) tox_file_send(toxThread->Tox(), friendNumber, TOX_FILE_KIND_AVATAR, 0, NULL, NULL, 0, &error); if (error != TOX_ERR_FILE_SEND_OK) { - logger->Log(__FUNCTION__": failed to unset avatar (%d)", error); + debugLogA(__FUNCTION__": failed to unset avatar (%d)", error); return 0; } } -- cgit v1.2.3