Skip to content

cmp Feat: change data type for 'bytes' limit and 'ignore initial' to u64#183

Open
GunterSchmidt wants to merge 6 commits intouutils:mainfrom
GunterSchmidt:feat-cmp--change-data-type---bytes-limit-to-u64/u128---ignore-initial--u64
Open

cmp Feat: change data type for 'bytes' limit and 'ignore initial' to u64#183
GunterSchmidt wants to merge 6 commits intouutils:mainfrom
GunterSchmidt:feat-cmp--change-data-type---bytes-limit-to-u64/u128---ignore-initial--u64

Conversation

@GunterSchmidt
Copy link
Contributor

feat: u64 for --bytes and --ignore-initial
fix: bumped up tempfile to "3.26.0"

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

This is now all u64, which works also on 32-bit systems with Rust. There is no reason to implement a 32-bit barrier for 32 bit machines.

Additionally the --bytes limit can be set to 'u128' using the feature "cmp_bytes_limit_128_bit".

The performance impact would be negligible, as there only few calculations each time a full block is read from the file.

This makes PR #172 obsolete.

Gunter Schmidt added 2 commits March 1, 2026 22:37
fix: bumped up tempfile to "3.26.0"

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

This is now all u64, which works also on 32-bit systems with Rust.
There is no reason to implement a 32-bit barrier for 32 bit machines.

Additionally the --bytes limit can be set to 'u128' using the feature
"cmp_bytes_limit_128_bit".

The performance impact would be negligible, as there only few calculations
each time a full block is read from the file.
@GunterSchmidt
Copy link
Contributor Author

Fixed clippy warning.

u64 seems the max file size with Rust, which is an Exabyte.

Renamed type to Skip as this seems preferred.
@GunterSchmidt GunterSchmidt changed the title cmp Feat: change data type bytes limit to u64/u128 ignore initial u64 cmp Feat: change data type for 'bytes' limit and 'ignore initial' to u64 Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants