coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore the return to avoid MISRA-C violations. The only directory excluded directory was ext/* since it contains only imported code. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
5884c7f54b
commit
da49f2e440
220 changed files with 577 additions and 550 deletions
|
@ -45,8 +45,8 @@ int client_reset(struct http_ctx *ctx)
|
|||
{
|
||||
http_parser_init(&ctx->http.parser, HTTP_RESPONSE);
|
||||
|
||||
memset(ctx->http.rsp.http_status, 0,
|
||||
sizeof(ctx->http.rsp.http_status));
|
||||
(void)memset(ctx->http.rsp.http_status, 0,
|
||||
sizeof(ctx->http.rsp.http_status));
|
||||
|
||||
ctx->http.rsp.cl_present = 0;
|
||||
ctx->http.rsp.content_length = 0;
|
||||
|
@ -55,7 +55,8 @@ int client_reset(struct http_ctx *ctx)
|
|||
ctx->http.rsp.message_complete = 0;
|
||||
ctx->http.rsp.body_start = NULL;
|
||||
|
||||
memset(ctx->http.rsp.response_buf, 0, ctx->http.rsp.response_buf_len);
|
||||
(void)memset(ctx->http.rsp.response_buf, 0,
|
||||
ctx->http.rsp.response_buf_len);
|
||||
ctx->http.rsp.data_len = 0;
|
||||
|
||||
return 0;
|
||||
|
@ -649,7 +650,7 @@ int http_client_init(struct http_ctx *ctx,
|
|||
{
|
||||
int ret;
|
||||
|
||||
memset(ctx, 0, sizeof(*ctx));
|
||||
(void)memset(ctx, 0, sizeof(*ctx));
|
||||
|
||||
ret = net_app_init_tcp_client(&ctx->app_ctx,
|
||||
NULL, /* use any local address */
|
||||
|
|
|
@ -2305,7 +2305,7 @@ void http_parser_init(struct http_parser *parser, enum http_parser_type t)
|
|||
{
|
||||
void *data = parser->data; /* preserve application data */
|
||||
|
||||
memset(parser, 0, sizeof(*parser));
|
||||
(void)memset(parser, 0, sizeof(*parser));
|
||||
parser->data = data;
|
||||
parser->type = t;
|
||||
parser->state =
|
||||
|
@ -2316,7 +2316,7 @@ void http_parser_init(struct http_parser *parser, enum http_parser_type t)
|
|||
|
||||
void http_parser_settings_init(struct http_parser_settings *settings)
|
||||
{
|
||||
memset(settings, 0, sizeof(*settings));
|
||||
(void)memset(settings, 0, sizeof(*settings));
|
||||
}
|
||||
|
||||
const char *http_errno_name(enum http_errno err)
|
||||
|
|
|
@ -462,7 +462,7 @@ int http_parse_host(const char *buf, struct http_parser_url *u,
|
|||
void
|
||||
http_parser_url_init(struct http_parser_url *u)
|
||||
{
|
||||
memset(u, 0, sizeof(*u));
|
||||
(void)memset(u, 0, sizeof(*u));
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -977,7 +977,8 @@ static int on_headers_complete(struct http_parser *parser)
|
|||
|
||||
static int init_http_parser(struct http_ctx *ctx)
|
||||
{
|
||||
memset(ctx->http.field_values, 0, sizeof(ctx->http.field_values));
|
||||
(void)memset(ctx->http.field_values, 0,
|
||||
sizeof(ctx->http.field_values));
|
||||
|
||||
ctx->http.parser_settings.on_header_field = on_header_field;
|
||||
ctx->http.parser_settings.on_header_value = on_header_value;
|
||||
|
@ -1017,7 +1018,7 @@ static void init_net(struct http_ctx *ctx,
|
|||
struct sockaddr *server_addr,
|
||||
u16_t port)
|
||||
{
|
||||
memset(&ctx->local, 0, sizeof(ctx->local));
|
||||
(void)memset(&ctx->local, 0, sizeof(ctx->local));
|
||||
|
||||
if (server_addr) {
|
||||
memcpy(&ctx->local, server_addr, sizeof(ctx->local));
|
||||
|
@ -1050,7 +1051,7 @@ int http_server_init(struct http_ctx *ctx,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(ctx, 0, sizeof(*ctx));
|
||||
(void)memset(ctx, 0, sizeof(*ctx));
|
||||
|
||||
init_net(ctx, server_addr, HTTP_DEFAULT_PORT);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue