filesystem: use designated initializers where possible

This commit is contained in:
Alibek Omarov
2026-05-20 12:44:36 -04:00
committed by a1batross
parent 64be4251c8
commit 1fed340330

View File

@@ -530,7 +530,6 @@ static byte *FS_LoadZIPFile( searchpath_t *search, const char *path, int pack_in
} }
else if( file->flags == ZIP_COMPRESSION_DEFLATED ) else if( file->flags == ZIP_COMPRESSION_DEFLATED )
{ {
z_stream decompress_stream;
int zlib_result; int zlib_result;
compressed_buffer = (byte *)Mem_Malloc( fs_mempool, file->compressed_size + 1 ); compressed_buffer = (byte *)Mem_Malloc( fs_mempool, file->compressed_size + 1 );
@@ -542,16 +541,18 @@ static byte *FS_LoadZIPFile( searchpath_t *search, const char *path, int pack_in
return NULL; return NULL;
} }
memset( &decompress_stream, 0, sizeof( decompress_stream ) ); z_stream decompress_stream =
{
decompress_stream.total_in = decompress_stream.avail_in = file->compressed_size; .total_in = file->compressed_size,
decompress_stream.next_in = (Bytef *)compressed_buffer; .avail_in = file->compressed_size,
decompress_stream.total_out = decompress_stream.avail_out = file->size; .next_in = (Bytef *)compressed_buffer,
decompress_stream.next_out = (Bytef *)decompressed_buffer; .total_out = file->size,
.avail_out = file->size,
decompress_stream.zalloc = Z_NULL; .next_out = (Bytef *)decompressed_buffer,
decompress_stream.zfree = Z_NULL; .zalloc = Z_NULL,
decompress_stream.opaque = Z_NULL; .zfree = Z_NULL,
.opaque = Z_NULL,
};
if( inflateInit2( &decompress_stream, -MAX_WBITS ) != Z_OK ) if( inflateInit2( &decompress_stream, -MAX_WBITS ) != Z_OK )
{ {