[gtranslator] Patch by Ray Wang and Vincent Untz.
- From: Pablo Sanxiao Roca <psanxiao src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtranslator] Patch by Ray Wang and Vincent Untz.
- Date: Sun, 7 Jun 2009 14:09:32 -0400 (EDT)
commit 1b6c692f9ef83b44c2b2f192d538fcdf613943cb
Author: Pablo Sanxiao <psanxiao gmail com>
Date: Sun Jun 7 20:06:55 2009 -0700
Patch by Ray Wang and Vincent Untz.
Added some header files to the source code. (Fixes bug #542430)
---
plugins/open-tran/open-tran-panel.c | 2 +-
src/context.c | 2 +-
src/profile.c | 4 ++++
src/statusbar.c | 2 +-
src/tab.c | 2 +-
src/utils.c | 2 +-
src/window.c | 2 +-
7 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/plugins/open-tran/open-tran-panel.c b/plugins/open-tran/open-tran-panel.c
index d97e249..ba19451 100644
--- a/plugins/open-tran/open-tran-panel.c
+++ b/plugins/open-tran/open-tran-panel.c
@@ -241,7 +241,7 @@ open_connection(GtranslatorOpenTranPanel *panel,
array = soup_value_array_new_with_vals (G_TYPE_STRING, text,
G_TYPE_STRING, search_code,
G_TYPE_STRING, own_code,
- "%s", G_TYPE_INVALID);
+ NULL);
body = soup_xmlrpc_build_method_call ("suggest2", array->values,
array->n_values);
diff --git a/src/context.c b/src/context.c
index 92d167b..e2dc744 100644
--- a/src/context.c
+++ b/src/context.c
@@ -162,7 +162,7 @@ gtranslator_context_panel_new (GtkWidget *tab)
GtkTextView *
gtranslator_context_panel_get_context_text_view (GtranslatorContextPanel *panel)
{
- g_return_if_fail (GTR_IS_CONTEXT_PANEL (panel));
+ g_return_val_if_fail (GTR_IS_CONTEXT_PANEL (panel), NULL);
return GTK_TEXT_VIEW (panel->priv->context);
}
diff --git a/src/profile.c b/src/profile.c
index e1fa6ae..5bd482f 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -27,6 +27,10 @@
#include <glib.h>
#include <glib-object.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/socket.h>
#define GTR_PROFILE_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ( \
(object), \
diff --git a/src/statusbar.c b/src/statusbar.c
index f749ea7..5f3b881 100644
--- a/src/statusbar.c
+++ b/src/statusbar.c
@@ -181,7 +181,7 @@ gtranslator_statusbar_push (GtranslatorStatusbar *statusbar,
guint context_id,
const gchar *text)
{
- g_return_if_fail (GTR_IS_STATUSBAR (statusbar));
+ g_return_val_if_fail (GTR_IS_STATUSBAR (statusbar), 0);
return gtk_statusbar_push (GTK_STATUSBAR (statusbar->priv->statusbar),
context_id, text);
diff --git a/src/tab.c b/src/tab.c
index 6850093..3abb2a0 100644
--- a/src/tab.c
+++ b/src/tab.c
@@ -1053,7 +1053,7 @@ gtranslator_tab_get_all_views(GtranslatorTab *tab,
GList *ret = NULL;
gint i = 0;
- g_return_if_fail(GTR_IS_TAB(tab));
+ g_return_val_if_fail(GTR_IS_TAB(tab), NULL);
if(original)
{
diff --git a/src/utils.c b/src/utils.c
index fa13ce9..b937826 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -173,7 +173,7 @@ xmlDocPtr
gtranslator_xml_open_file (const gchar *filename)
{
xmlDocPtr doc;
- g_return_if_fail (filename != NULL);
+ g_return_val_if_fail (filename != NULL, NULL);
doc = xmlParseFile (filename);
return doc;
}
diff --git a/src/window.c b/src/window.c
index d38c816..af343a0 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1940,7 +1940,7 @@ gtranslator_window_get_tab_from_location (GtranslatorWindow *window,
GtranslatorPo *po;
GFile *po_location;
- g_return_if_fail (GTR_IS_WINDOW (window));
+ g_return_val_if_fail (GTR_IS_WINDOW (window), NULL);
tabs = gtranslator_window_get_all_tabs (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]