Mercurial > octave
comparison libinterp/corefcn/txt-eng-ft.cc @ 17377:15e2ad6372f7
maint: Tweaks to remove compiler warnings.
* libgui/src/find-files-model.cc(rowCount, columnCount): Eliminate unused input
parameter p.
* libinterp/corefcn/octave-link.cc(F__octave_link_file_dialog__): Use signed int
in for loop index for comparison to octave_idx_type.
* libinterp/corefcn/txt-eng-ft.cc(ft_render::visit): Initialize all of
mbstate_t structure (not just first field) with memset() to 0.
* libinterp/parse-tree/oct-parse.in.yy(F__parse_file__): Remove unused nargout
parameter.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 05 Sep 2013 10:34:09 -0700 |
parents | 4a348443de9b |
children | 4f1dd8a980df |
comparison
equal
deleted
inserted
replaced
17376:f0e3d3de5c22 | 17377:15e2ad6372f7 |
---|---|
40 | 40 |
41 #include "error.h" | 41 #include "error.h" |
42 #include "pr-output.h" | 42 #include "pr-output.h" |
43 #include "txt-eng-ft.h" | 43 #include "txt-eng-ft.h" |
44 | 44 |
45 // FIXME -- maybe issue at most one warning per glyph/font/size/weight | 45 // FIXME: maybe issue at most one warning per glyph/font/size/weight |
46 // combination. | 46 // combination. |
47 | 47 |
48 static void | 48 static void |
49 gripe_missing_glyph (FT_ULong c) | 49 gripe_missing_glyph (FT_ULong c) |
50 { | 50 { |
51 warning_with_id ("Octave:missing-glyph", | 51 warning_with_id ("Octave:missing-glyph", |
60 "ft_render: unable to render glyph for character '%x'", | 60 "ft_render: unable to render glyph for character '%x'", |
61 c); | 61 c); |
62 } | 62 } |
63 | 63 |
64 #ifdef _MSC_VER | 64 #ifdef _MSC_VER |
65 // This is just a trick to avoid multiply symbols definition. | 65 // This is just a trick to avoid multiple symbol definitions. |
66 // PermMatrix.h contains a dllexport'ed Array<octave_idx_type> | 66 // PermMatrix.h contains a dllexport'ed Array<octave_idx_type> |
67 // that will make MSVC not to generate new instantiation and | 67 // that will cause MSVC not to generate a new instantiation and |
68 // use the imported one. | 68 // use the imported one instead. |
69 #include "PermMatrix.h" | 69 #include "PermMatrix.h" |
70 #endif | 70 #endif |
71 | 71 |
72 // Forward declaration | 72 // Forward declaration |
73 static void ft_face_destroyed (void* object); | 73 static void ft_face_destroyed (void* object); |
152 { | 152 { |
153 if (freetype_initialized) | 153 if (freetype_initialized) |
154 FT_Done_FreeType (library); | 154 FT_Done_FreeType (library); |
155 | 155 |
156 #if defined (HAVE_FONTCONFIG) | 156 #if defined (HAVE_FONTCONFIG) |
157 // FIXME -- Skip the call to FcFini because it can trigger the | 157 // FIXME: Skip the call to FcFini because it can trigger the assertion |
158 // assertion | |
159 // | 158 // |
160 // octave: fccache.c:507: FcCacheFini: Assertion 'fcCacheChains[i] == ((void *)0)' failed. | 159 // octave: fccache.c:507: FcCacheFini: Assertion 'fcCacheChains[i] == ((void *)0)' failed. |
161 // | 160 // |
162 // if (fontconfig_initialized) | 161 // if (fontconfig_initialized) |
163 // FcFini (); | 162 // FcFini (); |
223 FcPattern *match; | 222 FcPattern *match; |
224 | 223 |
225 FcDefaultSubstitute (pat); | 224 FcDefaultSubstitute (pat); |
226 match = FcFontMatch (0, pat, &res); | 225 match = FcFontMatch (0, pat, &res); |
227 | 226 |
228 // FIXME -- originally, this test also required that | 227 // FIXME: originally, this test also required that |
229 // res != FcResultNoMatch. Is that really needed? | 228 // res != FcResultNoMatch. Is that really needed? |
230 if (match) | 229 if (match) |
231 { | 230 { |
232 unsigned char *tmp; | 231 unsigned char *tmp; |
233 | 232 |
282 | 281 |
283 void do_font_destroyed (FT_Face face) | 282 void do_font_destroyed (FT_Face face) |
284 { | 283 { |
285 if (face->generic.data) | 284 if (face->generic.data) |
286 { | 285 { |
287 ft_key* pkey = | 286 ft_key* pkey = reinterpret_cast<ft_key*> (face->generic.data); |
288 reinterpret_cast<ft_key*> (face->generic.data); | |
289 | 287 |
290 cache.erase (*pkey); | 288 cache.erase (*pkey); |
291 delete pkey; | 289 delete pkey; |
292 face->generic.data = 0; | 290 face->generic.data = 0; |
293 } | 291 } |
632 { | 630 { |
633 FT_UInt glyph_index, previous = 0; | 631 FT_UInt glyph_index, previous = 0; |
634 | 632 |
635 std::string str = e.string_value (); | 633 std::string str = e.string_value (); |
636 size_t n = str.length (), curr = 0; | 634 size_t n = str.length (), curr = 0; |
637 mbstate_t ps = { 0 }; | 635 mbstate_t ps; |
636 memset (&ps, 0, sizeof (ps)); // Initialize state to 0. | |
638 wchar_t wc; | 637 wchar_t wc; |
639 | 638 |
640 while (n > 0) | 639 while (n > 0) |
641 { | 640 { |
642 size_t r = gnulib::mbrtowc (&wc, str.data () + curr, n, &ps); | 641 size_t r = gnulib::mbrtowc (&wc, str.data () + curr, n, &ps); |