839 Commits

Author SHA1 Message Date
Zoltan Somogyi
2d6c0ff87c Fix indentation. 2026-04-02 23:22:02 +11:00
Julien Fischer
497288a2f9 Minor fixes for extras/lex.
extras/lex/lex.m:
extras/lex/regex.m:
    Fix comments.

extras/lex/lex.convert_NFA_to_DFA.m:
    Fix formatting.
2026-04-02 21:58:15 +11:00
Zoltan Somogyi
7aa23d91d3 Fix indentation.
Stop duplicating the description of the library.
2026-02-28 20:01:06 +11:00
Julien Fischer
27fd3be973 Delete unused imports.
extras/base64/base64.m:
    As above.
2026-02-27 23:41:33 +11:00
Julien Fischer
e480234798 Fix incorrect argument checks in mcurses.
extras/curses/mcurses.user.m:
    Fix some incorrect argument checks.
2026-02-27 23:33:30 +11:00
Julien Fischer
65f41d71b2 Fix some errors in extras/cgi.
extras/cgi/html.m:
    There is no HTML tag named "it", it is supposed to be "i".

    Fix a misformed attribute value.

    Fix incorrect character code character escapes.
2026-02-27 21:49:04 +11:00
Julien Fischer
f3ff95db82 Add a missing determinism declaration.
extras/moose/moose.m:
    As above.
2026-02-27 17:20:53 +11:00
Julien Fischer
814f644c73 Fix documentation in complex number library.
extras/complex_numbers/complex_numbers.complex.m:
    Fix incorrect predicate name in documentation of complex_to_polar/3.
2026-02-27 17:02:02 +11:00
Julien Fischer
126677a832 Fix errors in the GLUT binding.
extras/graphics/mercury_glut/glut.callback.m:
    Rename overlay_display_func/2 -> disable_overlay_display_func/2
    for consistency with every other pair of callback predicates in
    this module.

    Add a space before a determinism declaration.

    Delete doubled-up tabled_for_io attributes from foreign_procs.

    Call the correct GLUT function to disable keyboard up callbacks.

extras/graphics/mercury_glut/glut.color_map.m:
    Fix incorrect argument ordering in a documentation comment.

extras/graphics/mercury_glut/glut.font.m:
    Fix formatting.

extras/graphics/mercury_glut/glut.m:
    Fix the definition of the glut_alpha/0 function, which was returning
    the wrong value.

extras/graphics/mercury_glut/glut.overlay.m:
    Fix a documentation comment.

    Add some tabled_for_io attributes.

extras/graphics/mercury_glut/glut.window.m:
    Fix doubled-up-word.

    s/__IO/_IO etc.
2026-02-27 16:49:38 +11:00
Julien Fischer
18f1cb69ee Fix some errors in the OpenGL binding.
extras/graphics/mercury_opengl/mogl.m:
    Fix incorrect casts in some of the calls to glRasterPosNd.

    Fix wording of an exception message.

    Fix incorrect constants in some foreign_enum pragmas.

    Fix a typo in a comment.
2026-02-27 16:22:13 +11:00
Julien Fischer
f5ca6b67a8 Fix some typos in the ODBC interface.
extras/odbc/odbc.m:
    As above.
2026-02-27 16:00:43 +11:00
Julien Fischer
330323c7a1 Minor fixes for the cairo binding.
extras/graphics/mercury_cairo/cario.m:
    Avoid a warning about unused state variables.

