-removed one unneeded function and replaced it by a existing one

This commit is contained in:
fix94.1 2012-07-04 14:33:08 +00:00
parent 7f6394fa36
commit a201479cb4
2 changed files with 2 additions and 4 deletions

View File

@ -323,7 +323,7 @@ string Plugin::GenerateCoverLink(dir_discHdr gameHeader, string url, Config &Che
infile.seekg(0x0e, ios::beg); infile.seekg(0x0e, ios::beg);
infile.read((char*)&buffer, 8); infile.read((char*)&buffer, 8);
infile.close(); infile.close();
snprintf(crc_string, sizeof(crc_string), "%08x", SWAP32(buffer)); snprintf(crc_string, sizeof(crc_string), "%08x", (u32)__builtin_bswap32(buffer));
} }
else if(strstr(gameHeader.path, ".7z") != NULL) else if(strstr(gameHeader.path, ".7z") != NULL)
{ {
@ -339,7 +339,7 @@ string Plugin::GenerateCoverLink(dir_discHdr gameHeader, string url, Config &Che
infile.seekg(-13, ios::cur); infile.seekg(-13, ios::cur);
infile.read((char*)&buffer, 8); infile.read((char*)&buffer, 8);
infile.close(); infile.close();
snprintf(crc_string, sizeof(crc_string), "%08x", SWAP32(buffer)); snprintf(crc_string, sizeof(crc_string), "%08x", (u32)__builtin_bswap32(buffer));
} }
else else
snprintf(crc_string, sizeof(crc_string), "%08x", crc32file(gameHeader.path)); snprintf(crc_string, sizeof(crc_string), "%08x", crc32file(gameHeader.path));

View File

@ -27,8 +27,6 @@
using namespace std; using namespace std;
#define SWAP32(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) >> 24) & 0xff))
#define TAG_GAME_ID "{gameid}" #define TAG_GAME_ID "{gameid}"
#define TAG_LOC "{loc}" #define TAG_LOC "{loc}"
#define TAG_CONSOLE "{console}" #define TAG_CONSOLE "{console}"