Skip to content

Commit c4d0256

Browse files
bjorn3folkertdev
authored andcommitted
Make many statics immutable
1 parent f5cffbf commit c4d0256

27 files changed

+172
-190
lines changed

lib/common/fse_decompress_old.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ unsafe extern "C" fn BIT_reloadDStream(mut bitD: *mut BIT_DStream_t) -> BIT_DStr
310310
as std::ffi::c_long
311311
!= 0
312312
{
313-
static mut zeroFilled: BitContainerType = 0 as std::ffi::c_int as BitContainerType;
313+
static zeroFilled: BitContainerType = 0 as std::ffi::c_int as BitContainerType;
314314
(*bitD).ptr = &zeroFilled as *const BitContainerType as *const std::ffi::c_char;
315315
return BIT_DStream_overflow;
316316
}

lib/compress/fse_compress.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ unsafe extern "C" fn ZSTD_countLeadingZeros32(mut val: u32) -> std::ffi::c_uint
9595
unsafe extern "C" fn ZSTD_highbit32(mut val: u32) -> std::ffi::c_uint {
9696
(31 as std::ffi::c_int as std::ffi::c_uint).wrapping_sub(ZSTD_countLeadingZeros32(val))
9797
}
98-
static mut BIT_mask: [std::ffi::c_uint; 32] = [
98+
static BIT_mask: [std::ffi::c_uint; 32] = [
9999
0 as std::ffi::c_int as std::ffi::c_uint,
100100
1 as std::ffi::c_int as std::ffi::c_uint,
101101
3 as std::ffi::c_int as std::ffi::c_uint,
@@ -763,7 +763,7 @@ pub unsafe extern "C" fn FSE_normalizeCount(
763763
if tableLog < FSE_minTableLog(total, maxSymbolValue) {
764764
return -(ZSTD_error_GENERIC as std::ffi::c_int) as size_t;
765765
}
766-
static mut rtbTable: [u32; 8] = [0, 473195, 504333, 520860, 550000, 700000, 750000, 830000];
766+
static rtbTable: [u32; 8] = [0, 473195, 504333, 520860, 550000, 700000, 750000, 830000];
767767
let lowProbCount = (if useLowProbCount != 0 { -(1) } else { 1 }) as std::ffi::c_short;
768768
let scale = (62 as std::ffi::c_int as std::ffi::c_uint).wrapping_sub(tableLog) as u64;
769769
let step = ((1) << 62) / total as u32 as u64;

lib/compress/zstd_compress.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,12 @@ pub const ZSTD_WINDOW_START_INDEX: std::ffi::c_int = 2;
694694
pub const ZSTD_MAX_NB_BLOCK_SPLITS: std::ffi::c_int = 196;
695695
#[inline]
696696
unsafe extern "C" fn ZSTD_LLcode(mut litLength: u32) -> u32 {
697-
static mut LL_Code: [u8; 64] = [
697+
static LL_Code: [u8; 64] = [
698698
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20,
699699
20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
700700
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
701701
];
702-
static mut LL_deltaCode: u32 = 19;
702+
static LL_deltaCode: u32 = 19;
703703
if litLength > 63 {
704704
(ZSTD_highbit32(litLength)).wrapping_add(LL_deltaCode)
705705
} else {
@@ -708,15 +708,15 @@ unsafe extern "C" fn ZSTD_LLcode(mut litLength: u32) -> u32 {
708708
}
709709
#[inline]
710710
unsafe extern "C" fn ZSTD_MLcode(mut mlBase: u32) -> u32 {
711-
static mut ML_Code: [u8; 128] = [
711+
static ML_Code: [u8; 128] = [
712712
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
713713
25, 26, 27, 28, 29, 30, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37,
714714
38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 40,
715715
40, 40, 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
716716
41, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
717717
42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
718718
];
719-
static mut ML_deltaCode: u32 = 36;
719+
static ML_deltaCode: u32 = 36;
720720
if mlBase > 127 {
721721
(ZSTD_highbit32(mlBase)).wrapping_add(ML_deltaCode)
722722
} else {
@@ -1272,10 +1272,10 @@ use crate::{
12721272
pub const ZSTD_isError: unsafe extern "C" fn(size_t) -> std::ffi::c_uint = ERR_isError;
12731273
pub const ZSTD_OPT_NUM: std::ffi::c_int = (1) << 12;
12741274
pub const ZSTD_REP_NUM: std::ffi::c_int = 3;
1275-
static mut repStartValue: [u32; 3] = [1, 4, 8];
1275+
static repStartValue: [u32; 3] = [1, 4, 8];
12761276
pub const ZSTD_WINDOWLOG_ABSOLUTEMIN: std::ffi::c_int = 10;
12771277
pub const ZSTD_BLOCKHEADERSIZE: std::ffi::c_int = 3;
1278-
static mut ZSTD_blockHeaderSize: size_t = ZSTD_BLOCKHEADERSIZE as size_t;
1278+
static ZSTD_blockHeaderSize: size_t = ZSTD_BLOCKHEADERSIZE as size_t;
12791279
pub const MIN_CBLOCK_SIZE: std::ffi::c_int = 1 + 1;
12801280
pub const LONGNBSEQ: std::ffi::c_int = 0x7f00 as std::ffi::c_int;
12811281
pub const MINMATCH: std::ffi::c_int = 3;
@@ -1288,11 +1288,11 @@ pub const MaxOff: std::ffi::c_int = 31;
12881288
pub const MLFSELog: std::ffi::c_int = 9;
12891289
pub const LLFSELog: std::ffi::c_int = 9;
12901290
pub const OffFSELog: std::ffi::c_int = 8;
1291-
static mut LL_bits: [u8; 36] = [
1291+
static LL_bits: [u8; 36] = [
12921292
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11,
12931293
12, 13, 14, 15, 16,
12941294
];
1295-
static mut LL_defaultNorm: [S16; 36] = [
1295+
static LL_defaultNorm: [S16; 36] = [
12961296
4,
12971297
3,
12981298
2,
@@ -1331,12 +1331,12 @@ static mut LL_defaultNorm: [S16; 36] = [
13311331
-(1) as S16,
13321332
];
13331333
pub const LL_DEFAULTNORMLOG: std::ffi::c_int = 6;
1334-
static mut LL_defaultNormLog: u32 = LL_DEFAULTNORMLOG as u32;
1335-
static mut ML_bits: [u8; 53] = [
1334+
static LL_defaultNormLog: u32 = LL_DEFAULTNORMLOG as u32;
1335+
static ML_bits: [u8; 53] = [
13361336
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13371337
1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
13381338
];
1339-
static mut ML_defaultNorm: [S16; 53] = [
1339+
static ML_defaultNorm: [S16; 53] = [
13401340
1,
13411341
4,
13421342
3,
@@ -1392,8 +1392,8 @@ static mut ML_defaultNorm: [S16; 53] = [
13921392
-(1) as S16,
13931393
];
13941394
pub const ML_DEFAULTNORMLOG: std::ffi::c_int = 6;
1395-
static mut ML_defaultNormLog: u32 = ML_DEFAULTNORMLOG as u32;
1396-
static mut OF_defaultNorm: [S16; 29] = [
1395+
static ML_defaultNormLog: u32 = ML_DEFAULTNORMLOG as u32;
1396+
static OF_defaultNorm: [S16; 29] = [
13971397
1,
13981398
1,
13991399
1,
@@ -1425,7 +1425,7 @@ static mut OF_defaultNorm: [S16; 29] = [
14251425
-(1) as S16,
14261426
];
14271427
pub const OF_DEFAULTNORMLOG: std::ffi::c_int = 5;
1428-
static mut OF_defaultNormLog: u32 = OF_DEFAULTNORMLOG as u32;
1428+
static OF_defaultNormLog: u32 = OF_DEFAULTNORMLOG as u32;
14291429
unsafe extern "C" fn ZSTD_copy8(mut dst: *mut std::ffi::c_void, mut src: *const std::ffi::c_void) {
14301430
libc::memcpy(dst, src, 8 as libc::size_t);
14311431
}
@@ -3884,7 +3884,7 @@ unsafe extern "C" fn ZSTD_adjustCParams_internal(
38843884
}
38853885
if srcSize <= maxWindowResize as std::ffi::c_ulonglong && dictSize <= maxWindowResize {
38863886
let tSize = srcSize.wrapping_add(dictSize as std::ffi::c_ulonglong) as u32;
3887-
static mut hashSizeMin: u32 = ((1) << ZSTD_HASHLOG_MIN) as u32;
3887+
static hashSizeMin: u32 = ((1) << ZSTD_HASHLOG_MIN) as u32;
38883888
let srcLog = if tSize < hashSizeMin {
38893889
ZSTD_HASHLOG_MIN as std::ffi::c_uint
38903890
} else {
@@ -4874,7 +4874,7 @@ pub unsafe extern "C" fn ZSTD_invalidateRepCodes(mut cctx: *mut ZSTD_CCtx) {
48744874
i += 1;
48754875
}
48764876
}
4877-
static mut attachDictSizeCutoffs: [size_t; 10] = [
4877+
static attachDictSizeCutoffs: [size_t; 10] = [
48784878
(8 * ((1) << 10)) as size_t,
48794879
(8 * ((1) << 10)) as size_t,
48804880
(16 * ((1) << 10)) as size_t,
@@ -5699,7 +5699,7 @@ pub unsafe extern "C" fn ZSTD_selectBlockCompressor(
56995699
mut useRowMatchFinder: ZSTD_ParamSwitch_e,
57005700
mut dictMode: ZSTD_dictMode_e,
57015701
) -> ZSTD_BlockCompressor_f {
5702-
static mut blockCompressor: [[ZSTD_BlockCompressor_f; 10]; 4] = unsafe {
5702+
static blockCompressor: [[ZSTD_BlockCompressor_f; 10]; 4] = unsafe {
57035703
[
57045704
[
57055705
Some(
@@ -5821,7 +5821,7 @@ pub unsafe extern "C" fn ZSTD_selectBlockCompressor(
58215821
};
58225822
let mut selectedCompressor: ZSTD_BlockCompressor_f = None;
58235823
if ZSTD_rowMatchFinderUsed(strat, useRowMatchFinder) != 0 {
5824-
static mut rowBasedBlockCompressors: [[ZSTD_BlockCompressor_f; 3]; 4] = [
5824+
static rowBasedBlockCompressors: [[ZSTD_BlockCompressor_f; 3]; 4] = [
58255825
[
58265826
Some(ZSTD_COMPRESSBLOCK_GREEDY_ROW),
58275827
Some(ZSTD_COMPRESSBLOCK_LAZY_ROW),
@@ -7477,7 +7477,7 @@ unsafe extern "C" fn ZSTD_optimalBlockSize(
74777477
mut strat: ZSTD_strategy,
74787478
mut savings: S64,
74797479
) -> size_t {
7480-
static mut splitLevels: [std::ffi::c_int; 10] = [0, 0, 1, 2, 2, 3, 3, 4, 4, 4];
7480+
static splitLevels: [std::ffi::c_int; 10] = [0, 0, 1, 2, 2, 3, 3, 4, 4, 4];
74817481
if srcSize < (128 * ((1) << 10)) as size_t || blockSizeMax < (128 * ((1) << 10)) as size_t {
74827482
return if srcSize < blockSizeMax {
74837483
srcSize
@@ -12105,7 +12105,7 @@ pub unsafe extern "C" fn ZSTD_getParams(
1210512105
}
1210612106
pub const __INT_MAX__: std::ffi::c_int = 2147483647;
1210712107
pub const ZSTD_MAX_CLEVEL: std::ffi::c_int = 22;
12108-
static mut ZSTD_defaultCParameters: [[ZSTD_compressionParameters; 23]; 4] = [
12108+
static ZSTD_defaultCParameters: [[ZSTD_compressionParameters; 23]; 4] = [
1210912109
[
1211012110
{
1211112111
ZSTD_compressionParameters {

lib/compress/zstd_compress_sequences.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ unsafe extern "C" fn _force_has_format_string(mut format: *const std::ffi::c_cha
115115
pub const MLFSELog: std::ffi::c_int = 9;
116116
pub const LLFSELog: std::ffi::c_int = 9;
117117
pub const OffFSELog: std::ffi::c_int = 8;
118-
static mut LL_bits: [u8; 36] = [
118+
static LL_bits: [u8; 36] = [
119119
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11,
120120
12, 13, 14, 15, 16,
121121
];
122-
static mut ML_bits: [u8; 53] = [
122+
static ML_bits: [u8; 53] = [
123123
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
124124
1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
125125
];
@@ -200,7 +200,7 @@ unsafe extern "C" fn FSE_bitCost(
200200
let bitMultiplier = ((1) << accuracyLog) as u32;
201201
(minNbBits.wrapping_add(1) * bitMultiplier).wrapping_sub(normalizedDeltaFromThreshold)
202202
}
203-
static mut BIT_mask: [std::ffi::c_uint; 32] = [
203+
static BIT_mask: [std::ffi::c_uint; 32] = [
204204
0,
205205
1,
206206
3,
@@ -298,7 +298,7 @@ unsafe extern "C" fn BIT_closeCStream(mut bitC: *mut BIT_CStream_t) -> size_t {
298298
(((*bitC).ptr).offset_from((*bitC).startPtr) as std::ffi::c_long as size_t)
299299
.wrapping_add(((*bitC).bitPos > 0) as std::ffi::c_int as size_t)
300300
}
301-
static mut kInverseProbabilityLog256: [std::ffi::c_uint; 256] = [
301+
static kInverseProbabilityLog256: [std::ffi::c_uint; 256] = [
302302
0, 2048, 1792, 1642, 1536, 1453, 1386, 1329, 1280, 1236, 1197, 1162, 1130, 1100, 1073, 1047,
303303
1024, 1001, 980, 960, 941, 923, 906, 889, 874, 859, 844, 830, 817, 804, 791, 779, 768, 756,
304304
745, 734, 724, 714, 704, 694, 685, 676, 667, 658, 650, 642, 633, 626, 618, 610, 603, 595, 588,

lib/compress/zstd_compress_superblock.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,18 @@ unsafe extern "C" fn MEM_writeLE32(mut memPtr: *mut std::ffi::c_void, mut val32:
403403
pub const ZSTD_isError: unsafe extern "C" fn(size_t) -> std::ffi::c_uint = ERR_isError;
404404
pub const ZSTD_REP_NUM: std::ffi::c_int = 3;
405405
pub const ZSTD_BLOCKHEADERSIZE: std::ffi::c_int = 3;
406-
static mut ZSTD_blockHeaderSize: size_t = ZSTD_BLOCKHEADERSIZE as size_t;
406+
static ZSTD_blockHeaderSize: size_t = ZSTD_BLOCKHEADERSIZE as size_t;
407407
pub const LONGNBSEQ: std::ffi::c_int = 0x7f00 as std::ffi::c_int;
408408
pub const MINMATCH: std::ffi::c_int = 3;
409409
pub const MaxML: std::ffi::c_int = 52;
410410
pub const MaxLL: std::ffi::c_int = 35;
411411
pub const DefaultMaxOff: std::ffi::c_int = 28;
412412
pub const MaxOff: std::ffi::c_int = 31;
413-
static mut LL_bits: [u8; 36] = [
413+
static LL_bits: [u8; 36] = [
414414
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11,
415415
12, 13, 14, 15, 16,
416416
];
417-
static mut LL_defaultNorm: [i16; 36] = [
417+
static LL_defaultNorm: [i16; 36] = [
418418
4,
419419
3,
420420
2,
@@ -453,12 +453,12 @@ static mut LL_defaultNorm: [i16; 36] = [
453453
-(1) as i16,
454454
];
455455
pub const LL_DEFAULTNORMLOG: std::ffi::c_int = 6;
456-
static mut LL_defaultNormLog: u32 = LL_DEFAULTNORMLOG as u32;
457-
static mut ML_bits: [u8; 53] = [
456+
static LL_defaultNormLog: u32 = LL_DEFAULTNORMLOG as u32;
457+
static ML_bits: [u8; 53] = [
458458
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
459459
1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
460460
];
461-
static mut ML_defaultNorm: [i16; 53] = [
461+
static ML_defaultNorm: [i16; 53] = [
462462
1,
463463
4,
464464
3,
@@ -514,8 +514,8 @@ static mut ML_defaultNorm: [i16; 53] = [
514514
-(1) as i16,
515515
];
516516
pub const ML_DEFAULTNORMLOG: std::ffi::c_int = 6;
517-
static mut ML_defaultNormLog: u32 = ML_DEFAULTNORMLOG as u32;
518-
static mut OF_defaultNorm: [i16; 29] = [
517+
static ML_defaultNormLog: u32 = ML_DEFAULTNORMLOG as u32;
518+
static OF_defaultNorm: [i16; 29] = [
519519
1,
520520
1,
521521
1,
@@ -547,7 +547,7 @@ static mut OF_defaultNorm: [i16; 29] = [
547547
-(1) as i16,
548548
];
549549
pub const OF_DEFAULTNORMLOG: std::ffi::c_int = 5;
550-
static mut OF_defaultNormLog: u32 = OF_DEFAULTNORMLOG as u32;
550+
static OF_defaultNormLog: u32 = OF_DEFAULTNORMLOG as u32;
551551
unsafe extern "C" fn ERR_isError(mut code: size_t) -> std::ffi::c_uint {
552552
(code > -(ZSTD_error_maxCode as std::ffi::c_int) as size_t) as std::ffi::c_int
553553
as std::ffi::c_uint

lib/compress/zstd_double_fast.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,38 +283,38 @@ unsafe extern "C" fn ZSTD_count_2segments(
283283
}
284284
matchLength.wrapping_add(ZSTD_count(ip.offset(matchLength as isize), iStart, iEnd))
285285
}
286-
static mut prime4bytes: u32 = 2654435761;
286+
static prime4bytes: u32 = 2654435761;
287287
unsafe extern "C" fn ZSTD_hash4(mut u: u32, mut h: u32, mut s: u32) -> u32 {
288288
((u * prime4bytes) ^ s) >> (32 as std::ffi::c_int as u32).wrapping_sub(h)
289289
}
290290
unsafe extern "C" fn ZSTD_hash4Ptr(mut ptr: *const std::ffi::c_void, mut h: u32) -> size_t {
291291
ZSTD_hash4(MEM_readLE32(ptr), h, 0) as size_t
292292
}
293-
static mut prime5bytes: u64 = 889523592379;
293+
static prime5bytes: u64 = 889523592379;
294294
unsafe extern "C" fn ZSTD_hash5(mut u: u64, mut h: u32, mut s: u64) -> size_t {
295295
(((u << (64 as std::ffi::c_int - 40 as std::ffi::c_int)) * prime5bytes) ^ s)
296296
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
297297
}
298298
unsafe extern "C" fn ZSTD_hash5Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
299299
ZSTD_hash5(MEM_readLE64(p), h, 0)
300300
}
301-
static mut prime6bytes: u64 = 227718039650203;
301+
static prime6bytes: u64 = 227718039650203;
302302
unsafe extern "C" fn ZSTD_hash6(mut u: u64, mut h: u32, mut s: u64) -> size_t {
303303
(((u << (64 as std::ffi::c_int - 48 as std::ffi::c_int)) * prime6bytes) ^ s)
304304
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
305305
}
306306
unsafe extern "C" fn ZSTD_hash6Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
307307
ZSTD_hash6(MEM_readLE64(p), h, 0)
308308
}
309-
static mut prime7bytes: u64 = 58295818150454627;
309+
static prime7bytes: u64 = 58295818150454627;
310310
unsafe extern "C" fn ZSTD_hash7(mut u: u64, mut h: u32, mut s: u64) -> size_t {
311311
(((u << (64 as std::ffi::c_int - 56 as std::ffi::c_int)) * prime7bytes) ^ s)
312312
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
313313
}
314314
unsafe extern "C" fn ZSTD_hash7Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
315315
ZSTD_hash7(MEM_readLE64(p), h, 0)
316316
}
317-
static mut prime8bytes: u64 = 0xcf1bbcdcb7a56463 as std::ffi::c_ulonglong as u64;
317+
static prime8bytes: u64 = 0xcf1bbcdcb7a56463 as std::ffi::c_ulonglong as u64;
318318
unsafe extern "C" fn ZSTD_hash8(mut u: u64, mut h: u32, mut s: u64) -> size_t {
319319
((u * prime8bytes) ^ s) >> (64 as std::ffi::c_int as u32).wrapping_sub(h)
320320
}

lib/compress/zstd_fast.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,38 +283,38 @@ unsafe extern "C" fn ZSTD_count_2segments(
283283
}
284284
matchLength.wrapping_add(ZSTD_count(ip.offset(matchLength as isize), iStart, iEnd))
285285
}
286-
static mut prime4bytes: u32 = 2654435761;
286+
static prime4bytes: u32 = 2654435761;
287287
unsafe extern "C" fn ZSTD_hash4(mut u: u32, mut h: u32, mut s: u32) -> u32 {
288288
((u * prime4bytes) ^ s) >> (32 as std::ffi::c_int as u32).wrapping_sub(h)
289289
}
290290
unsafe extern "C" fn ZSTD_hash4Ptr(mut ptr: *const std::ffi::c_void, mut h: u32) -> size_t {
291291
ZSTD_hash4(MEM_readLE32(ptr), h, 0) as size_t
292292
}
293-
static mut prime5bytes: u64 = 889523592379;
293+
static prime5bytes: u64 = 889523592379;
294294
unsafe extern "C" fn ZSTD_hash5(mut u: u64, mut h: u32, mut s: u64) -> size_t {
295295
(((u << (64 as std::ffi::c_int - 40 as std::ffi::c_int)) * prime5bytes) ^ s)
296296
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
297297
}
298298
unsafe extern "C" fn ZSTD_hash5Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
299299
ZSTD_hash5(MEM_readLE64(p), h, 0)
300300
}
301-
static mut prime6bytes: u64 = 227718039650203;
301+
static prime6bytes: u64 = 227718039650203;
302302
unsafe extern "C" fn ZSTD_hash6(mut u: u64, mut h: u32, mut s: u64) -> size_t {
303303
(((u << (64 as std::ffi::c_int - 48 as std::ffi::c_int)) * prime6bytes) ^ s)
304304
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
305305
}
306306
unsafe extern "C" fn ZSTD_hash6Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
307307
ZSTD_hash6(MEM_readLE64(p), h, 0)
308308
}
309-
static mut prime7bytes: u64 = 58295818150454627;
309+
static prime7bytes: u64 = 58295818150454627;
310310
unsafe extern "C" fn ZSTD_hash7(mut u: u64, mut h: u32, mut s: u64) -> size_t {
311311
(((u << (64 as std::ffi::c_int - 56 as std::ffi::c_int)) * prime7bytes) ^ s)
312312
>> (64 as std::ffi::c_int as u32).wrapping_sub(h)
313313
}
314314
unsafe extern "C" fn ZSTD_hash7Ptr(mut p: *const std::ffi::c_void, mut h: u32) -> size_t {
315315
ZSTD_hash7(MEM_readLE64(p), h, 0)
316316
}
317-
static mut prime8bytes: u64 = 0xcf1bbcdcb7a56463 as std::ffi::c_ulonglong as u64;
317+
static prime8bytes: u64 = 0xcf1bbcdcb7a56463 as std::ffi::c_ulonglong as u64;
318318
unsafe extern "C" fn ZSTD_hash8(mut u: u64, mut h: u32, mut s: u64) -> size_t {
319319
((u * prime8bytes) ^ s) >> (64 as std::ffi::c_int as u32).wrapping_sub(h)
320320
}
@@ -572,7 +572,7 @@ unsafe extern "C" fn ZSTD_match4Found_cmov(
572572
mut matchIdx: u32,
573573
mut idxLowLimit: u32,
574574
) -> std::ffi::c_int {
575-
static mut dummy: [u8; 4] = [
575+
static dummy: [u8; 4] = [
576576
0x12 as std::ffi::c_int as u8,
577577
0x34 as std::ffi::c_int as u8,
578578
0x56 as std::ffi::c_int as u8,

0 commit comments

Comments
 (0)