[grilo-plugins] youtube: Fix ISO C90 warnings
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] youtube: Fix ISO C90 warnings
- Date: Thu, 21 Jul 2011 12:07:04 +0000 (UTC)
commit 4e36c471735d09c20c96f88e7aa348ed689da996
Author: Philip Withnall <philip tecnocode co uk>
Date: Mon Jul 4 22:53:18 2011 +0100
youtube: Fix ISO C90 warnings
Can't mix declarations and code.
src/media/youtube/grl-youtube.c | 48 ++++++++++++++++++++++----------------
1 files changed, 28 insertions(+), 20 deletions(-)
---
diff --git a/src/media/youtube/grl-youtube.c b/src/media/youtube/grl-youtube.c
index 19b68c5..35d28ab 100644
--- a/src/media/youtube/grl-youtube.c
+++ b/src/media/youtube/grl-youtube.c
@@ -250,6 +250,7 @@ grl_youtube_plugin_init (GrlPluginRegistry *registry,
gchar *api_key;
GrlConfig *config;
gint config_count;
+ GrlYoutubeSource *source;
GRL_LOG_DOMAIN_INIT (youtube_log_domain, "youtube");
@@ -277,8 +278,7 @@ grl_youtube_plugin_init (GrlPluginRegistry *registry,
g_thread_init (NULL);
}
- GrlYoutubeSource *source =
- grl_youtube_source_new (api_key, YOUTUBE_CLIENT_ID);
+ source = grl_youtube_source_new (api_key, YOUTUBE_CLIENT_ID);
grl_plugin_registry_register_source (registry,
plugin,
@@ -301,11 +301,11 @@ G_DEFINE_TYPE (GrlYoutubeSource, grl_youtube_source, GRL_TYPE_MEDIA_SOURCE);
static GrlYoutubeSource *
grl_youtube_source_new (const gchar *api_key, const gchar *client_id)
{
- GRL_DEBUG ("grl_youtube_source_new");
-
GrlYoutubeSource *source;
GDataYouTubeService *service;
+ GRL_DEBUG ("grl_youtube_source_new");
+
service = gdata_youtube_service_new (api_key, client_id);
if (!service) {
GRL_WARNING ("Failed to initialize gdata service");
@@ -426,9 +426,13 @@ release_operation_data (GrlMetadataSource *source,
static OperationSpec *
operation_spec_new ()
{
+ OperationSpec *os;
+
GRL_DEBUG ("Allocating new spec");
- OperationSpec *os = g_slice_new0 (OperationSpec);
+
+ os = g_slice_new0 (OperationSpec);
os->ref_count = 1;
+
return os;
}
@@ -615,14 +619,14 @@ build_media_from_entry (GrlYoutubeSource *source,
static void
parse_categories (xmlDocPtr doc, xmlNodePtr node, OperationSpec *os)
{
- GRL_DEBUG ("parse_categories");
-
guint total = 0;
GList *all = NULL, *iter;
CategoryInfo *cat_info;
gchar *id;
guint index = 0;
+ GRL_DEBUG ("parse_categories");
+
while (node) {
cat_info = g_slice_new (CategoryInfo);
id = (gchar *) xmlGetProp (node, (xmlChar *) "term");
@@ -801,14 +805,14 @@ metadata_cb (GObject *object,
GAsyncResult *result,
gpointer user_data)
{
- GRL_DEBUG ("metadata_cb");
-
GError *error = NULL;
GrlYoutubeSource *source;
GDataEntry *video;
GDataService *service;
GrlMediaSourceMetadataSpec *ms = (GrlMediaSourceMetadataSpec *) user_data;
+ GRL_DEBUG ("metadata_cb");
+
source = GRL_YOUTUBE_SOURCE (ms->source);
service = GDATA_SERVICE (source->priv->service);
@@ -877,13 +881,13 @@ search_progress_cb (GDataEntry *entry,
static void
search_cb (GObject *object, GAsyncResult *result, OperationSpec *os)
{
- GRL_DEBUG ("search_cb");
-
GDataFeed *feed;
GError *error = NULL;
gboolean need_extra_unref = FALSE;
GrlYoutubeSource *source = GRL_YOUTUBE_SOURCE (os->source);
+ GRL_DEBUG ("search_cb");
+
/* Check if operation was cancelled */
if (g_cancellable_is_cancelled (os->cancellable)) {
GRL_DEBUG ("Search operation has been cancelled");
@@ -1046,10 +1050,10 @@ produce_container_from_directory (GDataService *service,
static void
produce_from_directory (CategoryInfo *dir, gint dir_size, OperationSpec *os)
{
- GRL_DEBUG ("produce_from_directory");
-
guint index, remaining;
+ GRL_DEBUG ("produce_from_directory");
+
/* Youtube's first index is 1, but the directories start at 0 */
os->skip--;
@@ -1480,11 +1484,11 @@ grl_youtube_source_metadata (GrlMediaSource *source,
static gboolean
grl_youtube_test_media_from_uri (GrlMediaSource *source, const gchar *uri)
{
- GRL_DEBUG ("grl_youtube_test_media_from_uri");
-
gchar *video_id;
gboolean ok;
+ GRL_DEBUG ("grl_youtube_test_media_from_uri");
+
video_id = get_video_id_from_url (uri);
ok = (video_id != NULL);
g_free (video_id);
@@ -1495,12 +1499,15 @@ static void
grl_youtube_get_media_from_uri (GrlMediaSource *source,
GrlMediaSourceMediaFromUriSpec *mfus)
{
- GRL_DEBUG ("grl_youtube_get_media_from_uri");
-
gchar *video_id;
GError *error;
GCancellable *cancellable;
GDataService *service;
+#ifdef GDATA_API_SUBJECT_TO_CHANGE
+ gchar *entry_id;
+#endif /* GDATA_API_SUBJECT_TO_CHANGE */
+
+ GRL_DEBUG ("grl_youtube_get_media_from_uri");
video_id = get_video_id_from_url (mfus->uri);
if (video_id == NULL) {
@@ -1517,7 +1524,7 @@ grl_youtube_get_media_from_uri (GrlMediaSource *source,
cancellable = g_cancellable_new ();
grl_operation_set_data (mfus->media_from_uri_id, cancellable);
#ifdef GDATA_API_SUBJECT_TO_CHANGE
- gchar *entry_id = g_strconcat ("tag:youtube.com,2008:video:", video_id, NULL);
+ entry_id = g_strconcat ("tag:youtube.com,2008:video:", video_id, NULL);
gdata_service_query_single_entry_async (service,
entry_id,
NULL,
@@ -1540,10 +1547,11 @@ static void
grl_youtube_source_cancel (GrlMetadataSource *source,
guint operation_id)
{
+ GCancellable *cancellable;
+
GRL_DEBUG (__FUNCTION__);
- GCancellable *cancellable =
- (GCancellable *) grl_operation_get_data (operation_id);
+ cancellable = G_CANCELLABLE (grl_operation_get_data (operation_id));
if (cancellable) {
g_cancellable_cancel (cancellable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]