comparison packet.c @ 1459:06d52bcb8094

Pointer parameter could be declared as pointing to const
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Aug 2017 17:16:13 +0200
parents 9169e4e7cbee
children fdae6fae00af
comparison
equal deleted inserted replaced
1458:bdd3802c8ac6 1459:06d52bcb8094
47 * We might allocate 5 unnecessary bytes here if it's an 47 * We might allocate 5 unnecessary bytes here if it's an
48 * exact multiple. */ 48 * exact multiple. */
49 #define ZLIB_COMPRESS_EXPANSION (((RECV_MAX_PAYLOAD_LEN/16384)+1)*5 + 6) 49 #define ZLIB_COMPRESS_EXPANSION (((RECV_MAX_PAYLOAD_LEN/16384)+1)*5 + 6)
50 #define ZLIB_DECOMPRESS_INCR 1024 50 #define ZLIB_DECOMPRESS_INCR 1024
51 #ifndef DISABLE_ZLIB 51 #ifndef DISABLE_ZLIB
52 static buffer* buf_decompress(buffer* buf, unsigned int len); 52 static buffer* buf_decompress(const buffer* buf, unsigned int len);
53 static void buf_compress(buffer * dest, buffer * src, unsigned int len); 53 static void buf_compress(buffer * dest, buffer * src, unsigned int len);
54 #endif 54 #endif
55 55
56 /* non-blocking function writing out a current encrypted packet */ 56 /* non-blocking function writing out a current encrypted packet */
57 void write_packet() { 57 void write_packet() {
365 } 365 }
366 } 366 }
367 367
368 #ifndef DISABLE_ZLIB 368 #ifndef DISABLE_ZLIB
369 /* returns a pointer to a newly created buffer */ 369 /* returns a pointer to a newly created buffer */
370 static buffer* buf_decompress(buffer* buf, unsigned int len) { 370 static buffer* buf_decompress(const buffer* buf, unsigned int len) {
371 371
372 int result; 372 int result;
373 buffer * ret; 373 buffer * ret;
374 z_streamp zstream; 374 z_streamp zstream;
375 375