summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Wiberg <troglobit@gmail.com>2021-05-02 13:01:00 +0200
committerGitHub <noreply@github.com>2021-05-02 13:01:00 +0200
commitf8c4a70bc1c447352b6973b9e7179de9a988b007 (patch)
treebc2d522d5f2c51b7f1d33ea064bc2f0232a57caf
parentea7eb404c2f6254a3efa673138019151d5dbd49c (diff)
parent91f6727878c6f70920e85a8e1c91f4013c153dc8 (diff)
downloadlibnet-f8c4a70bc1c447352b6973b9e7179de9a988b007.tar.gz
Merge pull request #124 from ivalery111/resolve-potential-cpp-new-conflict
Fix potential name conflict with cpp keyword 'new'
-rw-r--r--src/libnet_cq.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libnet_cq.c b/src/libnet_cq.c
index b3c5677..5b109f3 100644
--- a/src/libnet_cq.c
+++ b/src/libnet_cq.c
@@ -70,7 +70,7 @@ clear_cq_lock(uint32_t x)
int
libnet_cq_add(libnet_t *l, char *label)
{
- libnet_cq_t *new;
+ libnet_cq_t *new_cq;
if (l == NULL)
{
@@ -127,8 +127,8 @@ libnet_cq_add(libnet_t *l, char *label)
return (-1);
}
- new = (libnet_cq_t *)malloc(sizeof (libnet_cq_t));
- if (new == NULL)
+ new_cq = (libnet_cq_t *)malloc(sizeof (libnet_cq_t));
+ if (new_cq == NULL)
{
snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
"%s(): can't malloc new context queue: %s",
@@ -136,17 +136,17 @@ libnet_cq_add(libnet_t *l, char *label)
return (-1);
}
- new->context = l;
+ new_cq->context = l;
/* label the context with the user specified string */
strncpy(l->label, label, LIBNET_LABEL_SIZE);
l->label[LIBNET_LABEL_SIZE -1] = '\0';
- new->next = l_cq;
- new->prev = NULL;
+ new_cq->next = l_cq;
+ new_cq->prev = NULL;
- l_cq->prev = new;
- l_cq = new;
+ l_cq->prev = new_cq;
+ l_cq = new_cq;
/* track the number of nodes in the context queue */
l_cqd.node++;