First batch of doc <-> header <-> source alignment#2604
Merged
fredrik-johansson merged 4 commits intoflintlib:mainfrom Mar 16, 2026
Merged
First batch of doc <-> header <-> source alignment#2604fredrik-johansson merged 4 commits intoflintlib:mainfrom
fredrik-johansson merged 4 commits intoflintlib:mainfrom
Conversation
Collaborator
|
Hmm, I think Edgar is alive after all |
src/ca_vec/ca_vec.c
Outdated
|
|
||
| void | ||
| ca_vec_printn(const ca_vec_t vec, slong digits, ca_ctx_t ctx) | ||
| ca_vec_printn(const ca_vec_t poly, slong digits, ca_ctx_t ctx) |
Collaborator
There was a problem hiding this comment.
vec seems more appropriate than poly here
Collaborator
There was a problem hiding this comment.
In the latest commit this still seems to be poly?
8e88593 to
4397734
Compare
1 task
Cases where the automated tool cannot safely rename, or where the header was the one that needed fixing: - thread_pool_init: header had 'l', source and doc use 'size' - _padic_poly_fprint_pretty: header had val/len swapped relative to the source definition (len, val). Also fix the wrapper _padic_poly_print_pretty to match. - ca_vec_set_length: header had 'res', source and doc agree on 'vec' - fmpz_lshift_mpn: header and source used terse names (d, dn, sgnbit), doc used more descriptive names (src, n, negative). Updated header and source to match the doc.
Rename parameters in docs and sources to match header declarations, applied via dev/check_param_names.py --fix --check-src. Remaining mismatches that could not be auto-fixed: - arb_calc_isolate_roots: source uses blocks/block but doc uses found/interval. The ADD_BLOCK macro captures these names, blocking rename. Doc names are more descriptive and used in prose. - _padic_poly_fprint_pretty, _padic_poly_print_pretty: val/len swap between header and source (fixed manually in previous commit) - padic_poly_set_coeff_padic: cannot rename source 'x' to 'c' due to collision with local variable 'c'
arb: arb_set, arb_set_si, arb_set_ui, arb_set_d, arb_set_fmpz, and arb_neg_round had x/y swapped relative to the rest of the arb module (convention: y = output, x = input). Updated header, source, and bodies. gr_poly: _gr_poly_div_series_newton and _gr_poly_div_series_invmul had A/B swapped between header and source. Convention is (res, A, Alen, B, Blen) where A is the dividend and B the divisor. Updated headers and sources to match. nmod_mat: nmod_mat_neg doc had A/B swapped vs header and source. Updated doc to match.
4397734 to
5887f10
Compare
Collaborator
|
This looks fine to merge once |
Member
Author
|
Fixed, sorry for the double error! |
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.
First batch of parameter name consistency fixes, applying the auto-fix tool from #2602 to
arb_calc,padic_poly, andca_vec, plus manual fixes and swap corrections found in other modules during review.The fixes are split into three commits to make review easier:
Commit 1: Manual fixes
Cases that need human judgement rather than automated renaming:
thread_poolthread_pool_initl->sizein headersizepadic_poly_padic_poly_fprint_prettyval, len->len, valin header and doc(val, len)but source had(len, val). Also fixed the_padic_poly_print_prettywrapper which was forwarding in the wrong orderpadic_polypadic_poly_set_coeff_padicf->polyin header and docpoly; header and doc both hadfca_vecca_vec_set_lengthres->vecin headervecfmpz_extrasfmpz_lshift_mpnd, dn, sgnbit->src, n, negativein header and sourceCommit 2: Auto-fix parameter names
Automated renames in
arb_calc,padic_poly, andca_vecwhere the source used different names from the header. Header names are treated as canonical.Notable cases:
padic_poly_set_coeff_padic: renaming parameterx->cin the source required also renaming a local variableint c->int allocto avoid a name collisionarb_calc_isolate_roots: renamedblocks->foundandblock->intervalin source to match headerCommit 3: Fix swapped parameter names
Cross-module swap fixes found by the checker's swap detection:
arbarb_set,arb_set_si,arb_set_ui,arb_set_d,arb_set_fmpz,arb_neg_roundx<->yin sourcey= output,x= input; these had it backwardsgr_poly_gr_poly_div_series_newton,_gr_poly_div_series_invmulA<->Bin source and doc(res, A, Alen, B, Blen)where A = dividend, B = divisor; source and doc had them flippednmod_matnmod_mat_negA<->Bin doc(A, B)but header and source both had(B, A)