summaryrefslogtreecommitdiff
path: root/lily
diff options
context:
space:
mode:
authorReinhold Kainhofer <reinhold@kainhofer.com>2011-09-28 12:39:12 +0200
committerReinhold Kainhofer <reinhold@kainhofer.com>2011-11-14 22:09:58 +0100
commitc618987255838a2af9813a69eb1f4f20a8df6315 (patch)
tree40c4d4192900a34ca2667089e8af262220b9e2ed /lily
parent0722babbea9d5a6b26c4872cbb7ba41ba55cb7bc (diff)
Warnings: Move all warning-as-error handling to warn.cc
This finally makes that option apply to ALL warnings, and it considerably cleans up the error/warning functions.
Diffstat (limited to 'lily')
-rw-r--r--lily/input.cc10
-rw-r--r--lily/program-option-scheme.cc6
-rw-r--r--lily/warn-scheme.cc21
3 files changed, 10 insertions, 27 deletions
diff --git a/lily/input.cc b/lily/input.cc
index 28923f4948..9ba3767638 100644
--- a/lily/input.cc
+++ b/lily/input.cc
@@ -103,10 +103,7 @@ Input::error (string s) const
void
Input::programming_error (string s) const
{
- if (get_program_option ("warning-as-error"))
- ::error (message_string (s), message_location ());
- else
- ::programming_error (message_string (s), message_location ());
+ ::programming_error (message_string (s), message_location ());
}
void
@@ -118,10 +115,7 @@ Input::non_fatal_error (string s) const
void
Input::warning (string s) const
{
- if (get_program_option ("warning-as-error"))
- ::non_fatal_error (message_string (s), message_location ());
- else
- ::warning (message_string (s), message_location ());
+ ::warning (message_string (s), message_location ());
}
void
diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc
index 2c3d60dc87..2d65001a14 100644
--- a/lily/program-option-scheme.cc
+++ b/lily/program-option-scheme.cc
@@ -123,7 +123,11 @@ internal_set_option (SCM var,
val = val_scm_bool;
}
else if (varstr == "warning-as-error")
- val = val_scm_bool;
+ {
+ /* warning_as_error is defined in flower/warn.cc */
+ warning_as_error = valbool;
+ val = val_scm_bool;
+ }
else if (varstr == "music-strings-to-paths")
{
music_strings_to_paths = valbool;
diff --git a/lily/warn-scheme.cc b/lily/warn-scheme.cc
index 2f7a1af611..3b917b760e 100644
--- a/lily/warn-scheme.cc
+++ b/lily/warn-scheme.cc
@@ -49,12 +49,7 @@ LY_DEFINE (ly_programming_error, "ly:programming-error",
{
LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
-
- if (get_program_option ("warning-as-error"))
- error (ly_scm2string (str));
- else
- programming_error (ly_scm2string (str));
-
+ programming_error (ly_scm2string (str));
return SCM_UNSPECIFIED;
}
@@ -65,12 +60,7 @@ LY_DEFINE (ly_warning, "ly:warning",
{
LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
-
- if (get_program_option ("warning-as-error"))
- error (ly_scm2string (str));
- else
- warning (ly_scm2string (str));
-
+ warning (ly_scm2string (str));
return SCM_UNSPECIFIED;
}
@@ -129,12 +119,7 @@ LY_DEFINE (ly_warning_located, "ly:warning-located",
LY_ASSERT_TYPE (scm_is_string, location, 1);
LY_ASSERT_TYPE (scm_is_string, str, 2);
str = scm_simple_format (SCM_BOOL_F, str, rest);
-
- if (get_program_option ("warning-as-error"))
- error (ly_scm2string (str), ly_scm2string (location));
- else
- warning (ly_scm2string (str), ly_scm2string (location));
-
+ warning (ly_scm2string (str), ly_scm2string (location));
return SCM_UNSPECIFIED;
}