Fix more warnings from --warn-inconsistent-pred-order-clauses.

browser/browse.m:
browser/browser_info.m:
browser/collect_lib.m:
browser/debugger_interface.m:
browser/declarative_analyser.m:
browser/declarative_debugger.m:
browser/declarative_edt.m:
browser/declarative_execution.m:
browser/declarative_oracle.m:
browser/declarative_test.m:
browser/declarative_tree.m:
browser/declarative_user.m:
browser/diff.m:
browser/dl.m:
browser/frame.m:
browser/help.m:
browser/interactive_query.m:
browser/io_action.m:
browser/listing.m:
browser/mdb.m:
browser/mer_browser.m:
browser/name_mangle.m:
browser/term_rep.m:
browser/tree234_cc.m:
    Fix inconsistencies between (a) the order in which functions and predicates
    are declared, and (b) the order in which they are defined.

    In most modules, either the order of the declarations or the order
    of the definitions made sense, and I changed the other to match.
    In some modules, neither made sense, so I changed *both* to an order
    that *does* make sense (i.e. it has related predicates together).

    In some places, put dividers between groups of related
    functions/predicates, to make the groups themselves more visible.

    In some places, fix comments or programming style.

browser/MDB_FLAGS.in:
    Since all the modules in this directory are now free from any warnings
    generated by --warn-inconsistent-pred-order-clauses, specify that option
    by default in this directory to keep it that way.
This commit is contained in:
Zoltan Somogyi
2017-04-29 14:08:50 +10:00
parent 1a77161e3a
commit 6ea8406ac8
25 changed files with 1688 additions and 1589 deletions

View File

@@ -1,10 +1,10 @@
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
% vim: ft=mercury ts=4 sw=4 et
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
% Copyright (C) 1998-2006 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
%
% File: dl.m.
% Purpose: dynamic linking support.
@@ -15,7 +15,7 @@
% and dlclose(). For details about the behaviour of those procedures,
% see the documentation for those procedures (i.e. `man dlopen').
%
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
:- module mdb.dl.
@@ -163,20 +163,6 @@ open(FileName, Mode, Scope, Result, !IO) :-
dlopen(_, _, _, _, !IO) :-
private_builtin.sorry("dlopen").
mercury_sym(Handle, MercuryProc0, Result, !IO) :-
check_proc_spec_matches_result_type(Result, _, MercuryProc0, MercuryProc1),
check_type_is_supported(Result, _, MercuryProc1, MercuryProc),
MangledName = proc_name_mangle(MercuryProc),
sym(Handle, MangledName, Result0, !IO),
(
Result0 = dl_error(Msg),
Result = dl_error(Msg)
;
Result0 = dl_ok(Address),
private_builtin.unsafe_type_cast(make_closure(Address), Closure),
Result = dl_ok(Closure)
).
:- pragma foreign_decl("C",
"
#include ""mercury_ho_call.h""
@@ -306,6 +292,20 @@ sym(handle(Handle), Name, Result, !IO) :-
Result = dl_ok(Pointer)
).
mercury_sym(Handle, MercuryProc0, Result, !IO) :-
check_proc_spec_matches_result_type(Result, _, MercuryProc0, MercuryProc1),
check_type_is_supported(Result, _, MercuryProc1, MercuryProc),
MangledName = proc_name_mangle(MercuryProc),
sym(Handle, MangledName, Result0, !IO),
(
Result0 = dl_error(Msg),
Result = dl_error(Msg)
;
Result0 = dl_ok(Address),
private_builtin.unsafe_type_cast(make_closure(Address), Closure),
Result = dl_ok(Closure)
).
:- pred dlsym(c_pointer::in, string::in, c_pointer::out,
io::di, io::uo) is det.
@@ -366,7 +366,7 @@ close(handle(Handle), Result, !IO) :-
dlclose(_, !IO) :-
private_builtin.sorry("dlclose").
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%
:- pred high_level_code is semidet.
:- pragma foreign_proc("C",
@@ -383,4 +383,4 @@ dlclose(_, !IO) :-
high_level_code :-
private_builtin.sorry("high_level_code").
%-----------------------------------------------------------------------------%
%---------------------------------------------------------------------------%