[ekg2-commit] r3859 - in trunk: ekg plugins/perl plugins/python plugins/ruby: trunk/ekg/plugins.h trunk/ekg/scripts.h trunk/plugins/perl/perl_core.c trunk/plugins/python/python.c trunk/plugins/ruby/ruby_ekg.c

SVN commit svn w toxygen.net
Sob, 8 Mar 2008, 15:33:54 CET


Author: peres
Date: 2008-03-08 15:33:54 +0100 (Sat, 08 Mar 2008)
New Revision: 3859

Modified:
   trunk/ekg/plugins.h
   trunk/ekg/scripts.h
   trunk/plugins/perl/perl_core.c
   trunk/plugins/python/python.c
   trunk/plugins/ruby/ruby_ekg.c
Log:

Use 'long int' for watch in script watch handler. This should fix issues
on amd64, where sizeof(void*) > sizeof(int). But I think we should totally
split watch handling into one function for normal watches, and other for
line ones.

EPIC FAIL STILL POSSIBLE!



Modified: trunk/ekg/plugins.h
===================================================================
--- trunk/ekg/plugins.h	2008-03-08 14:09:51 UTC (rev 3858)
+++ trunk/ekg/plugins.h	2008-03-08 14:33:54 UTC (rev 3859)
@@ -26,7 +26,7 @@
 #include "dynstuff.h"
 #include "sessions.h"
 
-#define EKG_ABI_VER 3856
+#define EKG_ABI_VER 3859
 
 #define EXPORT __attribute__ ((visibility("default")))
 

Modified: trunk/ekg/scripts.h
===================================================================
--- trunk/ekg/scripts.h	2008-03-08 14:09:51 UTC (rev 3858)
+++ trunk/ekg/scripts.h	2008-03-08 14:33:54 UTC (rev 3859)
@@ -123,6 +123,10 @@
 	}\
 	return NULL;
 
+/* XXX: split *_watches() into normal and line-ones,
+ * 	else we can have epic fails if void* > long int */
+#warning "POSSIBLE EPIC FAIL: when void* > long int, WATCH_LINE pointer may be shortened"
+
 #define SCRIPT_DEFINE(x, y)\
 	extern int x##_load(script_t *);\
 	extern int x##_unload(script_t *);\
@@ -131,7 +135,7 @@
 	extern int x##_timers(script_t *, script_timer_t *, int );\
 	extern int x##_variable_changed(script_t *, script_var_t *, char *);\
 	extern int x##_query(script_t *, script_query_t *, void **);\
-	extern int x##_watches(script_t *, script_watch_t *, int, int, int);\
+	extern int x##_watches(script_t *, script_watch_t *, int, int, long int);\
 	\
 	extern int x##_bind_free(script_t *, void *, int type, void *, ...);\
 	\

Modified: trunk/plugins/perl/perl_core.c
===================================================================
--- trunk/plugins/perl/perl_core.c	2008-03-08 14:09:51 UTC (rev 3858)
+++ trunk/plugins/perl/perl_core.c	2008-03-08 14:33:54 UTC (rev 3859)
@@ -110,7 +110,7 @@
 	PERL_HANDLER_FOOTER();
 }
 /* IF WATCH_READ_LINE int type == char *line */
-int perl_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, int watch)
+int perl_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, long int watch)
 {
 //	if (type) return -1;
 	

Modified: trunk/plugins/python/python.c
===================================================================
--- trunk/plugins/python/python.c	2008-03-08 14:09:51 UTC (rev 3858)
+++ trunk/plugins/python/python.c	2008-03-08 14:33:54 UTC (rev 3859)
@@ -170,7 +170,7 @@
 	return python_handle_result;
 }
 
-int python_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, int watch)
+int python_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, long int watch)
 {
 	int python_handle_result;
         PyObject * args;

Modified: trunk/plugins/ruby/ruby_ekg.c
===================================================================
--- trunk/plugins/ruby/ruby_ekg.c	2008-03-08 14:09:51 UTC (rev 3858)
+++ trunk/plugins/ruby/ruby_ekg.c	2008-03-08 14:33:54 UTC (rev 3859)
@@ -29,7 +29,7 @@
 static int ruby_commands(script_t *scr, script_command_t *comm, char **params);
 static int ruby_timers(script_t *scr, script_timer_t *time, int type);
 static int ruby_variable_changed(script_t *scr, script_var_t *scr_var, char *what);
-static int ruby_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, int watch);
+static int ruby_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, long int watch);
 
 static int ruby_script_theme_init(script_t *scr);
 
@@ -453,7 +453,8 @@
 }
 
 /* IF WATCH_READ_LINE int type == char *line */
-static int ruby_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, int watch) {
+/* ^ mg: rather watch */
+static int ruby_watches(script_t *scr, script_watch_t *scr_wat, int type, int fd, long int watch) {
 	ruby_helper_t ruby_watch;
 	VALUE argv[3];
 



Więcej informacji o liście dyskusyjnej ekg2-commit