extras/graphics/mercury_cairo/*.m:
    Avoid excessive module qualification in comments.

    Format documentation comments in our usual manner.

    Delete my old CSSE email address.
2026-02-25 17:48:14 +11:00
Zoltan Somogyi
2a1f376c5d Use spaces in all Mercury.options files.
Use consistent indentation.

Sort many blocks of module-specific MCFLAGS settings by module name.

Add XXXs about some questionable options.
2025-12-06 10:39:04 +11:00
Zoltan Somogyi
f2ac8bc60a Merge --warn-interface-imports into --warn-unused-interface-imports.
compiler/options.m:
    Merge the two options into one, which can be specified by either name.

compiler/module_qual.m:
    Update their documentation.

compiler/module_qual.qualify_items.m:
    Conform to the change above.

tests/warnings/help_text.err_exp:
    Expect the merged option's documentation.

NEWS.md:
    Announce the new option name.

RELEASE_NOTES_NEXT:
    Schedule the old option name for deletion.

extras/base64/Mercury.options:
extras/fixed/Mercury.options:
extras/graphics/mercury_allegro/Mercury.options:
extras/graphics/mercury_cairo/Mercury.options:
extras/graphics/mercury_glfw/Mercury.options:
extras/graphics/mercury_glut/Mercury.options:
extras/graphics/mercury_glut/Mmakefile:
extras/graphics/mercury_glut/Mmakefile.MacOSX:
extras/graphics/mercury_opengl/Mercury.options:
extras/graphics/mercury_opengl/Mmakefile:
extras/graphics/mercury_opengl/Mmakefile.MacOSX:
extras/odbc/Mercury.options:
extras/odbc/Mmakefile:
extras/references/Mercury.options:
extras/solver_types/library/Mercury.options:
extras/solver_types/library/Mmakefile:
extras/trail/Mercury.options:
tests/submodules/Mercury.options:
tests/warnings/Mercury.options:
    Replace all references to --warn-interface-imports with
    --warn-unused-interface-imports, the new preferred name.

    In several places, compiler options (both module-specific
    and otherwise) were specified in Mmakefiles. Move them
    to Mercury.options files. In some cases, this meant creating
    new Mercury.options files.
2025-11-29 02:23:32 +11:00
Julien Fischer
6dc101827a Fix compilation of extras/xml.
extras/xml/parsing.m:
    Avoid a warning about initial and final state variables being the same
    in a predicate.  That is true, but changing the predicate signature is
    incompatible with the use of DCGs in this library.
2025-05-27 16:10:28 +10:00
Julien Fischer
2f13f76e98 Avoid warnings in extras and benchmarks.
benchmarks/prog/icfp2000_no_iostate/renderer.m:
    Avoid a warning about an unused module in ther interface.

extras/curs/curs.m:
    Delete an unused import.

extras/lex/lex.m:
    Replace state variables that are not updated.
2025-05-25 17:12:01 +10:00
Julien Fischer
f7837e2f94 Fix copyright notices in some Mmakefiles.
extras/*/Mmakefile:
    As above.
2025-05-05 15:50:03 +10:00
Zoltan Somogyi
af23a48a2b Minor style improvements to extras.
extras/gator/gator:
    Update programming style. Fix indentation. Add a vim modeline.

extras/gator/genotype.m:
extras/gator/phenotype.m:
    Fix indentation.

extras/lex/regex.m:
    Replace if-then-else chain with a switch.

extras/base64/base64.m:
extras/cgi/cgi.m:
extras/cgi/form_test.m:
extras/cgi/html.m:
extras/cgi/mercury_www.m:
extras/complex_numbers/complex_numbers.complex.m:
extras/complex_numbers/complex_numbers.complex_float.m:
extras/complex_numbers/complex_numbers.complex_imag.m:
extras/complex_numbers/complex_numbers.float_complex.m:
extras/complex_numbers/complex_numbers.float_imag.m:
extras/complex_numbers/complex_numbers.imag.m:
extras/complex_numbers/complex_numbers.imag_complex.m:
extras/complex_numbers/complex_numbers.imag_float.m:
extras/complex_numbers/complex_numbers.m:
extras/curs/curs.m:
extras/dynamic_linking/dl_test.m:
extras/dynamic_linking/dl_test2.m:
extras/dynamic_linking/hello.m:
extras/error/error.m:
extras/fixed/fixed.m:
extras/fixed/mercury_fixed.m:
extras/java_extras/make_temp.m:
extras/lex/lex.automata.m:
extras/lex/lex.buf.m:
extras/lex/lex.convert_NFA_to_DFA.m:
extras/lex/lex.lexeme.m:
extras/lex/lex.m:
extras/lex/lex.regexp.m:
extras/logged_output/logged_output.m:
extras/logged_output/main.m:
extras/monte/doit.m:
extras/monte/dots.m:
extras/monte/geom.m:
extras/monte/hg.m:
extras/monte/monte.m:
extras/monte/rnd.m:
extras/mopenssl/mopenssl.m:
extras/odbc/mercury_odbc.m:
extras/odbc/odbc.m:
extras/odbc/odbc_test.m:
extras/posix/posix.chdir.m:
extras/posix/posix.closedir.m:
extras/posix/posix.dup.m:
extras/posix/posix.exec.m:
extras/posix/posix.fork.m:
extras/posix/posix.getpid.m:
extras/posix/posix.kill.m:
extras/posix/posix.lseek.m:
extras/posix/posix.m:
extras/posix/posix.mkdir.m:
extras/posix/posix.open.m:
extras/posix/posix.opendir.m:
extras/posix/posix.pipe.m:
extras/posix/posix.read.m:
extras/posix/posix.readdir.m:
extras/posix/posix.realpath.m:
extras/posix/posix.rmdir.m:
extras/posix/posix.select.m:
extras/posix/posix.sleep.m:
extras/posix/posix.socket.m:
extras/posix/posix.stat.m:
extras/posix/posix.strerror.m:
extras/posix/posix.wait.m:
extras/posix/posix.write.m:
extras/quickcheck/qcheck.m:
extras/quickcheck/rnd.m:
extras/quickcheck/test_qcheck.m:
extras/show_ops/show_ops.m:
extras/split_file/split_file.m:
extras/windows_installer_generator/wix.m:
extras/windows_installer_generator/wix_files.m:
extras/windows_installer_generator/wix_gui.m:
extras/windows_installer_generator/wix_installer.m:
extras/windows_installer_generator/wix_util.m:
    Apply tools/stdlines to all these files.
