[asterisk-commits] kpfleming: trunk r73726 - /trunk/main/minimime/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 6 11:30:33 CDT 2007


Author: kpfleming
Date: Fri Jul  6 11:30:32 2007
New Revision: 73726

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73726
Log:
eliminate another batch of compiler warnings (and a bug, although in code we aren't using)... note that this required manually editing the lexer output code (generated by flex), so some of them will come back if the lexer is rebuilt

Modified:
    trunk/main/minimime/Makefile
    trunk/main/minimime/mimeparser.h
    trunk/main/minimime/mimeparser.l
    trunk/main/minimime/mimeparser.tab.c
    trunk/main/minimime/mimeparser.tab.h
    trunk/main/minimime/mimeparser.y
    trunk/main/minimime/mimeparser.yy.c
    trunk/main/minimime/mm_parse.c

Modified: trunk/main/minimime/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/Makefile?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/Makefile (original)
+++ trunk/main/minimime/Makefile Fri Jul  6 11:30:32 2007
@@ -42,6 +42,8 @@
 # may actually be important and spot out real bugs.
 ASTCFLAGS:=$(filter-out -Werror,$(ASTCFLAGS))
 
+ASTCFLAGS+=-std=c99
+
 all: $(LIBMMIME)
 
 $(LIBMMIME): $(MM_OBJS)
@@ -49,11 +51,11 @@
 	$(CMD_PREFIX) $(AR) cr $@ $^
 	$(CMD_PREFIX) $(RANLIB) $@
 
-#mimeparser.yy.c: mimeparser.l
-#	flex -Pmimeparser_yy -omimeparser.yy.c mimeparser.l
+mimeparser.yy.c:
+	flex -Pmimeparser_yy -omimeparser.yy.c mimeparser.l
 
-#mimeparser.tab.c: mimeparser.y
-#	bison -d -pmimeparser_yy -omimeparser.tab.c mimeparser.y
+mimeparser.tab.c:
+	bison -d -pmimeparser_yy -omimeparser.tab.c mimeparser.y
 
 clean::
 	rm -f $(LIBMMIME) *.o

Modified: trunk/main/minimime/mimeparser.h
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.h?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.h (original)
+++ trunk/main/minimime/mimeparser.h Fri Jul  6 11:30:32 2007
@@ -33,7 +33,7 @@
 
 	char *boundary_string;
 	char *endboundary_string;
-	char *message_buffer;
+	const char *message_buffer;
 };
 
 
@@ -51,6 +51,10 @@
 	struct lexer_state lstate;
 };
 
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
 
 #include "mimeparser.tab.h"
 
@@ -62,6 +66,11 @@
 int 	mimeparser_yyparse(struct parser_state *, void *);
 int 	mimeparser_yylex(YYSTYPE *, void *);
 int	mimeparser_yyerror(struct parser_state *, void *, const char *);
-
+int	mimeparser_yylex_init(yyscan_t* scanner);
+int	mimeparser_yylex_destroy(yyscan_t yyscanner);
+void	reset_lexer_state(void *yyscanner, struct parser_state *pstate);
+int	PARSER_initialize(struct parser_state *pstate, yyscan_t scanner);
+void	PARSER_setbuffer(const char *string, yyscan_t scanner);
+void	PARSER_setfp(FILE *fp, yyscan_t scanner);
 
 #endif /* ! _MIMEPARSER_H_INCLUDED */

Modified: trunk/main/minimime/mimeparser.l
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.l?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.l (original)
+++ trunk/main/minimime/mimeparser.l Fri Jul  6 11:30:32 2007
@@ -94,8 +94,9 @@
 %%
 
 <INITIAL,headers>^[a-zA-Z]+[a-zA-Z0-9\-\_]* {
+	struct lexer_state *lstate = yyget_extra(yyscanner);
+
 	yylval_param->string=strdup(yytext); 
-	struct lexer_state *lstate = yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	BC(header);
 
@@ -443,7 +444,7 @@
 }
 
 void
-PARSER_setbuffer(char *string, yyscan_t scanner)
+PARSER_setbuffer(const char *string, yyscan_t scanner)
 {
 	struct lexer_state *lstate = yyget_extra(scanner);
 	lstate->message_buffer = string;
@@ -451,15 +452,15 @@
 }
 
 void
