Hello,
what compiler and version threw the warnings you tried to fix in this
commit? I pulled git devel version and now get a lot of warnings related
to clist operations (e.g., from timer files, tm module), before they
were not printed for me.
I compiled on ubuntu 10.10, gcc 4.6.1, and mac os x, gcc 4.2.1, the
warning are like:
make
In file included from local_timer.h:41,
from tcp_read.c:80:
timer_funcs.h: In function ‘timer_redist’:
timer_funcs.h:155: warning: assignment from incompatible pointer type
timer_funcs.h:155: warning: assignment from incompatible pointer type
timer_funcs.h: In function ‘timer_run’:
timer_funcs.h:171: warning: assignment from incompatible pointer type
timer_funcs.h:171: warning: assignment from incompatible pointer type
make modules modules=modules/tm
CC (gcc) [M tm.so] config.o
In file included from lock.h:61,
from timer.h:116,
from config.c:35:
h_table.h: In function ‘insert_into_hash_table_unsafe’:
h_table.h:551: warning: assignment from incompatible pointer type
h_table.h: In function ‘remove_from_hash_table_unsafe’:
h_table.h:566: warning: assignment from incompatible pointer type
h_table.h:566: warning: assignment from incompatible pointer type
Cheers,
Daniel
On 1/17/12 10:35 AM, Anca Vamanu wrote:
Module: sip-router
Branch: master
Commit: 13fb8f05cadae84fc2f3479edd873d0bb0a09a60
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=13fb8f0…
Author: Anca Vamanu<anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu<anca.vamanu(a)1and1.ro>
Date: Tue Jan 17 11:02:50 2012 +0200
Fixed compile warnings - casts from void at memory allocation
---
clist.h | 10 +++++-----
str_hash.h | 2 +-
ut.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/clist.h b/clist.h
index c96a93e..124a83c 100644
--- a/clist.h
+++ b/clist.h
@@ -41,8 +41,8 @@
/*! \brief circular list */
#define clist_init(c, next, prev) \
do{ \
- (c)->next=(void*)(c); \
- (c)->prev=(void*)(c); \
+ (c)->next=(struct str_hash_entry*)(void*)(c); \
+ (c)->prev=(struct str_hash_entry*)(void*)(c); \
} while(0)
@@ -57,7 +57,7 @@
*/
#define clist_insert_sublist(head, s, e, next, prev) \
do{ \
- (s)->prev=(void*)(head); \
+ (s)->prev=(struct str_hash_entry*)(void*)(head); \
(e)->next=(head)->next; \
(e)->next->prev=(e); \
(head)->next=s; \
@@ -91,8 +91,8 @@
* instead! */
#define clist_rm_sublist(s, e, next, prev) \
do{\
- (s)->prev->next=(e)->next; \
- (e)->next->prev=(s)->prev ; \
+ (s)->prev->next=(struct str_hash_entry*)(e)->next; \
+ (e)->next->prev=(struct str_hash_entry*)(s)->prev ; \
}while(0)
diff --git a/str_hash.h b/str_hash.h
index 1de9748..62423f1 100644
--- a/str_hash.h
+++ b/str_hash.h
@@ -66,7 +66,7 @@ struct str_hash_table{
/* returns 0 on success,<0 on failure */
inline static int str_hash_alloc(struct str_hash_table* ht, int size)
{
- ht->table=pkg_malloc(sizeof(struct str_hash_head)*size);
+ ht->table=(struct str_hash_head*)pkg_malloc(sizeof(struct str_hash_head)*size);
if (ht->table==0)
return -1;
ht->size=size;
diff --git a/ut.h b/ut.h
index eaec93f..d7d09e6 100644
--- a/ut.h
+++ b/ut.h
@@ -695,7 +695,7 @@ static inline int str2sint(str* _s, int* _r)
*/
static inline int shm_str_dup(str* dst, const str* src)
{
- dst->s = shm_malloc(src->len);
+ dst->s = (char*)shm_malloc(src->len);
if (!dst->s) {
SHM_MEM_ERROR;
return -1;
@@ -717,7 +717,7 @@ static inline int shm_str_dup(str* dst, const str* src)
*/
static inline int pkg_str_dup(str* dst, const str* src)
{
- dst->s = pkg_malloc(src->len);
+ dst->s = (char*)pkg_malloc(src->len);
if (dst->s==NULL)
{
PKG_MEM_ERROR;
_______________________________________________
sr-dev mailing list
sr-dev(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin Mierla --
http://www.asipto.com
http://linkedin.com/in/miconda --
http://twitter.com/miconda