X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b1aeed1bbd55c942e7ebe1f7e02877a1ea6e25e..c29c95fe24973b94fd724db767193171ca7c513d:/utils/wxrc/wxrc.cpp diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 9a309dbf5e..9e580866c3 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -140,7 +140,7 @@ public: { const XRCWidgetData& w = m_wdata.Item(i); if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue; - if( w.GetName().Length() == 0 ) continue; + if( w.GetName().empty() ) continue; file.Write( wxT(" ") + w.GetClass() + wxT("* ") + w.GetName() + wxT(";\n")); @@ -155,7 +155,7 @@ public: { const XRCWidgetData& w = m_wdata.Item(i); if( !CanBeUsedWithXRCCTRL(w.GetClass()) ) continue; - if( w.GetName().Length() == 0 ) continue; + if( w.GetName().empty() ) continue; file.Write( wxT(" ") + w.GetName() + wxT(" = XRCCTRL(*this,\"") @@ -586,7 +586,8 @@ static wxString FileToCppArray(wxString filename, int num) wxT("Huge file not supported") ); snum.Printf(wxT("%i"), num); - output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %zu;\n"), lng); + output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %lu;\n"), + static_cast(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 :( @@ -706,16 +707,17 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) 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