-PARSER_setfp(FILE *fp, yyscan_t yyscanner)
+PARSER_setfp(FILE *fp, yyscan_t scanner)
 {
 	/* looks like a bug in bison 2.2a -- the wrong code is generated for yyset_in !! */
-	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	struct yyguts_t * yyg = (struct yyguts_t*) scanner;
 	yyg->yyin_r = fp;
 	
 	if (0) {
 		/* This is just to make a compiler warning go away */
-		yyunput(0, NULL, yyscanner);
+		yyunput(0, NULL, scanner);
 	}
 }
 

Modified: trunk/main/minimime/mimeparser.tab.c
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.tab.c?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.tab.c (original)
+++ trunk/main/minimime/mimeparser.tab.c Fri Jul  6 11:30:32 2007
@@ -184,8 +184,6 @@
 void reset_environ(struct parser_state *pstate);
 int PARSER_initialize(struct parser_state *pstate, void *yyscanner);
 
-typedef void *yyscan_t;
-
 static char *PARSE_readmessagepart(size_t, size_t, size_t, size_t *,yyscan_t, struct parser_state *);
 FILE *mimeparser_yyget_in (yyscan_t yyscanner );
 
@@ -211,14 +209,14 @@
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 69 "mimeparser.y"
+#line 67 "mimeparser.y"
 {
 	int number;
 	char *string;
 	struct s_position position;
 }
-/* Line 193 of yacc.c.  */
-#line 222 "mimeparser.tab.c"
+/* Line 187 of yacc.c.  */
+#line 220 "mimeparser.tab.c"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -231,7 +229,7 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 235 "mimeparser.tab.c"
+#line 233 "mimeparser.tab.c"
 
 #ifdef short
 # undef short
@@ -281,7 +279,7 @@
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined(YYENABLE_NLS)
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -534,12 +532,12 @@
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   114,   114,   116,   121,   120,   133,   141,   143,   167,
-     171,   186,   190,   193,   197,   199,   203,   218,   220,   230,
-     232,   234,   236,   250,   257,   276,   284,   294,   300,   308,
-     331,   338,   345,   349,   351,   355,   364,   366,   368,   382,
-     384,   386,   400,   431,   445,   451,   466,   474,   481,   500,
-     519
+       0,   112,   112,   114,   119,   118,   131,   139,   141,   165,
+     169,   184,   188,   191,   195,   197,   201,   216,   218,   228,
+     230,   232,   234,   248,   255,   274,   282,   292,   298,   306,
+     329,   336,   343,   347,   349,   353,   362,   364,   366,   380,
+     382,   384,   398,   429,   443,   449,   464,   472,   479,   498,
+     517
 };
 #endif
 
@@ -759,7 +757,7 @@
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined(YYLTYPE_IS_TRIVIAL)
 #  define YY_LOCATION_PRINT(File, Loc)			\
      fprintf (File, "%d.%d-%d.%d",			\
 	      (Loc).first_line, (Loc).first_column,	\
@@ -1513,31 +1511,31 @@
   switch (yyn)
     {
         case 4:
-#line 121 "mimeparser.y"
+#line 119 "mimeparser.y"
     { 
 		mm_context_attachpart(pstate->ctx, pstate->current_mimepart);
 		pstate->current_mimepart = mm_mimepart_new();
 		pstate->have_contenttype = 0;
-	}
+	;}
     break;
 
   case 5:
-#line 127 "mimeparser.y"
+#line 125 "mimeparser.y"
     {
 		dprintf2(pstate,"This was a multipart message\n");
-	}
+	;}
     break;
 
   case 6:
-#line 134 "mimeparser.y"
+#line 132 "mimeparser.y"
     {
 		dprintf2(pstate,"This was a single part message\n");
 		mm_context_attachpart(pstate->ctx, pstate->current_mimepart);
-	}
+	;}
     break;
 
   case 8:
