Merge pull request #1439 from ssakash/Cleanup_Warnings

PCSX2: Clean up warnings on MSVC
This commit is contained in:
Gregory Hainaut 2016-07-03 15:45:39 +02:00 committed by GitHub
commit cc62e8c785
12 changed files with 43 additions and 43 deletions

View File

@ -426,10 +426,10 @@ void EmitRex( const xRegisterBase& reg1, const void* src )
void EmitRex( const xRegisterBase& reg1, const xIndirectVoid& sib ) void EmitRex( const xRegisterBase& reg1, const xIndirectVoid& sib )
{ {
u8 w = reg1.IsWide(); bool w = reg1.IsWide();
u8 r = reg1.IsExtended(); bool r = reg1.IsExtended();
u8 x = sib.Index.IsExtended(); bool x = sib.Index.IsExtended();
u8 b = sib.Base.IsExtended(); bool b = sib.Base.IsExtended();
EmitRex(w, r, x, b); EmitRex(w, r, x, b);
} }

View File

@ -666,12 +666,12 @@ void LD()
} }
static const u64 LDL_MASK[8] = static const u64 LDL_MASK[8] =
{ 0x00ffffffffffffffLL, 0x0000ffffffffffffLL, 0x000000ffffffffffLL, 0x00000000ffffffffLL, { 0x00ffffffffffffffULL, 0x0000ffffffffffffULL, 0x000000ffffffffffULL, 0x00000000ffffffffULL,
0x0000000000ffffffLL, 0x000000000000ffffLL, 0x00000000000000ffLL, 0x0000000000000000LL 0x0000000000ffffffULL, 0x000000000000ffffULL, 0x00000000000000ffULL, 0x0000000000000000ULL
}; };
static const u64 LDR_MASK[8] = static const u64 LDR_MASK[8] =
{ 0x0000000000000000LL, 0xff00000000000000LL, 0xffff000000000000LL, 0xffffff0000000000LL, { 0x0000000000000000ULL, 0xff00000000000000ULL, 0xffff000000000000ULL, 0xffffff0000000000ULL,
0xffffffff00000000LL, 0xffffffffff000000LL, 0xffffffffffff0000LL, 0xffffffffffffff00LL 0xffffffff00000000ULL, 0xffffffffff000000ULL, 0xffffffffffff0000ULL, 0xffffffffffffff00ULL
}; };
static const u8 LDR_SHIFT[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; static const u8 LDR_SHIFT[8] = { 0, 8, 16, 24, 32, 40, 48, 56 };
@ -797,12 +797,12 @@ void SD()
} }
static const u64 SDL_MASK[8] = static const u64 SDL_MASK[8] =
{ 0xffffffffffffff00LL, 0xffffffffffff0000LL, 0xffffffffff000000LL, 0xffffffff00000000LL, { 0xffffffffffffff00ULL, 0xffffffffffff0000ULL, 0xffffffffff000000ULL, 0xffffffff00000000ULL,
0xffffff0000000000LL, 0xffff000000000000LL, 0xff00000000000000LL, 0x0000000000000000LL 0xffffff0000000000ULL, 0xffff000000000000ULL, 0xff00000000000000ULL, 0x0000000000000000ULL
}; };
static const u64 SDR_MASK[8] = static const u64 SDR_MASK[8] =
{ 0x0000000000000000LL, 0x00000000000000ffLL, 0x000000000000ffffLL, 0x0000000000ffffffLL, { 0x0000000000000000ULL, 0x00000000000000ffULL, 0x000000000000ffffULL, 0x0000000000ffffffULL,
0x00000000ffffffffLL, 0x000000ffffffffffLL, 0x0000ffffffffffffLL, 0x00ffffffffffffffLL 0x00000000ffffffffULL, 0x000000ffffffffffULL, 0x0000ffffffffffffULL, 0x00ffffffffffffffULL
}; };
static const u8 SDL_SHIFT[8] = { 56, 48, 40, 32, 24, 16, 8, 0 }; static const u8 SDL_SHIFT[8] = { 56, 48, 40, 32, 24, 16, 8, 0 };

View File

