SF.net SVN: geany-plugins:[1918] trunk/geany-plugins/debugger/src

cesspit at users.sourceforge.net cesspit at xxxxx
Thu Feb 10 06:41:31 UTC 2011


Revision: 1918
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1918&view=rev
Author:   cesspit
Date:     2011-02-10 06:41:31 +0000 (Thu, 10 Feb 2011)

Log Message:
-----------
some glib and casting errors

Modified Paths:
--------------
    trunk/geany-plugins/debugger/src/breakpoints.c
    trunk/geany-plugins/debugger/src/dbm_gdb.c
    trunk/geany-plugins/debugger/src/debug.c
    trunk/geany-plugins/debugger/src/stree.c
    trunk/geany-plugins/debugger/src/tpage.c

Modified: trunk/geany-plugins/debugger/src/breakpoints.c
===================================================================
--- trunk/geany-plugins/debugger/src/breakpoints.c	2011-02-09 23:39:19 UTC (rev 1917)
+++ trunk/geany-plugins/debugger/src/breakpoints.c	2011-02-10 06:41:31 UTC (rev 1918)
@@ -76,7 +76,7 @@
 	breakpoint* bp = NULL;
 	GTree* tree = NULL;
 	if (tree = (GTree*)g_hash_table_lookup(files, file))
-		bp = g_tree_lookup(tree, (gconstpointer)line);
+		bp = g_tree_lookup(tree, GINT_TO_POINTER(line));
 
 	return bp;
 }
@@ -91,10 +91,7 @@
  */
 gint compare_func(gconstpointer a, gconstpointer b, gpointer user_data)
 {
-	if (a == b)
-		return 0;
-	else
-		return a > b ? 1 : -1; 
+	return GPOINTER_TO_INT(a) - GPOINTER_TO_INT(b);
 }
 
 /*
@@ -120,7 +117,7 @@
 		markers_add_breakpoint(bp);
 	}
 	else
-		dialogs_show_msgbox(GTK_MESSAGE_ERROR, debug_error_message());
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", debug_error_message());
 }
 
 /*
@@ -139,10 +136,10 @@
 		bptree_remove_breakpoint(bp);
 		/* remove from internal storage */
 		GTree *tree = g_hash_table_lookup(files,bp->file);
-		g_tree_remove(tree, (gconstpointer)bp->line);
+		g_tree_remove(tree, GINT_TO_POINTER(bp->line));
 	}
 	else
-		dialogs_show_msgbox(GTK_MESSAGE_ERROR, debug_error_message());
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", debug_error_message());
 }
 
 /*
@@ -156,7 +153,7 @@
 	if (success)
 		bptree_set_hitscount(bp->iter, bp->hitscount);
 	else
-		dialogs_show_msgbox(GTK_MESSAGE_ERROR, debug_error_message());
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", debug_error_message());
 }
 
 /*
@@ -179,7 +176,7 @@
 		strcpy(bp->condition, oldcondition);
 		g_free(oldcondition);
 		/* show error message */
-		dialogs_show_msgbox(GTK_MESSAGE_ERROR, debug_error_message());
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", debug_error_message());
 	}
 }
 
@@ -298,7 +295,7 @@
 	}
 	
 	/* insert to internal storage */
-	g_tree_insert(tree, (gpointer)bp->line, (gpointer)bp);
+	g_tree_insert(tree, GINT_TO_POINTER(bp->line), bp);
 
 	/* handle creation instantly if debugger is idle or stopped
 	and request debug module interruption overwise */
@@ -442,7 +439,7 @@
 	else
 	{
 		/* lookup for the break in GTree*/
-		gpointer p = g_tree_lookup(tree, (gconstpointer)line);
+		gpointer p = g_tree_lookup(tree, GINT_TO_POINTER(line));
 		return p && ((breakpoint*)p)->enabled;
 	}
 }

