More prototype fun - make the Lemon parser allocate and free routines
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 Feb 2001 06:22:46 +0000 (06:22 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 15 Feb 2001 06:22:46 +0000 (06:22 +0000)
take fully-prototyped function arguments with types appropriate to
"g_malloc()" and "g_free()", and change the calls to the functions
pointed to by those arguments not pass the extra __FILE__ and __LINE__
arguments.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3039 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dfilter/dfilter-int.h
tools/lemon/lempar.c

index 3c97bc5235d6c35f28b8e6772baefaefc5b2fadf..c1e677443877f3b993b4afc7a9711f22156fc48b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: dfilter-int.h,v 1.2 2001/02/01 20:31:18 gram Exp $
+ * $Id: dfilter-int.h,v 1.3 2001/02/15 06:22:45 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -48,8 +48,8 @@ typedef struct {
 } dfwork_t;
 
 /* Constructor/Destructor prototypes for Lemon Parser */
-void *DfilterAlloc(void* (*)());
-void DfilterFree(void*, void (*)());
+void *DfilterAlloc(void* (*)(gulong));
+void DfilterFree(void*, void (*)(void *));
 void Dfilter(void*, int, stnode_t*, dfwork_t*);
 
 /* Scanner's lval */
index 73783a3d357bbde293e89b33f3af184975be47d4..bee6c33eb4de3ead572b3340d5ece55dac294d95 100644 (file)
@@ -202,9 +202,9 @@ static char *yyTokenName[] = {
 ** A pointer to a parser.  This pointer is used in subsequent calls
 ** to Parse and ParseFree.
 */
-void *ParseAlloc(void *(*mallocProc)()){
+void *ParseAlloc(void *(*mallocProc)(gulong)){
   yyParser *pParser;
-  pParser = (yyParser*)(*mallocProc)( sizeof(yyParser), __FILE__, __LINE__ );
+  pParser = (yyParser*)(*mallocProc)( sizeof(yyParser) );
   if( pParser ){
     pParser->idx = -1;
   }
@@ -272,13 +272,13 @@ static int yy_pop_parser_stack(yyParser *pParser){
 ** </ul>
 */
 void ParseFree(
-  void *p,               /* The parser to be deleted */
-  void (*freeProc)()     /* Function used to reclaim memory */
+  void *p,                 /* The parser to be deleted */
+  void (*freeProc)(void *) /* Function used to reclaim memory */
 ){
   yyParser *pParser = (yyParser*)p;
   if( pParser==0 ) return;
   while( pParser->idx>=0 ) yy_pop_parser_stack(pParser);
-  (*freeProc)(pParser, __FILE__, __LINE__);
+  (*freeProc)(pParser);
 }
 
 /*