Fix some type comparison warnings.

This commit is contained in:
Unknown W. Brackets committed 2016-08-05 10:47:45 -07:00
1 parent e55198f7e7
commit fd546ff21d
7 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -712,7 +712,7 @@ int sceNetAdhocPollSocket(u32 socketStructAddr, int count, int timeout, int nonb
if (timeout == 0) timeout = 1;
int affectedsockets = 0;
if (count > FD_SETSIZE) count = FD_SETSIZE; // return affectedsockets;
if (count > (int)FD_SETSIZE) count = FD_SETSIZE; // return affectedsockets;
// Acquire Network Lock
//acquireNetworkLock();
+1 -1
View File
@@ -834,7 +834,7 @@ static u32 scePsmfGetCurrentStreamType(u32 psmfStruct, u32 typeAddr, u32 channel
if (!psmf) {
return hleLogError(ME, ERROR_PSMF_NOT_INITIALIZED, "invalid psmf");
}
if (psmf->currentStreamNum == ERROR_PSMF_NOT_INITIALIZED) {
if (psmf->currentStreamNum == (int)ERROR_PSMF_NOT_INITIALIZED) {
return hleLogError(ME, ERROR_PSMF_NOT_INITIALIZED, "no stream set");
}
if (!Memory::IsValidAddress(typeAddr) || !Memory::IsValidAddress(channelAddr)) {
+1 -1
View File
@@ -377,7 +377,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, const u32 *constPool, int c
break;
case IROp::FCmovVfpuCC:
if (((mips->vfpuCtrl[VFPU_CTRL_CC] >> (inst->src2 & 0xf)) & 1) == (inst->src2 >> 7)) {
if (((mips->vfpuCtrl[VFPU_CTRL_CC] >> (inst->src2 & 0xf)) & 1) == ((u32)inst->src2 >> 7)) {
mips->f[inst->dest] = mips->f[inst->src1];
}
break;
+1 -1
View File
@@ -56,7 +56,7 @@ void CwCheatScreen::CreateCodeList() {
std::size_t lslash = gamePath_.find_last_of("/");
std::size_t lastdot = gamePath_.find_last_of(".");
std::string extension = gamePath_.substr(lastdot + 1);
for (int i = 0; i < extension.size(); i++) {
for (size_t i = 0; i < extension.size(); i++) {
extension[i] = tolower(extension[i]);
}
if ((extension != "iso" && extension != "cso" && extension != "pbp") || gameTitle == "") {
+1 -1
View File
@@ -169,7 +169,7 @@ void ChunkFile::readData(void *what, int count) {
if (fastMode) {
memcpy(what, data + pos, count);
} else {
if (fread(what, 1, count, file) != count) {
if (fread(what, 1, count, file) != (size_t)count) {
ELOG("Failed to read complete %d bytes", count);
}
}
+1 -1
View File
@@ -347,7 +347,7 @@ protected:
float AtlasWordWrapper::MeasureWidth(const char *str, size_t bytes) {
float w = 0.0f;
for (UTF8 utf(str); utf.byteIndex() < bytes; ) {
for (UTF8 utf(str); utf.byteIndex() < (int)bytes; ) {
const AtlasChar *ch = atlasfont_.getChar(utf.next());
if (!ch)
ch = atlasfont_.getChar('?');
+3 -3
View File
@@ -268,13 +268,13 @@ bool OutputSink::Printf(const char *fmt, ...) {
bool success = true;
int result = vsnprintf(buf_ + write_, avail, fmt, args);
if (result >= avail) {
if (result >= (int)avail) {
// There wasn't enough space. Let's use a buffer instead.
// This could be caused by wraparound.
char temp[BUFFER_SIZE];
result = vsnprintf(temp, BUFFER_SIZE, fmt, args);
if (result < BUFFER_SIZE && result > 0) {
if ((size_t)result < BUFFER_SIZE && result > 0) {
// In case it did return the null terminator.
if (temp[result - 1] == '\0') {
result--;
@@ -289,7 +289,7 @@ bool OutputSink::Printf(const char *fmt, ...) {
va_end(backup);
// Okay, did we actually write?
if (result >= avail) {
if (result >= (int)avail) {
// This means the result string was too big for the buffer.
ELOG("Not enough space to format output.");
return false;