Modified: trunk/geany-plugins/debugger/src/dbm_gdb.c
===================================================================
--- trunk/geany-plugins/debugger/src/dbm_gdb.c	2011-02-09 23:39:19 UTC (rev 1917)
+++ trunk/geany-plugins/debugger/src/dbm_gdb.c	2011-02-10 06:41:31 UTC (rev 1918)
@@ -251,7 +251,7 @@
 static gboolean on_read_from_gdb(GIOChannel * src, GIOCondition cond, gpointer data)
 {
 	gchar *line;
-	gint length;
+	gsize length;
 	
 	if (G_IO_STATUS_NORMAL != g_io_channel_read_line(src, &line, NULL, &length, NULL))
 		return TRUE;		
@@ -900,7 +900,7 @@
 			strcpy(f->file, "");
 		
 		/* whether source is available */
-		f->have_source = (gboolean)fullname;
+		f->have_source = fullname ? TRUE : FALSE;
 
 		/* line */
 		int line = 0;

Modified: trunk/geany-plugins/debugger/src/debug.c
===================================================================
--- trunk/geany-plugins/debugger/src/debug.c	2011-02-09 23:39:19 UTC (rev 1917)
+++ trunk/geany-plugins/debugger/src/debug.c	2011-02-10 06:41:31 UTC (rev 1918)
@@ -735,7 +735,7 @@
  */
 static void on_debugger_error (gchar* message)
 {
-	dialogs_show_msgbox(GTK_MESSAGE_ERROR, message);
+	dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", message);
 }
 
 /* callbacks structure to pass to debugger module */
@@ -986,7 +986,7 @@
 					sprintf(msg, _("Breakpoint at %s:%i cannot be set\nDebugger message: %s"),
 						erroneous_break->file, erroneous_break->line, active_module->error_message());
 						
-					dialogs_show_msgbox(GTK_MESSAGE_ERROR, msg);
+					dialogs_show_msgbox(GTK_MESSAGE_ERROR, "%s", msg);
 						
 					active_module->stop();
 					debug_state = DBS_STOP_REQUESTED;

Modified: trunk/geany-plugins/debugger/src/stree.c
===================================================================
--- trunk/geany-plugins/debugger/src/stree.c	2011-02-09 23:39:19 UTC (rev 1917)
+++ trunk/geany-plugins/debugger/src/stree.c	2011-02-10 06:41:31 UTC (rev 1918)
@@ -93,7 +93,7 @@
 			-1);
 		
 		/* check if file name is not empty and we have source files for the frame */
-		if (strlen(file) && g_hash_table_lookup(frames, (gpointer)file))
+		if (strlen(file) && GPOINTER_TO_INT(g_hash_table_lookup(frames, (gpointer)file)))
 			callback(file, line);
 		
 		g_free(file);
@@ -203,8 +203,8 @@
                     -1);
     
 	/* remember if we have source for this frame */
-    if (f->have_source && !g_hash_table_lookup(frames, (gpointer)f->file))
-		g_hash_table_insert(frames, g_strdup(f->file), (gpointer)f->have_source);
+    if (f->have_source && !GPOINTER_TO_INT(g_hash_table_lookup(frames, (gpointer)f->file)))
+		g_hash_table_insert(frames, g_strdup(f->file), GINT_TO_POINTER(f->have_source));
 }
 
 /*

Modified: trunk/geany-plugins/debugger/src/tpage.c
===================================================================
--- trunk/geany-plugins/debugger/src/tpage.c	2011-02-09 23:39:19 UTC (rev 1917)
+++ trunk/geany-plugins/debugger/src/tpage.c	2011-02-10 06:41:31 UTC (rev 1918)
@@ -247,13 +247,13 @@
 {
 	/* do not allow to edit value in read only mode */
 	if (page_read_only)
-		g_object_set (cell, "editable", FALSE);
+		g_object_set (cell, "editable", FALSE, NULL);
 	else
 	{
 		/* do not allow to edit value for empty row */
 		GtkTreePath *path = gtk_tree_model_get_path(tree_model, iter);
 		gboolean empty = !gtk_tree_path_compare(path, gtk_tree_row_reference_get_path(empty_row));
-		g_object_set (cell, "editable", entering_new_var || !empty);
+		g_object_set (cell, "editable", entering_new_var || !empty, NULL);
 		gtk_tree_path_free(path);
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list