]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: ErrorReporter: Drop ErrorType
authorFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 13:44:36 +0000 (15:44 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Sat, 21 Jul 2012 13:44:36 +0000 (15:44 +0200)
src/libvaladoc/errorreporter.vala

index 0ff49237361b3576c11d3bf8a7f810d14ed57c57..073eb4b3d118543ce3429e0731827fb32a67c767 100644 (file)
@@ -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++;
        }
 }