瀏覽代碼

- warnings fixed for gcc-3.4
- older solaris support (5.6)

Andrei Pelinescu-Onciul 21 年之前
父節點
當前提交
4168f707f1
共有 8 個文件被更改,包括 35 次插入26 次删除
  1. 2 2
      Makefile
  2. 9 2
      Makefile.defs
  3. 4 4
      mem/f_malloc.c
  4. 5 5
      mem/f_malloc.h
  5. 4 4
      mem/q_malloc.c
  6. 6 6
      mem/q_malloc.h
  7. 2 1
      mem/shm_mem.c
  8. 3 2
      mem/shm_mem.h

+ 2 - 2
Makefile

@@ -45,12 +45,12 @@ skip_cfg_install?=
 skip_modules?=
 
 # if not set on the cmd. line or the env, exclude this modules:
-exclude_modules?= 			cpl ext extcmd avp_radius \
+exclude_modules?= 			cpl ext extcmd \
 							postgres snmp \
 							im \
 							jabber mysql \
 							cpl-c \
-							auth_radius group_radius uri_radius \
+							auth_radius group_radius uri_radius avp_radius \
 							pa
 # always exclude the CVS dir
 override exclude_modules+= CVS $(skip_modules)

+ 9 - 2
Makefile.defs

@@ -50,7 +50,7 @@ MAIN_NAME=ser
 VERSION = 0
 PATCHLEVEL = 8
 SUBLEVEL =   99
-EXTRAVERSION = -dev24
+EXTRAVERSION = -dev25
 
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
@@ -778,7 +778,14 @@ endif
 ifeq ($(CC_NAME), suncc)
 	LIBS= -lfast -ldl -lresolv
 endif
-	LIBS+= -L/usr/local/lib -lfl -lxnet -lrt -lnsl 
+	OLD_SOLARIS= $(shell echo "$(OSREL)" | \
+				sed -e 's/^5\.[0-6][^0-9]*$$/yes/' )
+	LIBS+= -L/usr/local/lib -lfl -lxnet -lnsl 
+ifeq	($(OLD_SOLARIS), yes)
+		LIBS+=-lposix4
+else
+		LIBS+=-lrt
+endif
 	# -lrt needed for sched_yield
 endif
 

+ 4 - 4
mem/f_malloc.c

@@ -140,7 +140,7 @@ static inline
 #ifdef DBG_F_MALLOC 
 void fm_split_frag(struct fm_block* qm, struct fm_frag* frag,
 					unsigned long size,
-					char* file, char* func, unsigned int line)
+					const char* file, const char* func, unsigned int line)
 #else
 void fm_split_frag(struct fm_block* qm, struct fm_frag* frag,
 					unsigned long size)
@@ -234,7 +234,7 @@ struct fm_block* fm_malloc_init(char* address, unsigned long size)
 
 #ifdef DBG_F_MALLOC
 void* fm_malloc(struct fm_block* qm, unsigned long size,
-					char* file, char* func, unsigned int line)
+					const char* file, const char* func, unsigned int line)
 #else
 void* fm_malloc(struct fm_block* qm, unsigned long size)
 #endif
@@ -297,7 +297,7 @@ found:
 
 
 #ifdef DBG_F_MALLOC
-void fm_free(struct fm_block* qm, void* p, char* file, char* func, 
+void fm_free(struct fm_block* qm, void* p, const char* file, const char* func, 
 				unsigned int line)
 #else
 void fm_free(struct fm_block* qm, void* p)
@@ -338,7 +338,7 @@ void fm_free(struct fm_block* qm, void* p)
 
 #ifdef DBG_F_MALLOC
 void* fm_realloc(struct fm_block* qm, void* p, unsigned long size,
-					char* file, char* func, unsigned int line)
+					const char* file, const char* func, unsigned int line)
 #else
 void* fm_realloc(struct fm_block* qm, void* p, unsigned long size)
 #endif

+ 5 - 5
mem/f_malloc.h

@@ -81,8 +81,8 @@ struct fm_frag{
 		long reserved;
 	}u;
 #ifdef DBG_F_MALLOC
-	char* file;
-	char* func;
+	const char* file;
+	const char* func;
 	unsigned long line;
 	unsigned long check;
 #endif
@@ -113,13 +113,13 @@ struct fm_block* fm_malloc_init(char* address, unsigned long size);
 
 #ifdef DBG_F_MALLOC
 void* fm_malloc(struct fm_block*, unsigned long size,
-					char* file, char* func, unsigned int line);
+					const char* file, const char* func, unsigned int line);
 #else
 void* fm_malloc(struct fm_block*, unsigned long size);
 #endif
 
 #ifdef DBG_F_MALLOC
