[asterisk-commits] tilghman: trunk r72492 - in /trunk: include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 28 14:41:18 CDT 2007


Author: tilghman
Date: Thu Jun 28 14:41:18 2007
New Revision: 72492

URL: http://svn.digium.com/view/asterisk?view=rev&rev=72492
Log:
Remove the ill-advised ast_restrdupa API call and related structures

Modified:
    trunk/include/asterisk/strings.h
    trunk/res/res_config_odbc.c
    trunk/res/res_config_pgsql.c

Modified: trunk/include/asterisk/strings.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/strings.h?view=diff&rev=72492&r1=72491&r2=72492
==============================================================================
--- trunk/include/asterisk/strings.h (original)
+++ trunk/include/asterisk/strings.h Thu Jun 28 14:41:18 2007
@@ -244,24 +244,6 @@
 */
 int ast_get_time_t(const char *src, time_t *dst, time_t _default, int *consumed);
 
-/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
-
-struct ast_realloca {
-	char *ptr;
-	int alloclen;
-};
-
-#define ast_restrdupa(ra, s) \
-	({ \
-		if ((ra)->ptr && strlen(s) + 1 < (ra)->alloclen) { \
-			strcpy((ra)->ptr, s); \
-		} else { \
-			(ra)->ptr = alloca(strlen(s) + 1 - (ra)->alloclen); \
-			if ((ra)->ptr) (ra)->alloclen = strlen(s) + 1; \
-		} \
-		(ra)->ptr; \
-	})
-
 /*!
  * Support for dynamic strings.
  *

Modified: trunk/res/res_config_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_config_odbc.c?view=diff&rev=72492&r1=72491&r2=72492
==============================================================================
--- trunk/res/res_config_odbc.c (original)
+++ trunk/res/res_config_odbc.c Thu Jun 28 14:41:18 2007
@@ -220,7 +220,6 @@
 	struct ast_variable *var=NULL;
 	struct ast_config *cfg=NULL;
 	struct ast_category *cat=NULL;
-	struct ast_realloca ra;
 	SQLULEN colsize;
 	SQLSMALLINT colcount=0;
 	SQLSMALLINT datatype;
@@ -230,11 +229,9 @@
 
 	va_list aq;
 	va_copy(aq, ap);
-	
-	
+
 	if (!table)
 		return NULL;
-	memset(&ra, 0, sizeof(ra));
 
 	obj = ast_odbc_request_obj(database, 0);
 	if (!obj)

Modified: trunk/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_config_pgsql.c?view=diff&rev=72492&r1=72491&r2=72492
==============================================================================
--- trunk/res/res_config_pgsql.c (original)
+++ trunk/res/res_config_pgsql.c Thu Jun 28 14:41:18 2007
@@ -208,7 +208,6 @@
 	char *chunk;
 	char *op;
 	const char *newparam, *newval;
-	struct ast_realloca ra;
 	struct ast_variable *var = NULL;
 	struct ast_config *cfg = NULL;
 	struct ast_category *cat = NULL;
@@ -217,8 +216,6 @@
 		ast_log(LOG_WARNING, "Postgresql RealTime: No table specified.\n");
 		return NULL;
 	}
-
-	memset(&ra, 0, sizeof(ra));
 
 	if (!(cfg = ast_config_new()))
 		return NULL;




More information about the asterisk-commits mailing list