[PATCH 1/2] youtube: remove c99 code style



This module has variable declarations in a for sentence, which is
only valid for c99, but the dialect is not activated in configure.ac

As the rest of the code don't stick to c99 hence is better just
change these few lines.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez igalia com>
---
 src/youtube/grl-youtube.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/youtube/grl-youtube.c b/src/youtube/grl-youtube.c
index 826a088..d8b78fc 100644
--- a/src/youtube/grl-youtube.c
+++ b/src/youtube/grl-youtube.c
@@ -656,7 +656,9 @@ get_category_term_from_id (const gchar *category_id)
 static gint
 get_category_index_from_id (const gchar *category_id)
 {
-  for (gint i=0; i<root_dir[ROOT_DIR_CATEGORIES_INDEX].count; i++) {
+  gint i;
+
+  for (i=0; i<root_dir[ROOT_DIR_CATEGORIES_INDEX].count; i++) {
     if (!strcmp (categories_dir[i].id, category_id)) {
       return i;
     }
@@ -693,9 +695,11 @@ item_count_cb (GObject *object, GAsyncResult *result, CategoryCountCb *cc)
 static void
 compute_category_counts (GDataService *service)
 {
+  gint i;
+
   g_debug ("compute_category_counts");
 
-  for (gint i=0; i<root_dir[ROOT_DIR_CATEGORIES_INDEX].count; i++) {
+  for (i=0; i<root_dir[ROOT_DIR_CATEGORIES_INDEX].count; i++) {
     g_debug ("Computing chilcount for category '%s'", categories_dir[i].id);
     GDataQuery *query = gdata_query_new_with_limits (NULL, 0, 1);
     const gchar *category_term =
@@ -716,9 +720,10 @@ compute_category_counts (GDataService *service)
 static void
 compute_feed_counts (GDataService *service)
 {
+  gint i;
   g_debug ("compute_feed_counts");
 
-  for (gint i=0; i<root_dir[ROOT_DIR_FEEDS_INDEX].count; i++) {
+  for (i=0; i<root_dir[ROOT_DIR_FEEDS_INDEX].count; i++) {
     g_debug ("Computing chilcount for feed '%s'", feeds_dir[i].id);
     gint feed_type = get_feed_type_from_id (feeds_dir[i].id);
     GDataQuery *query = gdata_query_new_with_limits (NULL, 0, 1);
-- 
1.7.1



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