From e67c8bf9fbf00779cc4faab5684617148f57f1f0 Mon Sep 17 00:00:00 2001 From: Julien Fischer Date: Thu, 10 Dec 2015 11:40:46 +1100 Subject: [PATCH] Fix minor issues in mdbcomp. mdbcomp/slice_and_dice.m: Expand tabs. mdbcomp/mdbcomp.goal_path.m: Fix spelling. mdbcomp/trace_counts.m: Consistently use "I/O" instead of "IO" in error messages. --- mdbcomp/mdbcomp.goal_path.m | 2 +- mdbcomp/slice_and_dice.m | 36 ++++++++++++++++++------------------ mdbcomp/trace_counts.m | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/mdbcomp/mdbcomp.goal_path.m b/mdbcomp/mdbcomp.goal_path.m index 759225f5e..f5fe8ab5b 100644 --- a/mdbcomp/mdbcomp.goal_path.m +++ b/mdbcomp/mdbcomp.goal_path.m @@ -314,7 +314,7 @@ % update_goal_attribute(GoalId, Attribute, !Array), % - % Make Attirubte the new attribute for GoalId in !:Array. + % Make Attribute the new attribute for GoalId in !:Array. % :- pred update_goal_attribute(goal_id::in, T::in, goal_attr_array(T)::gaa_di, goal_attr_array(T)::gaa_uo) is det. diff --git a/mdbcomp/slice_and_dice.m b/mdbcomp/slice_and_dice.m index 68b97bf27..76794f675 100644 --- a/mdbcomp/slice_and_dice.m +++ b/mdbcomp/slice_and_dice.m @@ -298,10 +298,10 @@ read_dice(PassFile, FailFile, Result, !IO) :- ). :- pred maybe_dice_error_to_problem_string(maybe_error(dice)::in, string::out) - is det. + is det. :- pragma foreign_export("C", maybe_dice_error_to_problem_string(in, out), - "MR_MDBCOMP_maybe_dice_error_to_problem_string"). + "MR_MDBCOMP_maybe_dice_error_to_problem_string"). maybe_dice_error_to_problem_string(ok(_), ""). maybe_dice_error_to_problem_string(error(ErrorStr), ErrorStr). @@ -309,11 +309,11 @@ maybe_dice_error_to_problem_string(error(ErrorStr), ErrorStr). :- pred det_maybe_dice_error_to_dice(maybe_error(dice)::in, dice::out) is det. :- pragma foreign_export("C", det_maybe_dice_error_to_dice(in, out), - "MR_MDBCOMP_det_maybe_dice_error_to_dice"). + "MR_MDBCOMP_det_maybe_dice_error_to_dice"). det_maybe_dice_error_to_dice(ok(Dice), Dice). det_maybe_dice_error_to_dice(error(_), _) :- - error("det_maybe_dice_error_to_dice: result is error"). + error("det_maybe_dice_error_to_dice: result is error"). :- type trace_counts_kind ---> pass_slice @@ -924,22 +924,22 @@ suspicion_ratio_binary(PassCount, FailCount) = R :- :- pragma foreign_export("C", get_suspicion_for_label_layout(in, in) = out, - "MR_MDBCOMP_get_suspicion_for_label_layout"). + "MR_MDBCOMP_get_suspicion_for_label_layout"). get_suspicion_for_label_layout(Dice, LabelLayout) = Suspicion :- - ProcLayout = get_proc_layout_from_label_layout(LabelLayout), - ProcLabel = get_proc_label_from_layout(ProcLayout), - PathPort = get_path_port_from_label_layout(LabelLayout), - ( if map.search(Dice ^ dice_proc_map, ProcLabel, PathPortMap) then - ( if map.search(PathPortMap, PathPort, ExecCount) then - Suspicion = suspicion_ratio_binary( - ExecCount ^ pass_count, ExecCount ^ fail_count) - else - Suspicion = 0.0 - ) - else - Suspicion = 0.0 - ). + ProcLayout = get_proc_layout_from_label_layout(LabelLayout), + ProcLabel = get_proc_label_from_layout(ProcLayout), + PathPort = get_path_port_from_label_layout(LabelLayout), + ( if map.search(Dice ^ dice_proc_map, ProcLabel, PathPortMap) then + ( if map.search(PathPortMap, PathPort, ExecCount) then + Suspicion = suspicion_ratio_binary( + ExecCount ^ pass_count, ExecCount ^ fail_count) + else + Suspicion = 0.0 + ) + else + Suspicion = 0.0 + ). %-----------------------------------------------------------------------------% % diff --git a/mdbcomp/trace_counts.m b/mdbcomp/trace_counts.m index e9a945fb6..7c6f45e08 100644 --- a/mdbcomp/trace_counts.m +++ b/mdbcomp/trace_counts.m @@ -293,12 +293,12 @@ read_trace_counts_source(FileName, Result, !IO) :- ; ReadTCResult = io_error(IOError), ErrMsg = io.error_message(IOError), - Result = list_error_message("IO error reading file " ++ + Result = list_error_message("I/O error reading file " ++ "`" ++ FileName ++ "': " ++ ErrMsg) ; ReadTCResult = open_error(IOError), ErrMsg = io.error_message(IOError), - Result = list_error_message("IO error opening file " ++ + Result = list_error_message("I/O error opening file " ++ "`" ++ FileName ++ "': " ++ ErrMsg) ; ReadTCResult = syntax_error(ErrMsg),