2025-05-05 08:08:50 +10:00
Zoltan Somogyi
89b3e1dca3 Add "ft=make" to the modelines of Mmakefiles.
Add some missing .PHONY markers, and delete a stray .PHONY marker.

Add some missing copyright years.
2025-05-05 07:58:50 +10:00
Zoltan Somogyi
72dbfa74c6 Improve the style of the odbc library.
extras/odbc/odbc.m:
    Fix a warning from the Mercury compiler.

    Stop using higher order insts as modes.

    Use variable names that are consistent between caller and callee.

    The comments in this file came from the days when we used tabs for
    indentation. Reflow multi-line comments and multi-line calls
    to take advantage of the extra space allowed by four-space indentation.

    Delete a misleading comment.

extras/odbc/Mercury.options:
    Specify the same compiler flags for odbc.m as we do for all modules
    in the compiler directory.
2025-04-20 20:44:02 +10:00
Julien Fischer
dc2c470787 Update and fix copyright notices.
*/Mercury.options:
compiler/*.m:
extras/references/c_references.h:
extras/references/samples/max_test.m:
scripts/mprof_merge_runs:
     As above.
2024-12-30 20:17:22 +11:00
Zoltan Somogyi
c148ce54fe Update style in a bunch of Mmakefiles.
Mmake.common.in:
bindist/Mmakefile:
compiler/Mmakefile:
compiler/notes/Mmakefile:
doc/Mmakefile:
extras/align_right/Mmakefile:
extras/base64/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/error/Mmakefile:
extras/fixed/Mmakefile:
extras/graphics/samples/gears/Mmakefile.MacOSX:
extras/graphics/samples/maze/Mmakefile.MacOSX:
extras/lex/Mmakefile:
extras/monte/Mmakefile:
extras/posix/Mmakefile:
extras/references/Mmakefile:
extras/references/samples/Mmakefile:
extras/split_file/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
ssdb/Mmakefile:
tests/Mmake.common:
tests/mmc_make/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
    Invoke the sh builtin "test" as "test", not as "[".

    Make some target names more descriptive.

    Fix indentation.
2024-09-17 11:09:18 +02:00
Peter Wang
35e76e41e2 Put .mh files into Mercury/mhs subdirectory.
Put .mh files into a Mercury/mhs subdirectory when --use-subdirs
or --use-grade-subdirs is used.

compiler/file_names.m:
    Replace ext_cur_mh with ext_cur_ngs_max_cur_mh, in the new category
    ext_cur_ngs_max_cur. The new category is similar to that for .mih
    files, except that .mh files are never placed in grade-specific
    subdirectories.

compiler/handle_options.m:
    Add Mercury/mhs subdirs to list of C include directories
    when --use-subdirs or --use-grade-subdirs is in effect.

compiler/write_deps_file.m:
    Add $(mhs_subdir) prefix before %.mh patterns.

    Create a Mercury/mhs -> .. symlink when installing.
    This is required by mmc --make and mmake --use-subdirs.

    Conform to the changes above.

compiler/export.m:
compiler/make.file_names.m:
compiler/make.program_target.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mlds_to_c_file.m:
    Conform to the changes above.

scripts/Mmake.vars.in:
    Define the variable mhs_subdir.

scripts/Mmake.rules:
    Add -I option to find .mh files when --use-subdirs is used.

browser/.mgnuc_copts:
browser/MDB_FLAGS.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/DEEP_FLAGS.in:
extras/EXTRAS_FLAGS.in:
grade_lib/.mgnuc_copts:
grade_lib/GRADE_LIB_FLAGS.in:
library/.mgnuc_copts:
mdbcomp/.mgnuc_copts:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/.mgnuc_copts:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/.mgnuc_copts:
profiler/PROF_FLAGS.in:
slice/.mgnuc_copts:
slice/SLICE_FLAGS.in:
ssdb/.mgnuc_copts:
ssdb/SSDB_FLAGS.in:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
trace/.mgnuc_copts:
tools/lmc.in:
    Add -I options to find .mh files when the workspace is built
    with mmake --use-subdirs.

samples/c_interface/standalone_c/Makefile:
    Add option to let the C compiler find the .mh file.

NEWS.md:
    Announce change.

    Delete trailing whitespace.
2024-07-23 17:44:17 +10:00
Zoltan Somogyi
4d602d6ad3 Specify -I search flags in permitted reference order. 2024-07-17 13:48:27 +02:00
Julien Fischer
ea4b27f57f Delete --fullarch.
The internal option --fullarch has been deprecated in favour of --target-arch
since 2014. Delete it and replace any uses with --target-arch.

compiler/options.m:
    As above.

scripts/Mercury.config.in:
scripts/Mercury.config.boostrap.in:
extras/windows_installer_generator/sample/Mercury.config:
    Conform to the above change.
2023-09-07 11:47:38 +10:00
Julien Fischer
ae1a5863a5 Fix usage message for moose.
extras/moose/moose.m:
    Fix copy-and-paste errors.
2023-09-04 01:19:46 +10:00
Zoltan Somogyi
becb725dd4 Bring log4m.m's style up to date. 2023-07-24 12:53:48 +02:00
Julien Fischer
bbd1a9d138 Avoid warnings from MSVC in extras.
extras/odbc/odbc.m:
extras/log4m/log4.m:
    As above.
2023-07-24 15:20:03 +10:00
Zoltan Somogyi
3d756f61cd Put varsets before vars in write_variable.
library/term_io.m:
    Put the varset before the variable, the item to be written out,
    in the various versions of the write_variable operation.
    The new argument order

    - fits in better with the versions of write_term, which also put
      the varset before the item to be written out, and

    - allows the convenient use of fold operations that write out
      several variables.

NEWS.md:
    Announce the change, though only for the versions that existed
    before yesterday :-)

compiler/inst_graph.m:
extras/moose/mercury_syntax.m:
    Conform to the change.
2023-07-04 16:35:01 +02:00
Julien Fischer
13f01c98bd Ignore .obj files.
extras/.gitignore:
samples/.gitignore:
    As above.
2023-07-02 02:41:56 +10:00
Zoltan Somogyi
a5f9cb6851 Reduce differences between interpreter.m versions.
extras/trailed_update/samples/interpreter.m:
samples/interpreter.m:
    We have these two different versions of a pure Prolog interpreter
    as examples of Mercury code. Reduce the number of unneeded points
    of difference between them, by copying the better code at each such point
    to the other file.

tests/debugger/interpreter.m:
    This file is automatically copied from samples/interpreter.m.

tests/debugger/interpreter.exp:
    Expect the changes caused by the update to the source file.
2023-06-22 14:54:59 +02:00
Julien Fischer
c912aa4313 Fix compilation of extras/base64.
extras/base64/base64.m:
    Fix character escaping in a foreign_proc body.
2023-06-20 12:42:26 +10:00
Julien Fischer
1a95515413 Replace calls to obsolete predicates.
extras/moose/mercury_syntax.m:
extras/moose/moose.m:
    As above.
2023-06-20 11:52:32 +10:00
Julien Fischer
39fa7ddb47 Replace calls to obsolete predicates.
extras/cgi/cgi.m:
extras/moose/grammar.m:
    As above.

extras/curs/curs.panel.m:
    Delete an unused import.
2023-06-19 23:12:44 +10:00
Julien Fischer
2a366cf295 Deprecate --no-ansi and --no-ansi-c.
--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)

Also deprecate the internal compiler option --cflags-for-ansi.

compiler/options.m:
    Document that --no-ansi-c is now deprecated.

    Document that the internal option --cflags-for-ansi is now
    deprecated.

compiler/compile_target_code.m:
    Do not pass the ANSI options to the C compiler.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Deprecate the --no-ansi option; delete code that no longer does
    anything useful.

configure.ac:
    Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
    set to be empty. (The comment talks about --no-ansi doing other things
    in the mgnuc script. It used to also cause some preprocessor macros
    to be defined for compatibility with the system headers on some
    platforms -- that has not been the case since 2013.)

doc/user_guide.texi:
    Document that --no-ansi-c is deprecated.

bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
    Conform to the above change.

NEWS.md:
    Announce the above.
2023-05-31 17:44:26 +10:00
Julien Fischer
6faef40e9e Fix spelling.
extras/moose/check.m:
    As above.
2023-04-03 21:09:24 +10:00
Zoltan Somogyi
9b6390b17e Bring the programming style of extras up to date.
extras/curs/curs.m:
extras/curs/curs.panel.m:
    Make panel a separate submodule of curs, not a nested submodule.

extras/base64/base64.m:
extras/curses/mcurses.basics.m:
extras/curses/mcurses.m:
extras/curses/mcurses.misc.m:
extras/curses/mcurses.user.m:
extras/gator/evolve.m:
extras/gator/genotype.m:
extras/gator/phenotype.m:
extras/gator/tausworthe3.m:
extras/monte/dots.m:
extras/monte/geom.m:
extras/monte/hg.m:
extras/monte/monte.m:
extras/monte/rnd.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/mopenssl/mopenssl.m:
extras/net/echo.m:
extras/net/errno.m:
extras/net/getaddrinfo.m:
extras/net/net.m:
extras/net/netdb.m:
extras/net/sockets.m:
extras/net/streams.m:
extras/net/tcp.m:
extras/net/test_lookups.m:
extras/net/types.m:
extras/odbc/odbc.m:
extras/odbc/odbc_test.m:
extras/references/README:
extras/references/reference.m:
extras/references/scoped_update.m:
extras/solver_types/library/any.m:
extras/solver_types/library/any_array.m:
extras/solver_types/library/any_assoc_list.m:
extras/solver_types/library/any_list.m:
extras/solver_types/library/any_map.m:
extras/solver_types/library/any_tree234.m:
extras/solver_types/library/any_util.m:
extras/trail/trail.m:
extras/trailed_update/samples/interpreter.m:
extras/trailed_update/samples/vqueens.m:
extras/trailed_update/tests/var_test.m:
extras/trailed_update/tr_array.m:
extras/trailed_update/tr_store.m:
extras/trailed_update/trailed_update.m:
extras/trailed_update/unsafe.m:
extras/trailed_update/var.m:
    Bring programming style up to date.
2023-03-30 21:48:10 +11:00
Julien Fischer
b955ef9024 Fix spelling.
extras/lex/regex.m:
    As above.
2023-03-12 14:44:02 +11:00
Julien Fischer
93dba486ec Update programming style in extras/lex.
extras/lex/lex.buf.m:
extras/lex/lex.lexeme.m:
extras/lex/lex.convert_NFA_to_DFA.m:
    As above.
2023-03-12 14:36:49 +11:00
Julien Fischer
7e10820891 Update programming style.
extras/lex/tests/test_regex.m:
    As above.

    Delete an unused function, that the stdlib now provides
    in any case.
2023-03-11 14:34:50 +11:00
Julien Fischer
52fc3915e7 Update extras/references.
extra/references/c_reference.h:
     Replace refernces to the old c_header_code and c_code
     pragmas.
2023-02-25 12:59:54 +11:00
Julien Fischer
9da35ef306 Replace the use '--' as a module qualifier.
Use typed insts.

extras/solver_types/library/*.m:
    As above.
2023-02-14 18:25:59 +11:00
Julien Fischer
b58aab912c Use a typed inst in a spot.
extras/align_right/align_right.m:
    As above.
2023-02-14 18:24:08 +11:00
Julien Fischer
4b28829101 Use typed insts in extras/lex.
extras/lex/lex.automata.m:
extras/lex/lex.buf.m:
extras/lex/lex.lexeme.m:
extras/lex/lex.m:
    As above.
2023-02-14 17:04:26 +11:00
Julien Fischer
a2db163e56 Use a typed inst in spot.
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    As above.
2023-02-14 16:49:09 +11:00
Julien Fischer
c4358adeeb Fix the windows installer generator sample
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    Get this compiling again.

    Add a vim modeline; convert tabs to spaces.
2023-02-14 16:46:51 +11:00
Julien Fischer
df5b302a60 Update more links.
extras/windows_installer_generator/sample/gen_merc_wxs.m:
    As above.

    Delete trailing whitespace.
2023-02-14 16:32:08 +11:00
Julien Fischer
844e8cb9fa Fix my previous commit.
extras/odbc/odbc.m:
    Use the correct link to the tech report.
2023-02-14 16:20:09 +11:00
Julien Fischer
e54727a01b Update a link to the papers page.
extras/odbc/odbc.m:
    As above.
2023-02-14 16:16:44 +11:00
Julien Fischer
41193dc437 Adjust some documentation for the Tcl/Tk binding.
extras/graphics/mercury_tcltk/Mmakefile.MacOSX:
extras/graphics/mercury_tcltk/README:
     As above.
2023-02-13 21:05:09 +11:00