[cvslog] (2005-11-27 20:47:26 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Sun Nov 27 14:47:26 CST 2005


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2005-11-27 20:47:26 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     lib/eggdrop/script.c modules/tclscript/tclscript.c

Log message:

- Corrected a sizeof(int) == sizeof(pointer) assumption in
  lib/eggdrop/script.c.
- 'newvalue' was declared twice in one function in tclscript/tclscript.c.
* Patch by Sven Trenkel.

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/script.c
diff -u eggdrop1.9/lib/eggdrop/script.c:1.20 eggdrop1.9/lib/eggdrop/script.c:1.21
--- eggdrop1.9/lib/eggdrop/script.c:1.20	Sun Oct 17 00:14:06 2004
+++ eggdrop1.9/lib/eggdrop/script.c	Sun Nov 27 14:47:15 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: script.c,v 1.20 2004/10/17 05:14:06 stdarg Exp $";
+static const char rcsid[] = "$Id: script.c,v 1.21 2005/11/27 20:47:15 wcc Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -192,9 +192,10 @@
 	script_callback_t **callbacks, *static_callbacks[20];
 	int argstack_len, nfree_args, ncallbacks;
 	char *syntax;
-	int i, skip, nopts, err, simple_retval;
+	int i, skip, nopts, err;
+	void *simple_retval;
 	script_var_t var;
-	int (*callback)();
+	void *(*callback)();
 
 	/* Check if there is an argument count error. */
 	if (cmd->flags & SCRIPT_VAR_ARGS) err = (cmd->nargs > args->len);
@@ -269,7 +270,7 @@
 	argstack_len -= nopts;
 
 	/* Execute the callback. */
-	callback = (int (*)())cmd->callback;
+	callback = (void *(*)())cmd->callback;
 	if (cmd->flags & SCRIPT_PASS_ARRAY) {
 		simple_retval = callback(argstack_len, argstack);
 	}
@@ -286,7 +287,7 @@
 	if (!(cmd->flags & SCRIPT_PASS_RETVAL)) {
 		retval->type = cmd->retval_type;
 		retval->len = -1;
-		retval->value = (void *)simple_retval;
+		retval->value = simple_retval;
 	}
 
 cleanup_args:
Index: eggdrop1.9/modules/tclscript/tclscript.c
diff -u eggdrop1.9/modules/tclscript/tclscript.c:1.48 eggdrop1.9/modules/tclscript/tclscript.c:1.49
--- eggdrop1.9/modules/tclscript/tclscript.c:1.48	Sun Nov 13 22:44:43 2005
+++ eggdrop1.9/modules/tclscript/tclscript.c	Sun Nov 27 14:47:16 2005
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: tclscript.c,v 1.48 2005/11/14 04:44:43 wcc Exp $";
+static const char rcsid[] = "$Id: tclscript.c,v 1.49 2005/11/27 20:47:16 wcc Exp $";
 #endif
 
 #include <string.h>
@@ -150,7 +150,6 @@
 
 	if (flags & TCL_TRACE_READS) {
 		if (linked_var->callbacks && linked_var->callbacks->on_read) {
-			script_var_t newvalue = {0};
 			int r = (linked_var->callbacks->on_read)(linked_var, &newvalue);
 			if (r) return(NULL);
 		}
----------------------- End of diff -----------------------



More information about the Changes mailing list