mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix some type comparison warnings.
This commit is contained in:
parent
a69ddf840c
commit
dd2e996838
7 changed files with 29 additions and 27 deletions
|
@ -959,7 +959,7 @@ void DisassemblyData::createLines()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int len = strlen(buffer);
|
size_t len = strlen(buffer);
|
||||||
if (currentLine.size() != 0 && currentLine.size()+len >= maxChars)
|
if (currentLine.size() != 0 && currentLine.size()+len >= maxChars)
|
||||||
{
|
{
|
||||||
DataEntry entry = {currentLine,currentPos-currentLineStart,lineCount++};
|
DataEntry entry = {currentLine,currentPos-currentLineStart,lineCount++};
|
||||||
|
|
|
@ -228,8 +228,8 @@ SymbolType SymbolMap::GetSymbolType(u32 address) const
|
||||||
|
|
||||||
bool SymbolMap::GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask) const
|
bool SymbolMap::GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask) const
|
||||||
{
|
{
|
||||||
u32 functionAddress = -1;
|
u32 functionAddress = INVALID_ADDRESS;
|
||||||
u32 dataAddress = -1;
|
u32 dataAddress = INVALID_ADDRESS;
|
||||||
|
|
||||||
if (symmask & ST_FUNCTION)
|
if (symmask & ST_FUNCTION)
|
||||||
functionAddress = GetFunctionStart(address);
|
functionAddress = GetFunctionStart(address);
|
||||||
|
@ -237,9 +237,9 @@ bool SymbolMap::GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask)
|
||||||
if (symmask & ST_DATA)
|
if (symmask & ST_DATA)
|
||||||
dataAddress = GetDataStart(address);
|
dataAddress = GetDataStart(address);
|
||||||
|
|
||||||
if (functionAddress == -1 || dataAddress == -1)
|
if (functionAddress == INVALID_ADDRESS || dataAddress == INVALID_ADDRESS)
|
||||||
{
|
{
|
||||||
if (functionAddress != -1)
|
if (functionAddress != INVALID_ADDRESS)
|
||||||
{
|
{
|
||||||
if (info != NULL)
|
if (info != NULL)
|
||||||
{
|
{
|
||||||
|
@ -251,7 +251,7 @@ bool SymbolMap::GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataAddress != -1)
|
if (dataAddress != INVALID_ADDRESS)
|
||||||
{
|
{
|
||||||
if (info != NULL)
|
if (info != NULL)
|
||||||
{
|
{
|
||||||
|
@ -283,7 +283,7 @@ u32 SymbolMap::GetNextSymbolAddress(u32 address, SymbolType symmask)
|
||||||
const auto dataEntry = symmask & ST_DATA ? data.upper_bound(address) : data.end();
|
const auto dataEntry = symmask & ST_DATA ? data.upper_bound(address) : data.end();
|
||||||
|
|
||||||
if (functionEntry == functions.end() && dataEntry == data.end())
|
if (functionEntry == functions.end() && dataEntry == data.end())
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
|
|
||||||
u32 funcAddress = (functionEntry != functions.end()) ? functionEntry->first : 0xFFFFFFFF;
|
u32 funcAddress = (functionEntry != functions.end()) ? functionEntry->first : 0xFFFFFFFF;
|
||||||
u32 dataAddress = (dataEntry != data.end()) ? dataEntry->first : 0xFFFFFFFF;
|
u32 dataAddress = (dataEntry != data.end()) ? dataEntry->first : 0xFFFFFFFF;
|
||||||
|
@ -302,12 +302,12 @@ const char *SymbolMap::GetDescription(unsigned int address) const
|
||||||
const char* labelName = NULL;
|
const char* labelName = NULL;
|
||||||
|
|
||||||
u32 funcStart = GetFunctionStart(address);
|
u32 funcStart = GetFunctionStart(address);
|
||||||
if (funcStart != -1)
|
if (funcStart != INVALID_ADDRESS)
|
||||||
{
|
{
|
||||||
labelName = GetLabelName(funcStart);
|
labelName = GetLabelName(funcStart);
|
||||||
} else {
|
} else {
|
||||||
u32 dataStart = GetDataStart(address);
|
u32 dataStart = GetDataStart(address);
|
||||||
if (dataStart != -1)
|
if (dataStart != INVALID_ADDRESS)
|
||||||
labelName = GetLabelName(dataStart);
|
labelName = GetLabelName(dataStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ u32 SymbolMap::GetFunctionStart(u32 address) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise there's no function that contains this address
|
// otherwise there's no function that contains this address
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it != functions.begin())
|
if (it != functions.begin())
|
||||||
|
@ -397,14 +397,14 @@ u32 SymbolMap::GetFunctionStart(u32 address) const
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 SymbolMap::GetFunctionSize(u32 startAddress) const
|
u32 SymbolMap::GetFunctionSize(u32 startAddress) const
|
||||||
{
|
{
|
||||||
auto it = functions.find(startAddress);
|
auto it = functions.find(startAddress);
|
||||||
if (it == functions.end())
|
if (it == functions.end())
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
|
|
||||||
return it->second.size;
|
return it->second.size;
|
||||||
}
|
}
|
||||||
|
@ -412,12 +412,12 @@ u32 SymbolMap::GetFunctionSize(u32 startAddress) const
|
||||||
int SymbolMap::GetFunctionNum(u32 address) const
|
int SymbolMap::GetFunctionNum(u32 address) const
|
||||||
{
|
{
|
||||||
u32 start = GetFunctionStart(address);
|
u32 start = GetFunctionStart(address);
|
||||||
if (start == -1)
|
if (start == INVALID_ADDRESS)
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
|
|
||||||
auto it = functions.find(start);
|
auto it = functions.find(start);
|
||||||
if (it == functions.end())
|
if (it == functions.end())
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
|
|
||||||
return it->second.index;
|
return it->second.index;
|
||||||
}
|
}
|
||||||
|
@ -548,7 +548,7 @@ u32 SymbolMap::GetDataStart(u32 address) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise there's no data that contains this address
|
// otherwise there's no data that contains this address
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it != data.begin())
|
if (it != data.begin())
|
||||||
|
@ -561,14 +561,14 @@ u32 SymbolMap::GetDataStart(u32 address) const
|
||||||
return start;
|
return start;
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 SymbolMap::GetDataSize(u32 startAddress) const
|
u32 SymbolMap::GetDataSize(u32 startAddress) const
|
||||||
{
|
{
|
||||||
auto it = data.find(startAddress);
|
auto it = data.find(startAddress);
|
||||||
if (it == data.end())
|
if (it == data.end())
|
||||||
return -1;
|
return INVALID_ADDRESS;
|
||||||
|
|
||||||
return it->second.size;
|
return it->second.size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,8 @@ public:
|
||||||
u32 GetDataStart(u32 address) const;
|
u32 GetDataStart(u32 address) const;
|
||||||
u32 GetDataSize(u32 startAddress) const;
|
u32 GetDataSize(u32 startAddress) const;
|
||||||
DataType GetDataType(u32 startAddress) const;
|
DataType GetDataType(u32 startAddress) const;
|
||||||
|
|
||||||
|
static const u32 INVALID_ADDRESS = (u32)-1;
|
||||||
private:
|
private:
|
||||||
void AssignFunctionIndices();
|
void AssignFunctionIndices();
|
||||||
|
|
||||||
|
|
|
@ -289,7 +289,7 @@ int friendFinder(){
|
||||||
// BSSID Packet
|
// BSSID Packet
|
||||||
if(rx[0] == OPCODE_CONNECT_BSSID) {
|
if(rx[0] == OPCODE_CONNECT_BSSID) {
|
||||||
// Enough Data available
|
// Enough Data available
|
||||||
if(rxpos >= sizeof(SceNetAdhocctlConnectBSSIDPacketS2C)) {
|
if(rxpos >= (int)sizeof(SceNetAdhocctlConnectBSSIDPacketS2C)) {
|
||||||
// Cast Packet
|
// Cast Packet
|
||||||
SceNetAdhocctlConnectBSSIDPacketS2C * packet = (SceNetAdhocctlConnectBSSIDPacketS2C *)rx;
|
SceNetAdhocctlConnectBSSIDPacketS2C * packet = (SceNetAdhocctlConnectBSSIDPacketS2C *)rx;
|
||||||
// Update BSSID
|
// Update BSSID
|
||||||
|
@ -310,7 +310,7 @@ int friendFinder(){
|
||||||
// Chat Packet
|
// Chat Packet
|
||||||
else if(rx[0] == OPCODE_CHAT) {
|
else if(rx[0] == OPCODE_CHAT) {
|
||||||
// Enough Data available
|
// Enough Data available
|
||||||
if(rxpos >= sizeof(SceNetAdhocctlChatPacketS2C)) {
|
if(rxpos >= (int)sizeof(SceNetAdhocctlChatPacketS2C)) {
|
||||||
// Cast Packet
|
// Cast Packet
|
||||||
SceNetAdhocctlChatPacketS2C * packet = (SceNetAdhocctlChatPacketS2C *)rx;
|
SceNetAdhocctlChatPacketS2C * packet = (SceNetAdhocctlChatPacketS2C *)rx;
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ int friendFinder(){
|
||||||
// Connect Packet
|
// Connect Packet
|
||||||
else if(rx[0] == OPCODE_CONNECT) {
|
else if(rx[0] == OPCODE_CONNECT) {
|
||||||
// Enough Data available
|
// Enough Data available
|
||||||
if(rxpos >= sizeof(SceNetAdhocctlConnectPacketS2C)) {
|
if(rxpos >= (int)sizeof(SceNetAdhocctlConnectPacketS2C)) {
|
||||||
// Log Incoming Peer
|
// Log Incoming Peer
|
||||||
INFO_LOG(SCENET,"Incoming Peer Data...");
|
INFO_LOG(SCENET,"Incoming Peer Data...");
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ int friendFinder(){
|
||||||
// Disconnect Packet
|
// Disconnect Packet
|
||||||
else if(rx[0] == OPCODE_DISCONNECT) {
|
else if(rx[0] == OPCODE_DISCONNECT) {
|
||||||
// Enough Data available
|
// Enough Data available
|
||||||
if(rxpos >= sizeof(SceNetAdhocctlDisconnectPacketS2C)) {
|
if(rxpos >= (int)sizeof(SceNetAdhocctlDisconnectPacketS2C)) {
|
||||||
// Log Incoming Peer Delete Request
|
// Log Incoming Peer Delete Request
|
||||||
INFO_LOG(SCENET,"FriendFinder: Incoming Peer Data Delete Request...");
|
INFO_LOG(SCENET,"FriendFinder: Incoming Peer Data Delete Request...");
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ int friendFinder(){
|
||||||
// Scan Packet
|
// Scan Packet
|
||||||
else if(rx[0] == OPCODE_SCAN) {
|
else if(rx[0] == OPCODE_SCAN) {
|
||||||
// Enough Data available
|
// Enough Data available
|
||||||
if(rxpos >= sizeof(SceNetAdhocctlScanPacketS2C)) {
|
if(rxpos >= (int)sizeof(SceNetAdhocctlScanPacketS2C)) {
|
||||||
// Log Incoming Network Information
|
// Log Incoming Network Information
|
||||||
INFO_LOG(SCENET,"Incoming Group Information...");
|
INFO_LOG(SCENET,"Incoming Group Information...");
|
||||||
// Cast Packet
|
// Cast Packet
|
||||||
|
|
|
@ -852,7 +852,7 @@ int sceNetAdhocctlTerm() {
|
||||||
}
|
}
|
||||||
// Free sttuf here
|
// Free sttuf here
|
||||||
closesocket(metasocket);
|
closesocket(metasocket);
|
||||||
metasocket = INVALID_SOCKET;
|
metasocket = (int)INVALID_SOCKET;
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
|
@ -1091,7 +1091,7 @@ int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac, int dp
|
||||||
// Valid Arguments
|
// Valid Arguments
|
||||||
if(bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) {
|
if(bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) {
|
||||||
// Create Infrastructure Socket
|
// Create Infrastructure Socket
|
||||||
int tcpsocket = INVALID_SOCKET;
|
int tcpsocket = (int)INVALID_SOCKET;
|
||||||
tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
|
|
||||||
// Valid Socket produced
|
// Valid Socket produced
|
||||||
|
|
|
@ -151,7 +151,7 @@ MIPSState::MIPSState()
|
||||||
0x6, 0x26, 0x46, 0x66,
|
0x6, 0x26, 0x46, 0x66,
|
||||||
0x7, 0x27, 0x47, 0x67,
|
0x7, 0x27, 0x47, 0x67,
|
||||||
};
|
};
|
||||||
for (int i = 0; i < ARRAY_SIZE(firstThirtyTwo); i++) {
|
for (int i = 0; i < (int)ARRAY_SIZE(firstThirtyTwo); i++) {
|
||||||
if (voffset[firstThirtyTwo[i]] != i) {
|
if (voffset[firstThirtyTwo[i]] != i) {
|
||||||
ERROR_LOG(CPU, "Wrong voffset order! %i: %i should have been %i", firstThirtyTwo[i], voffset[firstThirtyTwo[i]], i);
|
ERROR_LOG(CPU, "Wrong voffset order! %i: %i should have been %i", firstThirtyTwo[i], voffset[firstThirtyTwo[i]], i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,7 @@ void CDisasm::stepInto()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < (newAddress-currentPc)/4; i++)
|
for (u32 i = 0; i < (newAddress-currentPc)/4; i++)
|
||||||
{
|
{
|
||||||
Core_DoSingleStep();
|
Core_DoSingleStep();
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue