Fix param names manual#2601
Merged
fredrik-johansson merged 3 commits intoflintlib:mainfrom Mar 11, 2026
Merged
Conversation
Manual fixes for 5 functions where the doc signature had wrong parameter counts compared to header+source: - gr_mpoly_write_pretty/print_pretty: remove stale x parameter - _gr_poly_get_str: add missing len parameter, fix type to gr_srcptr - _nmod_poly_evaluate_geometric_nmod_vec_fast_precomp: add missing mod - fprint_memory_usage: add missing param name fs in header - qsieve_parse_relation: remove stale str parameter
Several function declarations in headers omitted parameter names, making it harder to understand function signatures at a glance and causing mismatches with their source definitions. Headers fixed: fmpz.h, fq_nmod.h, fq_zech.h, mpn_extras.h, nmod_mat.h, acb_dft.h, fmpq_mpoly.h
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of the effort started in #1895 to make parameter names consistent across headers, docs, and sources. I have since built a proper tool (
dev/check_param_names.py, coming in a separate PR) that can automatically detect and fix ~2500 name mismatches. However, the cases below involve parameter count mismatches or type errors that the tool cannot auto-fix, so they need manual attention first.This PR supersedes #1895.
Commit 1: Fix parameter count mismatches in docs and headers
These are cases where the doc signature had a different number of parameters than the actual code, or had the wrong type.
gr_mpoly_write_pretty/gr_mpoly_print_pretty(doc/source/gr_mpoly.rst): The docs listed aconst char ** xparameter that doesn't exist in the header or source. The functions were changed to not take variable name strings, but the docs were never updated. Removed the stale parameter and description._gr_poly_get_str(doc/source/gr_poly.rst): The doc signature usedconst gr_poly_t f(a polynomial struct), but this is an underscore-prefixed internal function that takes raw arrays. Fixed togr_srcptr f, slong lento match the actual header/source signature._nmod_poly_evaluate_geometric_nmod_vec_fast_precomp(doc/source/nmod_poly.rst): The doc signature was missing the finalnmod_t modparameter that exists in both the header and source.fprint_memory_usage(src/profiler.h): The header declarationvoid fprint_memory_usage(FILE *)omitted the parameter name. Addedfsto match the source definition.qsieve_parse_relation(doc/source/qsieve.rst): The doc signature listedchar * stras a parameter, but the function only takesqs_t qs_infin both the header and source. The string is read internally, not passed as an argument. Removed the stale parameter.Commit 2: Add missing parameter names in header declarations
These are header declarations where some or all parameter names were omitted. The names added match the source definitions exactly.
_fmpz_clear_readonly_mpz(src/fmpz.h):(mpz_t)->(mpz_t z)fq_nmod_ctx_init,_fq_nmod_ctx_init_conway,fq_nmod_ctx_init_conway(src/fq_nmod.h): all three had(fq_nmod_ctx_t, fmpz_t, slong, const char *)with no names; addedctx, p, d, varfq_zech_ctx_init,_fq_zech_ctx_init_conway,fq_zech_ctx_init_conway,fq_zech_ctx_init_random(src/fq_zech.h): same pattern, addedctx, p, d, varfq_zech_ctx_order(src/fq_zech.h):(fmpz_t, const fq_zech_ctx_t)->(fmpz_t f, const fq_zech_ctx_t ctx)flint_mpn_mul_toom22,flint_mpn_mul_toom32(src/mpn_extras.h): all 6 parameters unnamed; addedpp, ap, an, bp, bn, scratch_flint_mpn_sqrhigh(src/mpn_extras.h):(mp_ptr, mp_srcptr, mp_size_t)->(mp_ptr res, mp_srcptr u, mp_size_t n)nmod_mat_randrank(src/nmod_mat.h): first parameternmod_mat_thad no name while the rest did; addedmatacb_dft_convol_rad2_precomp(src/acb_dft.h):const acb_dft_rad2_thad no name while all other parameters did; addedrad2fmpq_mpoly_reduce_easy(src/fmpq_mpoly.h):const fmpq_mpoly_ctx_thad no name; addedctxCommit 3
Commit 3 updates doc descriptions that became stale after the signature fixes: