@@ -4704,7 +4704,7 @@ unsafe fn ZSTD_buildSequencesStatistics(
47044704 ) as u32 ;
47054705 let countSize = ZSTD_buildCTable (
47064706 op as * mut core:: ffi:: c_void ,
4707- oend. offset_from ( op) as size_t ,
4707+ oend. offset_from_unsigned ( op) ,
47084708 CTable_LitLength ,
47094709 LLFSELog as u32 ,
47104710 stats. LLtype as SymbolEncodingType_e ,
@@ -4758,7 +4758,7 @@ unsafe fn ZSTD_buildSequencesStatistics(
47584758 ) as u32 ;
47594759 let countSize_0 = ZSTD_buildCTable (
47604760 op as * mut core:: ffi:: c_void ,
4761- oend. offset_from ( op) as size_t ,
4761+ oend. offset_from_unsigned ( op) ,
47624762 CTable_OffsetBits ,
47634763 OffFSELog as u32 ,
47644764 stats. Offtype as SymbolEncodingType_e ,
@@ -4807,7 +4807,7 @@ unsafe fn ZSTD_buildSequencesStatistics(
48074807 ) as u32 ;
48084808 let countSize_1 = ZSTD_buildCTable (
48094809 op as * mut core:: ffi:: c_void ,
4810- oend. offset_from ( op) as size_t ,
4810+ oend. offset_from_unsigned ( op) ,
48114811 CTable_MatchLength ,
48124812 MLFSELog as u32 ,
48134813 stats. MLtype as SymbolEncodingType_e ,
@@ -4831,7 +4831,7 @@ unsafe fn ZSTD_buildSequencesStatistics(
48314831 stats. lastCountSize = countSize_1;
48324832 }
48334833 op = op. add ( countSize_1) ;
4834- stats. size = op. offset_from ( ostart) as size_t ;
4834+ stats. size = op. offset_from_unsigned ( ostart) ;
48354835 stats
48364836}
48374837pub const SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO : core:: ffi:: c_int = 20 ;
@@ -4919,7 +4919,7 @@ unsafe fn ZSTD_entropyCompressSeqStore_internal(
49194919 & ( * prevEntropy) . fse as * const ZSTD_fseCTables_t as * const core:: ffi:: c_void ,
49204920 :: core:: mem:: size_of :: < ZSTD_fseCTables_t > ( ) ,
49214921 ) ;
4922- return op. offset_from ( ostart) as size_t ;
4922+ return op. offset_from_unsigned ( ostart) ;
49234923 }
49244924 let fresh3 = op;
49254925 op = op. add ( 1 ) ;
@@ -4948,7 +4948,7 @@ unsafe fn ZSTD_entropyCompressSeqStore_internal(
49484948 longOffsets = stats. longOffsets ;
49494949 let bitstreamSize = ZSTD_encodeSequences (
49504950 op as * mut core:: ffi:: c_void ,
4951- oend. offset_from ( op) as size_t ,
4951+ oend. offset_from_unsigned ( op) ,
49524952 CTable_MatchLength ,
49534953 mlCodeTable,
49544954 CTable_OffsetBits ,
@@ -4968,7 +4968,7 @@ unsafe fn ZSTD_entropyCompressSeqStore_internal(
49684968 if lastCountSize != 0 && lastCountSize. wrapping_add ( bitstreamSize) < 4 {
49694969 return 0 ;
49704970 }
4971- op. offset_from ( ostart) as size_t
4971+ op. offset_from_unsigned ( ostart)
49724972}
49734973unsafe fn ZSTD_entropyCompressSeqStore_wExtLitBuffer (
49744974 dst : * mut core:: ffi:: c_void ,
@@ -5461,7 +5461,7 @@ unsafe fn ZSTD_copyBlockSequences(
54615461 prevRepcodes : * const u32 ,
54625462) -> size_t {
54635463 let inSeqs: * const SeqDef = ( * seqStore) . sequencesStart ;
5464- let nbInSequences = ( ( * seqStore) . sequences ) . offset_from ( inSeqs) as size_t ;
5464+ let nbInSequences = ( ( * seqStore) . sequences ) . offset_from_unsigned ( inSeqs) ;
54655465 let nbInLiterals = ( ( * seqStore) . lit ) . offset_from ( ( * seqStore) . litStart ) as size_t ;
54665466 let outSeqs = if ( * seqCollector) . seqIndex == 0 {
54675467 ( * seqCollector) . seqStart
@@ -5681,7 +5681,7 @@ unsafe fn ZSTD_buildBlockEntropyStats_literals(
56815681 let countWkspSize = ( ( HUF_SYMBOLVALUE_MAX + 1 ) as size_t )
56825682 . wrapping_mul ( :: core:: mem:: size_of :: < core:: ffi:: c_uint > ( ) ) ;
56835683 let nodeWksp = countWkspStart. add ( countWkspSize) ;
5684- let nodeWkspSize = wkspEnd. offset_from ( nodeWksp) as size_t ;
5684+ let nodeWkspSize = wkspEnd. offset_from_unsigned ( nodeWksp) ;
56855685 let mut maxSymbolValue = HUF_SYMBOLVALUE_MAX as core:: ffi:: c_uint ;
56865686 let mut huffLog = LitHufLog as core:: ffi:: c_uint ;
56875687 let mut repeat = ( * prevHuf) . repeatMode ;
@@ -6142,7 +6142,7 @@ unsafe fn ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize(
61426142 }
61436143 ZSTD_estimateBlockSize (
61446144 seqStore. litStart ,
6145- ( seqStore. lit ) . offset_from ( seqStore. litStart ) as size_t ,
6145+ ( seqStore. lit ) . offset_from_unsigned ( seqStore. litStart ) ,
61466146 seqStore. ofCode ,
61476147 seqStore. llCode ,
61486148 seqStore. mlCode ,
@@ -6937,7 +6937,7 @@ unsafe fn ZSTD_compress_frameChunk(
69376937 if lastFrameChunk != 0 && op > ostart {
69386938 ( * cctx) . stage = ZSTDcs_ending ;
69396939 }
6940- op. offset_from ( ostart) as size_t
6940+ op. offset_from_unsigned ( ostart)
69416941}
69426942unsafe fn ZSTD_writeFrameHeader (
69436943 dst : * mut core:: ffi:: c_void ,
@@ -7375,7 +7375,7 @@ pub unsafe fn ZSTD_loadCEntropy(
73757375 ( ( * bs) . entropy . huf . CTable ) . as_mut_ptr ( ) ,
73767376 & mut maxSymbolValue,
73777377 dictPtr as * const core:: ffi:: c_void ,
7378- dictEnd. offset_from ( dictPtr) as size_t ,
7378+ dictEnd. offset_from_unsigned ( dictPtr) ,
73797379 & mut hasZeroWeights,
73807380 ) ;
73817381 if hasZeroWeights == 0 && maxSymbolValue == 255 {
@@ -7391,7 +7391,7 @@ pub unsafe fn ZSTD_loadCEntropy(
73917391 & mut offcodeMaxValue,
73927392 & mut offcodeLog,
73937393 dictPtr as * const core:: ffi:: c_void ,
7394- dictEnd. offset_from ( dictPtr) as size_t ,
7394+ dictEnd. offset_from_unsigned ( dictPtr) ,
73957395 ) ;
73967396 if ERR_isError ( offcodeHeaderSize) {
73977397 return Error :: dictionary_corrupted. to_error_code ( ) ;
@@ -7418,7 +7418,7 @@ pub unsafe fn ZSTD_loadCEntropy(
74187418 & mut matchlengthMaxValue,
74197419 & mut matchlengthLog,
74207420 dictPtr as * const core:: ffi:: c_void ,
7421- dictEnd. offset_from ( dictPtr) as size_t ,
7421+ dictEnd. offset_from_unsigned ( dictPtr) ,
74227422 ) ;
74237423 if ERR_isError ( matchlengthHeaderSize) {
74247424 return Error :: dictionary_corrupted. to_error_code ( ) ;
@@ -7450,7 +7450,7 @@ pub unsafe fn ZSTD_loadCEntropy(
74507450 & mut litlengthMaxValue,
74517451 & mut litlengthLog,
74527452 dictPtr as * const core:: ffi:: c_void ,
7453- dictEnd. offset_from ( dictPtr) as size_t ,
7453+ dictEnd. offset_from_unsigned ( dictPtr) ,
74547454 ) ;
74557455 if ERR_isError ( litlengthHeaderSize) {
74567456 return Error :: dictionary_corrupted. to_error_code ( ) ;
@@ -7481,7 +7481,7 @@ pub unsafe fn ZSTD_loadCEntropy(
74817481 * ( ( * bs) . rep ) . as_mut_ptr ( ) . add ( 1 ) = MEM_readLE32 ( dictPtr. add ( 4 ) as * const core:: ffi:: c_void ) ;
74827482 * ( ( * bs) . rep ) . as_mut_ptr ( ) . add ( 2 ) = MEM_readLE32 ( dictPtr. add ( 8 ) as * const core:: ffi:: c_void ) ;
74837483 dictPtr = dictPtr. add ( 12 ) ;
7484- let dictContentSize = dictEnd. offset_from ( dictPtr) as size_t ;
7484+ let dictContentSize = dictEnd. offset_from_unsigned ( dictPtr) ;
74857485 let mut offcodeMax = MaxOff as u32 ;
74867486 if dictContentSize
74877487 <= ( -( 1 as core:: ffi:: c_int ) as u32 )
@@ -7507,7 +7507,7 @@ pub unsafe fn ZSTD_loadCEntropy(
75077507 }
75087508 u = u. wrapping_add ( 1 ) ;
75097509 }
7510- dictPtr. offset_from ( dict as * const u8 ) as size_t
7510+ dictPtr. offset_from_unsigned ( dict as * const u8 )
75117511}
75127512unsafe fn ZSTD_loadZstdDictionary (
75137513 bs : * mut ZSTD_compressedBlockState_t ,
@@ -7535,7 +7535,7 @@ unsafe fn ZSTD_loadZstdDictionary(
75357535 return err_code;
75367536 }
75377537 dictPtr = dictPtr. add ( eSize) ;
7538- let dictContentSize = dictEnd. offset_from ( dictPtr) as size_t ;
7538+ let dictContentSize = dictEnd. offset_from_unsigned ( dictPtr) ;
75397539 let err_code_0 = ZSTD_loadDictionaryContent (
75407540 ms,
75417541 core:: ptr:: null_mut :: < ldmState_t > ( ) ,
@@ -7910,7 +7910,7 @@ unsafe fn ZSTD_writeEpilogue(
79107910 op = op. add ( 4 ) ;
79117911 }
79127912 ( * cctx) . stage = ZSTDcs_created ;
7913- op. offset_from ( ostart) as size_t
7913+ op. offset_from_unsigned ( ostart)
79147914}
79157915pub unsafe fn ZSTD_CCtx_trace ( cctx : * mut ZSTD_CCtx , extraCSize : size_t ) {
79167916 if ( * cctx) . traceCtx != 0 {
@@ -9545,18 +9545,18 @@ unsafe fn ZSTD_compressStream_generic(
95459545 1 => {
95469546 if flushMode as core:: ffi:: c_uint
95479547 == ZSTD_e_end as core:: ffi:: c_int as core:: ffi:: c_uint
9548- && ( oend. offset_from ( op) as size_t
9549- >= ZSTD_compressBound ( iend. offset_from ( ip) as size_t )
9548+ && ( oend. offset_from_unsigned ( op)
9549+ >= ZSTD_compressBound ( iend. offset_from_unsigned ( ip) )
95509550 || ( * zcs) . appliedParams . outBufferMode as core:: ffi:: c_uint
95519551 == ZSTD_bm_stable as core:: ffi:: c_int as core:: ffi:: c_uint )
95529552 && ( * zcs) . inBuffPos == 0
95539553 {
95549554 let cSize = ZSTD_compressEnd_public (
95559555 zcs,
95569556 op as * mut core:: ffi:: c_void ,
9557- oend. offset_from ( op) as size_t ,
9557+ oend. offset_from_unsigned ( op) ,
95589558 ip as * const core:: ffi:: c_void ,
9559- iend. offset_from ( ip) as size_t ,
9559+ iend. offset_from_unsigned ( ip) ,
95609560 ) ;
95619561 let err_code = cSize;
95629562 if ERR_isError ( err_code) {
@@ -9577,7 +9577,7 @@ unsafe fn ZSTD_compressStream_generic(
95779577 ( ( * zcs) . inBuff ) . add ( ( * zcs) . inBuffPos ) ,
95789578 toLoad,
95799579 ip,
9580- iend. offset_from ( ip) as size_t ,
9580+ iend. offset_from_unsigned ( ip) ,
95819581 ) ;
95829582 ( * zcs) . inBuffPos = ( ( * zcs) . inBuffPos ) . wrapping_add ( loaded) ;
95839583 if !ip. is_null ( ) {
@@ -9600,9 +9600,9 @@ unsafe fn ZSTD_compressStream_generic(
96009600 }
96019601 } else if flushMode as core:: ffi:: c_uint
96029602 == ZSTD_e_continue as core:: ffi:: c_int as core:: ffi:: c_uint
9603- && ( iend. offset_from ( ip) as size_t ) < ( * zcs) . blockSizeMax
9603+ && ( iend. offset_from_unsigned ( ip) ) < ( * zcs) . blockSizeMax
96049604 {
9605- ( * zcs) . stableIn_notConsumed = iend. offset_from ( ip) as size_t ;
9605+ ( * zcs) . stableIn_notConsumed = iend. offset_from_unsigned ( ip) ;
96069606 ip = iend;
96079607 someMoreWork = 0 ;
96089608 current_block_156 = 16754622181974910496 ;
@@ -9624,11 +9624,11 @@ unsafe fn ZSTD_compressStream_generic(
96249624 as core:: ffi:: c_int ;
96259625 let mut cDst = core:: ptr:: null_mut :: < core:: ffi:: c_void > ( ) ;
96269626 let mut cSize_0: size_t = 0 ;
9627- let mut oSize = oend. offset_from ( op) as size_t ;
9627+ let mut oSize = oend. offset_from_unsigned ( op) ;
96289628 let iSize = if inputBuffered != 0 {
96299629 ( ( * zcs) . inBuffPos ) . wrapping_sub ( ( * zcs) . inToCompress )
9630- } else if ( iend. offset_from ( ip) as size_t ) < ( * zcs) . blockSizeMax {
9631- iend. offset_from ( ip) as size_t
9630+ } else if ( iend. offset_from_unsigned ( ip) ) < ( * zcs) . blockSizeMax {
9631+ iend. offset_from_unsigned ( ip)
96329632 } else {
96339633 ( * zcs) . blockSizeMax
96349634 } ;
@@ -9747,7 +9747,7 @@ unsafe fn ZSTD_compressStream_generic(
97479747 let toFlush = ( ( * zcs) . outBuffContentSize ) . wrapping_sub ( ( * zcs) . outBuffFlushedSize ) ;
97489748 let flushed = ZSTD_limitCopy (
97499749 op,
9750- oend. offset_from ( op) as size_t ,
9750+ oend. offset_from_unsigned ( op) ,
97519751 ( ( * zcs) . outBuff ) . add ( ( * zcs) . outBuffFlushedSize ) ,
97529752 toFlush,
97539753 ) ;
@@ -9769,8 +9769,8 @@ unsafe fn ZSTD_compressStream_generic(
97699769 }
97709770 }
97719771 }
9772- ( * input) . pos = ip. offset_from ( istart) as size_t ;
9773- ( * output) . pos = op. offset_from ( ostart) as size_t ;
9772+ ( * input) . pos = ip. offset_from_unsigned ( istart) ;
9773+ ( * output) . pos = op. offset_from_unsigned ( ostart) ;
97749774 if ( * zcs) . frameEnded != 0 {
97759775 return 0 ;
97769776 }
@@ -10442,7 +10442,7 @@ unsafe fn ZSTD_transferSequences_noDelim(
1044210442 ZSTD_storeLastLiterals ( & mut ( * cctx) . seqStore , ip, lastLLSize as size_t ) ;
1044310443 ( * seqPos) . posInSrc = ( ( * seqPos) . posInSrc ) . wrapping_add ( lastLLSize as size_t ) ;
1044410444 }
10445- iend. offset_from ( istart) as size_t
10445+ iend. offset_from_unsigned ( istart)
1044610446}
1044710447unsafe fn ZSTD_selectSequenceCopier ( mode : ZSTD_SequenceFormat_e ) -> ZSTD_SequenceCopier_f {
1044810448 if mode as core:: ffi:: c_uint
0 commit comments