Fixing VC++ warnings and errors.

This commit is contained in:
Ben Vanik
2013-02-08 22:07:38 -08:00
parent c1e2119db4
commit 338b890ef5
26 changed files with 147 additions and 58 deletions

View File

@@ -83,7 +83,7 @@ void Debugger::Broadcast(uint32_t source_id,
0x00000001,
source_id,
0,
length,
(uint32_t)length,
};
uint8_t* buffers[] = {
(uint8_t*)header,

View File

@@ -9,6 +9,11 @@
#include <xenia/dbg/simple_sha1.h>
#if XE_PLATFORM(WIN32)
#include <winsock2.h>
#else
#endif // WIN32
using namespace xe;
using namespace xe::dbg;
@@ -211,7 +216,7 @@ void xe::dbg::SHA1(const uint8_t* data, size_t length, uint8_t out_hash[20]) {
{ 0 }
};
SHA1_Update(&ctx, data, length);
SHA1_Update(&ctx, data, (unsigned long)length);
uint32_t padlen[2] = {
htonl((uint32_t)(ctx.size >> 29)),

View File

@@ -12,6 +12,11 @@
#include <xenia/dbg/debugger.h>
#include <xenia/dbg/simple_sha1.h>
#if XE_PLATFORM(WIN32)
// Required for wslay.
typedef SSIZE_T ssize_t;
#endif // WIN32
#include <wslay/wslay.h>
@@ -69,13 +74,13 @@ void WsClient::StartCallback(void* param) {
namespace {
ssize_t WsClientSendCallback(wslay_event_context_ptr ctx,
int64_t WsClientSendCallback(wslay_event_context_ptr ctx,
const uint8_t* data, size_t len, int flags,
void* user_data) {
WsClient* client = reinterpret_cast<WsClient*>(user_data);
int error_code = 0;
ssize_t r;
int64_t r;
while ((r = xe_socket_send(client->socket_id(), data, len, 0,
&error_code)) == -1 && error_code == EINTR);
if (r == -1) {
@@ -88,13 +93,13 @@ ssize_t WsClientSendCallback(wslay_event_context_ptr ctx,
return r;
}
ssize_t WsClientRecvCallback(wslay_event_context_ptr ctx,
int64_t WsClientRecvCallback(wslay_event_context_ptr ctx,
uint8_t* data, size_t len, int flags,
void* user_data) {
WsClient* client = reinterpret_cast<WsClient*>(user_data);
int error_code = 0;
ssize_t r;
int64_t r;
while ((r = xe_socket_recv(client->socket_id(), data, len, 0,
&error_code)) == -1 && error_code == EINTR);
if (r == -1) {
@@ -167,7 +172,7 @@ int WsClient::PerformHandshake() {
std::string headers;
uint8_t buffer[4096];
int error_code = 0;
ssize_t r;
int64_t r;
while (true) {
while ((r = xe_socket_recv(socket_id_, buffer, sizeof(buffer), 0,
&error_code)) == -1 && error_code == EINTR);
@@ -279,8 +284,8 @@ void WsClient::EventThread() {
while (wslay_event_want_read(ctx) || wslay_event_want_write(ctx)) {
// Wait on the event.
if (xe_socket_loop_poll(loop_,
wslay_event_want_read(ctx),
wslay_event_want_write(ctx))) {
!!wslay_event_want_read(ctx),
!!wslay_event_want_write(ctx))) {
break;
}