[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 41/65] slirp: replace ARRAY_SIZE with G_N_ELEMENTS
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 41/65] slirp: replace ARRAY_SIZE with G_N_ELEMENTS |
Date: |
Mon, 14 Jan 2019 23:52:42 +0100 |
From: Marc-André Lureau <address@hidden>
Do not require QEMU macro.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Daniel P. Berrangé <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
slirp/ncsi.c | 2 +-
slirp/tftp.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/slirp/ncsi.c b/slirp/ncsi.c
index 10decfb5ef..8594382270 100644
--- a/slirp/ncsi.c
+++ b/slirp/ncsi.c
@@ -128,7 +128,7 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int
pkt_len)
memset(reh->h_source, 0xff, ETH_ALEN);
reh->h_proto = htons(ETH_P_NCSI);
- for (i = 0; i < ARRAY_SIZE(ncsi_rsp_handlers); i++) {
+ for (i = 0; i < G_N_ELEMENTS(ncsi_rsp_handlers); i++) {
if (ncsi_rsp_handlers[i].type == nh->type + 0x80) {
handler = &ncsi_rsp_handlers[i];
break;
diff --git a/slirp/tftp.c b/slirp/tftp.c
index 735b57aa55..a9ba1480db 100644
--- a/slirp/tftp.c
+++ b/slirp/tftp.c
@@ -359,7 +359,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct
sockaddr_storage *srcsas,
return;
}
- while (k < pktlen && nb_options < ARRAY_SIZE(option_name)) {
+ while (k < pktlen && nb_options < G_N_ELEMENTS(option_name)) {
const char *key, *value;
key = &tp->x.tp_buf[k];
@@ -403,7 +403,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct
sockaddr_storage *srcsas,
}
if (nb_options > 0) {
- assert(nb_options <= ARRAY_SIZE(option_name));
+ assert(nb_options <= G_N_ELEMENTS(option_name));
tftp_send_oack(spt, option_name, option_value, nb_options, tp);
return;
}
--
2.20.1
- [Qemu-devel] [PULL 33/65] slirp: remove unused global slirp_instance, (continued)
- [Qemu-devel] [PULL 33/65] slirp: remove unused global slirp_instance, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 32/65] slirp: replace compile time DO_KEEPALIVE, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 31/65] slirp: replace SIZEOF_CHAR_P with glib equivalent, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 37/65] slirp: remove #if notdef dead code, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 40/65] slirp: remove dead TCP_ACK_HACK code, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 38/65] slirp: remove unused sbflush(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 43/65] glib-compat: add g_spawn_async_with_fds() fallback, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 46/65] slirp: Enable fork_exec support on Windows, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 48/65] slirp: rename exec_list, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 36/65] slirp: add a callback to log guest errors, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 41/65] slirp: replace ARRAY_SIZE with G_N_ELEMENTS,
Samuel Thibault <=
- [Qemu-devel] [PULL 51/65] slirp: replace some fprintf() with DEBUG_MISC, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 42/65] net: do not depend on slirp internals, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 45/65] slirp: replace error_report() with g_critical(), Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 49/65] slirp: use virtual time for packet expiration, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 55/65] slirp: introduce SLIRP_DEBUG environment variable, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 64/65] slirp: Mark debugging calls as unlikely, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 61/65] build-sys: use a separate slirp-obj-y && slirp.mo, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 62/65] slirp: set G_LOG_DOMAIN, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 39/65] slirp: NULL is defined by stddef.h, Samuel Thibault, 2019/01/14
- [Qemu-devel] [PULL 34/65] slirp: replace error_report() with g_critical(), Samuel Thibault, 2019/01/14