mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Add string::c_str() to several functions.
There were a number of places where a std::string was being used in a function calls that expected a c string. These instances were trivally fixed by adding a call to string::c_str(). Note, I'm not sure if this is a GCC specific issue, however even if it is a case of MSVC simply letting these usages slide it can't hurt to be explicit.
This commit is contained in:
parent
86dab97cac
commit
dabcad1807
@ -143,7 +143,7 @@ App::App(int argc, const char* argv[])
|
|||||||
|
|
||||||
base::UniquePtr<Palette> pal(Palette::load(palFile.c_str()));
|
base::UniquePtr<Palette> pal(Palette::load(palFile.c_str()));
|
||||||
if (pal.get() == NULL)
|
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());
|
set_default_palette(pal.get());
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ static void save_document_in_background(Document* document, bool mark_as_saved)
|
|||||||
|
|
||||||
StatusBar::instance()
|
StatusBar::instance()
|
||||||
->setStatusText(2000, "File %s, saved.",
|
->setStatusText(2000, "File %s, saved.",
|
||||||
base::get_file_name(document->getFilename()));
|
base::get_file_name(document->getFilename()).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,13 +246,14 @@ FileOp* fop_to_save_document(Document* document)
|
|||||||
// Get the extension of the filename (in lower case)
|
// Get the extension of the filename (in lower case)
|
||||||
base::string extension = base::string_to_lower(base::get_file_extension(fop->document->getFilename()));
|
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 */
|
/* get the format through the extension of the filename */
|
||||||
fop->format = get_fileformat(extension.c_str());
|
fop->format = get_fileformat(extension.c_str());
|
||||||
if (!fop->format ||
|
if (!fop->format ||
|
||||||
!fop->format->support(FILE_SUPPORT_SAVE)) {
|
!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;
|
return fop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ bool GifFormat::onPostLoad(FileOp* fop)
|
|||||||
"<<ASEPRITE cannot handle this kind of GIF correctly in Indexed format."
|
"<<ASEPRITE cannot handle this kind of GIF correctly in Indexed format."
|
||||||
"<<What would you like to do?"
|
"<<What would you like to do?"
|
||||||
"||Convert to &RGBA||Keep &Indexed||&Cancel",
|
"||Convert to &RGBA||Keep &Indexed||&Cancel",
|
||||||
fop->document->getFilename());
|
fop->document->getFilename().c_str());
|
||||||
|
|
||||||
if (result == 1)
|
if (result == 1)
|
||||||
pixelFormat = IMAGE_RGB;
|
pixelFormat = IMAGE_RGB;
|
||||||
|
@ -28,7 +28,7 @@ FILE* open_file_raw(const string& filename, const string& mode)
|
|||||||
return _wfopen(from_utf8(filename).c_str(),
|
return _wfopen(from_utf8(filename).c_str(),
|
||||||
from_utf8(mode).c_str());
|
from_utf8(mode).c_str());
|
||||||
#else
|
#else
|
||||||
return fopen(filename.c_str(), mode);
|
return fopen(filename.c_str(), mode.c_str());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user