Commit 7473ac29 authored by W. Michael Petullo's avatar W. Michael Petullo

Fix gint vs. guint / atoi vs. strtoul issues

Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent e374a2e4
......@@ -839,7 +839,7 @@ databases_items_xxx (DMAPShare *share,
const gchar *transcode_mimetype;
const gchar *rest_of_path;
const gchar *id_str;
gint id;
guint id;
const gchar *range_header;
guint64 filesize;
guint64 offset = 0;
......@@ -847,7 +847,7 @@ databases_items_xxx (DMAPShare *share,
rest_of_path = strchr (path + 1, '/');
id_str = rest_of_path + 9;
id = atoi (id_str);
id = strtoul (id_str, NULL, 10);
g_object_get (share, "db", &db, NULL);
record = DAAP_RECORD (dmap_db_lookup_by_id (db, id));
......
......@@ -186,7 +186,7 @@ compare_record_property (DMAPRecord *record, const gchar *property_name, const g
g_value_unset (&value);
return FALSE;
}
accept = (g_value_get_long (&dest) == atoi (property_value));
accept = (g_value_get_long (&dest) == strtol (property_value, NULL, 10));
g_value_unset (&value);
return accept;
} else if (g_value_type_transformable (G_VALUE_TYPE (&value), G_TYPE_STRING)) {
......@@ -254,7 +254,7 @@ apply_filter (gpointer id, DMAPRecord *record, gpointer data)
query_value = def->value;
if (g_strcmp0 (query_key, "dmap.itemid") == 0) {
if (GPOINTER_TO_UINT (id) == atoi (query_value)) {
if (GPOINTER_TO_UINT (id) == strtoul (query_value, NULL, 10)) {
accept = TRUE;
break;
}
......
......@@ -1684,7 +1684,7 @@ _dmap_share_databases (DMAPShare *share,
GNode *apso;
struct DMAPMetaDataMap *map;
struct MLCL_Bits mb = {NULL,0};
gint pl_id;
guint pl_id;
gchar *record_query;
GSList *filter_def;
GHashTable *records;
......@@ -1726,7 +1726,7 @@ _dmap_share_databases (DMAPShare *share,
g_list_free (keys);
g_hash_table_destroy (records);
} else {
pl_id = atoi (rest_of_path + 14);
pl_id = strtoul (rest_of_path + 14, NULL, 10);
if (pl_id == 1) {
gint32 num_songs = dmap_db_count (share->priv->db);
dmap_structure_add (apso, DMAP_CC_MTCO, (gint32) num_songs);
......@@ -1741,6 +1741,7 @@ _dmap_share_databases (DMAPShare *share,
record = dmap_container_db_lookup_by_id (share->priv->container_db, pl_id);
entries = dmap_container_record_get_entries (record);
/* FIXME: what if entries is NULL (handled in dmapd but should be [also] handled here)? */
num_songs = dmap_db_count (entries);
dmap_structure_add (apso, DMAP_CC_MTCO, (gint32) num_songs);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment