[grilo-plugins] dmap: Use C comments



commit 3277e6ebde385ced0637f0a2ba1453077353c18e
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Feb 7 09:02:00 2014 +0100

    dmap: Use C comments
    
    Do not use C++ comments.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723574

 src/dmap/grl-dmap.c       |   24 +++++++++++++-----------
 src/dmap/simple-dmap-db.c |   27 ++++++++++++++++-----------
 2 files changed, 29 insertions(+), 22 deletions(-)
---
diff --git a/src/dmap/grl-dmap.c b/src/dmap/grl-dmap.c
index bcc8b50..e5fdc73 100644
--- a/src/dmap/grl-dmap.c
+++ b/src/dmap/grl-dmap.c
@@ -107,8 +107,10 @@ static void service_removed_cb (DMAPMdnsBrowser *browser,
 
 /* ===================== Globals  ======================= */
 static DMAPMdnsBrowser *browser;
-static GHashTable *connections; // Maps URIs to DBs.
-static GHashTable *sources;     // Map DMAP services to Grilo media sources.
+/* Maps URIs to DBs */
+static GHashTable *connections;
+/* Map DMAP services to Grilo media sources */
+static GHashTable *sources;
 
 /* =================== DMAP Plugin ====================== */
 
@@ -142,9 +144,9 @@ grl_dmap_plugin_init (GrlRegistry *registry,
                     (gpointer) plugin);
 
   if (!dmap_mdns_browser_start (browser, &error)) {
-    g_warning ("error starting browser. code: %d message: %s",
-               error->code,
-               error->message);
+    GRL_WARNING ("error starting browser. code: %d message: %s",
+                 error->code,
+                 error->message);
     g_error_free (error);
 
     g_clear_pointer (&connections, g_hash_table_unref);
@@ -267,7 +269,7 @@ browse_connected_cb (DMAPConnection       *connection,
 {
   GError *error;
 
-  // NOTE: connection argument is required by API but ignored in this case.
+  /* NOTE: connection argument is required by API but ignored in this case. */
   if (!result) {
     error = g_error_new_literal (GRL_CORE_ERROR,
                                  GRL_CORE_ERROR_BROWSE_FAILED,
@@ -292,7 +294,7 @@ search_connected_cb (DMAPConnection       *connection,
 {
   GError *error;
 
-  // NOTE: connection argument is required by API but ignored in this case.
+  /* NOTE: connection argument is required by API but ignored in this case. */
   if (!result) {
     error = g_error_new_literal (GRL_CORE_ERROR,
                                  GRL_CORE_ERROR_BROWSE_FAILED,
@@ -416,10 +418,10 @@ grl_dmap_source_browse (GrlSource *source,
   cb_and_db->cb.user_data      = bs->user_data;
 
   if ((cb_and_db->db = g_hash_table_lookup (connections, url))) {
-    // Just call directly; already connected, already populated database.
+    /* Just call directly; already connected, already populated database. */
     browse_connected_cb (NULL, TRUE, NULL, cb_and_db);
   } else {
-    // Connect.
+    /* Connect */
     cb_and_db->db = simple_dmap_db_new ();
 
     grl_dmap_connect (dmap_source->priv->service->name,
@@ -454,10 +456,10 @@ static void grl_dmap_source_search (GrlSource *source,
   cb_and_db->cb.user_data      = ss->user_data;
 
   if ((cb_and_db->db = g_hash_table_lookup (connections, url))) {
-    // Just call directly; already connected, already populated database.
+    /* Just call directly; already connected, already populated database */
     search_connected_cb (NULL, TRUE, NULL, cb_and_db);
   } else {
-    // Connect.
+    /* Connect */
     cb_and_db->db = simple_dmap_db_new ();
     grl_dmap_connect (service->name, service->host, service->port, cb_and_db, (DMAPConnectionCallback) 
search_connected_cb);
     g_hash_table_insert (connections, g_strdup (url), cb_and_db->db);
diff --git a/src/dmap/simple-dmap-db.c b/src/dmap/simple-dmap-db.c
index 716d263..2ec8c22 100644
--- a/src/dmap/simple-dmap-db.c
+++ b/src/dmap/simple-dmap-db.c
@@ -67,8 +67,11 @@
 static guint nextid = G_MAXINT; /* NOTE: this should be G_MAXUINT, but iPhoto can't handle it. */
 
 struct SimpleDMAPDbPrivate {
-  GrlMediaBox *albums_box;  // Contains each album box (tracked with albums hash table).
-  GrlMediaBox *artists_box; // Contains each artist box (tracked with artist hash table).
+  /* Contains each album box (tracked with albums hash table) */
+  GrlMediaBox *albums_box;
+
+  /* Contains each artist box (tracked with artist hash table) */
+  GrlMediaBox *artists_box;
 
   GHashTable  *root;
   GHashTable  *albums;
@@ -200,7 +203,7 @@ simple_dmap_db_add (DMAPDb *_db, DMAPRecord *record)
   }
 
   if (url) {
-    // Replace URL's daap:// with http://.
+    /* Replace URL's daap:// with http:// */
     url[0] = 'h'; url[1] = 't'; url[2] = 't'; url[3] = 'p';
     grl_media_set_url (media, url);
   }
@@ -282,8 +285,8 @@ simple_dmap_db_browse (SimpleDMAPDb *db,
     }
   }
 
-  // Should not be NULL; this means the container requested
-  // does not exist in the database.
+  /* Should not be NULL; this means the container requested
+     does not exist in the database. */
   if (NULL == hash_table) {
     GError *error = g_error_new (GRL_CORE_ERROR,
                                  GRL_CORE_ERROR_BROWSE_FAILED,
@@ -322,22 +325,24 @@ simple_dmap_db_search (SimpleDMAPDb *db,
   guint remaining = 0;
   gpointer key1, val1, key2, val2;
   GHashTable *hash_table[] = { db->priv->albums, db->priv->artists };
-  GHashTable *results = NULL; // Use hash table to avoid duplicates.
+
+  /* Use hash table to avoid duplicates */
+  GHashTable *results = NULL;
   GHashTableIter iter1, iter2;
 
   results = g_hash_table_new (g_str_hash, g_str_equal);
 
-  // For albums and artists...
+  /* For albums and artists... */
   for (i = 0; i < 2; i++) {
     g_hash_table_iter_init (&iter1, hash_table[i]);
-    // For each album or artist in above...
+    /* For each album or artist in above... */
     for (j = 0; g_hash_table_iter_next (&iter1, &key1, &val1); j++) {
       if (GRL_IS_MEDIA_BOX (key1)) {
         g_hash_table_iter_init (&iter2, val1);
-        // For each media item in above...
+        /* For each media item in above... */
         for (k = 0; g_hash_table_iter_next (&iter2, &key2, &val2); k++) {
           const char *id = grl_media_get_id (GRL_MEDIA (key2));
-          // If the predicate returns true, add to results set.
+          /* If the predicate returns true, add to results set. */
           if (predicate (key2, val2, pred_user_data)
            && ! g_hash_table_contains (results, id)) {
             remaining++;
@@ -348,7 +353,7 @@ simple_dmap_db_search (SimpleDMAPDb *db,
     }
   }
 
-  // Process results set.
+  /* Process results set. */
   g_hash_table_iter_init (&iter1, results);
   for (i = 0; g_hash_table_iter_next (&iter1, &key1, &val1); i++) {
     func (source, op_id, GRL_MEDIA (g_object_ref (val1)), --remaining, user_data, NULL);


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