-#line 144 "mimeparser.y"
+#line 142 "mimeparser.y"
     {
 		/* If we did not find a Content-Type header for the current
 		 * MIME part (or envelope), we create one and attach it.
@@ -1559,11 +1557,11 @@
 			mm_mimepart_attachcontenttype(pstate->current_mimepart, ct);
 		}	
 		pstate->have_contenttype = 0;
-	}
+	;}
     break;
 
   case 10:
-#line 172 "mimeparser.y"
+#line 170 "mimeparser.y"
     {
 		char *preamble;
 		size_t offset;
@@ -1577,17 +1575,17 @@
 			pstate->ctx->preamble = preamble;
 			dprintf2(pstate,"PREAMBLE:\n%s\n", preamble);
 		}
-	}
+	;}
     break;
 
   case 12:
-#line 191 "mimeparser.y"
-    {
-	}
+#line 189 "mimeparser.y"
+    {
+	;}
     break;
 
   case 16:
-#line 204 "mimeparser.y"
+#line 202 "mimeparser.y"
     {
 
 		if (mm_context_attachpart(pstate->ctx, pstate->current_mimepart) == -1) {
@@ -1598,11 +1596,11 @@
 		pstate->temppart = mm_mimepart_new();
 		pstate->current_mimepart = pstate->temppart;
 		pstate->mime_parts++;
-	}
+	;}
     break;
 
   case 18:
-#line 221 "mimeparser.y"
+#line 219 "mimeparser.y"
     {
 		pstate->have_contenttype = 1;
 		if (mm_content_iscomposite(pstate->envelope->type)) {
@@ -1610,11 +1608,11 @@
 		} else {
 			pstate->ctx->messagetype = MM_MSGTYPE_FLAT;
 		}	
-	}
+	;}
     break;
 
   case 22:
-#line 237 "mimeparser.y"
+#line 235 "mimeparser.y"
     {
 		if (pstate->parsemode != MM_PARSE_LOOSE) {
 			mm_errno = MM_ERROR_PARSE;
@@ -1624,20 +1622,20 @@
 		} else {
 			/* TODO: attach MM_WARNING_INVHDR */
 		}
-	}
+	;}
     break;
 
   case 23:
-#line 251 "mimeparser.y"
+#line 249 "mimeparser.y"
     {
 		struct mm_mimeheader *hdr;
 		hdr = mm_mimeheader_generate((yyvsp[(1) - (4)].string), (yyvsp[(3) - (4)].string));
 		mm_mimepart_attachheader(pstate->current_mimepart, hdr);
-	}
+	;}
     break;
 
   case 24:
-#line 258 "mimeparser.y"
+#line 256 "mimeparser.y"
     {
 		struct mm_mimeheader *hdr;
 
@@ -1652,47 +1650,47 @@
 		
 		hdr = mm_mimeheader_generate((yyvsp[(1) - (3)].string), xstrdup(""));
 		mm_mimepart_attachheader(pstate->current_mimepart, hdr);
-	}
+	;}
     break;
 
   case 25:
-#line 277 "mimeparser.y"
+#line 275 "mimeparser.y"
     {
 		mm_content_settype(pstate->ctype, "%s", (yyvsp[(3) - (4)].string));
 		mm_mimepart_attachcontenttype(pstate->current_mimepart, pstate->ctype);
 		dprintf2(pstate,"Content-Type -> %s\n", (yyvsp[(3) - (4)].string));
 		pstate->ctype = mm_content_new();
-	}
+	;}
     break;
 
   case 26:
-#line 285 "mimeparser.y"
+#line 283 "mimeparser.y"
     {
 		mm_content_settype(pstate->ctype, "%s", (yyvsp[(3) - (5)].string));
 		mm_mimepart_attachcontenttype(pstate->current_mimepart, pstate->ctype);
 		dprintf2(pstate,"Content-Type (P) -> %s\n", (yyvsp[(3) - (5)].string));
 		pstate->ctype = mm_content_new();
-	}
+	;}
     break;
 
   case 27:
-#line 295 "mimeparser.y"
+#line 293 "mimeparser.y"
     {
 		dprintf2(pstate,"Content-Disposition -> %s\n", (yyvsp[(3) - (4)].string));
 		pstate->ctype->disposition_type = xstrdup((yyvsp[(3) - (4)].string));
-	}
+	;}
     break;
 
   case 28:
