Skip to content

Commit d79557c

Browse files
committed
fix calloc() argument order
1 parent a80e076 commit d79557c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

common/binlog/binlog-buffer-replay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ static int bb_writer_rotate(bb_writer_t* W, bb_rotation_point_t* p) {
5353

5454
/******************** replay binlog ********************/
5555
void bbr_replay_init(bb_reader_t* R) {
56-
bbr_replay_extra_t* e = static_cast<bbr_replay_extra_t*>(calloc(sizeof(*e), 1));
56+
bbr_replay_extra_t* e = static_cast<bbr_replay_extra_t*>(calloc( 1, sizeof(*e)));
5757
assert(e);
58-
e->wait_job_cb = static_cast<bb_wait_job_cb_t*>(calloc(sizeof(*e->wait_job_cb), 1));
58+
e->wait_job_cb = static_cast<bb_wait_job_cb_t*>(calloc(1, sizeof(*e->wait_job_cb)));
5959
R->extra = e;
6060
}
6161

common/binlog/binlog-buffer-rotation-points.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void bb_buffer_insert_rotation_point(bb_buffer_t* B, bb_rotation_point_t*
7979
}
8080

8181
bb_rotation_point_t* bb_rotation_point_alloc(bb_buffer_t* B, enum bb_rotation_point_type tp, long long log_pos) {
82-
auto* p = static_cast<bb_rotation_point_t*>(calloc(sizeof(bb_rotation_point_t), 1));
82+
auto* p = static_cast<bb_rotation_point_t*>(calloc(1, sizeof(bb_rotation_point_t)));
8383
assert(p);
8484
p->tp = tp;
8585
p->log_pos = log_pos;

common/kfs/kfs-replica.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ kfs_replica_handle_t open_replica(const char* replica_name, int flags) {
113113
struct kfs_replica* R = 0;
114114

115115
if (flags & KFS_OPEN_REPLICA_FLAG_FORCE) {
116-
R = static_cast<kfs_replica*>(calloc(sizeof(*R), 1));
116+
R = static_cast<kfs_replica*>(calloc(1, sizeof(*R)));
117117
assert(R);
118118
R->replica_prefix = strdup(replica_name);
119119
assert(R->replica_prefix);

net/net-aes-keys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static size_t aes_loaded_keys_size;
3131
aes_key_t *default_aes_key;
3232

3333
aes_key_t *create_aes_key() {
34-
aes_key_t *key = static_cast<aes_key_t*>(calloc(sizeof(*key), 1));
34+
aes_key_t *key = static_cast<aes_key_t*>(calloc( 1, sizeof(*key)));
3535
assert(!posix_memalign((void **) &key->key, 4096, AES_KEY_MAX_LEN));
3636

3737
our_madvise(key->key, AES_KEY_MAX_LEN, MADV_DONTDUMP);

0 commit comments

Comments
 (0)