wxT("Huge file not supported") );
snum.Printf(wxT("%i"), num);
- output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %i;\n"), lng);
+ output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %lu;\n"),
+ static_cast<unsigned long>(lng));
output += wxT("static unsigned char xml_res_file_") + snum + wxT("[] = {\n");
// we cannot use string literals because MSVC is dumb wannabe compiler
// with arbitrary limitation to 2048 strings :(
void XmlResApp::MakePackageCPP(const wxArrayString& flist)
{
wxFFile file(parOutput, wxT("wt"));
- size_t i;
+ unsigned i;
if (flagVerbose)
wxPrintf(wxT("creating C++ source file ") + parOutput + wxT("...\n"));
#endif // wxUSE_MIMETYPE
s.Printf(" XRC_ADD_FILE(wxT(\"XRC_resource/" + flist[i] +
- "\"), xml_res_file_%i, xml_res_size_%i, wxT(\"%s\"));\n",
+ "\"), xml_res_file_%u, xml_res_size_%u, wxT(\"%s\"));\n",
i, i, mime.c_str());
file.Write(s);
}
void XmlResApp::GenCPPHeader()
{
- wxString fileSpec = ((parOutput.BeforeLast('.')).AfterLast('/')).AfterLast('\\');
- wxString heaFileName = fileSpec + wxT(".h");
+ // Generate the output header in the same directory as the source file.
+ wxFileName headerName(parOutput);
+ headerName.SetExt("h");
- wxFFile file(heaFileName, wxT("wt"));
+ wxFFile file(headerName.GetFullPath(), wxT("wt"));
file.Write(
"//\n"
"// This file was automatically generated by wxrc, do not edit by hand.\n"
"//\n\n"
-"#ifndef __" + fileSpec + "_h__\n"
-"#define __" + fileSpec + "_h__\n"
+"#ifndef __" + headerName.GetName() + "_h__\n"
+"#define __" + headerName.GetName() + "_h__\n"
);
for(size_t i=0;i<aXRCWndClassData.GetCount();++i){
aXRCWndClassData.Item(i).GenerateHeaderCode(file);
void XmlResApp::MakePackagePython(const wxArrayString& flist)
{
wxFFile file(parOutput, wxT("wt"));
- size_t i;
+ unsigned i;
if (flagVerbose)
wxPrintf(wxT("creating Python source file ") + parOutput + wxT("...\n"));
{
wxString s;
s.Printf(" wx.MemoryFSHandler.AddFile('XRC_resource/" + flist[i] +
- "', xml_res_file_%i)\n", i);
+ "', xml_res_file_%u)\n", i);
file.Write(s);
}
for (i = 0; i < parFiles.GetCount(); i++)