-#line 301 "mimeparser.y"
+#line 299 "mimeparser.y"
     {
 		dprintf2(pstate,"Content-Disposition (P) -> %s; params\n", (yyvsp[(3) - (5)].string));
 		pstate->ctype->disposition_type = xstrdup((yyvsp[(3) - (5)].string));
-	}
+	;}
     break;
 
   case 29:
-#line 309 "mimeparser.y"
+#line 307 "mimeparser.y"
     {
 		/*
 		 * According to RFC 2183, the content disposition value may
@@ -1711,34 +1709,34 @@
 			/* TODO: attach MM_WARNING_INVHDR */
 		}	
 		(yyval.string) = (yyvsp[(1) - (1)].string);
-	}
+	;}
     break;
 
   case 30:
-#line 332 "mimeparser.y"
+#line 330 "mimeparser.y"
     {
 		dprintf2(pstate,"Content-Transfer-Encoding -> %s\n", (yyvsp[(3) - (4)].string));
-	}
+	;}
     break;
 
   case 31:
-#line 339 "mimeparser.y"
+#line 337 "mimeparser.y"
     {
 		dprintf2(pstate,"MIME-Version -> '%s'\n", (yyvsp[(3) - (4)].string));
-	}
+	;}
     break;
 
   case 35:
-#line 356 "mimeparser.y"
+#line 354 "mimeparser.y"
     {
 		char type[255];
 		snprintf(type, sizeof(type), "%s/%s", (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].string));
 		(yyval.string) = type;
-	}
+	;}
     break;
 
   case 38:
-#line 369 "mimeparser.y"
+#line 367 "mimeparser.y"
     {
 		if (pstate->parsemode != MM_PARSE_LOOSE) {
 			mm_errno = MM_ERROR_MIME;
@@ -1748,11 +1746,11 @@
 		} else {
 			/* TODO: attach MM_WARNING_INVHDR */
 		}	
-	}
+	;}
     break;
 
   case 41:
-#line 387 "mimeparser.y"
+#line 385 "mimeparser.y"
     {	
 		if (pstate->parsemode != MM_PARSE_LOOSE) {
 			mm_errno = MM_ERROR_MIME;
@@ -1762,11 +1760,11 @@
 		} else {
 			/* TODO: attach MM_WARNING_INVHDR */
 		}
-	}
+	;}
     break;
 
   case 42:
-#line 401 "mimeparser.y"
+#line 399 "mimeparser.y"
     {
 		struct mm_param *param;
 		param = mm_param_new();
@@ -1793,11 +1791,11 @@
 		param->value = xstrdup((yyvsp[(3) - (3)].string));
 
 		mm_content_attachtypeparam(pstate->ctype, param);
-	}
+	;}
     break;
 
   case 43:
-#line 432 "mimeparser.y"
+#line 430 "mimeparser.y"
     {
 		struct mm_param *param;
 		param = mm_param_new();
@@ -1807,19 +1805,19 @@
 
 		mm_content_attachdispositionparam(pstate->ctype, param);
 
-	}
+	;}
     break;
 
   case 44:
-#line 446 "mimeparser.y"
+#line 444 "mimeparser.y"
     {
 		dprintf2(pstate,"contenttype_param_val: WORD=%s\n", (yyvsp[(1) - (1)].string));
 		(yyval.string) = (yyvsp[(1) - (1)].string);
-	}
+	;}
     break;
 
   case 45:
-#line 452 "mimeparser.y"
+#line 450 "mimeparser.y"
     {
 		dprintf2(pstate,"contenttype_param_val: TSPECIAL\n");
 		/* For broken MIME implementation */
@@ -1832,26 +1830,26 @@
 			/* TODO: attach MM_WARNING_INVAL */
 		}	
 		(yyval.string) = (yyvsp[(1) - (1)].string);
-	}
+	;}
     break;
 
   case 46:
-#line 467 "mimeparser.y"
+#line 465 "mimeparser.y"
     {
 		dprintf2(pstate,"contenttype_param_val: \"TSPECIAL\"\n" );
 		(yyval.string) = (yyvsp[(2) - (3)].string);
-	}
+	;}
     break;
 
   case 47:
-#line 475 "mimeparser.y"
+#line 473 "mimeparser.y"
     {
 		dprintf2(pstate,"End of headers at line %d\n", pstate->lstate.lineno);
-	}
+	;}
     break;
 
   case 48:
