1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
From ab53397850471ad64a2a09bf5901741a987d9ee1 Mon Sep 17 00:00:00 2001
From: Adrian Bunk <bunk@debian.org>
Date: Tue, 6 Aug 2024 23:23:59 +0300
Subject: [PATCH] guint64 is not the same as gsize on 32-bit
---
src/daemon/tmp/gpaste-clipboard.c | 2 +-
src/daemon/tmp/gpaste-daemon.c | 18 +++++++++---------
src/daemon/tmp/gpaste-file-backend.c | 4 ++--
src/daemon/tmp/gpaste-history.c | 2 +-
src/daemon/tmp/gpaste-search-provider.c | 4 ++--
src/libgpaste/gpaste/gpaste-util.c | 2 +-
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/daemon/tmp/gpaste-clipboard.c b/src/daemon/tmp/gpaste-clipboard.c
index 0f3e6f52..b8aae8d3 100644
--- a/src/daemon/tmp/gpaste-clipboard.c
+++ b/src/daemon/tmp/gpaste-clipboard.c
@@ -328,7 +328,7 @@ _get_clipboard_data_from_special_atom (GtkSelectionData *selection_data,
if (atom >= G_PASTE_SPECIAL_ATOM_FIRST && atom < G_PASTE_SPECIAL_ATOM_LAST)
{
g_autofree guchar *data = NULL;
- guint64 length = 0;
+ gsize length = 0;
const gchar *str = g_paste_item_get_special_value (item, atom);
if (str)
diff --git a/src/daemon/tmp/gpaste-daemon.c b/src/daemon/tmp/gpaste-daemon.c
index 1722e4c0..2987b0b6 100644
--- a/src/daemon/tmp/gpaste-daemon.c
+++ b/src/daemon/tmp/gpaste-daemon.c
@@ -121,7 +121,7 @@ _err (const gchar *name,
static gchar *
g_paste_daemon_get_dbus_string_parameter (GVariant *parameters,
- guint64 *length)
+ gsize *length)
{
GVariantIter parameters_iter;
@@ -139,7 +139,7 @@ _variant_iter_read_strings_parameter (GVariantIter *parameters_iter,
{
g_autoptr (GVariant) variant1 = g_variant_iter_next_value (parameters_iter);
g_autoptr (GVariant) variant2 = g_variant_iter_next_value (parameters_iter);
- guint64 length;
+ gsize length;
*str1 = g_variant_dup_string (variant1, &length);
*str2 = g_variant_dup_string (variant2, &length);
@@ -255,7 +255,7 @@ g_paste_daemon_private_add (const GPasteDaemonPrivate *priv,
GVariant *parameters,
GPasteDBusError **err)
{
- guint64 length;
+ gsize length;
g_autofree gchar *text = g_paste_daemon_get_dbus_string_parameter (parameters, &length);
g_paste_daemon_private_do_add (priv, text, length, err);
@@ -267,7 +267,7 @@ g_paste_daemon_private_add_file (const GPasteDaemonPrivate *priv,
GError **error,
GPasteDBusError **err)
{
- guint64 length;
+ gsize length;
g_autofree gchar *file = g_paste_daemon_get_dbus_string_parameter (parameters, &length);
g_autofree gchar *content = NULL;
@@ -486,10 +486,10 @@ g_paste_daemon_private_get_elements (const GPasteDaemonPrivate *priv,
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
g_autoptr (GVariant) variant = g_variant_iter_next_value (¶meters_iter);
- guint64 len;
+ gsize len;
g_autofree const gchar **uuids = g_variant_get_strv (variant, &len);
- for (guint64 i = 0; i < len; ++i)
+ for (gsize i = 0; i < len; ++i)
{
const GPasteItem *item = g_paste_history_get_by_uuid (history, uuids[i]);
G_PASTE_DBUS_ASSERT_FULL (item, "received no value for this index", NULL);
@@ -614,7 +614,7 @@ g_paste_daemon_private_merge (const GPasteDaemonPrivate *priv,
_variant_iter_read_strings_parameter (¶meters_iter, &decoration, &separator);
g_autoptr (GVariant) v_uuids = g_variant_iter_next_value (¶meters_iter);
- guint64 length;
+ gsize length;
const GStrv uuids = (const GStrv) g_variant_get_strv (v_uuids, &length);
G_PASTE_DBUS_ASSERT (length, "nothing to merge");
@@ -724,7 +724,7 @@ g_paste_daemon_private_replace (const GPasteDaemonPrivate *priv,
{
GPasteHistory *history = priv->history;
GVariantIter parameters_iter;
- guint64 length;
+ gsize length;
g_variant_iter_init (¶meters_iter, parameters);
@@ -751,7 +751,7 @@ g_paste_daemon_private_set_password (const GPasteDaemonPrivate *priv,
{
GPasteHistory *history = priv->history;
GVariantIter parameters_iter;
- guint64 length;
+ gsize length;
g_variant_iter_init (¶meters_iter, parameters);
diff --git a/src/daemon/tmp/gpaste-file-backend.c b/src/daemon/tmp/gpaste-file-backend.c
index bf1fa234..36fd21a4 100644
--- a/src/daemon/tmp/gpaste-file-backend.c
+++ b/src/daemon/tmp/gpaste-file-backend.c
@@ -402,7 +402,7 @@ end_tag (GMarkupParseContext *context G_GNUC_UNUSED,
static void
on_text (GMarkupParseContext *context G_GNUC_UNUSED,
const gchar *text,
- guint64 text_len,
+ gsize text_len,
gpointer user_data,
GError **error G_GNUC_UNUSED)
{
@@ -528,7 +528,7 @@ g_paste_file_backend_read_history_file (const GPasteStorageBackend *self,
G_MARKUP_TREAT_CDATA_AS_TEXT,
&data,
NULL);
- guint64 text_length;
+ gsize text_length;
g_file_get_contents (history_file_path, &text, &text_length, NULL);
g_markup_parse_context_parse (ctx, text, text_length, NULL);
diff --git a/src/daemon/tmp/gpaste-history.c b/src/daemon/tmp/gpaste-history.c
index 5b4ecb4b..7f45b608 100644
--- a/src/daemon/tmp/gpaste-history.c
+++ b/src/daemon/tmp/gpaste-history.c
@@ -36,7 +36,7 @@ typedef struct
GPasteStorageBackend *backend;
GPasteSettings *settings;
GList *history;
- guint64 size;
+ gsize size;
gchar *name;
diff --git a/src/daemon/tmp/gpaste-search-provider.c b/src/daemon/tmp/gpaste-search-provider.c
index 3f30b2e4..90965326 100644
--- a/src/daemon/tmp/gpaste-search-provider.c
+++ b/src/daemon/tmp/gpaste-search-provider.c
@@ -33,7 +33,7 @@ G_PASTE_DEFINE_TYPE_WITH_PRIVATE (SearchProvider, search_provider, G_PASTE_TYPE_
static char *
g_paste_dbus_get_as_result (GVariant *variant)
{
- guint64 _len;
+ gsize _len;
g_autofree const gchar **r = g_variant_get_strv (variant, &_len);
return g_strjoinv (" ", (gchar **) r);
@@ -183,7 +183,7 @@ g_paste_search_provider_private_get_result_metas (const GPasteSearchProviderPriv
g_variant_iter_init (¶meters_iter, parameters);
g_autoptr (GVariant) results = g_variant_iter_next_value (¶meters_iter);
- guint64 len;
+ gsize len;
g_autofree const gchar **uuids = g_variant_get_strv (results, &len);
if (!len)
diff --git a/src/libgpaste/gpaste/gpaste-util.c b/src/libgpaste/gpaste/gpaste-util.c
index 695fd8ed..56aae815 100644
--- a/src/libgpaste/gpaste/gpaste-util.c
+++ b/src/libgpaste/gpaste/gpaste-util.c
@@ -366,7 +366,7 @@ G_PASTE_VISIBLE guint32 *
g_paste_util_get_dbus_au_result (GVariant *variant,
guint64 *len)
{
- guint64 _len;
+ gsize _len;
const guint32 *r = g_variant_get_fixed_array (variant, &_len, sizeof (guint32));
guint32 *ret = g_memdup2 (r, _len * sizeof (guint32));
|