[gtksourceview] Tidy up gtksourceview-utils.h
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Tidy up gtksourceview-utils.h
- Date: Fri, 22 Jul 2016 19:59:32 +0000 (UTC)
commit c1796cedcdd13d9d9f4a28298b88dde5ebbe8bbf
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Jul 22 21:19:14 2016 +0200
Tidy up gtksourceview-utils.h
gtksourceview/gtksourceview-utils.c | 18 ++++++++++++++----
gtksourceview/gtksourceview-utils.h | 18 +++++++++---------
2 files changed, 23 insertions(+), 13 deletions(-)
---
diff --git a/gtksourceview/gtksourceview-utils.c b/gtksourceview/gtksourceview-utils.c
index 8b9a5f1..e0c7b75 100644
--- a/gtksourceview/gtksourceview-utils.c
+++ b/gtksourceview/gtksourceview-utils.c
@@ -1,5 +1,5 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- * gtksourceviewutils.c
+ * gtksourceview-utils.c
* This file is part of GtkSourceView
*
* Copyright (C) 2007 - Gustavo Giráldez and Paolo Maggi
@@ -13,7 +13,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
-
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -23,13 +23,13 @@
#include <config.h>
#endif
+#include "gtksourceview-utils.h"
+
#include <errno.h>
#include <math.h>
-#include "gtksourceview-utils.h"
#define SOURCEVIEW_DIR "gtksourceview-3.0"
-
gchar **
_gtk_source_view_get_default_dirs (const char *basename,
gboolean compat)
@@ -64,10 +64,12 @@ _gtk_source_view_get_default_dirs (const char *basename,
/* system dir */
for (xdg_dirs = g_get_system_data_dirs (); xdg_dirs && *xdg_dirs; ++xdg_dirs)
+ {
g_ptr_array_add (dirs, g_build_filename (*xdg_dirs,
SOURCEVIEW_DIR,
basename,
NULL));
+ }
g_ptr_array_add (dirs, NULL);
@@ -92,7 +94,9 @@ build_file_listing (const gchar *item,
dir = g_dir_open (item, 0, NULL);
if (dir == NULL)
+ {
return filenames;
+ }
while ((name = g_dir_read_name (dir)) != NULL)
{
@@ -122,7 +126,9 @@ _gtk_source_view_get_file_list (gchar **path,
GSList *files = NULL;
for ( ; path && *path; ++path)
+ {
files = build_file_listing (*path, files, suffix, only_dirs);
+ }
return g_slist_reverse (files);
}
@@ -139,13 +145,17 @@ _gtk_source_string_to_int (const gchar *str)
gchar *end_str;
if (str == NULL || *str == '\0')
+ {
return -1;
+ }
errno = 0;
number = g_ascii_strtoull (str, &end_str, 10);
if (errno != 0 || number > G_MAXINT || *end_str != '\0')
+ {
return -1;
+ }
return number;
}
diff --git a/gtksourceview/gtksourceview-utils.h b/gtksourceview/gtksourceview-utils.h
index f99827b..d426516 100644
--- a/gtksourceview/gtksourceview-utils.h
+++ b/gtksourceview/gtksourceview-utils.h
@@ -1,5 +1,5 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
- * gtksourceviewutils.h
+ * gtksourceview-utils.h
* This file is part of GtkSourceView
*
* Copyright (C) 2007 - Gustavo Giráldez and Paolo Maggi
@@ -13,7 +13,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
-
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -28,19 +28,19 @@
G_BEGIN_DECLS
G_GNUC_INTERNAL
-gchar **_gtk_source_view_get_default_dirs (const gchar *basename,
- gboolean compat);
+gchar ** _gtk_source_view_get_default_dirs (const gchar *basename,
+ gboolean compat);
G_GNUC_INTERNAL
-GSList *_gtk_source_view_get_file_list (gchar **path,
- const gchar *suffix,
- gboolean only_dirs);
+GSList * _gtk_source_view_get_file_list (gchar **path,
+ const gchar *suffix,
+ gboolean only_dirs);
G_GNUC_INTERNAL
-gint _gtk_source_string_to_int (const gchar *str);
+gint _gtk_source_string_to_int (const gchar *str);
G_GNUC_INTERNAL
-gchar *_gtk_source_pango_font_description_to_css (const PangoFontDescription *font_desc);
+gchar * _gtk_source_pango_font_description_to_css (const PangoFontDescription
*font_desc);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]