Browse Source

GCC 4.5 compatibility: nullptr-related issues.

Vladimír Vondruš 13 years ago
parent
commit
e2aa63f25c
  1. 24
      src/Text/AbstractFontConverter.cpp
  2. 9
      src/Trade/AbstractImageConverter.cpp

24
src/Text/AbstractFontConverter.cpp

@ -53,17 +53,29 @@ std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFo
}
Containers::Array<unsigned char> AbstractFontConverter::exportFontToSingleData(AbstractFont* const font, GlyphCache* const cache, const std::string& characters) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData),
"Text::AbstractFontConverter::exportFontToSingleData(): feature not supported", nullptr);
CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportFontToSingleData(): the format is not single-file", nullptr);
#else
CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData),
"Text::AbstractFontConverter::exportFontToSingleData(): feature not supported", {});
CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportFontToSingleData(): the format is not single-file", {});
#endif
return doExportFontToSingleData(font, cache, uniqueUnicode(characters));
}
Containers::Array<unsigned char> AbstractFontConverter::doExportFontToSingleData(AbstractFont*, GlyphCache*, const std::u32string&) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", nullptr);
#else
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", {});
#endif
}
bool AbstractFontConverter::exportFontToFile(AbstractFont* const font, GlyphCache* const cache, const std::string& filename, const std::string& characters) const {
@ -111,17 +123,29 @@ std::vector<std::pair<std::string, Containers::Array<unsigned char>>> AbstractFo
}
Containers::Array<unsigned char> AbstractFontConverter::exportGlyphCacheToSingleData(GlyphCache* cache) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData),
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported", nullptr);
CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): the format is not single-file", nullptr);
#else
CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData),
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported", {});
CORRADE_ASSERT(!(features() & Feature::MultiFile),
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): the format is not single-file", {});
#endif
return doExportGlyphCacheToSingleData(cache);
}
Containers::Array<unsigned char> AbstractFontConverter::doExportGlyphCacheToSingleData(GlyphCache*) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", nullptr);
#else
CORRADE_ASSERT(false,
"Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", {});
#endif
}
bool AbstractFontConverter::exportGlyphCacheToFile(GlyphCache* cache, const std::string& filename) const {

9
src/Trade/AbstractImageConverter.cpp

@ -46,14 +46,23 @@ Image2D* AbstractImageConverter::doExportToImage(const Image2D*) const {
}
Containers::Array<unsigned char> AbstractImageConverter::exportToData(const Image2D* const image) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(features() & Feature::ConvertData,
"Trade::AbstractImageConverter::exportToData(): feature not supported", nullptr);
#else
CORRADE_ASSERT(features() & Feature::ConvertData,
"Trade::AbstractImageConverter::exportToData(): feature not supported", {});
#endif
return doExportToData(image);
}
Containers::Array<unsigned char> AbstractImageConverter::doExportToData(const Image2D*) const {
#ifndef CORRADE_GCC45_COMPATIBILITY
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr);
#else
CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", {});
#endif
}
bool AbstractImageConverter::exportToFile(const Image2D* const image, const std::string& filename) const {

Loading…
Cancel
Save