[seahorse/gint-to-int] style: gint -> int
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/gint-to-int] style: gint -> int
- Date: Sun, 25 Jul 2021 10:21:37 +0000 (UTC)
commit a6c0583f51c245bc853e3d8f5917db992c15f356
Author: Niels De Graef <nielsdegraef gmail com>
Date: Sun Jul 25 12:20:03 2021 +0200
style: gint -> int
Stop using GLib types that are typedefs to actual C types. It's
confusing for newcomers and applications/webapps that show the actual
code.
Start with `gint`, since it has relatively little uses in the code.
libseahorse/seahorse-bind.c | 2 +-
libseahorse/seahorse-object-model.c | 6 +++---
libseahorse/seahorse-object-model.h | 4 ++--
libseahorse/seahorse-util.c | 2 +-
pgp/seahorse-gpg-options.c | 2 +-
pgp/seahorse-gpgme-exporter.c | 6 +++---
pgp/seahorse-gpgme-keyring.c | 10 +++++-----
pgp/seahorse-gpgme-uid.c | 4 ++--
pgp/seahorse-gpgme.c | 4 ++--
pgp/seahorse-hkp-source.c | 8 ++++----
pgp/seahorse-pgp-actions.c | 2 +-
pgp/seahorse-pgp-backend.c | 6 +++---
pgp/seahorse-pgp-key-properties.c | 14 +++++++-------
ssh/seahorse-ssh-askpass.c | 2 +-
14 files changed, 36 insertions(+), 36 deletions(-)
---
diff --git a/libseahorse/seahorse-bind.c b/libseahorse/seahorse-bind.c
index c9810a79..943f4053 100644
--- a/libseahorse/seahorse-bind.c
+++ b/libseahorse/seahorse-bind.c
@@ -161,7 +161,7 @@ typedef struct _Binding {
SeahorseTransform transform;
gboolean processing;
- gint references;
+ int references;
} Binding;
static void binding_unref (Binding *binding);
diff --git a/libseahorse/seahorse-object-model.c b/libseahorse/seahorse-object-model.c
index a8f5ee72..b1ea14d3 100644
--- a/libseahorse/seahorse-object-model.c
+++ b/libseahorse/seahorse-object-model.c
@@ -47,7 +47,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
struct _SeahorseObjectModel {
GtkTreeStore parent;
GHashTable *rows;
- gint data_column;
+ int data_column;
};
G_DEFINE_TYPE (SeahorseObjectModel, seahorse_object_model, GTK_TYPE_TREE_STORE);
@@ -264,7 +264,7 @@ seahorse_object_model_class_init (SeahorseObjectModelClass *klass)
SeahorseObjectModel*
-seahorse_object_model_new (gint n_columns, GType *types)
+seahorse_object_model_new (int n_columns, GType *types)
{
SeahorseObjectModel *model;
@@ -275,7 +275,7 @@ seahorse_object_model_new (gint n_columns, GType *types)
}
void
-seahorse_object_model_set_column_types (SeahorseObjectModel *self, gint n_columns,
+seahorse_object_model_set_column_types (SeahorseObjectModel *self, int n_columns,
GType *types)
{
GType *itypes;
diff --git a/libseahorse/seahorse-object-model.h b/libseahorse/seahorse-object-model.h
index aa56c31a..e2831d51 100644
--- a/libseahorse/seahorse-object-model.h
+++ b/libseahorse/seahorse-object-model.h
@@ -28,11 +28,11 @@ G_DECLARE_FINAL_TYPE (SeahorseObjectModel, seahorse_object_model,
SEAHORSE, OBJECT_MODEL,
GtkTreeStore)
-SeahorseObjectModel* seahorse_object_model_new (gint n_columns,
+SeahorseObjectModel* seahorse_object_model_new (int n_columns,
GType *types);
void seahorse_object_model_set_column_types (SeahorseObjectModel *self,
- gint n_columns,
+ int n_columns,
GType *types);
void seahorse_object_model_set_row_object (SeahorseObjectModel *self,
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index 69a8082c..93298160 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -235,7 +235,7 @@ seahorse_util_write_file_private (const gchar* filename, const gchar* contents,
* Returns: if source of k1<k2 it returns -1,
* 1 will be returned if k1>k2. If the sources are equal it returns 0
*/
-static gint
+static int
sort_objects_by_place (GObject *k1,
GObject *k2)
{
diff --git a/pgp/seahorse-gpg-options.c b/pgp/seahorse-gpg-options.c
index 80c973e0..1f6b127b 100644
--- a/pgp/seahorse-gpg-options.c
+++ b/pgp/seahorse-gpg-options.c
@@ -184,7 +184,7 @@ parse_home_directory (gpgme_engine_info_t engine, GError **err)
gchar *serr = NULL;
gchar *t;
gchar *x;
- gint status;
+ int status;
gboolean b;
g_assert (engine);
diff --git a/pgp/seahorse-gpgme-exporter.c b/pgp/seahorse-gpgme-exporter.c
index 0fc69f57..63d90ae3 100644
--- a/pgp/seahorse-gpgme-exporter.c
+++ b/pgp/seahorse-gpgme-exporter.c
@@ -236,7 +236,7 @@ seahorse_gpgme_exporter_add_object (SeahorseExporter *exporter,
typedef struct {
GPtrArray *keyids;
- gint at;
+ int at;
gpgme_data_t data;
gpgme_ctx_t gctx;
GMemoryOutputStream *output;
@@ -272,10 +272,10 @@ on_keyring_export_complete (gpgme_error_t gerr,
seahorse_progress_end (g_task_get_cancellable (task),
closure->keyids->pdata[closure->at]);
- g_assert (closure->at < (gint)closure->keyids->len);
+ g_assert (closure->at < (int) closure->keyids->len);
closure->at++;
- if (closure->at == (gint)closure->keyids->len) {
+ if (closure->at == (int) closure->keyids->len) {
g_task_return_pointer (task, g_steal_pointer (&closure->output), g_object_unref);
return FALSE; /* don't run this again */
}
diff --git a/pgp/seahorse-gpgme-keyring.c b/pgp/seahorse-gpgme-keyring.c
index 19a834a6..381760de 100644
--- a/pgp/seahorse-gpgme-keyring.c
+++ b/pgp/seahorse-gpgme-keyring.c
@@ -148,8 +148,8 @@ typedef struct {
SeahorseGpgmeKeyring *keyring;
gpgme_ctx_t gctx;
GHashTable *checks;
- gint parts;
- gint loaded;
+ int parts;
+ int loaded;
} keyring_list_closure;
static void
@@ -319,7 +319,7 @@ on_keyring_list_cancelled (GCancellable *cancellable,
static void
seahorse_gpgme_keyring_list_async (SeahorseGpgmeKeyring *self,
const gchar **patterns,
- gint parts,
+ int parts,
gboolean secret,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -467,7 +467,7 @@ on_keyring_public_list_complete (GObject *source,
static void
seahorse_gpgme_keyring_load_full_async (SeahorseGpgmeKeyring *self,
const gchar **patterns,
- gint parts,
+ int parts,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -601,7 +601,7 @@ on_keyring_import_complete (gpgme_error_t gerr, gpointer user_data)
gpgme_import_status_t import;
GError *error = NULL;
const gchar *msg;
- gint i;
+ int i;
if (seahorse_gpgme_propagate_error (gerr, &error)) {
g_task_return_error (task, g_steal_pointer (&error));
diff --git a/pgp/seahorse-gpgme-uid.c b/pgp/seahorse-gpgme-uid.c
index 050f4795..6ca96cfd 100644
--- a/pgp/seahorse-gpgme-uid.c
+++ b/pgp/seahorse-gpgme-uid.c
@@ -42,7 +42,7 @@ struct _SeahorseGpgmeUid {
gpgme_key_t pubkey; /* The public key that this uid is part of */
gpgme_user_id_t userid; /* The userid referred to */
guint gpgme_index; /* The GPGME index of the UID */
- gint actual_index; /* The actual index of this UID */
+ int actual_index; /* The actual index of this UID */
};
G_DEFINE_TYPE (SeahorseGpgmeUid, seahorse_gpgme_uid, SEAHORSE_PGP_TYPE_UID);
@@ -133,7 +133,7 @@ seahorse_gpgme_uid_set_userid (SeahorseGpgmeUid *self, gpgme_user_id_t userid)
GObject *obj;
gpgme_user_id_t uid;
gchar *string;
- gint index, i;
+ int index, i;
g_return_if_fail (SEAHORSE_GPGME_IS_UID (self));
g_return_if_fail (userid);
diff --git a/pgp/seahorse-gpgme.c b/pgp/seahorse-gpgme.c
index 5069c736..4d47d8d9 100644
--- a/pgp/seahorse-gpgme.c
+++ b/pgp/seahorse-gpgme.c
@@ -291,14 +291,14 @@ typedef struct {
gboolean busy;
GList *watches;
GCancellable *cancellable;
- gint cancelled_sig;
+ int cancelled_sig;
gboolean finished;
gpgme_error_t status;
} SeahorseGpgmeGSource;
static gboolean
seahorse_gpgme_gsource_prepare (GSource *gsource,
- gint *timeout)
+ int *timeout)
{
SeahorseGpgmeGSource *gpgme_gsource = (SeahorseGpgmeGSource *)gsource;
diff --git a/pgp/seahorse-hkp-source.c b/pgp/seahorse-hkp-source.c
index 5cfbc9f2..948a76cb 100644
--- a/pgp/seahorse-hkp-source.c
+++ b/pgp/seahorse-hkp-source.c
@@ -439,7 +439,7 @@ get_send_result (const char *response)
* Returns: FALSE if no key is contained, TRUE else
*/
static gboolean
-detect_key (const gchar *text, gint len, const gchar **start, const gchar **end)
+detect_key (const char *text, int len, const char **start, const char **end)
{
const gchar *t;
@@ -520,7 +520,7 @@ typedef struct {
GCancellable *cancellable;
gulong cancelled_sig;
SoupSession *session;
- gint requests;
+ int requests;
GcrSimpleCollection *results;
} source_search_closure;
@@ -655,7 +655,7 @@ typedef struct {
GCancellable *cancellable;
gulong cancelled_sig;
SoupSession *session;
- gint requests;
+ int requests;
} source_import_closure;
static void
@@ -802,7 +802,7 @@ typedef struct {
GCancellable *cancellable;
gulong cancelled_sig;
SoupSession *session;
- gint requests;
+ int requests;
} ExportClosure;
static void
diff --git a/pgp/seahorse-pgp-actions.c b/pgp/seahorse-pgp-actions.c
index c4e36e2b..22c3ad55 100644
--- a/pgp/seahorse-pgp-actions.c
+++ b/pgp/seahorse-pgp-actions.c
@@ -67,7 +67,7 @@ on_remote_find (GSimpleAction *action,
SeahorseActionGroup *actions = SEAHORSE_ACTION_GROUP (user_data);
SeahorseCatalog *catalog = NULL;
g_autoptr(SeahorseKeyserverSearch) search_dialog = NULL;
- gint response;
+ int response;
g_autofree gchar *search_text = NULL;
/* Make a new "Find remote keys" dialog */
diff --git a/pgp/seahorse-pgp-backend.c b/pgp/seahorse-pgp-backend.c
index 8c10e7e3..90ae28be 100644
--- a/pgp/seahorse-pgp-backend.c
+++ b/pgp/seahorse-pgp-backend.c
@@ -477,7 +477,7 @@ seahorse_pgp_backend_remove_remote (SeahorsePgpBackend *self,
}
typedef struct {
- gint num_searches;
+ int num_searches;
} search_remote_closure;
static void
@@ -573,7 +573,7 @@ seahorse_pgp_backend_search_remote_finish (SeahorsePgpBackend *self,
}
typedef struct {
- gint num_transfers;
+ int num_transfers;
} transfer_closure;
static void
@@ -730,7 +730,7 @@ seahorse_pgp_backend_discover_keys (SeahorsePgpBackend *self,
SeahorseGpgmeKey *key;
SeahorseObject *object;
g_autoptr(GPtrArray) todiscover = NULL;
- gint i;
+ int i;
self = self ? self : seahorse_pgp_backend_get ();
g_return_val_if_fail (SEAHORSE_PGP_IS_BACKEND (self), NULL);
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index 77a0d7f6..02551e94 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -317,7 +317,7 @@ on_uids_revoke (GSimpleAction *action, GVariant *param, gpointer user_data)
{
/* TODO: */
/* SeahorseObject *skey;
- gint index;
+ int index;
Glist *keys = NULL;
skey = self->key;
@@ -340,7 +340,7 @@ static void
update_names (GtkTreeSelection *selection, SeahorsePgpKeyProperties *self)
{
SeahorsePgpUid *uid = names_get_selected_uid (self);
- gint index = -1;
+ int index = -1;
if (uid && SEAHORSE_GPGME_IS_UID (uid))
index = seahorse_gpgme_uid_get_gpgme_index (SEAHORSE_GPGME_UID (uid));
@@ -499,8 +499,8 @@ static GtkTargetEntry target_list[] = {
static void
on_pgp_owner_photo_drag_received (GtkWidget *widget,
GdkDragContext *context,
- gint x,
- gint y,
+ int x,
+ int y,
GtkSelectionData *sel_data,
guint target_type,
guint time,
@@ -508,7 +508,7 @@ on_pgp_owner_photo_drag_received (GtkWidget *widget,
{
SeahorsePgpKeyProperties *self = SEAHORSE_PGP_KEY_PROPERTIES (user_data);
gboolean dnd_success = FALSE;
- gint len = 0;
+ int len = 0;
g_return_if_fail (SEAHORSE_GPGME_IS_KEY (self->key));
@@ -1093,7 +1093,7 @@ static void
on_pgp_details_trust_changed (GtkComboBox *selection, gpointer user_data)
{
SeahorsePgpKeyProperties *self = SEAHORSE_PGP_KEY_PROPERTIES (user_data);
- gint trust;
+ int trust;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -1533,7 +1533,7 @@ on_pgp_trusted_toggled (GtkToggleButton *toggle, GtkTreeModelFilter *filter)
/* Set flag on the store */
GtkTreeModel *model = gtk_tree_model_filter_get_model (filter);
g_object_set_data (G_OBJECT (model), "only-trusted",
- GINT_TO_POINTER (gtk_toggle_button_get_active (toggle)));
+ GINT_TO_POINTER (gtk_toggle_button_get_active (toggle)));
gtk_tree_model_filter_refilter (filter);
}
diff --git a/ssh/seahorse-ssh-askpass.c b/ssh/seahorse-ssh-askpass.c
index eb3ce0ed..b187fb9f 100644
--- a/ssh/seahorse-ssh-askpass.c
+++ b/ssh/seahorse-ssh-askpass.c
@@ -45,7 +45,7 @@ main (int argc, char* argv[])
const gchar *argument;
gchar *message;
const gchar *flags;
- gint result;
+ int result;
const gchar *pass;
gulong xid;
gssize len;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]