Merge pull request #7 from DocHoncho/gcc-fixes

GCC fixes: explicit conversion of std::basic_string to const char*
This commit is contained in:
David Capello 2013-11-25 05:18:12 -08:00
commit 5a5536c389
5 changed files with 7 additions and 6 deletions

View File

@ -143,7 +143,7 @@ App::App(int argc, const char* argv[])
base::UniquePtr<Palette> pal(Palette::load(palFile.c_str()));
if (pal.get() == NULL)
throw base::Exception("Error loading default palette from: %s", palFile);
throw base::Exception("Error loading default palette from: %s", palFile.c_str());
set_default_palette(pal.get());
}

View File

@ -95,7 +95,7 @@ static void save_document_in_background(Document* document, bool mark_as_saved)
StatusBar::instance()
->setStatusText(2000, "File %s, saved.",
base::get_file_name(document->getFilename()));
base::get_file_name(document->getFilename()).c_str());
}
}

View File

@ -246,13 +246,14 @@ FileOp* fop_to_save_document(Document* document)
// Get the extension of the filename (in lower case)
base::string extension = base::string_to_lower(base::get_file_extension(fop->document->getFilename()));
PRINTF("Saving document \"%s\" (%s)\n", fop->document->getFilename(), extension.c_str());
PRINTF("Saving document \"%s\" (%s)\n",
fop->document->getFilename().c_str(), extension.c_str());
/* get the format through the extension of the filename */
fop->format = get_fileformat(extension.c_str());
if (!fop->format ||
!fop->format->support(FILE_SUPPORT_SAVE)) {
fop_error(fop, "ASEPRITE can't save \"%s\" files\n", extension);
fop_error(fop, "ASEPRITE can't save \"%s\" files\n", extension.c_str());
return fop;
}

View File

@ -325,7 +325,7 @@ bool GifFormat::onPostLoad(FileOp* fop)
"<<ASEPRITE cannot handle this kind of GIF correctly in Indexed format."
"<<What would you like to do?"
"||Convert to &RGBA||Keep &Indexed||&Cancel",
fop->document->getFilename());
fop->document->getFilename().c_str());
if (result == 1)
pixelFormat = IMAGE_RGB;

View File

@ -28,7 +28,7 @@ FILE* open_file_raw(const string& filename, const string& mode)
return _wfopen(from_utf8(filename).c_str(),
from_utf8(mode).c_str());
#else
return fopen(filename.c_str(), mode);
return fopen(filename.c_str(), mode.c_str());
#endif
}