[asterisk-commits] trunk r9468 - in /trunk: apps/app_osplookup.c codecs/gsm/inc/private.h dnsmgr.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 10 20:13:26 MST 2006


Author: kpfleming
Date: Fri Feb 10 21:13:25 2006
New Revision: 9468

URL: http://svn.digium.com/view/asterisk?rev=9468&view=rev
Log:
fix compiler warnings

Modified:
    trunk/apps/app_osplookup.c
    trunk/codecs/gsm/inc/private.h
    trunk/dnsmgr.c

Modified: trunk/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_osplookup.c?rev=9468&r1=9467&r2=9468&view=diff
==============================================================================
--- trunk/apps/app_osplookup.c (original)
+++ trunk/apps/app_osplookup.c Fri Feb 10 21:13:25 2006
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2005, Digium, Inc.
+ * Copyright (C) 1999 - 2006, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -184,6 +184,7 @@
 	int res=0;
 	struct localuser *u;
 	char *temp;
+	const char *val;
 	int cause;
 	struct ast_osp_result result;
 	int priority_jump = 0;
@@ -212,11 +213,11 @@
 	}
 
 	cause = str2cause(args.cause);
-	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+	val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 	result.handle = -1;
-	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
-		temp = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
-		if (ast_strlen_zero(temp) || (sscanf(temp, "%d", &result.numresults) != 1)) {
+	if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
+		val = pbx_builtin_getvar_helper(chan, "OSPRESULTS");
+		if (ast_strlen_zero(val) || (sscanf(val, "%d", &result.numresults) != 1)) {
 			result.numresults = 0;
 		}
 		if ((res = ast_osp_next(&result, cause)) > 0) {
@@ -255,6 +256,7 @@
 	int res=0;
 	struct localuser *u;
 	char *temp;
+	const char *val;
 	int cause;
 	time_t start=0, duration=0;
 	struct ast_osp_result result;
@@ -293,9 +295,9 @@
 		ast_log(LOG_WARNING, "OSPFinish called on channel '%s' with no CDR!\n", chan->name);
 	
 	cause = str2cause(args.status);
-	temp = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
+	val = pbx_builtin_getvar_helper(chan, "OSPHANDLE");
 	result.handle = -1;
-	if (!ast_strlen_zero(temp) && (sscanf(temp, "%d", &result.handle) == 1) && (result.handle > -1)) {
+	if (!ast_strlen_zero(val) && (sscanf(val, "%d", &result.handle) == 1) && (result.handle > -1)) {
 		if (!ast_osp_terminate(result.handle, cause, start, duration)) {
 			pbx_builtin_setvar_helper(chan, "_OSPHANDLE", "");
 			pbx_builtin_setvar_helper(chan, "OSPFINISHSTATUS", "SUCCESS");

Modified: trunk/codecs/gsm/inc/private.h
URL: http://svn.digium.com/view/asterisk/trunk/codecs/gsm/inc/private.h?rev=9468&r1=9467&r2=9468&view=diff
==============================================================================
--- trunk/codecs/gsm/inc/private.h (original)
+++ trunk/codecs/gsm/inc/private.h Fri Feb 10 21:13:25 2006
@@ -149,17 +149,17 @@
 	          : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
 		    ? MAX_LONGWORD : utmp))
 
-static inline word GSM_ADD(a, b)
+static inline word GSM_ADD(longword a, longword b)
 {
 	register longword ltmp;
-	ltmp = (longword) (a) + (longword) (b);
+	ltmp = a + b;
 	return (word)((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp);
 };
 
-static inline word GSM_SUB(a, b)
+static inline word GSM_SUB(longword a, longword b)
 {
 	register longword ltmp;
-	ltmp = (longword) (a) - (longword) (b);
+	ltmp = a - b;
 	return (word)(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp);
 };
 

Modified: trunk/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/trunk/dnsmgr.c?rev=9468&r1=9467&r2=9468&view=diff
==============================================================================
--- trunk/dnsmgr.c (original)
+++ trunk/dnsmgr.c Fri Feb 10 21:13:25 2006
@@ -303,7 +303,6 @@
 	const char *enabled_value;
 	int interval;
 	int was_enabled;
-	pthread_attr_t attr;
 	int res = -1;
 
 	/* ensure that no refresh cycles run while the reload is in progress */



More information about the asterisk-commits mailing list