mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 04:29:09 -06:00
Revert "Merge pull request #49 from Parlane/sprintf_tidy"
Change broke the build on Debian stable. This reverts commit28755439b3
, reversing changes made to64e01ec763
.
This commit is contained in:
@ -110,6 +110,8 @@ void CodeToHeader(const std::vector<u16> &code, std::string _filename,
|
||||
// Pad with nops to 32byte boundary
|
||||
while (code_padded.size() & 0x7f)
|
||||
code_padded.push_back(0);
|
||||
|
||||
char buffer[1024];
|
||||
header.clear();
|
||||
header.reserve(code_padded.size() * 4);
|
||||
header.append("#define NUM_UCODES 1\n\n");
|
||||
@ -123,7 +125,8 @@ void CodeToHeader(const std::vector<u16> &code, std::string _filename,
|
||||
{
|
||||
if (j && ((j & 15) == 0))
|
||||
header.append("\n\t\t");
|
||||
header.append(StringFromFormat("0x%04x, ", code_padded[j]));
|
||||
sprintf(buffer, "0x%04x, ", code_padded[j]);
|
||||
header.append(buffer);
|
||||
}
|
||||
header.append("\n\t},\n");
|
||||
|
||||
@ -134,6 +137,7 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
|
||||
u32 numCodes, const char *name, std::string &header)
|
||||
{
|
||||
std::vector<std::vector<u16> > codes_padded;
|
||||
char buffer[1024];
|
||||
u32 reserveSize = 0;
|
||||
for(u32 i = 0; i < numCodes; i++)
|
||||
{
|
||||
@ -144,16 +148,20 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
|
||||
|
||||
reserveSize += (u32)codes_padded.at(i).size();
|
||||
}
|
||||
|
||||
|
||||
header.clear();
|
||||
header.reserve(reserveSize * 4);
|
||||
header.append(StringFromFormat("#define NUM_UCODES %u\n\n", numCodes));
|
||||
sprintf(buffer, "#define NUM_UCODES %u\n\n", numCodes);
|
||||
header.append(buffer);
|
||||
header.append("const char* UCODE_NAMES[NUM_UCODES] = {\n");
|
||||
for (u32 i = 0; i < numCodes; i++)
|
||||
{
|
||||
std::string filename;
|
||||
if (! SplitPath(filenames->at(i), NULL, &filename, NULL))
|
||||
filename = filenames->at(i);
|
||||
header.append(StringFromFormat("\t\"%s\",\n", filename.c_str()));
|
||||
sprintf(buffer, "\t\"%s\",\n", filename.c_str());
|
||||
header.append(buffer);
|
||||
}
|
||||
header.append("};\n\n");
|
||||
header.append("const unsigned short dsp_code[NUM_UCODES][0x1000] = {\n");
|
||||
@ -168,7 +176,8 @@ void CodesToHeader(const std::vector<u16> *codes, const std::vector<std::string>
|
||||
{
|
||||
if (j && ((j & 15) == 0))
|
||||
header.append("\n\t\t");
|
||||
header.append(StringFromFormat("0x%04x, ", codes_padded.at(i).at(j)));
|
||||
sprintf(buffer, "0x%04x, ", codes_padded.at(i).at(j));
|
||||
header.append(buffer);
|
||||
}
|
||||
header.append("\n\t},\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user