Skip to content

Commit

Permalink
Remove unused zlib exports (#84603)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabYourPitchforks authored Apr 11, 2023
1 parent 4ebecb0 commit b26dae2
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 72 deletions.
6 changes: 0 additions & 6 deletions src/libraries/Common/src/Interop/Interop.zlib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_(
[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")]
internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);

[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")]
internal static unsafe partial ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream);

[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")]
internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream);

Expand All @@ -32,9 +29,6 @@ internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_(
[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")]
internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush);

[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")]
internal static unsafe partial ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream);

[LibraryImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")]
internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream);

Expand Down
22 changes: 0 additions & 22 deletions src/libraries/Common/src/System/IO/Compression/ZLibNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,6 @@ public unsafe ErrorCode Deflate(FlushCode flush)
}


public unsafe ErrorCode DeflateReset()
{
EnsureNotDisposed();
EnsureState(State.InitializedForDeflate);

fixed (ZStream* stream = &_zStream)
{
return Interop.ZLib.DeflateReset(stream);
}
}

public unsafe ErrorCode DeflateEnd()
{
EnsureNotDisposed();
Expand Down Expand Up @@ -339,17 +328,6 @@ public unsafe ErrorCode Inflate(FlushCode flush)
}


public unsafe ErrorCode InflateReset()
{
EnsureNotDisposed();
EnsureState(State.InitializedForInflate);

fixed (ZStream* stream = &_zStream)
{
return Interop.ZLib.InflateReset(stream);
}
}

public unsafe ErrorCode InflateEnd()
{
EnsureNotDisposed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ EXPORTS
CompressionNative_Crc32
CompressionNative_Deflate
CompressionNative_DeflateEnd
CompressionNative_DeflateReset
CompressionNative_DeflateInit2_
CompressionNative_Inflate
CompressionNative_InflateEnd
CompressionNative_InflateReset
CompressionNative_InflateInit2_
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ BrotliEncoderSetParameter
CompressionNative_Crc32
CompressionNative_Deflate
CompressionNative_DeflateEnd
CompressionNative_DeflateReset
CompressionNative_DeflateInit2_
CompressionNative_Inflate
CompressionNative_InflateEnd
CompressionNative_InflateReset
CompressionNative_InflateInit2_
2 changes: 0 additions & 2 deletions src/native/libs/System.IO.Compression.Native/entrypoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ static const Entry s_compressionNative[] =
DllImportEntry(CompressionNative_Crc32)
DllImportEntry(CompressionNative_Deflate)
DllImportEntry(CompressionNative_DeflateEnd)
DllImportEntry(CompressionNative_DeflateReset)
DllImportEntry(CompressionNative_DeflateInit2_)
DllImportEntry(CompressionNative_Inflate)
DllImportEntry(CompressionNative_InflateEnd)
DllImportEntry(CompressionNative_InflateReset)
DllImportEntry(CompressionNative_InflateInit2_)
};

Expand Down
22 changes: 0 additions & 22 deletions src/native/libs/System.IO.Compression.Native/pal_zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ int32_t CompressionNative_Deflate(PAL_ZStream* stream, int32_t flush)
return result;
}

int32_t CompressionNative_DeflateReset(PAL_ZStream* stream)
{
assert(stream != NULL);

z_stream* zStream = GetCurrentZStream(stream);
int32_t result = deflateReset(zStream);
TransferStateToPalZStream(zStream, stream);

return result;
}

int32_t CompressionNative_DeflateEnd(PAL_ZStream* stream)
{
assert(stream != NULL);
Expand Down Expand Up @@ -185,17 +174,6 @@ int32_t CompressionNative_Inflate(PAL_ZStream* stream, int32_t flush)
return result;
}

int32_t CompressionNative_InflateReset(PAL_ZStream* stream)
{
assert(stream != NULL);

z_stream* zStream = GetCurrentZStream(stream);
int32_t result = inflateReset(zStream);
TransferStateToPalZStream(zStream, stream);

return result;
}

int32_t CompressionNative_InflateEnd(PAL_ZStream* stream)
{
assert(stream != NULL);
Expand Down
16 changes: 0 additions & 16 deletions src/native/libs/System.IO.Compression.Native/pal_zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ Returns a PAL_ErrorCode indicating success or an error number on failure.
*/
FUNCTIONEXPORT int32_t FUNCTIONCALLINGCONVENCTION CompressionNative_Deflate(PAL_ZStream* stream, int32_t flush);

/*
This function is equivalent to DeflateEnd followed by DeflateInit, but does not free and reallocate
the internal compression state. The stream will leave the compression level and any other attributes that may have been set unchanged.
Returns a PAL_ErrorCode indicating success or an error number on failure.
*/
FUNCTIONEXPORT int32_t FUNCTIONCALLINGCONVENCTION CompressionNative_DeflateReset(PAL_ZStream* stream);

/*
All dynamically allocated data structures for this stream are freed.
Expand All @@ -125,14 +117,6 @@ Returns a PAL_ErrorCode indicating success or an error number on failure.
*/
FUNCTIONEXPORT int32_t FUNCTIONCALLINGCONVENCTION CompressionNative_Inflate(PAL_ZStream* stream, int32_t flush);

/*
This function is equivalent to InflateEnd followed by InflateInit, but does not free and reallocate
the internal decompression state. The stream will keep attributes that may have been set by InflateInit.
Returns a PAL_ErrorCode indicating success or an error number on failure.
*/
FUNCTIONEXPORT int32_t FUNCTIONCALLINGCONVENCTION CompressionNative_InflateReset(PAL_ZStream* stream);

/*
All dynamically allocated data structures for this stream are freed.
Expand Down

0 comments on commit b26dae2

Please sign in to comment.