[g-a-devel]at-poke initialisation



The call to SPI_init at the top of main in at-poke is wrapped inside in
a g_assert macro.

If G_DISABLE_ASSERT is defined, the expression inside g_assert is
removed during preprocessing, and SPI doesn't get initialised.

I've attached a patch which should fix this.  OK to commit?

-- 
David Malcolm
http://www.davemalcolm.demon.co.uk
Index: src/main.c
===================================================================
RCS file: /cvs/gnome/at-poke/src/main.c,v
retrieving revision 1.19
diff -p -u -r1.19 main.c
--- src/main.c	4 Mar 2003 12:58:54 -0000	1.19
+++ src/main.c	15 Nov 2003 16:30:28 -0000
@@ -399,8 +399,13 @@ int
 main (int argc, char **argv)
 {
 	int leaked;
+	int init_error;
 
-	g_assert (!SPI_init ());
+	init_error = SPI_init ();
+	if (init_error) {
+	        g_warning ("Error initialising SPI");
+	        return init_error;
+	}
 
 	if (no_accessible_apps ()) { /* fork gtk-demo */
 		if (!fork ()) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]