-#line 482 "mimeparser.y"
+#line 480 "mimeparser.y"
     {
 		if (pstate->lstate.boundary_string == NULL) {
 			mm_errno = MM_ERROR_PARSE;
@@ -1866,11 +1864,11 @@
 			return(-1);
 		}
 		dprintf2(pstate,"New MIME part... (%s)\n", (yyvsp[(1) - (2)].string));
-	}
+	;}
     break;
 
   case 49:
-#line 501 "mimeparser.y"
+#line 499 "mimeparser.y"
     {
 		if (pstate->lstate.endboundary_string == NULL) {
 			mm_errno = MM_ERROR_PARSE;
@@ -1885,11 +1883,11 @@
 			return(-1);
 		}
 		dprintf2(pstate,"End of MIME message\n");
-	}
+	;}
     break;
 
   case 50:
-#line 520 "mimeparser.y"
+#line 518 "mimeparser.y"
     {
 		char *body;
 		size_t offset;
@@ -1906,12 +1904,12 @@
 		pstate->current_mimepart->body = body + offset;
 		pstate->current_mimepart->opaque_length = (yyvsp[(1) - (1)].position).end - (yyvsp[(1) - (1)].position).start - 2 + offset;
 		pstate->current_mimepart->length = pstate->current_mimepart->opaque_length - offset;
-	}
+	;}
     break;
 
 
 /* Line 1267 of yacc.c.  */
-#line 1915 "mimeparser.tab.c"
+#line 1913 "mimeparser.tab.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2125,7 +2123,7 @@
 }
 
 
-#line 539 "mimeparser.y"
+#line 537 "mimeparser.y"
 
 
 /*

Modified: trunk/main/minimime/mimeparser.tab.h
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.tab.h?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.tab.h (original)
+++ trunk/main/minimime/mimeparser.tab.h Fri Jul  6 11:30:32 2007
@@ -94,13 +94,13 @@
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 69 "mimeparser.y"
+#line 67 "mimeparser.y"
 {
 	int number;
 	char *string;
 	struct s_position position;
 }
-/* Line 1529 of yacc.c.  */
+/* Line 1489 of yacc.c.  */
 #line 105 "mimeparser.tab.h"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */

Modified: trunk/main/minimime/mimeparser.y
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.y?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.y (original)
+++ trunk/main/minimime/mimeparser.y Fri Jul  6 11:30:32 2007
@@ -53,8 +53,6 @@
 void reset_environ(struct parser_state *pstate);
 int PARSER_initialize(struct parser_state *pstate, void *yyscanner);
 
-typedef void *yyscan_t;
-
 static char *PARSE_readmessagepart(size_t, size_t, size_t, size_t *,yyscan_t, struct parser_state *);
 FILE *mimeparser_yyget_in (yyscan_t yyscanner );
 

Modified: trunk/main/minimime/mimeparser.yy.c
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mimeparser.yy.c?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mimeparser.yy.c (original)
+++ trunk/main/minimime/mimeparser.yy.c Fri Jul  6 11:30:32 2007
@@ -755,7 +755,11 @@
 
 int mimeparser_yyget_lineno (yyscan_t yyscanner );
 
+int mimeparser_yyget_column  (yyscan_t yyscanner);
+
 void mimeparser_yyset_lineno (int line_number ,yyscan_t yyscanner );
+
+void mimeparser_yyset_column (int  column_no , yyscan_t yyscanner);
 
 YYSTYPE * mimeparser_yyget_lval (yyscan_t yyscanner );
 
