[Freeswitch-svn] [commit] r7261 - in freeswitch/trunk/src: . include

Freeswitch SVN mikej at freeswitch.org
Thu Jan 17 00:52:50 EST 2008


Author: mikej
Date: Thu Jan 17 00:52:50 2008
New Revision: 7261

Modified:
   freeswitch/trunk/src/include/switch_utils.h
   freeswitch/trunk/src/switch_utils.c

Log:
use unsigned more consistently 

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Thu Jan 17 00:52:50 2008
@@ -304,7 +304,7 @@
   \param arraylen the max number of elements in the array
   \return the number of elements added to the array
 */
-SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen);
+SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, unsigned int arraylen);
 
 SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
 SWITCH_DECLARE(char *) switch_strip_spaces(const char *str);

Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c	(original)
+++ freeswitch/trunk/src/switch_utils.c	Thu Jan 17 00:52:50 2008
@@ -1072,7 +1072,7 @@
 }
 
 /* Separate a string using a delimiter that is not a space */
-static unsigned int separate_string_char_delim(char *buf, char delim, char **array, int arraylen)
+static unsigned int separate_string_char_delim(char *buf, char delim, char **array, unsigned int arraylen)
 {
 	enum tokenizer_state {
 		START,
@@ -1082,7 +1082,7 @@
 	unsigned int count = 0;
 	char *ptr = buf;
 	int  inside_quotes = 0;
-	int i;
+	unsigned int i;
 	
 	while (*ptr && count < arraylen) {
 		switch (state) {
@@ -1113,7 +1113,7 @@
 }
 
 /* Separate a string using a delimiter that is a space */
-static unsigned int separate_string_blank_delim(char *buf, char **array, int arraylen)
+static unsigned int separate_string_blank_delim(char *buf, char **array, unsigned int arraylen)
 {
 	enum tokenizer_state {
 		START,
@@ -1125,7 +1125,7 @@
 	unsigned int count = 0;
 	char *ptr = buf;
 	int  inside_quotes = 0;
-	int i;
+	unsigned int i;
 
 	while (*ptr && count < arraylen) {
 		switch (state) {
@@ -1170,7 +1170,7 @@
 	return count;
 }
 
-SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen)
+SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, unsigned int arraylen)
 {
 	if (!buf || !array || !arraylen) {
 		return 0;



More information about the Freeswitch-svn mailing list