Clone in a terminal:
Commit 992c62e
Johan Mattsson - 2012-09-02T20:49:59+00:00
992c62e46818210cafb65446019c9b97dbe53123johan.mattsson.m@gmail.com

fix some compiler warnings

Changed files (6)

Diff

diff --git a/src/BirdfontExport.vala b/src/BirdfontExport.valaindex 161ec10..5dfa415 100644--- a/src/BirdfontExport.vala+++ b/src/BirdfontExport.vala@@ -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) {diff --git a/src/Font.vala b/src/Font.valaindex dc9ba90..6bef1b9 100644--- a/src/Font.vala+++ b/src/Font.vala@@ -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;diff --git a/src/OpenFontFormatWriter.vala b/src/OpenFontFormatWriter.valaindex b0bbb83..881afe1 100644--- a/src/OpenFontFormatWriter.vala+++ b/src/OpenFontFormatWriter.vala@@ -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 ());
diff --git a/src/Path.vala b/src/Path.valaindex b1247e2..04123f6 100644--- a/src/Path.vala+++ b/src/Path.vala@@ -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;diff --git a/src/ShrinkTool.vala b/src/ShrinkTool.valaindex c011f03..be26d36 100644--- a/src/ShrinkTool.vala+++ b/src/ShrinkTool.vala@@ -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; 			}diff --git a/src/wscript b/src/wscriptindex 11484d5..8156348 100644--- a/src/wscript+++ b/src/wscript@@ -73,7 +73,7 @@ PARAM = [ 	'--enable-experimental',
 	'--enable-experimental-non-null',
 	'--vapidir=../../'
-	'--Xcc="-lm"'
+	'--Xcc=-lm'
 ]
 
 def build (bld):

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112