From f7b8a99b214927750504d2bcd07e14c04fa36af3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 2 Mar 2012 16:31:57 +0000 Subject: [PATCH 3/4] =?UTF-8?q?Use=20TP=5FNUM=5F=E2=80=A6=20instead=20of=20N?= =?UTF-8?q?UM=5FTP=5F=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on a patch from Jonny Lamb, updated for current master. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470 --- examples/cm/call/conn.c | 2 +- examples/cm/channelspecific/conn.c | 2 +- examples/cm/contactlist/conn.c | 2 +- examples/cm/echo-message-parts/conn.c | 2 +- examples/cm/extended/conn.c | 2 +- telepathy-glib/account.c | 10 +++++----- telepathy-glib/base-call-channel.c | 4 ++-- telepathy-glib/base-call-stream.c | 2 +- telepathy-glib/base-connection.c | 8 ++++---- telepathy-glib/base-connection.h | 2 +- telepathy-glib/base-media-call-channel.c | 2 +- telepathy-glib/base-media-call-content.c | 4 ++-- telepathy-glib/base-password-channel.c | 2 +- telepathy-glib/call-stream-endpoint.c | 6 +++--- telepathy-glib/connection-handles.c | 4 ++-- telepathy-glib/contact.c | 4 ++-- telepathy-glib/extra-gtkdoc.h | 2 +- telepathy-glib/file-transfer-channel.c | 2 +- telepathy-glib/handle-repo.h | 6 +++--- telepathy-glib/handle.h | 6 +++--- telepathy-glib/message-mixin.c | 2 +- telepathy-glib/message.c | 2 +- tests/dbus/contacts.c | 2 +- tests/dbus/file-transfer-channel.c | 4 ++-- tests/dbus/stream-tube.c | 4 ++-- tests/enums.c | 4 ++-- tests/lib/dbus-tube-chan.c | 2 +- tests/lib/echo-conn.c | 2 +- tests/lib/file-transfer-chan.c | 2 +- tests/lib/simple-account.c | 4 ++-- tests/lib/simple-conn.c | 2 +- tests/lib/stream-tube-chan.c | 2 +- 32 files changed, 53 insertions(+), 53 deletions(-) diff --git a/examples/cm/call/conn.c b/examples/cm/call/conn.c index 6962567..34c5613 100644 --- a/examples/cm/call/conn.c +++ b/examples/cm/call/conn.c @@ -158,7 +158,7 @@ example_call_normalize_contact (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_call_normalize_contact, NULL); diff --git a/examples/cm/channelspecific/conn.c b/examples/cm/channelspecific/conn.c index 1b2bc90..603ca02 100644 --- a/examples/cm/channelspecific/conn.c +++ b/examples/cm/channelspecific/conn.c @@ -160,7 +160,7 @@ example_csh_normalize_room (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_csh_normalize_contact, NULL); diff --git a/examples/cm/contactlist/conn.c b/examples/cm/contactlist/conn.c index 2eb3a80..9f0a5f1 100644 --- a/examples/cm/contactlist/conn.c +++ b/examples/cm/contactlist/conn.c @@ -151,7 +151,7 @@ example_contact_list_normalize_contact (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_contact_list_normalize_contact, NULL); diff --git a/examples/cm/echo-message-parts/conn.c b/examples/cm/echo-message-parts/conn.c index 62502e2..8445025 100644 --- a/examples/cm/echo-message-parts/conn.c +++ b/examples/cm/echo-message-parts/conn.c @@ -109,7 +109,7 @@ example_normalize_contact (TpHandleRepoIface *repo G_GNUC_UNUSED, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_normalize_contact, NULL); diff --git a/examples/cm/extended/conn.c b/examples/cm/extended/conn.c index 1cd18dc..0f8d51b 100644 --- a/examples/cm/extended/conn.c +++ b/examples/cm/extended/conn.c @@ -130,7 +130,7 @@ example_normalize_contact (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_normalize_contact, NULL); diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 455f8c1..6c13d24 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -1259,7 +1259,7 @@ tp_account_class_init (TpAccountClass *klass) "Presence", "The account connection's current presence type", 0, - NUM_TP_CONNECTION_PRESENCE_TYPES, + TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); @@ -1358,7 +1358,7 @@ tp_account_class_init (TpAccountClass *klass) "ConnectionStatus", "The account's connection status type", 0, - NUM_TP_CONNECTION_STATUSES, + TP_NUM_CONNECTION_STATUSES, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); @@ -1383,7 +1383,7 @@ tp_account_class_init (TpAccountClass *klass) "ConnectionStatusReason", "The account's connection status reason", 0, - NUM_TP_CONNECTION_STATUS_REASONS, + TP_NUM_CONNECTION_STATUS_REASONS, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); @@ -1662,7 +1662,7 @@ tp_account_class_init (TpAccountClass *klass) "RequestedPresence", "The account's requested presence type", 0, - NUM_TP_CONNECTION_PRESENCE_TYPES, + TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); @@ -1765,7 +1765,7 @@ tp_account_class_init (TpAccountClass *klass) "AutomaticPresence type", "Presence type used to put the account online automatically", 0, - NUM_TP_CONNECTION_PRESENCE_TYPES, + TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index 8eeede7..6f52adb 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -1450,14 +1450,14 @@ tp_base_call_channel_add_content_dbus (TpSvcChannelTypeCall *iface, goto error; } - if (mtype >= NUM_TP_MEDIA_STREAM_TYPES) + if (mtype >= TP_NUM_MEDIA_STREAM_TYPES) { g_set_error (&error, TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED, "Unknown content type"); goto error; } - if (initial_direction >= NUM_TP_MEDIA_STREAM_DIRECTIONS) + if (initial_direction >= TP_NUM_MEDIA_STREAM_DIRECTIONS) { g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Invalid initial direction"); diff --git a/telepathy-glib/base-call-stream.c b/telepathy-glib/base-call-stream.c index 16c2b72..09b4977 100644 --- a/telepathy-glib/base-call-stream.c +++ b/telepathy-glib/base-call-stream.c @@ -399,7 +399,7 @@ tp_base_call_stream_class_init (TpBaseCallStreamClass *klass) */ param_spec = g_param_spec_uint ("local-sending-state", "LocalSendingState", "Local sending state", - TP_SENDING_STATE_NONE, NUM_TP_SENDING_STATES, TP_SENDING_STATE_NONE, + TP_SENDING_STATE_NONE, TP_NUM_SENDING_STATES, TP_SENDING_STATE_NONE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_SENDING_STATE, param_spec); diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 44cb4b1..3abac1e 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -385,7 +385,7 @@ struct _TpBaseConnectionPrivate /* array of (ChannelRequest *) */ GPtrArray *channel_requests; - TpHandleRepoIface *handles[NUM_TP_HANDLE_TYPES]; + TpHandleRepoIface *handles[TP_NUM_HANDLE_TYPES]; /* If not %NULL, contains strings representing our interfaces. * If %NULL, we have no interfaces except those in @@ -618,7 +618,7 @@ tp_base_connection_dispose (GObject *object) priv->channel_requests = NULL; } - for (i = 0; i < NUM_TP_HANDLE_TYPES; i++) + for (i = 0; i < TP_NUM_HANDLE_TYPES; i++) tp_clear_object (priv->handles + i); if (priv->interfaces) @@ -1708,7 +1708,7 @@ tp_base_connection_init (TpBaseConnection *self) self->priv = priv; self->status = TP_INTERNAL_CONNECTION_STATUS_NEW; - for (i = 0; i < NUM_TP_HANDLE_TYPES; i++) + for (i = 0; i < TP_NUM_HANDLE_TYPES; i++) { priv->handles[i] = NULL; } @@ -2619,7 +2619,7 @@ tp_base_connection_get_handles (TpBaseConnection *self, { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); - if (handle_type >= NUM_TP_HANDLE_TYPES) + if (handle_type >= TP_NUM_HANDLE_TYPES) return NULL; return self->priv->handles[handle_type]; diff --git a/telepathy-glib/base-connection.h b/telepathy-glib/base-connection.h index e5f5c62..9649014 100644 --- a/telepathy-glib/base-connection.h +++ b/telepathy-glib/base-connection.h @@ -44,7 +44,7 @@ typedef gboolean (*TpBaseConnectionStartConnectingImpl) ( TpBaseConnection *self, GError **error); typedef void (*TpBaseConnectionCreateHandleReposImpl) (TpBaseConnection *self, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]); + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]); typedef GPtrArray *(*TpBaseConnectionCreateChannelFactoriesImpl) ( diff --git a/telepathy-glib/base-media-call-channel.c b/telepathy-glib/base-media-call-channel.c index f6155ad..0ab90f7 100644 --- a/telepathy-glib/base-media-call-channel.c +++ b/telepathy-glib/base-media-call-channel.c @@ -337,7 +337,7 @@ set_hold_state (TpBaseMediaCallChannel *self, TP_BASE_MEDIA_CALL_CHANNEL_GET_CLASS (self); gboolean changed; - g_return_if_fail (hold_state_reason < NUM_TP_LOCAL_HOLD_STATE_REASONS); + g_return_if_fail (hold_state_reason < TP_NUM_LOCAL_HOLD_STATE_REASONS); changed = (self->priv->hold_state != hold_state); diff --git a/telepathy-glib/base-media-call-content.c b/telepathy-glib/base-media-call-content.c index b0c9857..830d72b 100644 --- a/telepathy-glib/base-media-call-content.c +++ b/telepathy-glib/base-media-call-content.c @@ -412,7 +412,7 @@ tp_base_media_call_content_class_init (TpBaseMediaCallContentClass *klass) param_spec = g_param_spec_uchar ("current-dtmf-event", "CurrentDTMFEvent", "The currently being played dtmf event if any", - 0, NUM_TP_DTMF_EVENTS - 1, 0, + 0, TP_NUM_DTMF_EVENTS - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENT_DTMF_EVENT, param_spec); @@ -427,7 +427,7 @@ tp_base_media_call_content_class_init (TpBaseMediaCallContentClass *klass) param_spec = g_param_spec_uint ("current-dtmf-state", "CurrentDTMFState", "The sending state of the dtmf events", - 0, NUM_TP_SENDING_STATES - 1, TP_SENDING_STATE_NONE, + 0, TP_NUM_SENDING_STATES - 1, TP_SENDING_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENT_DTMF_STATE, param_spec); diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c index 6e3b532..43a5775 100644 --- a/telepathy-glib/base-password-channel.c +++ b/telepathy-glib/base-password-channel.c @@ -331,7 +331,7 @@ tp_base_password_channel_class_init (TpBasePasswordChannelClass *tp_base_passwor param_spec = g_param_spec_uint ("sasl-status", "Current status", "The status of the current SASL authentication.", - 0, NUM_TP_SASL_STATUSES, 0, + 0, TP_NUM_SASL_STATUSES, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SASL_STATUS, param_spec); diff --git a/telepathy-glib/call-stream-endpoint.c b/telepathy-glib/call-stream-endpoint.c index 88b49bd..d5eb010 100644 --- a/telepathy-glib/call-stream-endpoint.c +++ b/telepathy-glib/call-stream-endpoint.c @@ -682,7 +682,7 @@ validate_candidate (const GValueArray *candidate, } value = g_value_array_get_nth ((GValueArray *) candidate, 0); - if (g_value_get_uint (value) >= NUM_TP_STREAM_COMPONENTS) + if (g_value_get_uint (value) >= TP_NUM_STREAM_COMPONENTS) { g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Invalid component id: %d", g_value_get_uint (value)); @@ -811,7 +811,7 @@ call_stream_endpoint_set_endpoint_state (TpSvcCallStreamEndpoint *iface, { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); - if (component >= NUM_TP_STREAM_COMPONENTS) + if (component >= TP_NUM_STREAM_COMPONENTS) { GError *error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Stream component %d is out of the valid range.", state); @@ -820,7 +820,7 @@ call_stream_endpoint_set_endpoint_state (TpSvcCallStreamEndpoint *iface, return; } - if (state >= NUM_TP_STREAM_ENDPOINT_STATES) + if (state >= TP_NUM_STREAM_ENDPOINT_STATES) { GError *error = g_error_new (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "Stream state %d is out of the valid range.", state); diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c index 77c3bea..0364eb4 100644 --- a/telepathy-glib/connection-handles.c +++ b/telepathy-glib/connection-handles.c @@ -175,7 +175,7 @@ tp_connection_hold_handles (TpConnection *self, g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (handle_type > TP_HANDLE_TYPE_NONE); - g_return_if_fail (handle_type < NUM_TP_HANDLE_TYPES); + g_return_if_fail (handle_type < TP_NUM_HANDLE_TYPES); g_return_if_fail (n_handles >= 1); g_return_if_fail (callback != NULL); @@ -342,7 +342,7 @@ tp_connection_request_handles (TpConnection *self, g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (handle_type > TP_HANDLE_TYPE_NONE); - g_return_if_fail (handle_type < NUM_TP_HANDLE_TYPES); + g_return_if_fail (handle_type < TP_NUM_HANDLE_TYPES); g_return_if_fail (ids != NULL); g_return_if_fail (ids[0] != NULL); g_return_if_fail (callback != NULL); diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 3a10e24..2af5b53 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -343,7 +343,7 @@ tp_contact_has_feature (TpContact *self, TpContactFeature feature) { g_return_val_if_fail (self != NULL, FALSE); - g_return_val_if_fail (feature < NUM_TP_CONTACT_FEATURES, FALSE); + g_return_val_if_fail (feature < TP_NUM_CONTACT_FEATURES, FALSE); return ((self->priv->has_features & (1 << feature)) != 0); } @@ -4073,7 +4073,7 @@ get_feature_flags (guint n_features, for (i = 0; i < n_features; i++) { - g_return_val_if_fail (features[i] < NUM_TP_CONTACT_FEATURES, FALSE); + g_return_val_if_fail (features[i] < TP_NUM_CONTACT_FEATURES, FALSE); feature_flags |= (1 << features[i]); } diff --git a/telepathy-glib/extra-gtkdoc.h b/telepathy-glib/extra-gtkdoc.h index f969645..11c624c 100644 --- a/telepathy-glib/extra-gtkdoc.h +++ b/telepathy-glib/extra-gtkdoc.h @@ -392,7 +392,7 @@ * TP_ prefix, e.g. TP_CONNECTION_STATUS_CONNECTED. * * Each enum also has a constant for the number of members, named like - * NUM_TP_CONNECTION_STATUSES. The pluralization is currently hard-coded + * TP_NUM_CONNECTION_STATUSES. The pluralization is currently hard-coded * in the conversion scripts, but should move into the specification * in future. * diff --git a/telepathy-glib/file-transfer-channel.c b/telepathy-glib/file-transfer-channel.c index a046bd8..ab176bf 100644 --- a/telepathy-glib/file-transfer-channel.c +++ b/telepathy-glib/file-transfer-channel.c @@ -880,7 +880,7 @@ tp_file_transfer_channel_class_init (TpFileTransferChannelClass *klass) param_spec = g_param_spec_uint ("state", "State", "The TpFileTransferState of the channel", - 0, NUM_TP_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, + 0, TP_NUM_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); diff --git a/telepathy-glib/handle-repo.h b/telepathy-glib/handle-repo.h index a77aecb..2b02cee 100644 --- a/telepathy-glib/handle-repo.h +++ b/telepathy-glib/handle-repo.h @@ -148,7 +148,7 @@ TpIntset *tp_handle_set_difference_update (TpHandleSet *set, gchar *tp_handle_set_dump (const TpHandleSet *self) G_GNUC_WARN_UNUSED_RESULT; -/* static inline because it relies on NUM_TP_HANDLE_TYPES */ +/* static inline because it relies on TP_NUM_HANDLE_TYPES */ /** * tp_handles_supported_and_valid: (skip) * @repos: An array of possibly null pointers to handle repositories, indexed @@ -170,12 +170,12 @@ gchar *tp_handle_set_dump (const TpHandleSet *self) G_GNUC_WARN_UNUSED_RESULT; static inline /* spacer so gtkdoc documents this function as though not static */ gboolean tp_handles_supported_and_valid ( - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES], + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES], TpHandleType handle_type, const GArray *handles, gboolean allow_zero, GError **error); static inline gboolean -tp_handles_supported_and_valid (TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES], +tp_handles_supported_and_valid (TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES], TpHandleType handle_type, const GArray *handles, gboolean allow_zero, diff --git a/telepathy-glib/handle.h b/telepathy-glib/handle.h index 79ad097..60ed51e 100644 --- a/telepathy-glib/handle.h +++ b/telepathy-glib/handle.h @@ -72,16 +72,16 @@ static inline /* spacer so gtkdoc documents this function as though not static */ gboolean tp_handle_type_is_valid (TpHandleType type, GError **error); -/* Must be static inline because it references NUM_TP_HANDLE_TYPES - +/* Must be static inline because it references TP_NUM_HANDLE_TYPES - * if it wasn't inlined, a newer libtelepathy-glib with a larger number * of handle types might accept handle types that won't fit in the - * connection manager's array of length NUM_TP_HANDLE_TYPES + * connection manager's array of length TP_NUM_HANDLE_TYPES */ static inline gboolean tp_handle_type_is_valid (TpHandleType type, GError **error) { - if (type > TP_HANDLE_TYPE_NONE && type < NUM_TP_HANDLE_TYPES) + if (type > TP_HANDLE_TYPE_NONE && type < TP_NUM_HANDLE_TYPES) return TRUE; tp_g_set_error_invalid_handle_type (type, error); diff --git a/telepathy-glib/message-mixin.c b/telepathy-glib/message-mixin.c index f956d6b..c4a46e9 100644 --- a/telepathy-glib/message-mixin.c +++ b/telepathy-glib/message-mixin.c @@ -332,7 +332,7 @@ tp_message_mixin_init (GObject *obj, mixin->priv->pending = g_queue_new (); mixin->priv->recv_id = 0; mixin->priv->msg_types = g_array_sized_new (FALSE, FALSE, sizeof (guint), - NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES); + TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES); mixin->priv->connection = g_object_ref (connection); mixin->priv->supported_content_types = g_new0 (gchar *, 1); diff --git a/telepathy-glib/message.c b/telepathy-glib/message.c index c2576dc..b6c8761 100644 --- a/telepathy-glib/message.c +++ b/telepathy-glib/message.c @@ -245,7 +245,7 @@ tp_message_delete_part (TpMessage *self, * tp_message_ref_handle: * @self: a message * @handle_type: a handle type, greater than %TP_HANDLE_TYPE_NONE and less than - * %NUM_TP_HANDLE_TYPES + * %TP_NUM_HANDLE_TYPES * @handle: a handle of the given type * * Reference the given handle until this message is destroyed. diff --git a/tests/dbus/contacts.c b/tests/dbus/contacts.c index a7a4d8d..bce7334 100644 --- a/tests/dbus/contacts.c +++ b/tests/dbus/contacts.c @@ -82,7 +82,7 @@ static TpContactFeature all_contact_features[] = { /* If people add new features, they should add them to this test. We could * generate the list dynamically but this seems less brittle. */ -G_STATIC_ASSERT (G_N_ELEMENTS (all_contact_features) == NUM_TP_CONTACT_FEATURES); +G_STATIC_ASSERT (G_N_ELEMENTS (all_contact_features) == TP_NUM_CONTACT_FEATURES); static void diff --git a/tests/dbus/file-transfer-channel.c b/tests/dbus/file-transfer-channel.c index e09b6ac..3a167f7 100644 --- a/tests/dbus/file-transfer-channel.c +++ b/tests/dbus/file-transfer-channel.c @@ -37,7 +37,7 @@ TestContext contexts[] = { // { TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, // { TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_PORT }, - { NUM_TP_SOCKET_ADDRESS_TYPES, NUM_TP_SOCKET_ACCESS_CONTROLS } + { TP_NUM_SOCKET_ADDRESS_TYPES, TP_NUM_SOCKET_ACCESS_CONTROLS } }; typedef struct { @@ -329,7 +329,7 @@ run_file_transfer_test (const char *test_path, { guint i; - for (i = 0; contexts[i].address_type != NUM_TP_SOCKET_ADDRESS_TYPES; i++) + for (i = 0; contexts[i].address_type != TP_NUM_SOCKET_ADDRESS_TYPES; i++) { gchar *path = test_context_to_str (&contexts[i], test_path); diff --git a/tests/dbus/stream-tube.c b/tests/dbus/stream-tube.c index f2c98c5..df75818 100644 --- a/tests/dbus/stream-tube.c +++ b/tests/dbus/stream-tube.c @@ -51,7 +51,7 @@ TestContext contexts[] = { { TRUE, TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_PORT }, - { FALSE, NUM_TP_SOCKET_ADDRESS_TYPES, NUM_TP_SOCKET_ACCESS_CONTROLS } + { FALSE, TP_NUM_SOCKET_ADDRESS_TYPES, TP_NUM_SOCKET_ACCESS_CONTROLS } }; static gboolean have_ipv6 = FALSE; @@ -715,7 +715,7 @@ run_tube_test (const char *test_path, { guint i; - for (i = 0; contexts[i].address_type != NUM_TP_SOCKET_ADDRESS_TYPES; i++) + for (i = 0; contexts[i].address_type != TP_NUM_SOCKET_ADDRESS_TYPES; i++) { gchar *path = test_context_to_str (&contexts[i], test_path); diff --git a/tests/enums.c b/tests/enums.c index 3a31566..17ec4b4 100644 --- a/tests/enums.c +++ b/tests/enums.c @@ -29,7 +29,7 @@ test_tp_contact_feature (void) g_assert (klass != NULL); g_assert (G_IS_ENUM_CLASS (klass)); - g_assert_cmpint (klass->n_values, ==, NUM_TP_CONTACT_FEATURES); + g_assert_cmpint (klass->n_values, ==, TP_NUM_CONTACT_FEATURES); g_type_class_unref (klass); } @@ -47,7 +47,7 @@ test_tp_dbus_error (void) g_assert (klass != NULL); g_assert (G_IS_ENUM_CLASS (klass)); - g_assert_cmpint (klass->n_values, ==, NUM_TP_DBUS_ERRORS); + g_assert_cmpint (klass->n_values, ==, TP_NUM_DBUS_ERRORS); } diff --git a/tests/lib/dbus-tube-chan.c b/tests/lib/dbus-tube-chan.c index 15217a9..5437100 100644 --- a/tests/lib/dbus-tube-chan.c +++ b/tests/lib/dbus-tube-chan.c @@ -237,7 +237,7 @@ tp_tests_dbus_tube_channel_class_init (TpTestsDBusTubeChannelClass *klass) param_spec = g_param_spec_uint ( "state", "TpTubeState", "state of the tube", - 0, NUM_TP_TUBE_CHANNEL_STATES - 1, 0, + 0, TP_NUM_TUBE_CHANNEL_STATES - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); diff --git a/tests/lib/echo-conn.c b/tests/lib/echo-conn.c index 6dc9a2a..d9a01dc 100644 --- a/tests/lib/echo-conn.c +++ b/tests/lib/echo-conn.c @@ -125,7 +125,7 @@ tp_tests_echo_normalize_contact (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, tp_tests_echo_normalize_contact, NULL); diff --git a/tests/lib/file-transfer-chan.c b/tests/lib/file-transfer-chan.c index e2e950d..3d7d926 100644 --- a/tests/lib/file-transfer-chan.c +++ b/tests/lib/file-transfer-chan.c @@ -670,7 +670,7 @@ tp_tests_file_transfer_channel_class_init ( param_spec = g_param_spec_uint ("state", "State", "The State property of this channel", - 0, NUM_TP_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, + 0, TP_NUM_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); diff --git a/tests/lib/simple-account.c b/tests/lib/simple-account.c index 73b47e6..e1872de 100644 --- a/tests/lib/simple-account.c +++ b/tests/lib/simple-account.c @@ -415,14 +415,14 @@ tp_tests_simple_account_class_init (TpTestsSimpleAccountClass *klass) param_spec = g_param_spec_uint ("connection-status", "connection status", "ConnectionStatus property", - 0, NUM_TP_CONNECTION_STATUSES, TP_CONNECTION_STATUS_DISCONNECTED, + 0, TP_NUM_CONNECTION_STATUSES, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION_STATUS, param_spec); param_spec = g_param_spec_uint ("connection-status-reason", "connection status reason", "ConnectionStatusReason property", - 0, NUM_TP_CONNECTION_STATUS_REASONS, + 0, TP_NUM_CONNECTION_STATUS_REASONS, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION_STATUS_REASON, diff --git a/tests/lib/simple-conn.c b/tests/lib/simple-conn.c index 8a481af..476db0e 100644 --- a/tests/lib/simple-conn.c +++ b/tests/lib/simple-conn.c @@ -195,7 +195,7 @@ tp_tests_simple_normalize_contact (TpHandleRepoIface *repo, static void create_handle_repos (TpBaseConnection *conn, - TpHandleRepoIface *repos[NUM_TP_HANDLE_TYPES]) + TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, tp_tests_simple_normalize_contact, NULL); diff --git a/tests/lib/stream-tube-chan.c b/tests/lib/stream-tube-chan.c index 0d1ec27..410e8c1 100644 --- a/tests/lib/stream-tube-chan.c +++ b/tests/lib/stream-tube-chan.c @@ -296,7 +296,7 @@ tp_tests_stream_tube_channel_class_init (TpTestsStreamTubeChannelClass *klass) param_spec = g_param_spec_uint ( "state", "TpTubeState", "state of the tube", - 0, NUM_TP_TUBE_CHANNEL_STATES - 1, 0, + 0, TP_NUM_TUBE_CHANNEL_STATES - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); -- 1.7.9.1