Commit 2c593c6
fix warnings
Changed files (10)
modifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/GlyphBackgroundImage.valamodifiedlibbirdfont/GlyphTable.valamodifiedlibbirdfont/ImportSvg.valamodifiedlibbirdfont/KeyBindings.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/MenuTab.valamodifiedlibbirdfont/OpenFontFormatReader.valamodifiedlibbirdfont/OpenFontFormatWriter.valamodifiedlibbirdfont/Path.vala
Diff
@@ -1263,12 +1263,6 @@ public class Glyph : FontDisplay { return background_image_visible; } - private void plot_outline (Context cr) {- foreach (unowned Path p in path_list) {- p.plot (cr, allocation, view_zoom);- } - }- private void draw_coordinate (Context cr) { cr.set_source_rgba (0.5, 0.5, 0.5, 1); cr.set_font_size (12);@@ -641,19 +641,9 @@ public class GlyphBackgroundImage { return null; } - // Fixa: Add multi threading- //ThreadFunc<void*> run = () => {- output = process_background_colors ((!)original_image, contrast, desaturate, threshold);- Idle.add ((owned) callback);- //return null;- //};- - try {- //Thread.create<void*> (run, false);- yield;- } catch (ThreadError e) {- stderr.printf ("Thread error: %s\n", e.message);- }+ // TODO: Add multi threading+ output = process_background_colors ((!)original_image, contrast, desaturate, threshold);+ Idle.add ((owned) callback); return output; }@@ -60,17 +60,6 @@ class GlyphTable : GLib.Object { build_index (); } - public GlyphCollection? nth (uint i) {- unowned List<Item>? d = data.nth (i);- - if (d == null) {- warning (@"no glyph for index $i");- return null;- }- - return ((!) d).data.glyph_collection;- }- public uint length () { return data.length (); }@@ -291,9 +291,6 @@ public class ImportSvg { // start with line handles ep1 = path.points.last ().data; ep1.get_right_handle ().type = PointType.LINE;- if (ep1.next == null) {- warning (@"$(ep1.x) $(ep1.y) is null");- } lx = ep1.x + ((x2 - ep1.x) / 3); ly = ep1.y + ((y2 - ep1.y) / 3);@@ -322,19 +322,6 @@ public class KeyBindings { var events = (!) e; events.insert (binding.get_key (), binding); }- - bool get_short_cut (uint modifier, uint key, out ShortCut? sc) {- sc = null;- - foreach (var v in BindingList.get_default_bindings ()) {- if (v.get_default_modifier () == modifier && v.get_default_key () == key) {- sc = v;- return true;- }- }- - return false;- } public static void set_modifier (uint mod) { modifier = mod;@@ -101,14 +101,6 @@ public class MainWindow { return over_view; } - internal static MenuTab get_content_display () { - if (unlikely ((MenuTab?) menu_tab == null)) { - warning ("MenuTab not instantiated."); - } - - return menu_tab; - } - public static MainWindow get_singleton () { return singleton; } @@ -141,18 +141,17 @@ c.append (""" </html> """); - return c.str;- }- - void translations () {+#if traslations // xgettext needs these lines in order to extract strings properly- // TODO: update xgettext to handle vala strings well. _("Preferences"); _("Export SVG, TTF & EOT fonts"); _("Name"); _("Glyph sequence"); _("Export SVG font and view the result"); _("Export SVG font and view the result");+#endif++ return c.str; } public void propagate_recent_files () {@@ -21,11 +21,6 @@ namespace Supplement { [CCode (has_type_id = false)] // Vala bug internal struct Fixed : uint32 { - public void @set (uint16 upper, uint16 lower) {- uint32* p = &this;- *p = (upper << 16) + lower;- }- public bool @equals (uint16 upper, uint16 lower) { uint32 t = (upper << 16) + lower; return (t == this); @@ -622,12 +622,6 @@ class LocaTable : Table { } } - public void print_offsets () { - for (int i = 0; i < size; i++) { - print (@"get_offset ($i): $(get_offset (i))\n"); - } - } - public void process (GlyfTable glyf_table, HeadTable head_table) { FontData fd = new FontData (); uint32 last = 0; @@ -1892,45 +1886,6 @@ class CmapSubtableWindowsUnicode : CmapSubtable { // Fixa: implement rest of type 4 (mind gid_length in length field) } - - public bool validate_subtable () { - uint32 length = get_length (); - unichar c; - unichar prev; - uint32 i = 0; - uint32 err = 0; - StringBuilder s; - - c = get_char (i); - if (c != 0) { - s = new StringBuilder (); - s.append_unichar (c); - warning ("nodef. is mapped to $(s.str)"); - } - - i++; - - while (i < length) { - if (c == 0) { - s = new StringBuilder (); - s.append_unichar (c); - warning (@"No entry in cmap for index $i. Last avalable char is $(s.str) Got $(s.str), ($((uint32)c))"); - err++; - return false; - } else { - prev = c; - } - - c = get_char (i); - i++; - } - - if (err > 0) { - stderr.printf (@"$err glyphs without mapping to a charactercode were found in this font.\n"); - } - - return true; - } } class CmapTable : Table { @@ -2150,22 +2105,19 @@ class HeadTable : Table { warning (@"Unknown glyph data format. Expecting 0 got $glyph_data_format."); } - // print_values (); + printd (@"Version: $(version.get_string ())\n"); + printd (@"flags: $flags\n"); + printd (@"font_revision: $(font_revision.get_string ())\n"); + printd (@"flags: $flags\n"); + printd (@"Units per em: $units_per_em\n"); + printd (@"lowest_PPEM: $lowest_PPEM\n"); + printd (@"font_direction_hint: $font_direction_hint\n"); + printd (@"loca_offset_size: $loca_offset_size\n"); + printd (@"glyph_data_format: $glyph_data_format\n"); + // Some deprecated values follow here ... } - void print_values () { - print (@"Version: $(version.get_string ())\n"); - print (@"flags: $flags\n"); - print (@"font_revision: $(font_revision.get_string ())\n"); - print (@"flags: $flags\n"); - print (@"Units per em: $units_per_em\n"); - print (@"lowest_PPEM: $lowest_PPEM\n"); - print (@"font_direction_hint: $font_direction_hint\n"); - print (@"loca_offset_size: $loca_offset_size\n"); - print (@"glyph_data_format: $glyph_data_format\n"); - } - public uint32 get_font_checksum () { return adjusted_checksum; } @@ -2383,23 +2335,6 @@ class HmtxTable : Table { requires (i < nmonospaced && left_side_bearing_monospaced != null) { return left_side_bearing_monospaced[i] * 1000 / head_table.get_units_per_em (); } - - public void print_all () { - return_if_fail (advance_width != null); - return_if_fail (left_side_bearing != null); - - for (int i = 0; i < nmetrics; i++) { - print (@"get_lsb ($i): $(get_lsb(i))\n"); - print (@"get_advance ($i): $(get_advance(i))\n"); - } - - if (left_side_bearing_monospaced != null) { - for (int i = 0; i < nmonospaced; i++) { - print (@"get_lsb_mono ($i): $(get_lsb_mono(i))\n"); - } - } - - } public new void parse (FontData dis, HheaTable hhea_table, LocaTable loca_table) throws GLib.Error { nmetrics = hhea_table.num_horizontal_metrics; @@ -2625,14 +2560,6 @@ class NameTable : Table { return ""; } - public void print_all () { - stdout.printf (@"$(text.length ()) name table texts:\n"); - foreach (string s in text) { - stdout.printf (s); - stdout.printf ("\n"); - } - } - public override void parse (FontData dis) throws Error { uint16 format; @@ -3023,7 +2950,7 @@ class PostTable : Table { names.append (name.str); } - + populate_available (); } @@ -3032,20 +2959,6 @@ class PostTable : Table { available_names.append (get_name (i)); } } - - public void print_all () { - print (@"PostScript glyph mapping:\n"); - for (int i = 0; i < index.length (); i++) { - print (@"gid $i -> $(get_name (i))\n"); - } - } - - public void print_all_names () { - print (@"Post table names:\n"); - foreach (var n in names) { - print (@"$n\n"); - } - } // the Macintosh standard order private void add_standard_names () { @@ -1281,20 +1281,6 @@ public class Path { } }- - void point_on_bezier_path (double t, EditPoint start, EditPoint stop, out double x, out double y) { - double x0 = start.x;- double y0 = start.y; - double x1 = start.get_right_handle ().x ();- double y1 = start.get_right_handle ().y ();- double x2 = stop.get_left_handle ().x ();- double y2 = stop.get_left_handle ().y (); - double x3 = stop.x;- double y3 = stop.y;-- x = bezier_path (t, x0, x1, x2, x3);- y = bezier_path (t, y0, y1, y2, y3);- } private void all_of_path (RasterIterator iter) { unowned List<EditPoint> i, next;