[asterisk-commits] file: trunk r74616 - in /trunk: apps/ include/asterisk/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 11 12:34:31 CDT 2007


Author: file
Date: Wed Jul 11 12:34:30 2007
New Revision: 74616

URL: http://svn.digium.com/view/asterisk?view=rev&rev=74616
Log:
Use the linkedlists.h AST_LIST_NEXT macro for modifying the list of results.

Modified:
    trunk/apps/app_speech_utils.c
    trunk/include/asterisk/speech.h
    trunk/res/res_speech.c

Modified: trunk/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_speech_utils.c?view=diff&rev=74616&r1=74615&r2=74616
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Wed Jul 11 12:34:30 2007
@@ -150,7 +150,7 @@
 		if (i == wanted_num)
 			break;
 		i++;
-	} while ((result = result->next));
+	} while ((result = AST_LIST_NEXT(result, list)));
 
 	return result;
 }
@@ -315,11 +315,8 @@
 			ast_copy_string(buf, "0", len);
 	} else if (!strcasecmp(data, "results")) {
 		/* Count number of results */
-		result = speech->results;
-		while (result) {
+		for (result = speech->results; result; result = AST_LIST_NEXT(result, list))
 			results++;
-			result = result->next;
-		}
 		snprintf(tmp, sizeof(tmp), "%d", results);
 		ast_copy_string(buf, tmp, len);
 	}

Modified: trunk/include/asterisk/speech.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/speech.h?view=diff&rev=74616&r1=74615&r2=74616
==============================================================================
--- trunk/include/asterisk/speech.h (original)
+++ trunk/include/asterisk/speech.h Wed Jul 11 12:34:30 2007
@@ -110,7 +110,7 @@
 	/*! Matched grammar */
 	char *grammar;
 	/*! List information */
-	struct ast_speech_result *next;
+	AST_LIST_ENTRY(ast_speech_result) list;
 };
 
 /*! \brief Activate a grammar on a speech structure */

Modified: trunk/res/res_speech.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_speech.c?view=diff&rev=74616&r1=74615&r2=74616
==============================================================================
--- trunk/res/res_speech.c (original)
+++ trunk/res/res_speech.c Wed Jul 11 12:34:30 2007
@@ -113,7 +113,7 @@
 			current_result->grammar = NULL;
 		}
 		/* Move on and then free ourselves */
-		current_result = current_result->next;
+		current_result = AST_LIST_NEXT(current_result, list);
 		ast_free(prev_result);
 		prev_result = NULL;
 	}




More information about the asterisk-commits mailing list