summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/memclnt_api.c2
-rw-r--r--src/vlibmemory/memory_shared.c4
-rw-r--r--src/vlibmemory/socket_client.c14
-rw-r--r--src/vlibmemory/vlib_api_cli.c4
4 files changed, 12 insertions, 12 deletions
diff --git a/src/vlibmemory/memclnt_api.c b/src/vlibmemory/memclnt_api.c
index 87bb36a5426..289a4c5d947 100644
--- a/src/vlibmemory/memclnt_api.c
+++ b/src/vlibmemory/memclnt_api.c
@@ -500,7 +500,7 @@ api_rx_from_node (vlib_main_t *vm, vlib_node_runtime_t *node,
if (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
{
ASSERT (long_msg != 0);
- _vec_len (long_msg) = 0;
+ vec_set_len (long_msg, 0);
vec_add (long_msg, msg, msg_len);
while (b0->flags & VLIB_BUFFER_NEXT_PRESENT)
{
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c
index 1716f271466..5244b27ad37 100644
--- a/src/vlibmemory/memory_shared.c
+++ b/src/vlibmemory/memory_shared.c
@@ -545,8 +545,8 @@ vl_map_shmem (const char *region_name, int is_vlib)
if (strstr (region_name, vpe_api_region_suffix))
{
u8 *root_path = format (0, "%s", region_name);
- _vec_len (root_path) = (vec_len (root_path) -
- strlen (vpe_api_region_suffix));
+ vec_set_len (root_path,
+ vec_len (root_path) - strlen (vpe_api_region_suffix));
vec_terminate_c_string (root_path);
a->root_path = (const char *) root_path;
am->root_path = (const char *) root_path;
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c
index 7082d8ba7e0..237d2224d24 100644
--- a/src/vlibmemory/socket_client.c
+++ b/src/vlibmemory/socket_client.c
@@ -93,7 +93,7 @@ vl_socket_client_read_internal (socket_client_main_t * scm, int wait)
current_rx_index = vec_len (scm->socket_rx_buffer);
vec_validate (scm->socket_rx_buffer, current_rx_index
+ scm->socket_buffer_size - 1);
- _vec_len (scm->socket_rx_buffer) = current_rx_index;
+ vec_set_len (scm->socket_rx_buffer, current_rx_index);
n = read (scm->socket_fd, scm->socket_rx_buffer + current_rx_index,
scm->socket_buffer_size);
if (n < 0)
@@ -104,7 +104,7 @@ vl_socket_client_read_internal (socket_client_main_t * scm, int wait)
clib_unix_warning ("socket_read");
return -1;
}
- _vec_len (scm->socket_rx_buffer) += n;
+ vec_inc_len (scm->socket_rx_buffer, n);
}
#if CLIB_DEBUG > 1
@@ -116,7 +116,7 @@ vl_socket_client_read_internal (socket_client_main_t * scm, int wait)
data_len = ntohl (mbp->data_len);
current_rx_index = vec_len (scm->socket_rx_buffer);
vec_validate (scm->socket_rx_buffer, current_rx_index + data_len);
- _vec_len (scm->socket_rx_buffer) = current_rx_index;
+ vec_set_len (scm->socket_rx_buffer, current_rx_index);
mbp = (msgbuf_t *) (scm->socket_rx_buffer);
msg_size = data_len + sizeof (*mbp);
@@ -133,7 +133,7 @@ vl_socket_client_read_internal (socket_client_main_t * scm, int wait)
clib_unix_warning ("socket_read");
return -1;
}
- _vec_len (scm->socket_rx_buffer) += n;
+ vec_inc_len (scm->socket_rx_buffer, n);
}
if (vec_len (scm->socket_rx_buffer) >= data_len + sizeof (*mbp))
@@ -141,7 +141,7 @@ vl_socket_client_read_internal (socket_client_main_t * scm, int wait)
vl_msg_api_socket_handler ((void *) (mbp->data), data_len);
if (vec_len (scm->socket_rx_buffer) == data_len + sizeof (*mbp))
- _vec_len (scm->socket_rx_buffer) = 0;
+ vec_set_len (scm->socket_rx_buffer, 0);
else
vec_delete (scm->socket_rx_buffer, data_len + sizeof (*mbp), 0);
mbp = 0;
@@ -480,8 +480,8 @@ vl_socket_client_connect_internal (socket_client_main_t * scm,
SOCKET_CLIENT_DEFAULT_BUFFER_SIZE;
vec_validate (scm->socket_tx_buffer, scm->socket_buffer_size - 1);
vec_validate (scm->socket_rx_buffer, scm->socket_buffer_size - 1);
- _vec_len (scm->socket_rx_buffer) = 0;
- _vec_len (scm->socket_tx_buffer) = 0;
+ vec_set_len (scm->socket_rx_buffer, 0);
+ vec_set_len (scm->socket_tx_buffer, 0);
scm->name = format (0, "%s", client_name);
mp = vl_socket_client_msg_alloc2 (scm, sizeof (*mp));
diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c
index e3e7ee38e10..732ced7634c 100644
--- a/src/vlibmemory/vlib_api_cli.c
+++ b/src/vlibmemory/vlib_api_cli.c
@@ -673,7 +673,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename,
break;
}
- _vec_len (tmpbuf) = 0;
+ vec_set_len (tmpbuf, 0);
msg += size;
}
@@ -1285,7 +1285,7 @@ extract_name (u8 * s)
rv = vec_dup (s);
while (vec_len (rv) && rv[vec_len (rv)] != '_')
- _vec_len (rv)--;
+ vec_dec_len (rv, 0);
rv[vec_len (rv)] = 0;