Skip to content

Commit

Permalink
cppcheck constParameterPointer
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva committed Aug 10, 2024
1 parent 125d3d1 commit ce5c036
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions http/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct http_cookie {

static int callback_connected(void *, int);
static int callback_read_header(void *, int);
static int gotheaders(struct http_cookie *, uint8_t *, size_t);
static int gotheaders(struct http_cookie *, const uint8_t *, size_t);
static int callback_chunkedheader(void *, int);
static int get_body_gotclen(struct http_cookie *, size_t);
static int callback_read_toeof(void *, int);
Expand Down Expand Up @@ -178,7 +178,7 @@ sgetline(uint8_t * buf, size_t buflen, size_t * bufpos, size_t * linelen)

/* Add data to the body buffer. */
static int
addbody(struct http_cookie * H, uint8_t * buf, size_t buflen)
addbody(struct http_cookie * H, const uint8_t * buf, size_t buflen)
{
size_t nalloc;
uint8_t * nbuf;
Expand Down Expand Up @@ -433,7 +433,7 @@ callback_read_header(void * cookie, int status)

/* We have finished reading the request headers. */
static int
gotheaders(struct http_cookie * H, uint8_t * buf, size_t buflen)
gotheaders(struct http_cookie * H, const uint8_t * buf, size_t buflen)
{
size_t bufpos;
size_t linelen;
Expand Down
2 changes: 1 addition & 1 deletion tests/ipc_sync/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ child(void * cookie)
}

static int
check(struct testcase * test)
check(const struct testcase * test)
{
struct child_info CI_actual;
struct child_info * CI = &CI_actual;
Expand Down
6 changes: 3 additions & 3 deletions util/sock_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ sock_addr_deserialize(const uint8_t * buf, size_t buflen)

/* Prettyprint an IPv4 address. */
static char *
prettyprint_ipv4(struct sockaddr * name, size_t namelen)
prettyprint_ipv4(const struct sockaddr * name, size_t namelen)
{
struct sockaddr_in sa_in;
char addr[INET_ADDRSTRLEN];
Expand All @@ -219,7 +219,7 @@ prettyprint_ipv4(struct sockaddr * name, size_t namelen)

/* Prettyprint an IPv6 address. */
static char *
prettyprint_ipv6(struct sockaddr * name, size_t namelen)
prettyprint_ipv6(const struct sockaddr * name, size_t namelen)
{
struct sockaddr_in6 sa_in6;
char addr[INET6_ADDRSTRLEN];
Expand All @@ -246,7 +246,7 @@ prettyprint_ipv6(struct sockaddr * name, size_t namelen)

/* Prettyprint a UNIX address. */
static char *
prettyprint_unix(struct sockaddr_un * name)
prettyprint_unix(const struct sockaddr_un * name)
{

/* Just strdup the path. */
Expand Down

0 comments on commit ce5c036

Please sign in to comment.