Skip to content

Commit

Permalink
Const-ify CL_HandleDownload() data pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed May 9, 2024
1 parent b01ef62 commit a563d05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/client/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ bool CL_IgnoreDownload(const char *path);
void CL_FinishDownload(dlqueue_t *q);
void CL_CleanupDownloads(void);
void CL_LoadDownloadIgnores(void);
void CL_HandleDownload(byte *data, int size, int percent, int decompressed_size);
void CL_HandleDownload(const byte *data, int size, int percent, int decompressed_size);
bool CL_CheckDownloadExtension(const char *ext);
void CL_StartNextDownload(void);
void CL_RequestNextDownload(void);
Expand Down
6 changes: 3 additions & 3 deletions src/client/download.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static bool write_udp_download(const byte *data, int size)
#if USE_ZLIB
// handles both continuous deflate stream for entire download and chunked
// per-packet streams for compatibility.
static bool inflate_udp_download(byte *data, int size, int decompressed_size)
static bool inflate_udp_download(const byte *data, int size, int decompressed_size)
{
z_streamp z = &cls.download.z;
byte buffer[0x10000];
Expand All @@ -322,7 +322,7 @@ static bool inflate_udp_download(byte *data, int size, int decompressed_size)
return true;

// run inflate() until output buffer not full
z->next_in = data;
z->next_in = (Bytef *)data;
z->avail_in = size;
do {
z->next_out = buffer;
Expand Down Expand Up @@ -362,7 +362,7 @@ CL_HandleDownload
An UDP download data has been received from the server.
=====================
*/
void CL_HandleDownload(byte *data, int size, int percent, int decompressed_size)
void CL_HandleDownload(const byte *data, int size, int percent, int decompressed_size)
{
dlqueue_t *q = cls.download.current;
int ret;
Expand Down

0 comments on commit a563d05

Please sign in to comment.