@@ -1014,8 +1018,9 @@
 YY_RULE_SETUP
 #line 96 "mimeparser.l"
 {
+	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
+
 	yylval_param->string=strdup(yytext); 
-	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 	BC(header);
 
@@ -1042,7 +1047,7 @@
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 123 "mimeparser.l"
+#line 124 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* dprintf2("Unknown header char: %c\n", *yytext); */
@@ -1053,7 +1058,7 @@
 case 3:
 /* rule 3 can match eol */
 YY_RULE_SETUP
-#line 130 "mimeparser.l"
+#line 131 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno++; 
@@ -1078,7 +1083,7 @@
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 152 "mimeparser.l"
+#line 153 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headervalue); 
@@ -1089,7 +1094,7 @@
 case 5:
 /* rule 5 can match eol */
 YY_RULE_SETUP
-#line 159 "mimeparser.l"
+#line 160 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headers);
@@ -1101,7 +1106,7 @@
 case 6:
 /* rule 6 can match eol */
 YY_RULE_SETUP
-#line 167 "mimeparser.l"
+#line 168 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1110,7 +1115,7 @@
 case 7:
 /* rule 7 can match eol */
 YY_RULE_SETUP
-#line 172 "mimeparser.l"
+#line 173 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	if (lstate->header_state != STATE_MAIL && lstate->header_state != STATE_CENC) {
@@ -1131,7 +1136,7 @@
 case 8:
 /* rule 8 can match eol */
 YY_RULE_SETUP
-#line 189 "mimeparser.l"
+#line 190 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* marks the end of one header line */
@@ -1144,7 +1149,7 @@
 case 9:
 /* rule 9 can match eol */
 YY_RULE_SETUP
-#line 198 "mimeparser.l"
+#line 199 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno += count_lines(yytext);
@@ -1154,7 +1159,7 @@
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 205 "mimeparser.l"
+#line 206 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1163,7 +1168,7 @@
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 211 "mimeparser.l"
+#line 212 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(tspecialvalue);
@@ -1173,7 +1178,7 @@
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 218 "mimeparser.l"
+#line 219 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string=strdup(yytext);
@@ -1184,7 +1189,7 @@
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 226 "mimeparser.l"
+#line 227 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1192,7 +1197,7 @@
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 231 "mimeparser.l"
+#line 232 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno += count_lines(yytext);
@@ -1203,7 +1208,7 @@
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 239 "mimeparser.l"
+#line 240 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headervalue);
@@ -1213,7 +1218,7 @@
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 246 "mimeparser.l"
+#line 247 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/**
@@ -1251,7 +1256,7 @@
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 281 "mimeparser.l"
+#line 282 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/**
@@ -1297,7 +1302,7 @@
 case 18:
 /* rule 18 can match eol */
 YY_RULE_SETUP
-#line 323 "mimeparser.l"
+#line 324 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1306,7 +1311,7 @@
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 329 "mimeparser.l"
+#line 330 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1315,14 +1320,14 @@
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 335 "mimeparser.l"
+#line 336 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
 }
 	YY_BREAK
 case YY_STATE_EOF(body):
-#line 340 "mimeparser.l"
+#line 341 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	if (lstate->boundary_string == NULL && lstate->body_start) {
@@ -1340,7 +1345,7 @@
 case 21:
 /* rule 21 can match eol */
 YY_RULE_SETUP
-#line 354 "mimeparser.l"
+#line 355 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	/* dprintf2("Preamble CR/LF at line %d\n", lineno); */
@@ -1350,7 +1355,7 @@
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 361 "mimeparser.l"
+#line 362 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string = strdup(yytext);
@@ -1360,7 +1365,7 @@
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 368 "mimeparser.l"
+#line 369 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	yylval_param->string = strdup(yytext);
@@ -1371,7 +1376,7 @@
 case 24:
 /* rule 24 can match eol */
 YY_RULE_SETUP
-#line 375 "mimeparser.l"
+#line 376 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(headers);
@@ -1384,7 +1389,7 @@
 case 25:
 /* rule 25 can match eol */
 YY_RULE_SETUP
-#line 384 "mimeparser.l"
+#line 385 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	BC(postamble);
@@ -1394,7 +1399,7 @@
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 391 "mimeparser.l"
+#line 392 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1402,7 +1407,7 @@
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 397 "mimeparser.l"
+#line 398 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1411,7 +1416,7 @@
 case 28:
 /* rule 28 can match eol */
 YY_RULE_SETUP
-#line 402 "mimeparser.l"
+#line 403 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->lineno++;
@@ -1421,7 +1426,7 @@
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 409 "mimeparser.l"
+#line 410 "mimeparser.l"
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(yyscanner);
 	lstate->current_pos += yyleng;
