[asterisk-commits] seanbright: branch group/asterisk-cpp r168496 - in /team/group/asterisk-cpp: ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 12 10:24:22 CST 2009
Author: seanbright
Date: Mon Jan 12 10:24:22 2009
New Revision: 168496
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168496
Log:
Get some of the stuff in res/ compiling
Modified:
team/group/asterisk-cpp/include/asterisk/adsi.h
team/group/asterisk-cpp/res/ael/ael.flex
team/group/asterisk-cpp/res/ael/ael.tab.c
team/group/asterisk-cpp/res/ael/ael.y
team/group/asterisk-cpp/res/ael/ael_lex.c
team/group/asterisk-cpp/res/ael/pval.c
team/group/asterisk-cpp/res/res_adsi.c
team/group/asterisk-cpp/res/res_ael_share.c
Modified: team/group/asterisk-cpp/include/asterisk/adsi.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/adsi.h?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/adsi.h (original)
+++ team/group/asterisk-cpp/include/asterisk/adsi.h Mon Jan 12 10:24:22 2009
@@ -282,7 +282,7 @@
* \retval -1 on error.
*/
-extern int (*ast_adsi_display)(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
+extern int (*ast_adsi_display)(unsigned char *buf, int page, int line, int just, int wrap, char *col1, const char *col2);
/*!
* \brief Sets the current line and page.
Modified: team/group/asterisk-cpp/res/ael/ael.flex
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/ael/ael.flex?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/ael/ael.flex (original)
+++ team/group/asterisk-cpp/res/ael/ael.flex Mon Jan 12 10:24:22 2009
@@ -316,7 +316,7 @@
/* a non-word constituent char, like a space, tab, curly, paren, etc */
char c = yytext[yyleng-1];
STORE_POS;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = 0;
unput(c); /* put this ending char back in the stream */
@@ -330,7 +330,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -359,7 +359,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -373,7 +373,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -402,7 +402,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -423,7 +423,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
prev_word = 0;
@@ -434,7 +434,7 @@
yymore();
} else {
STORE_LOC;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = 0;
unput(')');
@@ -458,7 +458,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -488,7 +488,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -502,7 +502,7 @@
BEGIN(0);
if ( !strcmp(yytext, ")") )
return RP;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
unput(')');
@@ -517,7 +517,7 @@
STORE_LOC;
if( !strcmp(yytext,"," ) )
return COMMA;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */
unput(',');
@@ -531,7 +531,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = '\0';
return word;
@@ -556,7 +556,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = '\0';
return word;
@@ -566,7 +566,7 @@
<semic>{NOSEMIC}; {
STORE_LOC;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */
unput(';');
@@ -585,7 +585,7 @@
p2 = strrchr(yytext,'"');
if ( include_stack_index >= MAX_INCLUDE_DEPTH ) {
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col);
- } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
+ } else if ( (size_t)(p2-p1) > sizeof(fnamebuf) - 1 ) {
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10);
} else {
strncpy(fnamebuf, p1+1, p2-p1-1);
@@ -621,7 +621,7 @@
<<EOF>> {
char fnamebuf[2048];
- if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
+ if (include_stack_index > 0 && (size_t) include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner );
include_stack[include_stack_index-1].globbuf_pos++;
setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0);
@@ -788,7 +788,7 @@
/* extern int ael_yydebug; */
- io = calloc(sizeof(struct parse_io),1);
+ io = (struct parse_io *) calloc(sizeof(struct parse_io),1);
/* reset the global counters */
prev_word = 0;
my_lineno = 1;
@@ -807,7 +807,7 @@
my_file = strdup(filename);
stat(filename, &stats);
buffer = (char*)malloc(stats.st_size+2);
- if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
+ if (fread(buffer, 1, stats.st_size, fin) != (unsigned int) stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
}
buffer[stats.st_size]=0;
@@ -877,7 +877,7 @@
struct stat stats;
stat(fnamebuf2, &stats);
buffer = (char*)malloc(stats.st_size+1);
- if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
+ if (fread(buffer, 1, stats.st_size, in1) != (unsigned int) stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
}
buffer[stats.st_size] = 0;
Modified: team/group/asterisk-cpp/res/ael/ael.tab.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/ael/ael.tab.c?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/ael/ael.tab.c (original)
+++ team/group/asterisk-cpp/res/ael/ael.tab.c Mon Jan 12 10:24:22 2009
@@ -2352,7 +2352,7 @@
#line 286 "ael.y"
{
(yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (5)]), &(yylsp[(3) - (5)]));
- (yyval.pval)->u1.str = malloc(strlen((yyvsp[(1) - (5)].str))+strlen((yyvsp[(3) - (5)].str))+2);
+ (yyval.pval)->u1.str = (char *) malloc(strlen((yyvsp[(1) - (5)].str))+strlen((yyvsp[(3) - (5)].str))+2);
strcpy((yyval.pval)->u1.str,(yyvsp[(1) - (5)].str));
strcat((yyval.pval)->u1.str,"@");
strcat((yyval.pval)->u1.str,(yyvsp[(3) - (5)].str));
@@ -2713,7 +2713,7 @@
tot++; /* for a sep like a comma */
}
tot+=4; /* for safety */
- bufx = calloc(1, tot);
+ bufx = (char *) calloc(1, tot);
strcpy(bufx,(yyvsp[(1) - (5)].pval)->u1.str);
strcat(bufx,"(");
/* XXX need to advance the pointer or the loop is very inefficient */
@@ -3302,7 +3302,7 @@
#line 701 "ael.y"
-static char *token_equivs1[] =
+static const char *token_equivs1[] =
{
"AMPER",
"AT",
@@ -3342,7 +3342,7 @@
"SEMI",
};
-static char *token_equivs2[] =
+static const char *token_equivs2[] =
{
"&",
"@",
@@ -3402,7 +3402,7 @@
}
len++;
}
- res = calloc(1, len+1);
+ res = (char *) calloc(1, len+1);
res[0] = 0;
s = res;
for (p=mess; *p;) {
@@ -3410,7 +3410,7 @@
for (i=0; i<token_equivs_entries; i++) {
if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 ) {
*s++ = '\'';
- for (t=token_equivs2[i]; *t;) {
+ for (t=(char *) token_equivs2[i]; *t;) {
*s++ = *t++;
}
*s++ = '\'';
@@ -3441,7 +3441,7 @@
struct pval *npval(pvaltype type, int first_line, int last_line,
int first_column, int last_column)
{
- pval *z = calloc(1, sizeof(struct pval));
+ pval *z = (pval *) calloc(1, sizeof(struct pval));
z->type = type;
z->startline = first_line;
z->endline = last_line;
Modified: team/group/asterisk-cpp/res/ael/ael.y
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/ael/ael.y?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/ael/ael.y (original)
+++ team/group/asterisk-cpp/res/ael/ael.y Mon Jan 12 10:24:22 2009
@@ -285,7 +285,7 @@
$$->u2.statements = $3; set_dads($$,$3);}
| word AT word EXTENMARK statement {
$$ = npval2(PV_EXTENSION, &@1, &@3);
- $$->u1.str = malloc(strlen($1)+strlen($3)+2);
+ $$->u1.str = (char *) malloc(strlen($1)+strlen($3)+2);
strcpy($$->u1.str,$1);
strcat($$->u1.str,"@");
strcat($$->u1.str,$3);
@@ -504,7 +504,7 @@
tot++; /* for a sep like a comma */
}
tot+=4; /* for safety */
- bufx = calloc(1, tot);
+ bufx = (char *) calloc(1, tot);
strcpy(bufx,$1->u1.str);
strcat(bufx,"(");
/* XXX need to advance the pointer or the loop is very inefficient */
@@ -700,7 +700,7 @@
%%
-static char *token_equivs1[] =
+static const char *token_equivs1[] =
{
"AMPER",
"AT",
@@ -740,7 +740,7 @@
"SEMI",
};
-static char *token_equivs2[] =
+static const char *token_equivs2[] =
{
"&",
"@",
@@ -800,7 +800,7 @@
}
len++;
}
- res = calloc(1, len+1);
+ res = (char *) calloc(1, len+1);
res[0] = 0;
s = res;
for (p=mess; *p;) {
@@ -808,7 +808,7 @@
for (i=0; i<token_equivs_entries; i++) {
if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 ) {
*s++ = '\'';
- for (t=token_equivs2[i]; *t;) {
+ for (t=(char *) token_equivs2[i]; *t;) {
*s++ = *t++;
}
*s++ = '\'';
@@ -839,7 +839,7 @@
struct pval *npval(pvaltype type, int first_line, int last_line,
int first_column, int last_column)
{
- pval *z = calloc(1, sizeof(struct pval));
+ pval *z = (pval *) calloc(1, sizeof(struct pval));
z->type = type;
z->startline = first_line;
z->endline = last_line;
Modified: team/group/asterisk-cpp/res/ael/ael_lex.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/ael/ael_lex.c?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/ael/ael_lex.c (original)
+++ team/group/asterisk-cpp/res/ael/ael_lex.c Mon Jan 12 10:24:22 2009
@@ -16,7 +16,6 @@
/* First, we deal with platform-specific or compiler-specific issues. */
-#include "asterisk.h"
/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
@@ -1619,7 +1618,7 @@
/* a non-word constituent char, like a space, tab, curly, paren, etc */
char c = yytext[yyleng-1];
STORE_POS;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = 0;
unput(c); /* put this ending char back in the stream */
@@ -1636,7 +1635,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1673,7 +1672,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1690,7 +1689,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1727,7 +1726,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1751,7 +1750,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression: %s !\n", my_file, my_lineno, my_col, yytext);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
prev_word = 0;
@@ -1762,7 +1761,7 @@
yymore();
} else {
STORE_LOC;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = 0;
unput(')');
@@ -1794,7 +1793,7 @@
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n",
my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1831,7 +1830,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched ')' in expression!\n", my_file, my_lineno, my_col);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = 0;
return word;
@@ -1845,7 +1844,7 @@
BEGIN(0);
if ( !strcmp(yytext, ")") )
return RP;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ')' */
unput(')');
@@ -1864,7 +1863,7 @@
STORE_LOC;
if( !strcmp(yytext,"," ) )
return COMMA;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ',' */
unput(',');
@@ -1882,7 +1881,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = '\0';
return word;
@@ -1915,7 +1914,7 @@
STORE_LOC;
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Mismatched '%c' in expression!\n", my_file, my_lineno, my_col, c);
BEGIN(0);
- yylval->str = malloc(yyleng+1);
+ yylval->str = (char *) malloc(yyleng+1);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng] = '\0';
return word;
@@ -1929,7 +1928,7 @@
#line 567 "ael.flex"
{
STORE_LOC;
- yylval->str = malloc(yyleng);
+ yylval->str = (char *) malloc(yyleng);
strncpy(yylval->str, yytext, yyleng);
yylval->str[yyleng-1] = '\0'; /* trim trailing ';' */
unput(';');
@@ -1952,7 +1951,7 @@
p2 = strrchr(yytext,'"');
if ( include_stack_index >= MAX_INCLUDE_DEPTH ) {
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Includes nested too deeply! Wow!!! How did you do that?\n", my_file, my_lineno, my_col);
- } else if ( (int)(p2-p1) > sizeof(fnamebuf) - 1 ) {
+ } else if ( (size_t)(p2-p1) > sizeof(fnamebuf) - 1 ) {
ast_log(LOG_ERROR,"File=%s, line=%d, column=%d: Filename is incredibly way too long (%d chars!). Inclusion ignored!\n", my_file, my_lineno, my_col, yyleng - 10);
} else {
strncpy(fnamebuf, p1+1, p2-p1-1);
@@ -1996,7 +1995,7 @@
#line 622 "ael.flex"
{
char fnamebuf[2048];
- if (include_stack_index > 0 && include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
+ if (include_stack_index > 0 && (size_t) include_stack[include_stack_index-1].globbuf_pos < include_stack[include_stack_index-1].globbuf.gl_pathc-1) {
ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner );
include_stack[include_stack_index-1].globbuf_pos++;
setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0);
@@ -3347,7 +3346,7 @@
/* extern int ael_yydebug; */
- io = calloc(sizeof(struct parse_io),1);
+ io = (struct parse_io *) calloc(sizeof(struct parse_io),1);
/* reset the global counters */
prev_word = 0;
my_lineno = 1;
@@ -3366,7 +3365,7 @@
my_file = strdup(filename);
stat(filename, &stats);
buffer = (char*)malloc(stats.st_size+2);
- if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) {
+ if (fread(buffer, 1, stats.st_size, fin) != (unsigned int) stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
}
buffer[stats.st_size]=0;
@@ -3436,7 +3435,7 @@
struct stat stats;
stat(fnamebuf2, &stats);
buffer = (char*)malloc(stats.st_size+1);
- if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) {
+ if (fread(buffer, 1, stats.st_size, in1) != (unsigned int) stats.st_size) {
ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno));
}
buffer[stats.st_size] = 0;
Modified: team/group/asterisk-cpp/res/ael/pval.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/ael/pval.c?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/ael/pval.c (original)
+++ team/group/asterisk-cpp/res/ael/pval.c Mon Jan 12 10:24:22 2009
@@ -65,7 +65,7 @@
#ifdef STANDALONE
static int extensions_dot_conf_loaded = 0;
#endif
-static char *registrar = "pbx_ael";
+static const char *registrar = "pbx_ael";
static pval *current_db;
static pval *current_context;
@@ -650,7 +650,7 @@
pval *i;
if (!macro->u3.macro_statements)
{
- pval *z = calloc(1, sizeof(struct pval));
+ pval *z = (pval *) calloc(1, sizeof(struct pval));
ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The macro %s is empty! I will insert a return.\n",
macro->filename, macro->startline, macro->endline, macro->u1.str);
@@ -668,7 +668,7 @@
/* if the last statement in the list is not return, then insert a return there */
if (i->next == NULL) {
if (i->type != PV_RETURN) {
- pval *z = calloc(1, sizeof(struct pval));
+ pval *z = (pval *) calloc(1, sizeof(struct pval));
ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The macro %s does not end with a return; I will insert one.\n",
macro->filename, macro->startline, macro->endline, macro->u1.str);
@@ -885,7 +885,7 @@
return;
}
-static char *days[] =
+static const char *days[] =
{
"sun",
"mon",
@@ -983,7 +983,7 @@
e = s;
}
-static char *months[] =
+static const char *months[] =
{
"jan",
"feb",
@@ -2287,7 +2287,7 @@
if (def) /* nothing to check. All cases accounted for! */
return;
/* if no default, warn and insert a default case at the end */
- p2 = tl->next = calloc(1, sizeof(struct pval));
+ p2 = tl->next = (pval *) calloc(1, sizeof(struct pval));
p2->type = PV_DEFAULT;
p2->startline = tl->startline;
@@ -2949,7 +2949,7 @@
and the user accesses this copy instead. */
if (prio->appargs && ((mother_exten && mother_exten->has_switch) || exten->has_switch) ) {
while ((p1 = strstr(prio->appargs, "${EXTEN}"))) {
- p2 = malloc(strlen(prio->appargs)+5);
+ p2 = (char *) malloc(strlen(prio->appargs)+5);
*p1 = 0;
strcpy(p2, prio->appargs);
strcat(p2, "${~~EXTEN~~}");
@@ -2959,7 +2959,7 @@
prio->appargs = p2;
}
while ((p1 = strstr(prio->appargs, "${EXTEN:"))) {
- p2 = malloc(strlen(prio->appargs)+5);
+ p2 = (char *) malloc(strlen(prio->appargs)+5);
*p1 = 0;
strcpy(p2, prio->appargs);
strcat(p2, "${~~EXTEN~~:");
@@ -4512,7 +4512,7 @@
*c = '\0';
c++;
} else
- c = "";
+ c = (char *) "";
ast_context_add_switch2(context, p3->u1.str, c, 0, registrar);
}
@@ -4525,7 +4525,7 @@
*c = '\0';
c++;
} else
- c = "";
+ c = (char *) "";
ast_context_add_switch2(context, p3->u1.str, c, 1, registrar);
}
@@ -4916,7 +4916,7 @@
/* ----------------- implementation ------------------- */
-int pvalCheckType( pval *p, char *funcname, pvaltype type )
+int pvalCheckType( pval *p, const char *funcname, pvaltype type )
{
if (p->type != type)
{
@@ -4929,7 +4929,7 @@
pval *pvalCreateNode( pvaltype type )
{
- pval *p = calloc(1,sizeof(pval)); /* why, oh why, don't I use ast_calloc? Way, way, way too messy if I do! */
+ pval *p = (pval *) calloc(1,sizeof(pval)); /* why, oh why, don't I use ast_calloc? Way, way, way too messy if I do! */
p->type = type; /* remember, this can be used externally or internally to asterisk */
return p;
}
Modified: team/group/asterisk-cpp/res/res_adsi.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/res_adsi.c?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/res_adsi.c (original)
+++ team/group/asterisk-cpp/res/res_adsi.c Mon Jan 12 10:24:22 2009
@@ -392,7 +392,7 @@
}
if (!res)
- chan->adsicpe = (chan->adsicpe & ~ADSI_FLAG_DATAMODE) | newdatamode;
+ chan->adsicpe = (enum ast_channel_adsicpe) ((chan->adsicpe & ~ADSI_FLAG_DATAMODE) | newdatamode);
if (writeformat)
ast_set_write_format(chan, writeformat);
@@ -760,7 +760,7 @@
}
static int _ast_adsi_display(unsigned char *buf, int page, int line, int just, int wrap,
- char *col1, char *col2)
+ char *col1, const char *col2)
{
int bytes = 0;
@@ -1071,7 +1071,7 @@
return 0;
}
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
{
adsi_load(0);
@@ -1114,7 +1114,7 @@
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ADSI Resource",
- .load = load_module,
- .unload = unload_module,
- .reload = reload,
- );
+ load_module,
+ unload_module,
+ reload
+ );
Modified: team/group/asterisk-cpp/res/res_ael_share.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/res/res_ael_share.c?view=diff&rev=168496&r1=168495&r2=168496
==============================================================================
--- team/group/asterisk-cpp/res/res_ael_share.c (original)
+++ team/group/asterisk-cpp/res/res_ael_share.c Mon Jan 12 10:24:22 2009
@@ -43,12 +43,13 @@
return 0;
}
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
{
return AST_MODULE_LOAD_SUCCESS;
}
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "share-able code for AEL",
- .load = load_module,
- .unload = unload_module
+ load_module,
+ unload_module,
+ NULL
);
More information about the asterisk-commits
mailing list