summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-08-25 08:45:46 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-08-25 08:45:46 +0000
commit7ffa781dc39a7274692d8db11043b3a9e92e36ce (patch)
tree77653933e1c211dbec6c125da9ec5c28f9eeaa4e /pjlib
parent1b41ed3f7c9361106a585c1fe43d2338ab94cacc (diff)
Re #1881: Fixed compile warnings on VS2015 about declaration hides previous declaration.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5170 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/src/pj/errno.c10
-rw-r--r--pjlib/src/pj/pool_caching.c2
-rw-r--r--pjlib/src/pjlib-test/ioq_perf.c2
-rw-r--r--pjlib/src/pjlib-test/ioq_udp.c12
-rw-r--r--pjlib/src/pjlib-test/pool.c10
-rw-r--r--pjlib/src/pjlib-test/pool_perf.c6
-rw-r--r--pjlib/src/pjlib-test/timer.c9
-rw-r--r--pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c10
8 files changed, 31 insertions, 30 deletions
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index dd39e23c..8cf90f3c 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -98,11 +98,11 @@ static int pjlib_error(pj_status_t code, char *buf, pj_size_t size)
for (i=0; i<sizeof(err_str)/sizeof(err_str[0]); ++i) {
if (err_str[i].code == code) {
- pj_size_t len = strlen(err_str[i].msg);
- if (len >= size) len = size-1;
- pj_memcpy(buf, err_str[i].msg, len);
- buf[len] = '\0';
- return (int)len;
+ pj_size_t len2 = pj_ansi_strlen(err_str[i].msg);
+ if (len2 >= size) len2 = size-1;
+ pj_memcpy(buf, err_str[i].msg, len2);
+ buf[len2] = '\0';
+ return (int)len2;
}
}
#endif
diff --git a/pjlib/src/pj/pool_caching.c b/pjlib/src/pj/pool_caching.c
index 3a969233..8e2c9920 100644
--- a/pjlib/src/pj/pool_caching.c
+++ b/pjlib/src/pj/pool_caching.c
@@ -90,8 +90,8 @@ PJ_DEF(void) pj_caching_pool_destroy( pj_caching_pool *cp )
/* Delete all pool in free list */
for (i=0; i < PJ_CACHING_POOL_ARRAY_SIZE; ++i) {
- pj_pool_t *pool = (pj_pool_t*) cp->free_list[i].next;
pj_pool_t *next;
+ pool = (pj_pool_t*) cp->free_list[i].next;
for (; pool != (void*)&cp->free_list[i]; pool = next) {
next = pool->next;
pj_list_erase(pool);
diff --git a/pjlib/src/pjlib-test/ioq_perf.c b/pjlib/src/pjlib-test/ioq_perf.c
index 2dd94442..8c736f1a 100644
--- a/pjlib/src/pjlib-test/ioq_perf.c
+++ b/pjlib/src/pjlib-test/ioq_perf.c
@@ -84,9 +84,9 @@ static void on_read_complete(pj_ioqueue_key_t *key,
return;
if (bytes_read < 0) {
- pj_status_t rc = (pj_status_t)-bytes_read;
char errmsg[PJ_ERR_MSG_SIZE];
+ rc = (pj_status_t)-bytes_read;
if (rc != last_error) {
//last_error = rc;
pj_strerror(rc, errmsg, sizeof(errmsg));
diff --git a/pjlib/src/pjlib-test/ioq_udp.c b/pjlib/src/pjlib-test/ioq_udp.c
index 86a01c7e..3efd7fec 100644
--- a/pjlib/src/pjlib-test/ioq_udp.c
+++ b/pjlib/src/pjlib-test/ioq_udp.c
@@ -263,21 +263,21 @@ static int compliance_test(pj_bool_t allow_concur)
// Poll if pending.
while (send_pending || recv_pending) {
- int rc;
+ int ret;
pj_time_val timeout = { 5, 0 };
TRACE_("poll...");
#ifdef PJ_SYMBIAN
- rc = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
+ ret = pj_symbianos_poll(-1, PJ_TIME_VAL_MSEC(timeout));
#else
- rc = pj_ioqueue_poll(ioque, &timeout);
+ ret = pj_ioqueue_poll(ioque, &timeout);
#endif
- if (rc == 0) {
+ if (ret == 0) {
PJ_LOG(1,(THIS_FILE, "...ERROR: timed out..."));
status=-45; goto on_error;
- } else if (rc < 0) {
- app_perror("...ERROR in ioqueue_poll()", -rc);
+ } else if (ret < 0) {
+ app_perror("...ERROR in ioqueue_poll()", -ret);
status=-50; goto on_error;
}
diff --git a/pjlib/src/pjlib-test/pool.c b/pjlib/src/pjlib-test/pool.c
index e3fbb555..581ccc69 100644
--- a/pjlib/src/pjlib-test/pool.c
+++ b/pjlib/src/pjlib-test/pool.c
@@ -190,20 +190,20 @@ static int drain_test(pj_size_t size, pj_size_t increment)
/* Drain the pool until there's nothing left. */
while (freesize > 0) {
- int size;
+ int size2;
if (freesize > 255)
- size = ((pj_rand() & 0x000000FF) + PJ_POOL_ALIGNMENT) &
+ size2 = ((pj_rand() & 0x000000FF) + PJ_POOL_ALIGNMENT) &
~(PJ_POOL_ALIGNMENT - 1);
else
- size = (int)freesize;
+ size2 = (int)freesize;
- p = pj_pool_alloc(pool, size);
+ p = pj_pool_alloc(pool, size2);
if (!p) {
status=-20; goto on_error;
}
- freesize -= size;
+ freesize -= size2;
}
/* Check that capacity is zero. */
diff --git a/pjlib/src/pjlib-test/pool_perf.c b/pjlib/src/pjlib-test/pool_perf.c
index 5847f4df..82407cea 100644
--- a/pjlib/src/pjlib-test/pool_perf.c
+++ b/pjlib/src/pjlib-test/pool_perf.c
@@ -47,14 +47,14 @@ static int pool_test_pool()
return -1;
for (i=0; i<COUNT; ++i) {
- char *p;
- if ( (p=(char*)pj_pool_alloc(pool, sizes[i])) == NULL) {
+ char *ptr;
+ if ( (ptr=(char*)pj_pool_alloc(pool, sizes[i])) == NULL) {
PJ_LOG(3,(THIS_FILE," error: pool failed to allocate %d bytes",
sizes[i]));
pj_pool_release(pool);
return -1;
}
- *p = '\0';
+ *ptr = '\0';
}
pj_pool_release(pool);
diff --git a/pjlib/src/pjlib-test/timer.c b/pjlib/src/pjlib-test/timer.c
index 9521aa9e..26c035e8 100644
--- a/pjlib/src/pjlib-test/timer.c
+++ b/pjlib/src/pjlib-test/timer.c
@@ -58,7 +58,8 @@ static int test_timer_heap(void)
pj_pool_t *pool;
pj_timer_heap_t *timer;
pj_time_val delay;
- pj_status_t rc; int err=0;
+ pj_status_t status;
+ int err=0;
pj_size_t size;
unsigned count;
@@ -77,9 +78,9 @@ static int test_timer_heap(void)
for (i=0; i<MAX_COUNT; ++i) {
entry[i].cb = &timer_callback;
}
- rc = pj_timer_heap_create(pool, MAX_COUNT, &timer);
- if (rc != PJ_SUCCESS) {
- app_perror("...error: unable to create timer heap", rc);
+ status = pj_timer_heap_create(pool, MAX_COUNT, &timer);
+ if (status != PJ_SUCCESS) {
+ app_perror("...error: unable to create timer heap", status);
return -30;
}
diff --git a/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c b/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
index bd701655..445c9d7d 100644
--- a/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
+++ b/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
@@ -36,7 +36,7 @@ struct op_key
int addrlen;
};
-static void on_read_complete(pj_ioqueue_key_t *key,
+static void on_read_complete(pj_ioqueue_key_t *ioq_key,
pj_ioqueue_op_key_t *op_key,
pj_ssize_t bytes_received)
{
@@ -62,7 +62,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
pj_memcpy(send_rec->buffer, recv_rec->buffer, bytes_received);
pj_memcpy(&send_rec->addr, &recv_rec->addr, recv_rec->addrlen);
send_rec->addrlen = recv_rec->addrlen;
- rc = pj_ioqueue_sendto(key, &send_rec->op_key_,
+ rc = pj_ioqueue_sendto(ioq_key, &send_rec->op_key_,
send_rec->buffer, &sent, 0,
&send_rec->addr, send_rec->addrlen);
send_rec->is_pending = (rc==PJ_EPENDING);
@@ -75,7 +75,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
if (!send_rec->is_pending) {
bytes_received = recv_rec->size;
- rc = pj_ioqueue_recvfrom(key, &recv_rec->op_key_,
+ rc = pj_ioqueue_recvfrom(ioq_key, &recv_rec->op_key_,
recv_rec->buffer, &bytes_received, 0,
&recv_rec->addr, &recv_rec->addrlen);
recv_rec->is_pending = (rc==PJ_EPENDING);
@@ -99,7 +99,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
}
}
-static void on_write_complete(pj_ioqueue_key_t *key,
+static void on_write_complete(pj_ioqueue_key_t *ioq_key,
pj_ioqueue_op_key_t *op_key,
pj_ssize_t bytes_sent)
{
@@ -114,7 +114,7 @@ static void on_write_complete(pj_ioqueue_key_t *key,
}
send_rec->is_pending = 0;
- on_read_complete(key, &send_rec->peer->op_key_, 0);
+ on_read_complete(ioq_key, &send_rec->peer->op_key_, 0);
}
static int worker_thread(void *arg)