From: Mike M. <che...@ya...> - 2003-04-01 19:09:32
|
I could be wrong, but I didn't think you could set a pointer at the same time it was deffined? Any way this just lookes better to me, and seams to debug nicer in ddd. Index: src/inputevt.c =================================================================== RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/inputevt.c,v retrieving revision 1.6 diff -c -r1.6 inputevt.c *** src/inputevt.c 18 Mar 2003 00:28:29 -0000 1.6 --- src/inputevt.c 1 Apr 2003 19:07:05 -0000 *************** *** 75,81 **** gpointer data) { inputevt_cond_t cond = 0; ! inputevt_relay_t *relay = (inputevt_relay_t *) data; if (condition & READ_CONDITION) cond |= INPUT_EVENT_READ; --- 75,82 ---- gpointer data) { inputevt_cond_t cond = 0; ! inputevt_relay_t *relay; ! relay = (inputevt_relay_t *) data; if (condition & READ_CONDITION) cond |= INPUT_EVENT_READ; Index: src/sockets.c =================================================================== RCS file: /cvsroot/gtk-gnutella/gtk-gnutella-current/src/sockets.c,v retrieving revision 1.80 diff -c -r1.80 sockets.c *** src/sockets.c 26 Mar 2003 21:13:21 -0000 1.80 --- src/sockets.c 1 Apr 2003 19:07:06 -0000 *************** *** 340,350 **** static void socket_read(gpointer data, gint source, inputevt_cond_t cond) { gint r; ! struct gnutella_socket *s = (struct gnutella_socket *) data; guint count; guint parsed; guchar *first; /* s->type = 0; */ if (cond & INPUT_EVENT_EXCEPTION) { --- 340,351 ---- static void socket_read(gpointer data, gint source, inputevt_cond_t cond) { gint r; ! struct gnutella_socket *s; guint count; guint parsed; guchar *first; + s = (struct gnutella_socket *) data; /* s->type = 0; */ if (cond & INPUT_EVENT_EXCEPTION) { *************** *** 489,494 **** --- 490,497 ---- else goto unknown; + socket_tos_default(s); + return; unknown: *************** *** 1132,1139 **** s->gdk_tag = inputevt_add(sd, INPUT_EVENT_READ | INPUT_EVENT_EXCEPTION, socket_accept, s); - - socket_tos_default(s); return s; } --- 1135,1140 ---- __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more http://platinum.yahoo.com |