@@ -1430,10 +1435,10 @@
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 416 "mimeparser.l"
+#line 417 "mimeparser.l"
 ECHO;
 	YY_BREAK
-#line 1437 "mimeparser.yy.c"
+#line 1438 "mimeparser.yy.c"
 			case YY_STATE_EOF(INITIAL):
 			case YY_STATE_EOF(headers):
 			case YY_STATE_EOF(header):
@@ -1646,7 +1651,7 @@
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, num_to_read );
+			yyg->yy_n_chars, (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
@@ -2549,7 +2554,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 416 "mimeparser.l"
+#line 417 "mimeparser.l"
 
 
 
@@ -2581,7 +2586,7 @@
 }
 
 void
-PARSER_setbuffer(char *string, yyscan_t scanner)
+PARSER_setbuffer(const char *string, yyscan_t scanner)
 {
 	struct lexer_state *lstate = mimeparser_yyget_extra(scanner);
 	lstate->message_buffer = string;
@@ -2589,15 +2594,15 @@
 }
 
 void
-PARSER_setfp(FILE *fp, yyscan_t yyscanner)
+PARSER_setfp(FILE *fp, yyscan_t scanner)
 {
 	/* looks like a bug in bison 2.2a -- the wrong code is generated for mimeparser_yyset_in !! */
-	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	struct yyguts_t * yyg = (struct yyguts_t*) scanner;
 	yyg->yyin_r = fp;
 	
 	if (0) {
 		/* This is just to make a compiler warning go away */
-		yyunput(0, NULL, yyscanner);
+		yyunput(0, NULL, scanner);
 	}
 }
 

Modified: trunk/main/minimime/mm_parse.c
URL: http://svn.digium.com/view/asterisk/trunk/main/minimime/mm_parse.c?view=diff&rev=73726&r1=73725&r2=73726
==============================================================================
--- trunk/main/minimime/mm_parse.c (original)
+++ trunk/main/minimime/mm_parse.c Fri Jul  6 11:30:32 2007
@@ -47,11 +47,6 @@
 #include "mimeparser.h"
 #include "mimeparser.tab.h"
 
-int yyparse (struct parser_state *pstate, void *yyscanner);
-void PARSER_initialize(struct parser_state *, void *);
-void PARSER_setbuffer(const char *);
-void PARSER_setfp(FILE *,void *yyscanner);
-
 /** @file mm_parse.c
  *
  * Functions to parse MIME messages
@@ -86,9 +81,6 @@
 	void *yyscanner;
 	int res;
 	struct parser_state pstate;
-	typedef void *yyscan_t;
-	int mimeparser_yylex_init (yyscan_t* scanner);
-	int mimeparser_yylex_destroy (yyscan_t yyscanner );
 	
 	pstate.ctx = ctx;
 	pstate.parsemode = parsemode;
@@ -96,8 +88,8 @@
 	mimeparser_yylex_init(&yyscanner);
 	PARSER_initialize(&pstate, yyscanner);
 	
-	PARSER_setbuffer(text);
-	PARSER_setfp(NULL,yyscanner);
+	PARSER_setbuffer(text, yyscanner);
+	PARSER_setfp(NULL, yyscanner);
 	
 	res =  mimeparser_yyparse(&pstate,yyscanner);
 	mimeparser_yylex_destroy(yyscanner);
@@ -127,7 +119,6 @@
  * The context needs to be initialized before using mm_context_new() and may
  * be freed using mm_context_free().
  */
-typedef void *yyscan_t;
 int
 mm_parse_file(MM_CTX *ctx, const char *filename, int parsemode, int flags)
 {
@@ -135,8 +126,6 @@
 	int res;
 	void *yyscanner;
 	struct parser_state pstate;
-	int mimeparser_yylex_init (yyscan_t* scanner);
-	int mimeparser_yylex_destroy (yyscan_t yyscanner );
 
 	mimeparser_yylex_init(&yyscanner);
 
@@ -163,8 +152,6 @@
 	int res;
 	void *yyscanner;
 	struct parser_state pstate;
-	int mimeparser_yylex_init (yyscan_t* scanner);
-	int mimeparser_yylex_destroy (yyscan_t yyscanner );
 
 	mimeparser_yylex_init(&yyscanner);
 




More information about the asterisk-commits mailing list