-void  fm_free(struct fm_block*, void* p, char* file, char* func, 
+void  fm_free(struct fm_block*, void* p, const char* file, const char* func, 
 				unsigned int line);
 #else
 void  fm_free(struct fm_block*, void* p);
@@ -127,7 +127,7 @@ void  fm_free(struct fm_block*, void* p);
 
 #ifdef DBG_F_MALLOC
 void*  fm_realloc(struct fm_block*, void* p, unsigned long size, 
-					char* file, char* func, unsigned int line);
+					const char* file, const char* func, unsigned int line);
 #else
 void*  fm_realloc(struct fm_block*, void* p, unsigned long size);
 #endif

+ 4 - 4
mem/q_malloc.c

@@ -301,7 +301,7 @@ static inline struct qm_frag* qm_find_free(struct qm_block* qm,
 static inline
 #ifdef DBG_QM_MALLOC
 int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size,
-				char* file, char* func, unsigned int line)
+				const char* file, const char* func, unsigned int line)
 #else
 int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size)
 #endif
@@ -348,7 +348,7 @@ int split_frag(struct qm_block* qm, struct qm_frag* f, unsigned long new_size)
 
 #ifdef DBG_QM_MALLOC
 void* qm_malloc(struct qm_block* qm, unsigned long size,
-					char* file, char* func, unsigned int line)
+					const char* file, const char* func, unsigned int line)
 #else
 void* qm_malloc(struct qm_block* qm, unsigned long size)
 #endif
@@ -411,7 +411,7 @@ void* qm_malloc(struct qm_block* qm, unsigned long size)
 
 
 #ifdef DBG_QM_MALLOC
-void qm_free(struct qm_block* qm, void* p, char* file, char* func, 
+void qm_free(struct qm_block* qm, void* p, const char* file, const char* func, 
 				unsigned int line)
 #else
 void qm_free(struct qm_block* qm, void* p)
@@ -496,7 +496,7 @@ void qm_free(struct qm_block* qm, void* p)
 
 #ifdef DBG_QM_MALLOC
 void* qm_realloc(struct qm_block* qm, void* p, unsigned long size,
-					char* file, char* func, unsigned int line)
+					const char* file, const char* func, unsigned int line)
 #else
 void* qm_realloc(struct qm_block* qm, void* p, unsigned long size)
 #endif

+ 6 - 6
mem/q_malloc.h

@@ -83,8 +83,8 @@ struct qm_frag{
 		long is_free;
 	}u;
 #ifdef DBG_QM_MALLOC
-	char* file;
-	char* func;
+	const char* file;
+	const char* func;
 	unsigned long line;
 	unsigned long check;
 #endif
@@ -128,21 +128,21 @@ struct qm_block{
 struct qm_block* qm_malloc_init(char* address, unsigned long size);
 
 #ifdef DBG_QM_MALLOC
-void* qm_malloc(struct qm_block*, unsigned long size, char* file, char* func, 
-					unsigned int line);
+void* qm_malloc(struct qm_block*, unsigned long size, const char* file,
+					const char* func, unsigned int line);
 #else
 void* qm_malloc(struct qm_block*, unsigned long size);
 #endif
 
 #ifdef DBG_QM_MALLOC
-void  qm_free(struct qm_block*, void* p, char* file, char* func, 
+void  qm_free(struct qm_block*, void* p, const char* file, const char* func, 
 				unsigned int line);
 #else
 void  qm_free(struct qm_block*, void* p);
 #endif
 #ifdef DBG_QM_MALLOC
 void* qm_realloc(struct qm_block*, void* p, unsigned long size,
-				char* file, char* func, unsigned int line);
+					const char* file, const char* func, unsigned int line);
 #else
 void* qm_realloc(struct qm_block*, void* p, unsigned long size);
 #endif

+ 2 - 1
mem/shm_mem.c

@@ -91,7 +91,8 @@ inline static void* sh_realloc(void* p, unsigned int size)
 */
 
 #ifdef DBG_QM_MALLOC
-void* _shm_resize( void* p, unsigned int s, char* file, char* func, int line)
+void* _shm_resize( void* p, unsigned int s, const char* file, const char* func,
+							int line)
 #else
 void* _shm_resize( void* p , unsigned int s)
 #endif

+ 3 - 2
mem/shm_mem.h

@@ -127,7 +127,7 @@ void shm_mem_destroy();
 
 
 inline static void* _shm_malloc(unsigned int size, 
-	char *file, char *function, int line )
+	const char *file, const char *function, int line )
 {
 	void *p;
 	
@@ -168,7 +168,8 @@ do { \
 
 
 
-void* _shm_resize(void* ptr, unsigned int size, char* f, char* fn, int line);
+void* _shm_resize(void* ptr, unsigned int size, const char* f, const char* fn,
+					int line);
 #define shm_resize(_p, _s ) _shm_resize((_p), (_s), \
 		__FILE__, __FUNCTION__, __LINE__ )
 /*#define shm_resize(_p, _s ) shm_realloc( (_p), (_s))*/