[asterisk-commits] mmichelson: branch group/asterisk-cpp r168401 - in /team/group/asterisk-cpp/m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 18:20:04 CST 2009


Author: mmichelson
Date: Sat Jan 10 18:20:04 2009
New Revision: 168401

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168401
Log:
Get say.c and stdtime/localtime.c to compile


Modified:
    team/group/asterisk-cpp/main/say.c
    team/group/asterisk-cpp/main/stdtime/localtime.c

Modified: team/group/asterisk-cpp/main/say.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/say.c?view=diff&rev=168401&r1=168400&r2=168401
==============================================================================
--- team/group/asterisk-cpp/main/say.c (original)
+++ team/group/asterisk-cpp/main/say.c Sat Jan 10 18:20:04 2009
@@ -1773,7 +1773,7 @@
 }
 
 typedef struct {  
-	char *separator_dziesiatek;
+	const char *separator_dziesiatek;
 	char *cyfry[10];
 	char *cyfry2[10];
 	char *setki[10];
@@ -1785,7 +1785,7 @@
 static char *pl_rzad_na_tekst(odmiana *odm, int i, int rzad)
 {
 	if (rzad==0)
-		return "";
+		return (char *) "";
  
 	if (i==1)
 		return odm->rzedy[rzad - 1][0];
@@ -1795,7 +1795,7 @@
 		return odm->rzedy[rzad - 1][2];
 }
 
-static char* pl_append(char* buffer, char* str)
+static char* pl_append(char* buffer, const char* str)
 {
 	strcpy(buffer, str);
 	buffer += strlen(str); 
@@ -1979,31 +1979,31 @@
 
 */
 {
-	char *zenski_cyfry[] = {"0", "1z", "2z", "3", "4", "5", "6", "7", "8", "9"};
-
-	char *zenski_cyfry2[] = {"0", "1", "2z", "3", "4", "5", "6", "7", "8", "9"};
-
-	char *meski_cyfry[] = {"0", "1", "2-1m", "3-1m", "4-1m", "5m",  /*"2-1mdwaj"*/ "6m", "7m", "8m", "9m"};
-
-	char *meski_cyfry2[] = {"0", "1", "2-2m", "3-2m", "4-2m", "5m", "6m", "7m", "8m", "9m"};
-
-	char *meski_setki[] = {"", "100m", "200m", "300m", "400m", "500m", "600m", "700m", "800m", "900m"};
-
-	char *meski_dziesiatki[] = {"", "10m", "20m", "30m", "40m", "50m", "60m", "70m", "80m", "90m"};
-
-	char *meski_nastki[] = {"", "11m", "12m", "13m", "14m", "15m", "16m", "17m", "18m", "19m"};
-
-	char *nijaki_cyfry[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
-
-	char *nijaki_cyfry2[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
-
-	char *nijaki_setki[] = {"", "100", "200", "300", "400", "500", "600", "700", "800", "900"};
-
-	char *nijaki_dziesiatki[] = {"", "10", "20", "30", "40", "50", "60", "70", "80", "90"};
-
-	char *nijaki_nastki[] = {"", "11", "12", "13", "14", "15", "16", "17", "18", "19"};
-
-	char *rzedy[][3] = { {"1000", "1000.2", "1000.5"}, {"1000000", "1000000.2", "1000000.5"}, {"1000000000", "1000000000.2", "1000000000.5"}}; 
+	const char *zenski_cyfry[] = {"0", "1z", "2z", "3", "4", "5", "6", "7", "8", "9"};
+
+	const char *zenski_cyfry2[] = {"0", "1", "2z", "3", "4", "5", "6", "7", "8", "9"};
+
+	const char *meski_cyfry[] = {"0", "1", "2-1m", "3-1m", "4-1m", "5m",  /*"2-1mdwaj"*/ "6m", "7m", "8m", "9m"};
+
+	const char *meski_cyfry2[] = {"0", "1", "2-2m", "3-2m", "4-2m", "5m", "6m", "7m", "8m", "9m"};
+
+	const char *meski_setki[] = {"", "100m", "200m", "300m", "400m", "500m", "600m", "700m", "800m", "900m"};
+
+	const char *meski_dziesiatki[] = {"", "10m", "20m", "30m", "40m", "50m", "60m", "70m", "80m", "90m"};
+
+	const char *meski_nastki[] = {"", "11m", "12m", "13m", "14m", "15m", "16m", "17m", "18m", "19m"};
+
+	const char *nijaki_cyfry[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
+
+	const char *nijaki_cyfry2[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
+
+	const char *nijaki_setki[] = {"", "100", "200", "300", "400", "500", "600", "700", "800", "900"};
+
+	const char *nijaki_dziesiatki[] = {"", "10", "20", "30", "40", "50", "60", "70", "80", "90"};
+
+	const char *nijaki_nastki[] = {"", "11", "12", "13", "14", "15", "16", "17", "18", "19"};
+
+	const char *rzedy[][3] = { {"1000", "1000.2", "1000.5"}, {"1000000", "1000000.2", "1000000.5"}, {"1000000000", "1000000000.2", "1000000000.5"}}; 
 
 	/* Initialise variables to allow compilation on Debian-stable, etc */
 	odmiana *o;
@@ -2013,7 +2013,7 @@
 	static odmiana *odmiana_zenska = NULL; 
 
 	if (odmiana_nieosobowa == NULL) {
-		odmiana_nieosobowa = ast_malloc(sizeof(*odmiana_nieosobowa));
+		odmiana_nieosobowa = (odmiana *) ast_malloc(sizeof(*odmiana_nieosobowa));
 
 		odmiana_nieosobowa->separator_dziesiatek = " ";
 
@@ -2026,7 +2026,7 @@
 	}
 
 	if (odmiana_zenska == NULL) {
-		odmiana_zenska = ast_malloc(sizeof(*odmiana_zenska));
+		odmiana_zenska = (odmiana *) ast_malloc(sizeof(*odmiana_zenska));
 
 		odmiana_zenska->separator_dziesiatek = " ";
 
@@ -2039,7 +2039,7 @@
 	}
 
 	if (odmiana_meska == NULL) {
-		odmiana_meska = ast_malloc(sizeof(*odmiana_meska));
+		odmiana_meska = (odmiana *) ast_malloc(sizeof(*odmiana_meska));
 
 		odmiana_meska->separator_dziesiatek = " ";
 
@@ -2657,7 +2657,7 @@
 	/* options can be: '' or 'm' male gender; 'f' female gender; 'n' neuter gender; 'p' plural */
 	int res = 0, t = 0;
 	char fn[256] = "", fna[256] = "";
-	char *gender;
+	const char *gender;
 
 	if (options && !strncasecmp(options, "f", 1)) {
 		gender = "F";
@@ -2820,7 +2820,7 @@
 	/* options can be: '' or 'm' male gender; 'f' female gender; 'n' neuter gender; 'p' plural */
 	int res = 0, t = 0;
 	char fn[256] = "", fna[256] = "";
-	char *gender;
+	const char *gender;
 
 	if (options && !strncasecmp(options, "f", 1)) {
 		gender = "F";
@@ -7566,7 +7566,7 @@
 
 	while (res == 0 && (s = strstr(remaining, " "))) {
 		size_t len = s - remaining;
-		char* new_string = ast_malloc(len + 1 + strlen("digits/"));
+		char* new_string = (char *) ast_malloc(len + 1 + strlen("digits/"));
 
 		sprintf(new_string, "digits/");
 		strncat(new_string, remaining, len);  /* we can't sprintf() it, it's not null-terminated. */
@@ -7591,7 +7591,7 @@
 	/* the last chunk. */
 	if (res == 0 && *remaining) {
 
-		char* new_string = ast_malloc(strlen(remaining) + 1 + strlen("digits/"));
+		char* new_string = (char *) ast_malloc(strlen(remaining) + 1 + strlen("digits/"));
 		sprintf(new_string, "digits/%s", remaining);
 
 		if (!ast_streamfile(chan, new_string, language)) {

Modified: team/group/asterisk-cpp/main/stdtime/localtime.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/stdtime/localtime.c?view=diff&rev=168401&r1=168400&r2=168401
==============================================================================
--- team/group/asterisk-cpp/main/stdtime/localtime.c (original)
+++ team/group/asterisk-cpp/main/stdtime/localtime.c Sat Jan 10 18:20:04 2009
@@ -1023,7 +1023,7 @@
 	}
 	AST_LIST_UNLOCK(&zonelist);
 
-	if (!(sp = ast_calloc(1, sizeof *sp)))
+	if (!(sp = (struct state *) ast_calloc(1, sizeof *sp)))
 		return NULL;
 
 	if (tzload(zone, sp, TRUE) != 0) {
@@ -1763,7 +1763,7 @@
 int ast_strftime(char *buf, size_t len, const char *tmp, const struct ast_tm *tm)
 {
 	size_t fmtlen = strlen(tmp) + 1;
-	char *format = ast_calloc(1, fmtlen), *fptr = format, *newfmt;
+	char *format = (char *) ast_calloc(1, fmtlen), *fptr = format, *newfmt;
 	int decimals = -1, i, res;
 	long fraction;
 
@@ -1788,7 +1788,7 @@
 					decimals = 3;
 
 				/* Juggle some memory to fit the item */
-				newfmt = ast_realloc(format, fmtlen + decimals);
+				newfmt = (char *) ast_realloc(format, fmtlen + decimals);
 				if (!newfmt) {
 					ast_free(format);
 					return -1;




More information about the asterisk-commits mailing list