Rename FX_Random_MT_GenerateMT() [pdfium : main]

0 views
Skip to first unread message

Andy Phan (Gerrit)

unread,
Feb 19, 2026, 7:22:29 PM (3 days ago) Feb 19
to Pdfium LUCI CQ, pdfium-...@googlegroups.com

Andy Phan added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Andy Phan . resolved

The function changes again in the next CL. This is just to make the review for the next CL a little easier, hopefully.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I92e11809eae2f051b9fc741b85277c50b5322f71
Gerrit-Change-Number: 143450
Gerrit-PatchSet: 1
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 00:22:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 19, 2026, 7:35:08 PM (3 days ago) Feb 19
to Andy Phan, Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com
Attention needed from Andy Phan

Lei Zhang voted and added 1 comment

Votes added by Lei Zhang

Code-Review+1

1 comment

File core/fxcrt/fx_random.cpp
Line 131, Patchset 1 (Latest): for (size_t i = 0; i < buffer.size(); ++i) {
Lei Zhang . unresolved

Can also do range-based for-loop here to further modernize this code.

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Phan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pdfium
Gerrit-Branch: main
Gerrit-Change-Id: I92e11809eae2f051b9fc741b85277c50b5322f71
Gerrit-Change-Number: 143450
Gerrit-PatchSet: 1
Gerrit-Owner: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-Attention: Andy Phan <andy...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Feb 2026 00:35:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Phan (Gerrit)

unread,
Feb 19, 2026, 7:42:53 PM (3 days ago) Feb 19
to Lei Zhang, Pdfium LUCI CQ, pdfium-...@googlegroups.com

Andy Phan added 1 comment

File core/fxcrt/fx_random.cpp
Line 131, Patchset 1: for (size_t i = 0; i < buffer.size(); ++i) {
Lei Zhang . resolved

Can also do range-based for-loop here to further modernize this code.

Andy Phan

Done

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I92e11809eae2f051b9fc741b85277c50b5322f71
    Gerrit-Change-Number: 143450
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Comment-Date: Fri, 20 Feb 2026 00:42:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    satisfied_requirement
    open
    diffy

    Pdfium LUCI CQ (Gerrit)

    unread,
    Feb 20, 2026, 5:23:36 PM (2 days ago) Feb 20
    to Andy Phan, Lei Zhang, pdfium-...@googlegroups.com

    Pdfium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    1 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: core/fxcrt/fx_random.cpp
    Insertions: 2, Deletions: 2.

    @@ -128,8 +128,8 @@

    void FX_Random_MT_Fill(pdfium::span<uint32_t> buffer) {
    void* context = ContextFromNextGlobalSeed();
    - for (size_t i = 0; i < buffer.size(); ++i) {
    - buffer[i] = FX_Random_MT_Generate(context);
    + for (uint32_t& val : buffer) {
    + val = FX_Random_MT_Generate(context);
    }
    FX_Random_MT_Close(context);
    }
    ```

    Change information

    Commit message:
    Rename FX_Random_MT_GenerateMT()

    FX_Random_MT_Generate() and FX_Random_GenerateMT() have really similar
    names, but one returns a random number and one fills a passed-in buffer
    with random numbers. Make the latter more distinguishable by renaming it
    to FX_Random_MT_Fill().

    Then, modernize the function by using modern naming style and a
    range-based for loop.
    Change-Id: I92e11809eae2f051b9fc741b85277c50b5322f71
    Commit-Queue: Andy Phan <andy...@chromium.org>
    Reviewed-by: Lei Zhang <the...@chromium.org>
    Files:
    • M core/fpdfapi/parser/cpdf_security_handler.cpp
    • M core/fxcrt/fx_random.cpp
    • M core/fxcrt/fx_random.h
    • M core/fxcrt/fx_random_unittest.cpp
    • M fxjs/xfa/cfxjse_formcalc_context.cpp
    Change size: S
    Delta: 5 files changed, 9 insertions(+), 9 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Lei Zhang
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: pdfium
    Gerrit-Branch: main
    Gerrit-Change-Id: I92e11809eae2f051b9fc741b85277c50b5322f71
    Gerrit-Change-Number: 143450
    Gerrit-PatchSet: 4
    Gerrit-Owner: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Andy Phan <andy...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages