[Telepathy-commits] [telepathy-mission-control/master] Squash warnings about variable shadowing
Will Thompson
will.thompson at collabora.co.uk
Tue Dec 16 09:34:58 PST 2008
---
libmissioncontrol/mission-control.c | 24 ++++++++++++------------
src/mcd-connection.c | 3 ++-
src/mcd-dispatcher.c | 12 ++++++------
src/mcd-service.c | 15 +++++++++------
4 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/libmissioncontrol/mission-control.c b/libmissioncontrol/mission-control.c
index e0f6feb..e73cae3 100644
--- a/libmissioncontrol/mission-control.c
+++ b/libmissioncontrol/mission-control.c
@@ -36,8 +36,8 @@ static void _handle_mcd_errors (DBusGProxy * missioncontrol, guint serial,
static gboolean check_for_accounts (MissionControl * self);
static GObjectClass *parent_class = NULL;
-static guint operation_id; /* A simple counter for execution order tracking;
- must be global per process */
+/* A simple counter for execution order tracking; must be global per process */
+static guint last_operation_id;
static GList *instances = NULL;
static DBusConnection *dbus_connection = NULL;
static TpDBusDaemon *dbus_daemon = NULL;
@@ -642,20 +642,20 @@ mission_control_request_channel (MissionControl * self,
{
struct dbus_cb_data *cb_data;
const gchar *account_name = mc_account_get_unique_name (account);
- operation_id++;
+ last_operation_id++;
if (account_name == NULL)
{
INVOKE_CALLBACK (self, callback, user_data, MC_INVALID_ACCOUNT_ERROR,
" ");
- return operation_id;
+ return last_operation_id;
}
/* Check whether we have any accounts to request channel for */
if (!check_for_accounts (self))
{
INVOKE_CALLBACK (self, callback, user_data, MC_NO_ACCOUNTS_ERROR, " ");
- return operation_id;
+ return last_operation_id;
}
cb_data = g_malloc (sizeof (struct dbus_cb_data));
@@ -665,11 +665,11 @@ mission_control_request_channel (MissionControl * self,
mission_control_dbus_request_channel_async (DBUS_G_PROXY (self),
account_name,
type, handle, handle_type,
- operation_id,
+ last_operation_id,
dbus_async_cb,
cb_data);
- return operation_id;
+ return last_operation_id;
}
@@ -709,20 +709,20 @@ mission_control_request_channel_with_string_handle_and_vcard_field (MissionContr
const gchar *account_name = mc_account_get_unique_name (account);
char * mangled_handle = NULL;
- operation_id++;
+ last_operation_id++;
if (account_name == NULL)
{
INVOKE_CALLBACK (self, callback, user_data, MC_INVALID_ACCOUNT_ERROR,
" ");
- return operation_id;
+ return last_operation_id;
}
/* Check whether we have any accounts to request channel for */
if (!check_for_accounts (self))
{
INVOKE_CALLBACK (self, callback, user_data, MC_NO_ACCOUNTS_ERROR, " ");
- return operation_id;
+ return last_operation_id;
}
/* mangle the handle with the vcard_field */
@@ -779,12 +779,12 @@ mission_control_request_channel_with_string_handle_and_vcard_field (MissionContr
type,
(mangled_handle)?mangled_handle:handle,
handle_type,
- operation_id,
+ last_operation_id,
dbus_async_cb, cb_data);
g_free(mangled_handle);
- return operation_id;
+ return last_operation_id;
}
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 5ffb6ad..b5e523d 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -309,11 +309,12 @@ presence_get_statuses_cb (TpProxy *proxy, const GValue *v_statuses,
g_hash_table_iter_init (&iter, statuses);
while (g_hash_table_iter_next (&iter, &ht_key, &ht_value))
{
- const gchar *status = ht_key;
GValueArray *va = ht_value;
McdPresenceInfo *pi;
+ status = ht_key;
g_debug (" %s", status);
+
pi = g_slice_new (McdPresenceInfo);
pi->presence = g_value_get_uint (va->values);
pi->may_set_on_self = g_value_get_boolean (va->values + 1);
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index a6424d0..222a9dd 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1916,12 +1916,12 @@ parse_client_filter (GKeyFile *file, const gchar *group)
{
/* g_key_file_get_integer cannot be used because we need
* to support 64 bits */
- guint i;
+ guint x;
GValue *value = tp_g_value_slice_new (G_TYPE_UINT64);
gchar *str = g_key_file_get_string (file, group, key,
NULL);
errno = 0;
- i = g_ascii_strtoull (str, NULL, 0);
+ x = g_ascii_strtoull (str, NULL, 0);
if (errno != 0)
{
g_warning ("Invalid unsigned integer '%s' in client"
@@ -1929,7 +1929,7 @@ parse_client_filter (GKeyFile *file, const gchar *group)
}
else
{
- g_value_set_uint64 (value, i);
+ g_value_set_uint64 (value, x);
g_hash_table_insert (filter, file_property, value);
}
g_free (str);
@@ -1941,11 +1941,11 @@ parse_client_filter (GKeyFile *file, const gchar *group)
case 'i':
case 'x': /* signed integer */
{
- gint i;
+ gint x;
GValue *value = tp_g_value_slice_new (G_TYPE_INT64);
gchar *str = g_key_file_get_string (file, group, key, NULL);
errno = 0;
- i = g_ascii_strtoll (str, NULL, 0);
+ x = g_ascii_strtoll (str, NULL, 0);
if (errno != 0)
{
g_warning ("Invalid signed integer '%s' in client"
@@ -1953,7 +1953,7 @@ parse_client_filter (GKeyFile *file, const gchar *group)
}
else
{
- g_value_set_uint64 (value, i);
+ g_value_set_uint64 (value, x);
g_hash_table_insert (filter, file_property, value);
}
g_free (str);
diff --git a/src/mcd-service.c b/src/mcd-service.c
index 5c2aeea..f8a5ad6 100644
--- a/src/mcd-service.c
+++ b/src/mcd-service.c
@@ -316,17 +316,20 @@ mcd_service_get_account_for_connection(GObject *obj,
static gboolean
mcd_service_get_current_status(GObject *obj,
- McStatus *status, TpConnectionPresenceType *presence,
- TpConnectionPresenceType *requested_presence,
- GPtrArray **accounts, GError **error)
+ McStatus *status_out,
+ TpConnectionPresenceType *presence_out,
+ TpConnectionPresenceType *requested_presence_out,
+ GPtrArray **accounts,
+ GError **error)
{
+ McdMaster *as_master = MCD_MASTER (obj);
McdServicePrivate *priv = MCD_OBJECT_PRIV (obj);
GList *account_list, *account_node;
GType type;
- *status = priv->last_status;
- *presence = mcd_master_get_actual_presence (MCD_MASTER (obj));
- *requested_presence = mcd_master_get_requested_presence (MCD_MASTER (obj));
+ *status_out = priv->last_status;
+ *presence_out = mcd_master_get_actual_presence (as_master);
+ *requested_presence_out = mcd_master_get_requested_presence (as_master);
*accounts = g_ptr_array_new ();
type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT,
--
1.5.6.5
More information about the Telepathy-commits
mailing list