From 906f78949458732f138e4e2b79843c75e9d52f87 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Wed, 20 Jan 2010 20:31:57 +0100 Subject: Go back to using TR1 unordered containers to fix warnings. Add configure code to detect the broken header and display Wiki page URL. (bzr r9006) --- src/libnrtype/FontFactory.cpp | 14 +++++++------- src/libnrtype/FontInstance.cpp | 8 ++------ src/libnrtype/font-instance.h | 4 ++-- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 761da7756..09d9e2c4f 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -26,11 +26,9 @@ /* Freetype2 */ # include -//#include -#include +#include - -typedef __gnu_cxx::hash_map FaceMapType; +typedef std::tr1::unordered_map FaceMapType; // need to avoid using the size field size_t font_descr_hash::operator()( PangoFontDescription *const &x) const { @@ -826,9 +824,11 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) if ( nFace ) { // duplicate FcPattern, the hard way res = new font_instance(); - // store the descr of the font we asked for, since this is the key where we intend to put the font_instance at - // in the hash_map. the descr of the returned pangofont may differ from what was asked, so we don't know (at this - // point) whether loadedFaces[that_descr] is free or not (and overwriting an entry will bring deallocation problems) + // store the descr of the font we asked for, since this is the key where we intend + // to put the font_instance at in the unordered_map. the descr of the returned + // pangofont may differ from what was asked, so we don't know (at this + // point) whether loadedFaces[that_descr] is free or not (and overwriting + // an entry will bring deallocation problems) res->descr = pango_font_description_copy(descr); res->daddy = this; res->InstallFace(nFace); diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 8b8eb8bbe..628e3cba0 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -29,12 +29,9 @@ # include FT_TRUETYPE_TABLES_H # include -//#include -#include +#include -// the various raster_font in use at a given time are held in a hash_map whose indices are the -// styles, hence the 2 following 'classes' struct font_style_hash : public std::unary_function { size_t operator()(font_style const &x) const; }; @@ -43,8 +40,7 @@ struct font_style_equal : public std::binary_function StyleMap; +typedef std::tr1::unordered_map StyleMap; diff --git a/src/libnrtype/font-instance.h b/src/libnrtype/font-instance.h index 521c9a424..d52bd723f 100644 --- a/src/libnrtype/font-instance.h +++ b/src/libnrtype/font-instance.h @@ -25,7 +25,7 @@ public: // depending on the rendering backend, different temporary data // that's the font's fingerprint; this particular PangoFontDescription gives the entry at which this font_instance - // resides in the font_factory loadedFaces hash_map + // resides in the font_factory loadedFaces unordered_map PangoFontDescription* descr; // refcount int refCount; @@ -86,7 +86,7 @@ private: void FreeTheFace(); // hashmap to get the raster_font for a given style - void* loadedPtr; // Pointer to a hash_map. Moved into .cpp to not expose use of __gnu_cxx extension. + void* loadedPtr; #ifdef USE_PANGO_WIN32 HFONT theFace; -- cgit v1.2.3