[valadoc] libvaladoc: ErrorReporter: Drop ErrorType



commit 9a248d5f59f77181342a11e37a7423d85387cd8a
Author: Florian Brosch <flo brosch gmail com>
Date:   Sat Jul 21 15:44:36 2012 +0200

    libvaladoc: ErrorReporter: Drop ErrorType

 src/libvaladoc/errorreporter.vala |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/src/libvaladoc/errorreporter.vala b/src/libvaladoc/errorreporter.vala
index 0ff4923..073eb4b 100644
--- a/src/libvaladoc/errorreporter.vala
+++ b/src/libvaladoc/errorreporter.vala
@@ -58,25 +58,8 @@ public class Valadoc.ErrorReporter : Object {
 		}
 	}
 
-	private enum ErrorType {
-		WARNING,
-		ERROR;
-
-		public string to_string () {
-			switch (this) {
-			case ErrorType.WARNING:
-				return "warning";
-
-			case ErrorType.ERROR:
-				return "error";
-			}
-
-			assert_not_reached ();
-		}
-	}
-
-	private inline void msg (ErrorType type, string file, long line, long startpos, long endpos, string errline, string msg_format, va_list args) {
-		this.stream.printf ("%s:%lu.%lu-%lu.%lu: %s: ", file, line, startpos, line, endpos, type.to_string ());
+	private inline void msg (string type, string file, long line, long startpos, long endpos, string errline, string msg_format, va_list args) {
+		this.stream.printf ("%s:%lu.%lu-%lu.%lu: %s: ", file, line, startpos, line, endpos, type);
 		this.stream.vprintf (msg_format, args);
 		this.stream.putc ('\n');
 
@@ -111,13 +94,13 @@ public class Valadoc.ErrorReporter : Object {
 
 	public void error (string file, long line, long startpos, long endpos, string errline, string msg_format, ...) {
 		var args = va_list();
-		this.msg (ErrorType.ERROR, file, line, startpos, endpos, errline, msg_format, args);
+		this.msg ("error", file, line, startpos, endpos, errline, msg_format, args);
 		this._errors++;
 	}
 
 	public void warning (string file, long line, long startpos, long endpos, string errline, string msg_format, ...) {
 		var args = va_list();
-		this.msg (ErrorType.WARNING, file, line, startpos, endpos, errline, msg_format, args);
+		this.msg ("warning", file, line, startpos, endpos, errline, msg_format, args);
 		this._warnings++;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]