Skip to content

cmp: Unnecessary use of usize for --bytes limit and --ignore-inital values #184

@GunterSchmidt

Description

@GunterSchmidt

The variables for --bytes, --ignore-initial and line count where size 'usize', thus limiting the readable bytes on 32-bit systems, while GNU cmp is compiled with LFS (Large File Support) and allows i64 values.

There is no reason to implement a 32-bit barrier for 32 bit machines,when Rust supports u64 on all systems.

The --bytes limit could be set to 'u128' to support really large numbers. The performance impact would be negligible, as there only few calculations each time a full block is read from the file.

I changed the variable types with PR #183 . This makes PR #172 obsolete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions