Skip to content

Commit dae4302

Browse files
QuLogicgrimmy
authored andcommitted
Replace g_memmove by memmove
This was deprecated in GLib 2.40, but even in 2.16 it was a simple wrapper around `memmove` except for platforms where it didn't exist (but do we really care about those?)
1 parent 5d4dd12 commit dae4302

11 files changed

Lines changed: 19 additions & 19 deletions

File tree

msn/directconn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ msn_dc_recv_cb(gpointer data, gint fd, PurpleInputCondition cond)
686686
}
687687

688688
if ((guint32)dc->in_pos > packet_length + 4) {
689-
g_memmove(dc->in_buffer, dc->in_buffer + 4 + packet_length, dc->in_pos - packet_length - 4);
689+
memmove(dc->in_buffer, dc->in_buffer + 4 + packet_length, dc->in_pos - packet_length - 4);
690690
}
691691

692692
dc->in_pos -= packet_length + 4;

qq/buddy_list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ guint16 qq_process_get_buddies(guint8 *data, gint data_len, PurpleConnection *gc
338338
bd.last_update = time(NULL);
339339
qq_update_buddy_status(gc, bd.uid, bd.status, bd.comm_flag);
340340

341-
g_memmove(purple_buddy_get_protocol_data(buddy), &bd, sizeof(qq_buddy_data));
341+
memmove(purple_buddy_get_protocol_data(buddy), &bd, sizeof(qq_buddy_data));
342342
/* nickname has been copy to buddy_data do not free
343343
g_free(bd.nickname);
344344
*/

qq/buddy_opt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void add_buddy_authorize_input(PurpleConnection *gc, UID uid,
657657
add_req->auth_len = 0;
658658
if (auth != NULL && auth_len > 0) {
659659
add_req->auth = g_new0(guint8, auth_len);
660-
g_memmove(add_req->auth, auth, auth_len);
660+
memmove(add_req->auth, auth, auth_len);
661661
add_req->auth_len = auth_len;
662662
}
663663

qq/im.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ qq_im_format *qq_im_fmt_new_by_purple(const gchar *msg)
580580
gsize rgb_len;
581581
rgb = purple_base16_decode(tmp + 1, &rgb_len);
582582
if (rgb != NULL && rgb_len >= 3)
583-
g_memmove(fmt->rgb, rgb, 3);
583+
memmove(fmt->rgb, rgb, 3);
584584
g_free(rgb);
585585
}
586586

qq/qq_base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ guint8 qq_process_token(PurpleConnection *gc, guint8 *buf, gint buf_len)
340340
}
341341
qd->ld.token = g_new0(guint8, token_len);
342342
qd->ld.token_len = token_len;
343-
g_memmove(qd->ld.token, buf + 2, qd->ld.token_len);
343+
memmove(qd->ld.token, buf + 2, qd->ld.token_len);
344344
return ret;
345345
}
346346

@@ -857,7 +857,7 @@ void qq_captcha_input_dialog(PurpleConnection *gc,qq_captcha_data *captcha)
857857
captcha_req = g_new0(qq_captcha_request, 1);
858858
captcha_req->gc = gc;
859859
captcha_req->token = g_new0(guint8, captcha->token_len);
860-
g_memmove(captcha_req->token, captcha->token, captcha->token_len);
860+
memmove(captcha_req->token, captcha->token, captcha->token_len);
861861
captcha_req->token_len = captcha->token_len;
862862

863863
account = purple_connection_get_account(gc);

qq/qq_crypt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static inline void encrypt_out(guint8 *crypted, const gint crypted_len, const gu
147147
p32_prev[0] = 0; p32_prev[1] = 0;
148148
plain32[0] = crypted32[0] ^ p32_prev[0]; plain32[1] = crypted32[1] ^ p32_prev[1];
149149

150-
g_memmove(key32, key, 16);
150+
memmove(key32, key, 16);
151151
count64 = crypted_len / 8;
152152
while (count64-- > 0){
153153
/* encrypt it */
@@ -156,7 +156,7 @@ static inline void encrypt_out(guint8 *crypted, const gint crypted_len, const gu
156156
crypted32[0] ^= p32_prev[0]; crypted32[1] ^= p32_prev[1];
157157

158158
/* store curr 64 bits crypted */
159-
g_memmove(crypted_ptr, crypted32, sizeof(crypted32));
159+
memmove(crypted_ptr, crypted32, sizeof(crypted32));
160160

161161
/* set prev */
162162
p32_prev[0] = plain32[0]; p32_prev[1] = plain32[1];
@@ -206,7 +206,7 @@ gint qq_encrypt(guint8* crypted, const guint8* const plain, const gint plain_len
206206
crypted_ptr[pos++] = rand() & 0xff;
207207
}
208208

209-
g_memmove(crypted_ptr + pos, plain, plain_len);
209+
memmove(crypted_ptr + pos, plain, plain_len);
210210
pos += plain_len;
211211

212212
/* header padding len + plain len must be multiple of 8
@@ -330,7 +330,7 @@ gint qq_decrypt(guint8 *plain, const guint8* const crypted, const gint crypted_l
330330
}
331331

332332
hdr_padding = crypted_len - plain_len - 7;
333-
g_memmove(plain, plain + hdr_padding, plain_len);
333+
memmove(plain, plain + hdr_padding, plain_len);
334334

335335
return plain_len;
336336
}

qq/qq_network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,13 @@ static void tcp_pending(gpointer data, gint source, PurpleInputCondition cond)
449449
/* jump and over QQ_PACKET_TAIL */
450450
jump_len = (jump - conn->tcp_rxqueue) + 1;
451451
purple_debug_warning("TCP_PENDING", "Find next tail at %d, jump %d\n", jump_len, jump_len + 1);
452-
g_memmove(conn->tcp_rxqueue, jump, conn->tcp_rxlen - jump_len);
452+
memmove(conn->tcp_rxqueue, jump, conn->tcp_rxlen - jump_len);
453453
conn->tcp_rxlen -= jump_len;
454454
continue;
455455
}
456456

457457
memset(pkt, 0, MAX_PACKET_SIZE);
458-
g_memmove(pkt, conn->tcp_rxqueue + bytes, pkt_len - bytes);
458+
memmove(pkt, conn->tcp_rxqueue + bytes, pkt_len - bytes);
459459

460460
/* jump to next packet */
461461
conn->tcp_rxlen -= pkt_len;

qq/qq_process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static void process_server_msg(PurpleConnection *gc, guint8 *data, gint data_len
435435
qd = (qq_data *) gc->proto_data;
436436

437437
data_str = g_newa(guint8, data_len + 1);
438-
g_memmove(data_str, data, data_len);
438+
memmove(data_str, data, data_len);
439439
data_str[data_len] = 0x00;
440440

441441
segments = g_strsplit((gchar *) data_str, "\x1f", 0);

qq/send_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,11 +807,11 @@ void qq_process_recv_file_request(guint8 *data, gint data_len, UID sender_uid, P
807807
bd = (b == NULL) ? NULL : purple_buddy_get_protocol_data(b);
808808
if (bd) {
809809
if(0 != info->remote_real_ip) {
810-
g_memmove(&(bd->ip), &info->remote_real_ip, sizeof(bd->ip));
810+
memmove(&(bd->ip), &info->remote_real_ip, sizeof(bd->ip));
811811
bd->port = info->remote_minor_port;
812812
}
813813
else if (0 != info->remote_internet_ip) {
814-
g_memmove(&(bd->ip), &info->remote_internet_ip, sizeof(bd->ip));
814+
memmove(&(bd->ip), &info->remote_internet_ip, sizeof(bd->ip));
815815
bd->port = info->remote_major_port;
816816
}
817817

qq/utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ gchar **split_data(guint8 *data, gint len, const gchar *delimit, gint expected_f
105105
/* as the last field would be string, but data is not ended with 0x00
106106
* we have to duplicate the data and append a 0x00 at the end */
107107
input = g_newa(guint8, len + 1);
108-
g_memmove(input, data, len);
108+
memmove(input, data, len);
109109
input[len] = 0x00;
110110

111111
segments = g_strsplit((gchar *) input, delimit, 0);
@@ -181,7 +181,7 @@ gchar* try_dump_as_gbk(const guint8 *const data, gint len)
181181
gchar *msg_utf8;
182182

183183
incoming = g_newa(guint8, len + 1);
184-
g_memmove(incoming, data, len);
184+
memmove(incoming, data, len);
185185
incoming[len] = 0x00;
186186
/* GBK code:
187187
* Single-byte ASCII: 0x21-0x7E

0 commit comments

Comments
 (0)