Fix more warnings

This commit is contained in:
Ted John 2017-01-12 13:16:00 +00:00
parent 13a8eee1b4
commit 3a9b6f4bb0
6 changed files with 11 additions and 34 deletions

View File

@ -34,11 +34,11 @@ bool gUseTrueTypeFont = false;
static ILanguagePack * _languageFallback = nullptr;
static ILanguagePack * _languageCurrent = nullptr;
const utf8 BlackUpArrowString[] = { (utf8)0xC2, (utf8)0x8E, (utf8)0xE2, (utf8)0x96, (utf8)0xB2, (utf8)0x00 };
const utf8 BlackDownArrowString[] = { (utf8)0xC2, (utf8)0x8E, (utf8)0xE2, (utf8)0x96, (utf8)0xBC, (utf8)0x00 };
const utf8 BlackLeftArrowString[] = { (utf8)0xC2, (utf8)0x8E, (utf8)0xE2, (utf8)0x97, (utf8)0x80, (utf8)0x00 };
const utf8 BlackRightArrowString[] = { (utf8)0xC2, (utf8)0x8E, (utf8)0xE2, (utf8)0x96, (utf8)0xB6, (utf8)0x00 };
const utf8 CheckBoxMarkString[] = { (utf8)0xE2, (utf8)0x9C, (utf8)0x93, (utf8)0x00 };
const utf8 BlackUpArrowString[] = { (utf8)(uint8)0xC2, (utf8)(uint8)0x8E, (utf8)(uint8)0xE2, (utf8)(uint8)0x96, (utf8)(uint8)0xB2, (utf8)(uint8)0x00 };
const utf8 BlackDownArrowString[] = { (utf8)(uint8)0xC2, (utf8)(uint8)0x8E, (utf8)(uint8)0xE2, (utf8)(uint8)0x96, (utf8)(uint8)0xBC, (utf8)(uint8)0x00 };
const utf8 BlackLeftArrowString[] = { (utf8)(uint8)0xC2, (utf8)(uint8)0x8E, (utf8)(uint8)0xE2, (utf8)(uint8)0x97, (utf8)(uint8)0x80, (utf8)(uint8)0x00 };
const utf8 BlackRightArrowString[] = { (utf8)(uint8)0xC2, (utf8)(uint8)0x8E, (utf8)(uint8)0xE2, (utf8)(uint8)0x96, (utf8)(uint8)0xB6, (utf8)(uint8)0x00 };
const utf8 CheckBoxMarkString[] = { (utf8)(uint8)0xE2, (utf8)(uint8)0x9C, (utf8)(uint8)0x93, (utf8)(uint8)0x00 };
void utf8_remove_format_codes(utf8 * text, bool allowcolours)
{
@ -144,7 +144,7 @@ static wchar_t convert_specific_language_character_to_unicode(int languageId, wc
static utf8 * convert_multibyte_charset(const char * src, size_t srcMaxSize, int languageId)
{
constexpr char CODEPOINT_DOUBLEBYTE = (char)0xFF;
constexpr char CODEPOINT_DOUBLEBYTE = (char)(uint8)0xFF;
auto sb = StringBuilder(64);
for (const char * ch = src; (ch < src + srcMaxSize) && (*ch != '\0');)

View File

@ -441,7 +441,7 @@ static int award_is_deserved_most_disappointing(int awardType, int activeAwardTy
disappointingRides = 0;
FOR_ALL_RIDES(i, ride) {
if (ride->excitement == (ride_rating)0xFFFF || ride->popularity == 0xFF)
if (ride->excitement == (ride_rating)(uint16)0xFFFF || ride->popularity == 0xFF)
continue;
countedRides++;

View File

@ -350,7 +350,7 @@ bool NetworkKey::Sign(const uint8 * md, const size_t len, char ** signature, siz
*signature = nullptr;
/* Create the Message Digest Context */
if (!(mdctx = EVP_MD_CTX_create()))
if ((mdctx = EVP_MD_CTX_create()) == NULL)
{
log_error("Failed to create MD context");
return false;
@ -382,7 +382,7 @@ bool NetworkKey::Sign(const uint8 * md, const size_t len, char ** signature, siz
unsigned char * sig;
/* Allocate memory for the signature based on size in slen */
if (!(sig = (unsigned char*)OPENSSL_malloc((int)(sizeof(unsigned char) * (*out_size)))))
if ((sig = (unsigned char*)OPENSSL_malloc((int)(sizeof(unsigned char) * (*out_size)))) == NULL)
{
log_error("Failed to crypto-allocate space fo signature");
EVP_MD_CTX_destroy(mdctx);
@ -408,7 +408,7 @@ bool NetworkKey::Verify(const uint8 * md, const size_t len, const char * sig, co
EVP_MD_CTX * mdctx = nullptr;
/* Create the Message Digest Context */
if (!(mdctx = EVP_MD_CTX_create()))
if ((mdctx = EVP_MD_CTX_create()) == NULL)
{
log_error("Failed to create MD context");
return false;

View File

@ -62,22 +62,6 @@ void http_dispose()
curl_global_cleanup();
}
static size_t http_request_read_func(void *ptr, size_t size, size_t nmemb, void *userdata)
{
read_buffer *readBuffer = (read_buffer*)userdata;
size_t remainingBytes = readBuffer->length - readBuffer->position;
size_t readBytes = size * nmemb;
if (readBytes > remainingBytes) {
readBytes = remainingBytes;
}
memcpy(ptr, readBuffer->ptr + readBuffer->position, readBytes);
readBuffer->position += readBytes;
return readBytes;
}
static size_t http_request_write_func(void *ptr, size_t size, size_t nmemb, void *userdata)
{
write_buffer *writeBuffer = (write_buffer*)userdata;

View File

@ -90,7 +90,6 @@ void network_chat_show_server_greeting();
static void network_get_keys_directory(utf8 *buffer, size_t bufferSize);
static void network_get_private_key_path(utf8 *buffer, size_t bufferSize, const utf8 * playerName);
static void network_get_public_key_path(utf8 *buffer, size_t bufferSize, const utf8 * playerName, const utf8 * hash);
static void network_get_keymap_path(utf8 *buffer, size_t bufferSize);
Network::Network()
{
@ -2493,12 +2492,6 @@ static void network_get_public_key_path(utf8 *buffer, size_t bufferSize, const u
String::Append(buffer, bufferSize, ".pubkey");
}
static void network_get_keymap_path(utf8 *buffer, size_t bufferSize)
{
platform_get_user_directory(buffer, NULL, bufferSize);
Path::Append(buffer, bufferSize, "keymappings.json");
}
const utf8 * network_get_server_name() { return gNetwork.ServerName.c_str(); }
const utf8 * network_get_server_description() { return gNetwork.ServerDescription.c_str(); }
const utf8 * network_get_server_greeting() { return gNetwork.ServerGreeting.c_str(); }

View File

@ -546,7 +546,7 @@ namespace Twitch
if (gConfigTwitch.enable_news)
{
utf8 buffer[256];
buffer[0] = (utf8)FORMAT_TOPAZ;
buffer[0] = (utf8)(uint8)FORMAT_TOPAZ;
safe_strcpy(buffer + 1, message, sizeof(buffer) - 1);
// Remove unsupported characters