Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: calloc: swap arguments according to prototype semantic. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/bp.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int add_node(uint64_t v)
{
struct mynode *node;

node = calloc(sizeof(*node), 1);
node = calloc(1, sizeof(*node));
if (!node)
return -1;
node->value = v;
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int add_node(uint64_t v)
{
struct mynode *node;

node = calloc(sizeof(*node), 1);
node = calloc(1, sizeof(*node));
if (!node)
return -1;
node->value = v;
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/membarrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int add_node(uint64_t v)
{
struct mynode *node;

node = calloc(sizeof(*node), 1);
node = calloc(1, sizeof(*node));
if (!node)
return -1;
node->value = v;
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/qsbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int add_node(uint64_t v)
{
struct mynode *node;

node = calloc(sizeof(*node), 1);
node = calloc(1, sizeof(*node));
if (!node)
return -1;
node->value = v;
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int add_node(uint64_t v)
{
struct mynode *node;

node = calloc(sizeof(*node), 1);
node = calloc(1, sizeof(*node));
if (!node)
return -1;
node->value = v;
Expand Down
4 changes: 2 additions & 2 deletions src/urcu-call-rcu-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ void rcu_barrier(void)
goto online;
}

completion = calloc(sizeof(*completion), 1);
completion = calloc(1, sizeof(*completion));
if (!completion)
urcu_die(errno);

Expand All @@ -908,7 +908,7 @@ void rcu_barrier(void)
cds_list_for_each_entry(crdp, &call_rcu_data_list, list) {
struct call_rcu_completion_work *work;

work = calloc(sizeof(*work), 1);
work = calloc(1, sizeof(*work));
if (!work)
urcu_die(errno);
work->completion = completion;
Expand Down
2 changes: 1 addition & 1 deletion src/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void urcu_workqueue_queue_completion(struct urcu_workqueue *workqueue,
{
struct urcu_workqueue_completion_work *work;

work = calloc(sizeof(*work), 1);
work = calloc(1, sizeof(*work));
if (!work)
urcu_die(errno);
work->completion = completion;
Expand Down