Commit 992c62e
fix some compiler warnings
Changed files (6)
modifiedsrc/BirdfontExport.valamodifiedsrc/Font.valamodifiedsrc/OpenFontFormatWriter.valamodifiedsrc/Path.valamodifiedsrc/ShrinkTool.valamodifiedsrc/wscript
Diff
@@ -53,7 +53,6 @@ class BirdfontExport { if (arg[i] == "-h" || arg[i] == "--help") { print_help (arg); return 0;- continue; } if (arg[i] == "-o" || arg[i] == "--output" && i + 1 < arg.length) {@@ -634,6 +634,10 @@ class Font : GLib.Object { stderr.printf (@"Failed to save $path \n"); stderr.printf (@"$(e.message) \n"); return false;+ } catch (GLib.IOError e) {+ stderr.printf (@"Failed to save $path \n");+ stderr.printf (@"$(e.message) \n");+ return false; } return true;@@ -708,31 +712,36 @@ class Font : GLib.Object { public bool load (string path, bool recent = true) { bool loaded = false;-- otf_font = false;-- while (glyph_names.length () > 0) {- glyph_names.remove_link (glyph_names.first ());- } - glyph_cache.remove_all ();- unassigned_glyphs.remove_all ();- - if (path.has_suffix (".ffi")) {- loaded = parse_file (path);- font_file = path;- }- - if (Supplement.experimental) {- if (path.has_suffix (".ttf")) {- loaded = parse_otf_file (path);+ try {+ otf_font = false;++ while (glyph_names.length () > 0) {+ glyph_names.remove_link (glyph_names.first ());+ }+ + glyph_cache.remove_all ();+ unassigned_glyphs.remove_all ();+ + if (path.has_suffix (".ffi")) {+ loaded = parse_file (path); font_file = path; }- }- - if (recent) {- add_thumbnail ();- Preferences.add_recent_files (get_path ());+ + if (Supplement.experimental) {+ if (path.has_suffix (".ttf")) {+ loaded = parse_otf_file (path);+ font_file = path;+ }+ }+ + if (recent) {+ add_thumbnail ();+ Preferences.add_recent_files (get_path ());+ }+ } catch (GLib.Error e) {+ warning (e.message);+ return false; } return loaded;@@ -635,7 +635,6 @@ class LocaTable : Table { public void process (GlyfTable glyf_table, HeadTable head_table) { FontData fd = new FontData (); - Font font = OpenFontFormatWriter.get_current_font (); uint32 last = 0; uint32 prev = 0; int i = 0; @@ -1503,7 +1502,6 @@ class GlyfTable : Table { // bounding box int16 last = 0; - int16 coordinate; int i = 0; foreach (int16 c in coordinate_x) { @@ -2984,7 +2982,6 @@ class PostTable : Table { } public string get_name (int gid) { - uint16 i; int k; if (!(0 <= gid < index.length ())) { @@ -3059,7 +3056,6 @@ class PostTable : Table { for (int i = 0; i < non_standard_names; i++) { uint8 len = dis.read_byte (); StringBuilder name = new StringBuilder (); - int gid = (!) index.nth (i).data; for (int j = 0; j < len; j++) { name.append_c (dis.read_char ()); @@ -43,7 +43,6 @@ class Path { bool edit = true; bool open = true; - bool set_direction_from_tool = true; bool no_derived_direction = false; bool clockwise_direction = true; @@ -74,11 +73,6 @@ class Path { } } - public EditPoint get_end_point () - requires (points.length () > 0) {- return points.last ().data;- }- public void set_color (double r, double g, double b, double a) { this.r = r; this.g = g;@@ -86,14 +80,6 @@ class Path { this.a = a; } - public void set_name (string n) {- name = n;- }- - public string get_name () {- return (name == null) ? "NO_NAME" : (!) name;- }- public double get_width () { return_if_fail (xmax != double.MIN && xmin != double.MAX); return (xmax - xmin);@@ -1482,7 +1468,6 @@ class Path { public static void bezier_vector (double step, double p0, double p1, double p2, double p3, out double a0, out double a1) { double q0, q1, q2;- double r0, r1; q0 = step * (p1 - p0) + p0; q1 = step * (p2 - p1) + p1;@@ -1670,16 +1655,8 @@ class Path { private static bool try_merge (Path p0, Path p1, out PathList path_list) { EditPoint e; IntersectionList il;- - EditPoint ex;- EditPoint ix;- EditPoint prev;- - uint offset_i = 0;- uint offset_j;- uint len_i;- int i, j;- uint len_j;++ int i; bool over; Path np; Path np_counter;@@ -80,7 +80,7 @@ class ShrinkTool : Tool { if (unlikely (lep == null)) { warning ("Bad list.");- stderr.printf (@"No links in path $(path_index (p)) ($(p.get_name ())). Length: $(p.points.length ())\n");+ stderr.printf (@"No links in path $(path_index (p)). Length: $(p.points.length ())\n"); p.print_boundries (); continue; }@@ -73,7 +73,7 @@ PARAM = [ '--enable-experimental', '--enable-experimental-non-null', '--vapidir=../../' - '--Xcc="-lm"' + '--Xcc=-lm' ] def build (bld):