@ -327,7 +327,7 @@ void vtlb_dynarec_init()
{ {
xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) ); xSetPtr( GetIndirectDispatcherPtr( mode, bits, !!sign ) );
DynGen_IndirectTlbDispatcher( mode, bits, sign ); DynGen_IndirectTlbDispatcher( mode, bits, !!sign );
} }
} }
} }

View File

@ -184,7 +184,7 @@ namespace ReplaceGL {
void APIENTRY ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h) void APIENTRY ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
{ {
glViewport(x, y, w, h); glViewport(GLint(x), GLint(y), GLsizei(w), GLsizei(h));
} }
} }

View File

@ -163,7 +163,7 @@ void GSDeviceOGL::GenerateProfilerData()
double ms = 0.000001; double ms = 0.000001;
float replay = (float)(theApp.GetConfigI("linux_replay")); float replay = (float)(theApp.GetConfigI("linux_replay"));
int first_query = (float)m_profiler.last_query / replay; int first_query = static_cast<int>((float)m_profiler.last_query / replay);
glGetQueryObjectui64v(m_profiler.timer_query[first_query], GL_QUERY_RESULT, &time_start); glGetQueryObjectui64v(m_profiler.timer_query[first_query], GL_QUERY_RESULT, &time_start);
for (uint32 q = first_query + 1; q < m_profiler.last_query; q++) { for (uint32 q = first_query + 1; q < m_profiler.last_query; q++) {
@ -1665,7 +1665,7 @@ void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVecto
{ {
GLState::viewport = size; GLState::viewport = size;
// FIXME ViewportIndexedf or ViewportIndexedfv (GL4.1) // FIXME ViewportIndexedf or ViewportIndexedfv (GL4.1)
glViewportIndexedf(0, 0, 0, size.x, size.y); glViewportIndexedf(0, 0, 0, GLfloat(size.x), GLfloat(size.y));
} }
GSVector4i r = scissor ? *scissor : GSVector4i(size).zwxy(); GSVector4i r = scissor ? *scissor : GSVector4i(size).zwxy();

View File

@ -613,7 +613,7 @@ void GSRendererOGL::EmulateTextureSampler(const GSTextureCache::Source* tex)
const uint8 wms = m_context->CLAMP.WMS; const uint8 wms = m_context->CLAMP.WMS;
const uint8 wmt = m_context->CLAMP.WMT; const uint8 wmt = m_context->CLAMP.WMT;
bool complex_wms_wmt = (wms | wmt) & 2; bool complex_wms_wmt = !!((wms | wmt) & 2);
bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter != 0; bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter != 0;
bool simple_sample = !tex->m_palette && cpsm.fmt == 0 && !complex_wms_wmt && !psm.depth; bool simple_sample = !tex->m_palette && cpsm.fmt == 0 && !complex_wms_wmt && !psm.depth;
@ -999,15 +999,15 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// Replace all sprite with a single fullscreen sprite. // Replace all sprite with a single fullscreen sprite.
GSVertex* s = &m_vertex.buff[0]; GSVertex* s = &m_vertex.buff[0];
s[0].XYZ.X = (16.0f * m_vt.m_min.p.x) + m_context->XYOFFSET.OFX; s[0].XYZ.X = static_cast<uint16>((16.0f * m_vt.m_min.p.x) + m_context->XYOFFSET.OFX);
s[1].XYZ.X = (16.0f * m_vt.m_max.p.x) + m_context->XYOFFSET.OFX; s[1].XYZ.X = static_cast<uint16>((16.0f * m_vt.m_max.p.x) + m_context->XYOFFSET.OFX);
s[0].XYZ.Y = (16.0f * m_vt.m_min.p.y) + m_context->XYOFFSET.OFY; s[0].XYZ.Y = static_cast<uint16>((16.0f * m_vt.m_min.p.y) + m_context->XYOFFSET.OFY);
s[1].XYZ.Y = (16.0f * m_vt.m_max.p.y) + m_context->XYOFFSET.OFY; s[1].XYZ.Y = static_cast<uint16>((16.0f * m_vt.m_max.p.y) + m_context->XYOFFSET.OFY);
s[0].U = 16.0f * m_vt.m_min.t.x; s[0].U = static_cast<uint16>(16.0f * m_vt.m_min.t.x);
s[0].V = 16.0f * m_vt.m_min.t.y; s[0].V = static_cast<uint16>(16.0f * m_vt.m_min.t.y);
s[1].U = 16.0f * m_vt.m_max.t.x; s[1].U = static_cast<uint16>(16.0f * m_vt.m_max.t.x);
s[1].V = 16.0f * m_vt.m_max.t.y; s[1].V = static_cast<uint16>(16.0f * m_vt.m_max.t.y);
m_vertex.head = m_vertex.tail = m_vertex.next = 2; m_vertex.head = m_vertex.tail = m_vertex.next = 2;
m_index.tail = 2; m_index.tail = 2;

View File

@ -266,8 +266,8 @@ s32 CALLBACK USBfreeze(int mode, freezeData *data) {
usbd = *(USBfreezeData*)data->data; usbd = *(USBfreezeData*)data->data;
usbd.freezeID[9] = 0; usbd.freezeID[9] = 0;
usbd.cycles = clocks; usbd.cycles = static_cast<int>(clocks);
usbd.remaining = remaining; usbd.remaining = static_cast<int>(remaining);
if( strcmp(usbd.freezeID, USBfreezeID) != 0) if( strcmp(usbd.freezeID, USBfreezeID) != 0)
{ {

View File

@ -616,7 +616,7 @@ static const uint8_t qemu_keyboard_hid_report_descriptor[] = {
static int usb_keyboard_poll(USBKeyboardState *s, uint8_t *buf, int len) static int usb_keyboard_poll(USBKeyboardState *s, uint8_t *buf, int len)
{ {
static unsigned char keys[256]; static unsigned char keys[256];
int i,l; int l;
if (!s->keyboard_grabbed) { if (!s->keyboard_grabbed) {
//qemu_add_keyboard_event_handler(usb_keyboard_event, s, 0); //qemu_add_keyboard_event_handler(usb_keyboard_event, s, 0);

View File

@ -349,7 +349,7 @@ static inline int ohci_put_hcca(OHCIState *ohci,
/* Read/Write the contents of a TD from/to main memory. */ /* Read/Write the contents of a TD from/to main memory. */
static void ohci_copy_td(OHCIState *ohci, struct ohci_td *td, static void ohci_copy_td(OHCIState *ohci, struct ohci_td *td,
uint8_t *buf, int len, int write) uint8_t *buf, size_t len, int write)
{ {
uint32_t ptr; uint32_t ptr;
uint32_t n; uint32_t n;
@ -369,7 +369,7 @@ static void ohci_copy_td(OHCIState *ohci, struct ohci_td *td,
/* Read/Write the contents of an ISO TD from/to main memory. */ /* Read/Write the contents of an ISO TD from/to main memory. */
static void ohci_copy_iso_td(OHCIState *ohci, static void ohci_copy_iso_td(OHCIState *ohci,
uint32_t start_addr, uint32_t end_addr, uint32_t start_addr, uint32_t end_addr,
uint8_t *buf, int len, int write) uint8_t *buf, size_t len, int write)
{ {
uint32_t ptr; uint32_t ptr;
uint32_t n; uint32_t n;
@ -577,7 +577,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
#endif #endif
/* Writeback */ /* Writeback */
if (dir == OHCI_TD_DIR_IN && ret >= 0 && ret <= len) { if (dir == OHCI_TD_DIR_IN && ret >= 0 && ret <= static_cast<int>(len)) {
/* IN transfer succeeded */ /* IN transfer succeeded */
ohci_copy_iso_td(ohci, start_addr, end_addr, ohci->usb_buf, ret, 1); ohci_copy_iso_td(ohci, start_addr, end_addr, ohci->usb_buf, ret, 1);
OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC, OHCI_SET_BM(iso_td.offset[relative_frame_number], TD_PSW_CC,
@ -1117,7 +1117,7 @@ static uint32_t ohci_get_frame_remaining(OHCIState *ohci)
if (tks >= usb_frame_time) if (tks >= usb_frame_time)
return (ohci->frt << 31); return (ohci->frt << 31);
tks = muldiv64(1, tks, usb_bit_time); tks = muldiv64(1, static_cast<uint32_t>(tks), static_cast<uint32_t>(usb_bit_time));
fr = (uint16_t)(ohci->fi - tks); fr = (uint16_t)(ohci->fi - tks);
return (ohci->frt << 31) | fr; return (ohci->frt << 31) | fr;
@ -1216,7 +1216,7 @@ uint32_t ohci_mem_read(void *ptr, target_phys_addr_t addr)
if (addr & 3) { if (addr & 3) {
fprintf(stderr, "usb-ohci: Mis-aligned read\n"); fprintf(stderr, "usb-ohci: Mis-aligned read\n");
return 0xffffffff; return 0xffffffff;
} else if (addr >= 0x54 && addr < 0x54 + ohci->num_ports * 4) { } else if (addr >= 0x54 && addr < 0x54U + ohci->num_ports * 4) {
/* HcRhPortStatus */ /* HcRhPortStatus */
retval = ohci->rhport[(addr - 0x54) >> 2].ctrl | OHCI_PORT_PPS; retval = ohci->rhport[(addr - 0x54) >> 2].ctrl | OHCI_PORT_PPS;
} else { } else {
@ -1340,7 +1340,7 @@ void ohci_mem_write(void *ptr, target_phys_addr_t addr, uint32_t val)
return; return;
} }
if (addr >= 0x54 && addr < 0x54 + ohci->num_ports * 4) { if (addr >= 0x54 && addr < 0x54U + ohci->num_ports * 4) {
/* HcRhPortStatus */ /* HcRhPortStatus */
ohci_port_set_status(ohci, (addr - 0x54) >> 2, val); ohci_port_set_status(ohci, (addr - 0x54) >> 2, val);
return; return;
@ -1488,9 +1488,9 @@ OHCIState *ohci_create(uint32_t base, int ports)
usb_frame_time = get_ticks_per_sec(); usb_frame_time = get_ticks_per_sec();
usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000); usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ/1000);
#else #else
usb_frame_time = muldiv64(1, get_ticks_per_sec(), 1000); usb_frame_time = muldiv64(1, static_cast<uint32_t>(get_ticks_per_sec()), 1000U);
if (get_ticks_per_sec() >= USB_HZ) { if (get_ticks_per_sec() >= USB_HZ) {
usb_bit_time = muldiv64(1, get_ticks_per_sec(), USB_HZ); usb_bit_time = muldiv64(1U, static_cast<uint32_t>(get_ticks_per_sec()), USB_HZ);
} else { } else {
usb_bit_time = 1; usb_bit_time = 1;
} }

View File

@ -25,7 +25,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
rl = (uint64_t)u.l.low * (uint64_t)b; rl = (uint64_t)u.l.low * (uint64_t)b;
rh = (uint64_t)u.l.high * (uint64_t)b; rh = (uint64_t)u.l.high * (uint64_t)b;
rh += (rl >> 32); rh += (rl >> 32);
res.l.high = rh / c; res.l.high = static_cast<uint32_t>(rh / c);
res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c; res.l.low = (((rh % c) << 32) + (rl & 0xffffffff)) / c;
return res.ll; return res.ll;
} }

View File

@ -42,11 +42,11 @@ int Convert<2352,2048>(char *dest, const char* psrc, int lsn)
template<> template<>
int Convert<2048,2352>(char *dest, const char* psrc, int lsn) int Convert<2048,2352>(char *dest, const char* psrc, int lsn)
{ {
int m = lsn / (75*60); u8 m = lsn / (75*60);
int s = (lsn/75) % 60; u8 s = (lsn/75) % 60;
int f = lsn%75; u8 f = lsn%75;
unsigned char header[16] = { u8 header[16] = {
0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00, m, s, f,0x02 0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,m,s,f,0x02
}; };
memcpy(dest,header,16); memcpy(dest,header,16);

View File

@ -435,7 +435,7 @@ bool PCAPAdapter::blocks()
} }
bool PCAPAdapter::isInitialised() bool PCAPAdapter::isInitialised()
{ {
return pcap_io_running; return !!pcap_io_running;
} }
//gets a packet.rv :true success //gets a packet.rv :true success
bool PCAPAdapter::recv(NetPacket* pkt) bool PCAPAdapter::recv(NetPacket* pkt)