Skip to content

Commit

Permalink
Cleanup: calloc: swap arguments according to prototype semantic.
Browse files Browse the repository at this point in the history
This change has no effect on the behavior, and only ensures that the argument order matches the semantic expected by the prototype.
  • Loading branch information
ruihongw committed Jul 5, 2020
1 parent 4af3e30 commit 1acbe41
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/examples/urcu-flavors/bp.c
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
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
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
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
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
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
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

0 comments on commit 1acbe41

Please sign in to comment.