check: Using const keyword for some arguments

For ConfigSetLogDirectory and PrintRawLineHexBuf
pull/4550/head
Philippe Antoine 6 years ago committed by Victor Julien
parent 12a3a24906
commit ce55d06569

@ -657,7 +657,8 @@ inline int PacketSetData(Packet *p, const uint8_t *pktdata, uint32_t pktlen)
if (unlikely(!pktdata)) {
return -1;
}
p->ext_pkt = (uint8_t *)pktdata;
// ext_pkt cannot be const (because we sometimes copy)
p->ext_pkt = (uint8_t *) pktdata;
p->flags |= PKT_ZERO_COPY;
return 0;

@ -28,7 +28,7 @@
#include "runmodes.h"
#include "util-conf.h"
TmEcode ConfigSetLogDirectory(char *name)
TmEcode ConfigSetLogDirectory(const char *name)
{
return ConfSetFinal("default-log-dir", name) ? TM_ECODE_OK : TM_ECODE_FAILED;
}

@ -27,7 +27,7 @@
#include "conf.h"
TmEcode ConfigSetLogDirectory(char *name);
TmEcode ConfigSetLogDirectory(const char *name);
const char *ConfigGetLogDirectory(void);
TmEcode ConfigCheckLogDirectoryExists(const char *log_dir);

@ -39,7 +39,7 @@
* \param buf buffer to print from
* \param buflen length of the input buffer
*/
void PrintBufferRawLineHex(char *nbuf, int *offset, int max_size, uint8_t *buf, uint32_t buflen)
void PrintBufferRawLineHex(char *nbuf, int *offset, int max_size, const uint8_t *buf, uint32_t buflen)
{
uint32_t u = 0;
@ -58,7 +58,7 @@ void PrintBufferRawLineHex(char *nbuf, int *offset, int max_size, uint8_t *buf,
* \param buf buffer to print from
* \param buflen length of the input buffer
*/
void PrintRawLineHexBuf(char *retbuf, uint32_t retbuflen, uint8_t *buf, uint32_t buflen)
void PrintRawLineHexBuf(char *retbuf, uint32_t retbuflen, const uint8_t *buf, uint32_t buflen)
{
uint32_t offset = 0;
uint32_t u = 0;

@ -41,7 +41,7 @@
} \
} while (0)
void PrintBufferRawLineHex(char *, int *,int, uint8_t *, uint32_t);
void PrintBufferRawLineHex(char *, int *,int, const uint8_t *, uint32_t);
void PrintRawUriFp(FILE *, uint8_t *, uint32_t);
void PrintRawUriBuf(char *, uint32_t *, uint32_t,
uint8_t *, uint32_t);
@ -51,7 +51,7 @@ void PrintRawDataToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32
const uint8_t *src_buf, uint32_t src_buf_len);
void PrintStringsToBuffer(uint8_t *dst_buf, uint32_t *dst_buf_offset_ptr, uint32_t dst_buf_size,
const uint8_t *src_buf, const uint32_t src_buf_len);
void PrintRawLineHexBuf(char *, uint32_t, uint8_t *, uint32_t );
void PrintRawLineHexBuf(char *, uint32_t, const uint8_t *, uint32_t );
const char *PrintInet(int , const void *, char *, socklen_t);
#endif /* __UTIL_PRINT_H__ */

Loading…
Cancel
Save