mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 03:02:10 +01:00
Merge branch 'size_t-conversions' into 'main'
Fix various implicit conversions from size_t to smaller types See merge request GNOME/glib!4023
This commit is contained in:
commit
18cd1590c3
@ -666,8 +666,8 @@ const gchar *
|
|||||||
g_application_command_line_getenv (GApplicationCommandLine *cmdline,
|
g_application_command_line_getenv (GApplicationCommandLine *cmdline,
|
||||||
const gchar *name)
|
const gchar *name)
|
||||||
{
|
{
|
||||||
gint length = strlen (name);
|
size_t length = strlen (name);
|
||||||
gint i;
|
size_t i;
|
||||||
|
|
||||||
/* TODO: expand on windows */
|
/* TODO: expand on windows */
|
||||||
if (cmdline->priv->environ)
|
if (cmdline->priv->environ)
|
||||||
|
@ -1373,7 +1373,7 @@ dump_method (const GDBusMethodInfo *o,
|
|||||||
{
|
{
|
||||||
guint n;
|
guint n;
|
||||||
guint m;
|
guint m;
|
||||||
guint name_len;
|
size_t name_len;
|
||||||
guint total_num_args;
|
guint total_num_args;
|
||||||
|
|
||||||
for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++)
|
for (n = 0; o->annotations != NULL && o->annotations[n] != NULL; n++)
|
||||||
|
@ -3822,8 +3822,8 @@ static gboolean
|
|||||||
namespace_rule_matches (const gchar *namespace,
|
namespace_rule_matches (const gchar *namespace,
|
||||||
const gchar *name)
|
const gchar *name)
|
||||||
{
|
{
|
||||||
gint len_namespace;
|
size_t len_namespace;
|
||||||
gint len_name;
|
size_t len_name;
|
||||||
|
|
||||||
len_namespace = strlen (namespace);
|
len_namespace = strlen (namespace);
|
||||||
len_name = strlen (name);
|
len_name = strlen (name);
|
||||||
@ -3841,7 +3841,7 @@ static gboolean
|
|||||||
path_rule_matches (const gchar *path_a,
|
path_rule_matches (const gchar *path_a,
|
||||||
const gchar *path_b)
|
const gchar *path_b)
|
||||||
{
|
{
|
||||||
gint len_a, len_b;
|
size_t len_a, len_b;
|
||||||
|
|
||||||
len_a = strlen (path_a);
|
len_a = strlen (path_a);
|
||||||
len_b = strlen (path_b);
|
len_b = strlen (path_b);
|
||||||
|
@ -543,7 +543,8 @@ match_matches (GDBusDaemon *daemon,
|
|||||||
{
|
{
|
||||||
MatchElement *element;
|
MatchElement *element;
|
||||||
Name *name;
|
Name *name;
|
||||||
int i, len, len2;
|
int i;
|
||||||
|
size_t len, len2;
|
||||||
const char *value;
|
const char *value;
|
||||||
int check_type;
|
int check_type;
|
||||||
|
|
||||||
|
@ -2852,7 +2852,7 @@ append_value_to_blob (GVariant *value,
|
|||||||
const gchar *signature;
|
const gchar *signature;
|
||||||
child = g_variant_get_child_value (value, 0);
|
child = g_variant_get_child_value (value, 0);
|
||||||
signature = g_variant_get_type_string (child);
|
signature = g_variant_get_type_string (child);
|
||||||
g_memory_buffer_put_byte (mbuf, strlen (signature));
|
g_memory_buffer_put_byte (mbuf, (guint8) strlen (signature)); /* signature is already validated to be this short */
|
||||||
g_memory_buffer_put_string (mbuf, signature);
|
g_memory_buffer_put_string (mbuf, signature);
|
||||||
g_memory_buffer_put_byte (mbuf, '\0');
|
g_memory_buffer_put_byte (mbuf, '\0');
|
||||||
if (!append_value_to_blob (child,
|
if (!append_value_to_blob (child,
|
||||||
|
@ -113,7 +113,7 @@ is_valid_name (const gchar *start,
|
|||||||
gboolean
|
gboolean
|
||||||
g_dbus_is_name (const gchar *string)
|
g_dbus_is_name (const gchar *string)
|
||||||
{
|
{
|
||||||
guint len;
|
size_t len;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
const gchar *s;
|
const gchar *s;
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ static const char *
|
|||||||
match_prefix (const char *path,
|
match_prefix (const char *path,
|
||||||
const char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int prefix_len;
|
size_t prefix_len;
|
||||||
|
|
||||||
prefix_len = strlen (prefix);
|
prefix_len = strlen (prefix);
|
||||||
if (strncmp (path, prefix, prefix_len) != 0)
|
if (strncmp (path, prefix, prefix_len) != 0)
|
||||||
|
@ -345,7 +345,7 @@ init_completion (GFilenameCompleter *completer,
|
|||||||
GFile *file, *parent;
|
GFile *file, *parent;
|
||||||
char *basename;
|
char *basename;
|
||||||
char *t;
|
char *t;
|
||||||
int len;
|
size_t len;
|
||||||
|
|
||||||
*basename_out = NULL;
|
*basename_out = NULL;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ prompt_for (const char *prompt, const char *default_value, gboolean echo)
|
|||||||
gboolean restore_flags;
|
gboolean restore_flags;
|
||||||
#endif
|
#endif
|
||||||
char data[256];
|
char data[256];
|
||||||
int len;
|
size_t len;
|
||||||
|
|
||||||
if (default_value && *default_value != 0)
|
if (default_value && *default_value != 0)
|
||||||
g_print ("%s [%s]: ", prompt, default_value);
|
g_print ("%s [%s]: ", prompt, default_value);
|
||||||
|
@ -42,10 +42,10 @@ static const GOptionEntry entries[] = {
|
|||||||
static char *
|
static char *
|
||||||
hex_unescape (const char *str)
|
hex_unescape (const char *str)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
char *unescaped_str, *p;
|
char *unescaped_str, *p;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
int len;
|
size_t len;
|
||||||
|
|
||||||
len = strlen (str);
|
len = strlen (str);
|
||||||
unescaped_str = g_malloc (len + 1);
|
unescaped_str = g_malloc (len + 1);
|
||||||
|
@ -680,7 +680,7 @@ key_state_serialise (KeyState *state)
|
|||||||
|
|
||||||
if (state->l10n_context)
|
if (state->l10n_context)
|
||||||
{
|
{
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
/* Contextified messages are supported by prepending
|
/* Contextified messages are supported by prepending
|
||||||
* the context, followed by '\004' to the start of the
|
* the context, followed by '\004' to the start of the
|
||||||
|
@ -479,7 +479,7 @@ static const char *
|
|||||||
match_prefix (const char *path,
|
match_prefix (const char *path,
|
||||||
const char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int prefix_len;
|
size_t prefix_len;
|
||||||
|
|
||||||
prefix_len = strlen (prefix);
|
prefix_len = strlen (prefix);
|
||||||
if (strncmp (path, prefix, prefix_len) != 0)
|
if (strncmp (path, prefix, prefix_len) != 0)
|
||||||
|
@ -83,7 +83,7 @@ list_resource (GResource *resource,
|
|||||||
gint i;
|
gint i;
|
||||||
gchar *child;
|
gchar *child;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
children = g_resource_enumerate_children (resource, path, 0, &error);
|
children = g_resource_enumerate_children (resource, path, 0, &error);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -352,7 +352,7 @@ g_resource_find_overlay (const gchar *path,
|
|||||||
/* This is a null-terminated array of replacement strings (with '=' inside) */
|
/* This is a null-terminated array of replacement strings (with '=' inside) */
|
||||||
static const gchar * const *overlay_dirs;
|
static const gchar * const *overlay_dirs;
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
gint path_len = -1;
|
size_t path_len = 0;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* We try to be very fast in case there are no overlays. Otherwise,
|
/* We try to be very fast in case there are no overlays. Otherwise,
|
||||||
@ -449,9 +449,9 @@ g_resource_find_overlay (const gchar *path,
|
|||||||
for (i = 0; overlay_dirs[i]; i++)
|
for (i = 0; overlay_dirs[i]; i++)
|
||||||
{
|
{
|
||||||
const gchar *src;
|
const gchar *src;
|
||||||
gint src_len;
|
size_t src_len;
|
||||||
const gchar *dst;
|
const gchar *dst;
|
||||||
gint dst_len;
|
size_t dst_len;
|
||||||
gchar *candidate;
|
gchar *candidate;
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -466,7 +466,7 @@ g_resource_find_overlay (const gchar *path,
|
|||||||
/* hold off on dst_len because we will probably fail the checks below */
|
/* hold off on dst_len because we will probably fail the checks below */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path_len == -1)
|
if (i == 0)
|
||||||
path_len = strlen (path);
|
path_len = strlen (path);
|
||||||
|
|
||||||
/* The entire path is too short to match the source */
|
/* The entire path is too short to match the source */
|
||||||
|
@ -354,7 +354,7 @@ static const char *
|
|||||||
match_prefix (const char *path,
|
match_prefix (const char *path,
|
||||||
const char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int prefix_len;
|
size_t prefix_len;
|
||||||
|
|
||||||
prefix_len = strlen (prefix);
|
prefix_len = strlen (prefix);
|
||||||
if (strncmp (path, prefix, prefix_len) != 0)
|
if (strncmp (path, prefix, prefix_len) != 0)
|
||||||
|
@ -114,10 +114,10 @@ g_socks5_proxy_init (GSocks5Proxy *proxy)
|
|||||||
* +----+----------+----------+
|
* +----+----------+----------+
|
||||||
*/
|
*/
|
||||||
#define SOCKS5_NEGO_MSG_LEN 4
|
#define SOCKS5_NEGO_MSG_LEN 4
|
||||||
static gint
|
static size_t
|
||||||
set_nego_msg (guint8 *msg, gboolean has_auth)
|
set_nego_msg (guint8 *msg, gboolean has_auth)
|
||||||
{
|
{
|
||||||
gint len = 3;
|
size_t len = 3;
|
||||||
|
|
||||||
msg[0] = SOCKS5_VERSION;
|
msg[0] = SOCKS5_VERSION;
|
||||||
msg[1] = 0x01; /* number of methods supported */
|
msg[1] = 0x01; /* number of methods supported */
|
||||||
@ -200,15 +200,20 @@ parse_nego_reply (const guint8 *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SOCKS5_AUTH_MSG_LEN 515
|
#define SOCKS5_AUTH_MSG_LEN 515
|
||||||
static gint
|
static gboolean
|
||||||
set_auth_msg (guint8 *msg,
|
set_auth_msg (guint8 *msg,
|
||||||
const gchar *username,
|
const gchar *username,
|
||||||
const gchar *password,
|
const gchar *password,
|
||||||
|
size_t *out_len,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gint len = 0;
|
size_t len = 0;
|
||||||
gint ulen = 0; /* username length */
|
size_t ulen = 0; /* username length */
|
||||||
gint plen = 0; /* Password length */
|
size_t plen = 0; /* Password length */
|
||||||
|
|
||||||
|
/* Clear output first */
|
||||||
|
if (out_len != NULL)
|
||||||
|
*out_len = 0;
|
||||||
|
|
||||||
if (username)
|
if (username)
|
||||||
ulen = strlen (username);
|
ulen = strlen (username);
|
||||||
@ -221,7 +226,7 @@ set_auth_msg (guint8 *msg,
|
|||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||||
_("Username or password is too long for SOCKSv5 "
|
_("Username or password is too long for SOCKSv5 "
|
||||||
"protocol."));
|
"protocol."));
|
||||||
return -1;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg[len++] = SOCKS5_AUTH_VERSION;
|
msg[len++] = SOCKS5_AUTH_VERSION;
|
||||||
@ -238,7 +243,10 @@ set_auth_msg (guint8 *msg,
|
|||||||
|
|
||||||
len += plen;
|
len += plen;
|
||||||
|
|
||||||
return len;
|
if (out_len != NULL)
|
||||||
|
*out_len = len;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -266,13 +274,18 @@ check_auth_status (const guint8 *data, GError **error)
|
|||||||
* longer then 256 bytes.
|
* longer then 256 bytes.
|
||||||
*/
|
*/
|
||||||
#define SOCKS5_CONN_MSG_LEN 262
|
#define SOCKS5_CONN_MSG_LEN 262
|
||||||
static gint
|
static gboolean
|
||||||
set_connect_msg (guint8 *msg,
|
set_connect_msg (guint8 *msg,
|
||||||
const gchar *hostname,
|
const gchar *hostname,
|
||||||
guint16 port,
|
guint16 port,
|
||||||
|
size_t *out_len,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
guint len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
|
/* Clear output first */
|
||||||
|
if (out_len != NULL)
|
||||||
|
*out_len = 0;
|
||||||
|
|
||||||
msg[len++] = SOCKS5_VERSION;
|
msg[len++] = SOCKS5_VERSION;
|
||||||
msg[len++] = SOCKS5_CMD_CONNECT;
|
msg[len++] = SOCKS5_CMD_CONNECT;
|
||||||
@ -301,7 +314,7 @@ set_connect_msg (guint8 *msg,
|
|||||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
|
||||||
_("Hostname “%s” is too long for SOCKSv5 protocol"),
|
_("Hostname “%s” is too long for SOCKSv5 protocol"),
|
||||||
hostname);
|
hostname);
|
||||||
return -1;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg[len++] = SOCKS5_ATYP_DOMAINNAME;
|
msg[len++] = SOCKS5_ATYP_DOMAINNAME;
|
||||||
@ -316,7 +329,10 @@ set_connect_msg (guint8 *msg,
|
|||||||
len += 2;
|
len += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
if (out_len != NULL)
|
||||||
|
*out_len = len;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -447,7 +463,7 @@ g_socks5_proxy_connect (GProxy *proxy,
|
|||||||
/* Send SOCKS5 handshake */
|
/* Send SOCKS5 handshake */
|
||||||
{
|
{
|
||||||
guint8 msg[SOCKS5_NEGO_MSG_LEN];
|
guint8 msg[SOCKS5_NEGO_MSG_LEN];
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
len = set_nego_msg (msg, has_auth);
|
len = set_nego_msg (msg, has_auth);
|
||||||
|
|
||||||
@ -471,11 +487,9 @@ g_socks5_proxy_connect (GProxy *proxy,
|
|||||||
if (must_auth)
|
if (must_auth)
|
||||||
{
|
{
|
||||||
guint8 msg[SOCKS5_AUTH_MSG_LEN];
|
guint8 msg[SOCKS5_AUTH_MSG_LEN];
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
len = set_auth_msg (msg, username, password, error);
|
if (!set_auth_msg (msg, username, password, &len, error))
|
||||||
|
|
||||||
if (len < 0)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!g_output_stream_write_all (out, msg, len, NULL,
|
if (!g_output_stream_write_all (out, msg, len, NULL,
|
||||||
@ -494,11 +508,9 @@ g_socks5_proxy_connect (GProxy *proxy,
|
|||||||
/* Send SOCKS5 connection request */
|
/* Send SOCKS5 connection request */
|
||||||
{
|
{
|
||||||
guint8 msg[SOCKS5_CONN_MSG_LEN];
|
guint8 msg[SOCKS5_CONN_MSG_LEN];
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
len = set_connect_msg (msg, hostname, port, error);
|
if (!set_connect_msg (msg, hostname, port, &len, error))
|
||||||
|
|
||||||
if (len < 0)
|
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!g_output_stream_write_all (out, msg, len, NULL,
|
if (!g_output_stream_write_all (out, msg, len, NULL,
|
||||||
@ -561,8 +573,8 @@ typedef struct
|
|||||||
gchar *username;
|
gchar *username;
|
||||||
gchar *password;
|
gchar *password;
|
||||||
guint8 *buffer;
|
guint8 *buffer;
|
||||||
gssize length;
|
size_t length;
|
||||||
gssize offset;
|
size_t offset;
|
||||||
} ConnectAsyncData;
|
} ConnectAsyncData;
|
||||||
|
|
||||||
static void nego_msg_write_cb (GObject *source,
|
static void nego_msg_write_cb (GObject *source,
|
||||||
@ -751,13 +763,13 @@ nego_reply_read_cb (GObject *source,
|
|||||||
g_free (data->buffer);
|
g_free (data->buffer);
|
||||||
|
|
||||||
data->buffer = g_malloc0 (SOCKS5_AUTH_MSG_LEN);
|
data->buffer = g_malloc0 (SOCKS5_AUTH_MSG_LEN);
|
||||||
data->length = set_auth_msg (data->buffer,
|
|
||||||
data->username,
|
|
||||||
data->password,
|
|
||||||
&error);
|
|
||||||
data->offset = 0;
|
data->offset = 0;
|
||||||
|
|
||||||
if (data->length < 0)
|
if (!set_auth_msg (data->buffer,
|
||||||
|
data->username,
|
||||||
|
data->password,
|
||||||
|
&data->length,
|
||||||
|
&error))
|
||||||
{
|
{
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
@ -873,13 +885,13 @@ send_connect_msg (GTask *task)
|
|||||||
g_free (data->buffer);
|
g_free (data->buffer);
|
||||||
|
|
||||||
data->buffer = g_malloc0 (SOCKS5_CONN_MSG_LEN);
|
data->buffer = g_malloc0 (SOCKS5_CONN_MSG_LEN);
|
||||||
data->length = set_connect_msg (data->buffer,
|
|
||||||
data->hostname,
|
|
||||||
data->port,
|
|
||||||
&error);
|
|
||||||
data->offset = 0;
|
data->offset = 0;
|
||||||
|
|
||||||
if (data->length < 0)
|
if (!set_connect_msg (data->buffer,
|
||||||
|
data->hostname,
|
||||||
|
data->port,
|
||||||
|
&data->length,
|
||||||
|
&error))
|
||||||
{
|
{
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
|
@ -472,15 +472,21 @@ g_unix_socket_address_new_with_type (const gchar *path,
|
|||||||
{
|
{
|
||||||
GSocketAddress *address;
|
GSocketAddress *address;
|
||||||
GByteArray *array;
|
GByteArray *array;
|
||||||
|
size_t path_len_unsigned;
|
||||||
|
|
||||||
if (type == G_UNIX_SOCKET_ADDRESS_ANONYMOUS)
|
if (type == G_UNIX_SOCKET_ADDRESS_ANONYMOUS)
|
||||||
path_len = 0;
|
path_len_unsigned = 0;
|
||||||
else if (path_len == -1)
|
else if (path_len < 0)
|
||||||
path_len = strlen (path);
|
path_len_unsigned = strlen (path);
|
||||||
|
else
|
||||||
|
path_len_unsigned = (size_t) path_len;
|
||||||
|
|
||||||
array = g_byte_array_sized_new (path_len);
|
/* The code below can’t handle anything longer. */
|
||||||
|
g_return_val_if_fail (path_len_unsigned <= G_MAXUINT, NULL);
|
||||||
|
|
||||||
g_byte_array_append (array, (guint8 *)path, path_len);
|
array = g_byte_array_sized_new (path_len_unsigned);
|
||||||
|
|
||||||
|
g_byte_array_append (array, (guint8 *)path, path_len_unsigned);
|
||||||
|
|
||||||
address = g_object_new (G_TYPE_UNIX_SOCKET_ADDRESS,
|
address = g_object_new (G_TYPE_UNIX_SOCKET_ADDRESS,
|
||||||
"path-as-array", array,
|
"path-as-array", array,
|
||||||
|
@ -63,7 +63,7 @@ test_read_lines (GDataStreamNewlineType newline_type)
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gpointer data;
|
gpointer data;
|
||||||
char *lines;
|
char *lines;
|
||||||
int size;
|
size_t size;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#define TEST_STRING "some_text"
|
#define TEST_STRING "some_text"
|
||||||
@ -99,7 +99,7 @@ test_read_lines (GDataStreamNewlineType newline_type)
|
|||||||
|
|
||||||
/* compare data */
|
/* compare data */
|
||||||
size = strlen (data);
|
size = strlen (data);
|
||||||
g_assert_cmpint (size, <, MAX_LINES_BUFF);
|
g_assert_cmpuint (size, <, MAX_LINES_BUFF);
|
||||||
g_assert_cmpstr ((char*)data, ==, lines);
|
g_assert_cmpstr ((char*)data, ==, lines);
|
||||||
|
|
||||||
g_object_unref (base_stream);
|
g_object_unref (base_stream);
|
||||||
|
@ -1470,7 +1470,7 @@ test_run_in_thread_overflow (void)
|
|||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
GTask *task;
|
GTask *task;
|
||||||
gchar buf[NUM_OVERFLOW_TASKS + 1];
|
gchar buf[NUM_OVERFLOW_TASKS + 1];
|
||||||
gint i;
|
size_t i;
|
||||||
|
|
||||||
/* Queue way too many tasks and then sleep for a bit. The first 10
|
/* Queue way too many tasks and then sleep for a bit. The first 10
|
||||||
* tasks will be dispatched to threads and will then block on
|
* tasks will be dispatched to threads and will then block on
|
||||||
@ -1516,13 +1516,13 @@ test_run_in_thread_overflow (void)
|
|||||||
* plausibly get (and we hope that if gtask is actually broken then
|
* plausibly get (and we hope that if gtask is actually broken then
|
||||||
* it will exceed those limits).
|
* it will exceed those limits).
|
||||||
*/
|
*/
|
||||||
g_assert_cmpint (i, >=, 10);
|
g_assert_cmpuint (i, >=, 10);
|
||||||
if (g_test_slow ())
|
if (g_test_slow ())
|
||||||
g_assert_cmpint (i, <, 50);
|
g_assert_cmpuint (i, <, 50);
|
||||||
else
|
else
|
||||||
g_assert_cmpint (i, <, 20);
|
g_assert_cmpuint (i, <, 20);
|
||||||
|
|
||||||
g_assert_cmpint (i + strspn (buf + i, "X"), ==, NUM_OVERFLOW_TASKS);
|
g_assert_cmpuint (i + strspn (buf + i, "X"), ==, NUM_OVERFLOW_TASKS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test_return_on_cancel */
|
/* test_return_on_cancel */
|
||||||
|
@ -160,8 +160,8 @@ g_win32_fs_monitor_callback (DWORD error,
|
|||||||
|
|
||||||
if (monitor->isfile)
|
if (monitor->isfile)
|
||||||
{
|
{
|
||||||
gint long_filename_length = wcslen (monitor->wfilename_long);
|
size_t long_filename_length = wcslen (monitor->wfilename_long);
|
||||||
gint short_filename_length = wcslen (monitor->wfilename_short);
|
size_t short_filename_length = wcslen (monitor->wfilename_short);
|
||||||
enum GWin32FileMonitorFileAlias alias_state;
|
enum GWin32FileMonitorFileAlias alias_state;
|
||||||
|
|
||||||
/* If monitoring a file, check that the changed file
|
/* If monitoring a file, check that the changed file
|
||||||
|
@ -318,7 +318,7 @@ static const char *
|
|||||||
match_prefix (const char *path,
|
match_prefix (const char *path,
|
||||||
const char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int prefix_len;
|
size_t prefix_len;
|
||||||
|
|
||||||
prefix_len = strlen (prefix);
|
prefix_len = strlen (prefix);
|
||||||
if (strncmp (path, prefix, prefix_len) != 0)
|
if (strncmp (path, prefix, prefix_len) != 0)
|
||||||
|
@ -223,12 +223,14 @@ gi_base_info_type_register_static (const char *type_name,
|
|||||||
{
|
{
|
||||||
GTypeInfo info;
|
GTypeInfo info;
|
||||||
|
|
||||||
|
g_assert (instance_size <= G_MAXUINT16);
|
||||||
|
|
||||||
info.class_size = sizeof (GIBaseInfoClass);
|
info.class_size = sizeof (GIBaseInfoClass);
|
||||||
info.base_init = NULL;
|
info.base_init = NULL;
|
||||||
info.base_finalize = NULL;
|
info.base_finalize = NULL;
|
||||||
info.class_init = class_init;
|
info.class_init = class_init;
|
||||||
info.class_finalize = NULL;
|
info.class_finalize = NULL;
|
||||||
info.instance_size = instance_size;
|
info.instance_size = (guint16) instance_size;
|
||||||
info.n_preallocs = 0;
|
info.n_preallocs = 0;
|
||||||
info.instance_init = NULL;
|
info.instance_init = NULL;
|
||||||
info.value_table = NULL;
|
info.value_table = NULL;
|
||||||
|
@ -651,7 +651,7 @@ gi_callable_info_invoke (GICallableInfo *info,
|
|||||||
GITypeInfo *rinfo;
|
GITypeInfo *rinfo;
|
||||||
GITypeTag rtag;
|
GITypeTag rtag;
|
||||||
GIArgInfo *ainfo;
|
GIArgInfo *ainfo;
|
||||||
size_t n_args, n_invoke_args, in_pos, out_pos, i;
|
unsigned int n_args, n_invoke_args, in_pos, out_pos, i;
|
||||||
void **args;
|
void **args;
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
GError *local_error = NULL;
|
GError *local_error = NULL;
|
||||||
|
@ -190,7 +190,7 @@ gi_field_info_get_field (GIFieldInfo *field_info,
|
|||||||
void *mem,
|
void *mem,
|
||||||
GIArgument *value)
|
GIArgument *value)
|
||||||
{
|
{
|
||||||
int offset;
|
size_t offset;
|
||||||
GITypeInfo *type_info;
|
GITypeInfo *type_info;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
|
|
||||||
@ -385,7 +385,7 @@ gi_field_info_set_field (GIFieldInfo *field_info,
|
|||||||
void *mem,
|
void *mem,
|
||||||
const GIArgument *value)
|
const GIArgument *value)
|
||||||
{
|
{
|
||||||
int offset;
|
size_t offset;
|
||||||
GITypeInfo *type_info;
|
GITypeInfo *type_info;
|
||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ gi_ir_node_get_size (GIIrNode *node)
|
|||||||
|
|
||||||
g_assert (size <= G_MAXUINT32);
|
g_assert (size <= G_MAXUINT32);
|
||||||
|
|
||||||
return size;
|
return (guint32) size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1338,7 +1338,8 @@ gi_ir_writer_write (GIRepository *repository,
|
|||||||
gboolean show_all)
|
gboolean show_all)
|
||||||
{
|
{
|
||||||
FILE *ofile;
|
FILE *ofile;
|
||||||
size_t i, j;
|
size_t i;
|
||||||
|
unsigned int j;
|
||||||
char **dependencies;
|
char **dependencies;
|
||||||
Xml *xml;
|
Xml *xml;
|
||||||
|
|
||||||
|
@ -424,7 +424,8 @@ guchar *
|
|||||||
g_base64_decode_inplace (gchar *text,
|
g_base64_decode_inplace (gchar *text,
|
||||||
gsize *out_len)
|
gsize *out_len)
|
||||||
{
|
{
|
||||||
gint input_length, state = 0;
|
gint state = 0;
|
||||||
|
size_t input_length;
|
||||||
guint save = 0;
|
guint save = 0;
|
||||||
|
|
||||||
g_return_val_if_fail (text != NULL, NULL);
|
g_return_val_if_fail (text != NULL, NULL);
|
||||||
|
@ -2258,6 +2258,7 @@ win32_strftime_helper (const GDate *d,
|
|||||||
gchar *convbuf;
|
gchar *convbuf;
|
||||||
glong convlen = 0;
|
glong convlen = 0;
|
||||||
gsize retval;
|
gsize retval;
|
||||||
|
size_t format_len = strlen (format);
|
||||||
|
|
||||||
systemtime.wYear = tm->tm_year + 1900;
|
systemtime.wYear = tm->tm_year + 1900;
|
||||||
systemtime.wMonth = tm->tm_mon + 1;
|
systemtime.wMonth = tm->tm_mon + 1;
|
||||||
@ -2269,7 +2270,8 @@ win32_strftime_helper (const GDate *d,
|
|||||||
systemtime.wMilliseconds = 0;
|
systemtime.wMilliseconds = 0;
|
||||||
|
|
||||||
lcid = GetThreadLocale ();
|
lcid = GetThreadLocale ();
|
||||||
result = g_array_sized_new (FALSE, FALSE, sizeof (wchar_t), MAX (128, strlen (format) * 2));
|
result = g_array_sized_new (FALSE, FALSE, sizeof (wchar_t),
|
||||||
|
(format_len <= 64) ? (guint) format_len * 2 : 128);
|
||||||
|
|
||||||
p = format;
|
p = format;
|
||||||
while (*p)
|
while (*p)
|
||||||
|
@ -3268,7 +3268,7 @@ g_date_time_format_utf8 (GDateTime *datetime,
|
|||||||
GString *outstr,
|
GString *outstr,
|
||||||
gboolean locale_is_utf8)
|
gboolean locale_is_utf8)
|
||||||
{
|
{
|
||||||
guint len;
|
size_t len;
|
||||||
guint colons;
|
guint colons;
|
||||||
gunichar c;
|
gunichar c;
|
||||||
gboolean alt_digits = FALSE;
|
gboolean alt_digits = FALSE;
|
||||||
|
@ -647,7 +647,7 @@ g_get_environ (void)
|
|||||||
{
|
{
|
||||||
gunichar2 *strings;
|
gunichar2 *strings;
|
||||||
gchar **result;
|
gchar **result;
|
||||||
gint i, n;
|
size_t i, n;
|
||||||
|
|
||||||
strings = GetEnvironmentStringsW ();
|
strings = GetEnvironmentStringsW ();
|
||||||
for (n = 0, i = 0; strings[n]; i++)
|
for (n = 0, i = 0; strings[n]; i++)
|
||||||
|
@ -373,7 +373,7 @@ g_file_test (const gchar *filename,
|
|||||||
{
|
{
|
||||||
const gchar *lastdot = strrchr (filename, '.');
|
const gchar *lastdot = strrchr (filename, '.');
|
||||||
const gchar *pathext = NULL, *p;
|
const gchar *pathext = NULL, *p;
|
||||||
int extlen;
|
size_t extlen;
|
||||||
|
|
||||||
if (lastdot == NULL)
|
if (lastdot == NULL)
|
||||||
break;
|
break;
|
||||||
@ -401,7 +401,7 @@ g_file_test (const gchar *filename,
|
|||||||
const gchar *q = strchr (p, ';');
|
const gchar *q = strchr (p, ';');
|
||||||
if (q == NULL)
|
if (q == NULL)
|
||||||
q = p + strlen (p);
|
q = p + strlen (p);
|
||||||
if (extlen == q - p &&
|
if (extlen == (size_t) (q - p) &&
|
||||||
memcmp (lastdot, p, extlen) == 0)
|
memcmp (lastdot, p, extlen) == 0)
|
||||||
{
|
{
|
||||||
g_free ((gchar *) pathext);
|
g_free ((gchar *) pathext);
|
||||||
|
@ -1420,9 +1420,9 @@ win32_is_pipe_tty (int fd)
|
|||||||
gboolean result = FALSE;
|
gboolean result = FALSE;
|
||||||
HANDLE h_fd;
|
HANDLE h_fd;
|
||||||
FILE_NAME_INFO *info = NULL;
|
FILE_NAME_INFO *info = NULL;
|
||||||
gint info_size = sizeof (FILE_NAME_INFO) + sizeof (WCHAR) * MAX_PATH;
|
size_t info_size = sizeof (FILE_NAME_INFO) + sizeof (WCHAR) * MAX_PATH;
|
||||||
wchar_t *name = NULL;
|
wchar_t *name = NULL;
|
||||||
gint length;
|
size_t length;
|
||||||
|
|
||||||
h_fd = (HANDLE) _get_osfhandle (fd);
|
h_fd = (HANDLE) _get_osfhandle (fd);
|
||||||
|
|
||||||
|
@ -1461,7 +1461,7 @@ parse_long_option (GOptionContext *context,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gint len = strlen (group->entries[j].long_name);
|
size_t len = strlen (group->entries[j].long_name);
|
||||||
|
|
||||||
if (strncmp (arg, group->entries[j].long_name, len) == 0 &&
|
if (strncmp (arg, group->entries[j].long_name, len) == 0 &&
|
||||||
(arg[len] == '=' || arg[len] == 0))
|
(arg[len] == '=' || arg[len] == 0))
|
||||||
|
@ -65,9 +65,9 @@ typedef enum
|
|||||||
struct _GPatternSpec
|
struct _GPatternSpec
|
||||||
{
|
{
|
||||||
GMatchType match_type;
|
GMatchType match_type;
|
||||||
guint pattern_length;
|
size_t pattern_length;
|
||||||
guint min_length;
|
size_t min_length;
|
||||||
guint max_length;
|
size_t max_length;
|
||||||
gchar *pattern;
|
gchar *pattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -930,7 +930,7 @@ g_ascii_formatd (gchar *buffer,
|
|||||||
const char *decimal_point;
|
const char *decimal_point;
|
||||||
gsize decimal_point_len;
|
gsize decimal_point_len;
|
||||||
gchar *p;
|
gchar *p;
|
||||||
int rest_len;
|
size_t rest_len;
|
||||||
gchar format_char;
|
gchar format_char;
|
||||||
|
|
||||||
g_return_val_if_fail (buffer != NULL, NULL);
|
g_return_val_if_fail (buffer != NULL, NULL);
|
||||||
|
@ -134,7 +134,7 @@ g_string_new (const gchar *init)
|
|||||||
string = g_string_sized_new (2);
|
string = g_string_sized_new (2);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
len = strlen (init);
|
len = strlen (init);
|
||||||
string = g_string_sized_new (len + 2);
|
string = g_string_sized_new (len + 2);
|
||||||
|
@ -3035,7 +3035,7 @@ static gboolean
|
|||||||
path_has_prefix (const char *path,
|
path_has_prefix (const char *path,
|
||||||
const char *prefix)
|
const char *prefix)
|
||||||
{
|
{
|
||||||
int prefix_len = strlen (prefix);
|
size_t prefix_len = strlen (prefix);
|
||||||
|
|
||||||
return (strncmp (path, prefix, prefix_len) == 0 &&
|
return (strncmp (path, prefix, prefix_len) == 0 &&
|
||||||
(path[prefix_len] == '\0' ||
|
(path[prefix_len] == '\0' ||
|
||||||
|
@ -187,11 +187,11 @@ lookup_item_id_for_locale (const gchar *locale)
|
|||||||
{
|
{
|
||||||
gchar key[MAX_LOCALE_NAME + 1];
|
gchar key[MAX_LOCALE_NAME + 1];
|
||||||
const gchar *language;
|
const gchar *language;
|
||||||
guint language_len;
|
size_t language_len;
|
||||||
const gchar *territory = NULL;
|
const gchar *territory = NULL;
|
||||||
guint territory_len = 0;
|
size_t territory_len = 0;
|
||||||
const gchar *modifier = NULL;
|
const gchar *modifier = NULL;
|
||||||
guint modifier_len = 0;
|
size_t modifier_len = 0;
|
||||||
const gchar *next_char;
|
const gchar *next_char;
|
||||||
guint id;
|
guint id;
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ output_special_case (gchar *out_buffer,
|
|||||||
int which)
|
int which)
|
||||||
{
|
{
|
||||||
const gchar *p = special_case_table + offset;
|
const gchar *p = special_case_table + offset;
|
||||||
gint len;
|
size_t len;
|
||||||
|
|
||||||
if (type != G_UNICODE_TITLECASE_LETTER)
|
if (type != G_UNICODE_TITLECASE_LETTER)
|
||||||
p = g_utf8_next_char (p);
|
p = g_utf8_next_char (p);
|
||||||
|
@ -1250,7 +1250,7 @@ g_utf16_to_ucs4 (const gunichar2 *str,
|
|||||||
const gunichar2 *in;
|
const gunichar2 *in;
|
||||||
gchar *out;
|
gchar *out;
|
||||||
gchar *result = NULL;
|
gchar *result = NULL;
|
||||||
gint n_bytes;
|
size_t n_bytes;
|
||||||
gunichar high_surrogate;
|
gunichar high_surrogate;
|
||||||
|
|
||||||
g_return_val_if_fail (str != NULL, NULL);
|
g_return_val_if_fail (str != NULL, NULL);
|
||||||
|
@ -196,7 +196,7 @@ g_find_program_in_path (const gchar *program)
|
|||||||
strchr (last_dot, '\\') != NULL ||
|
strchr (last_dot, '\\') != NULL ||
|
||||||
strchr (last_dot, '/') != NULL)
|
strchr (last_dot, '/') != NULL)
|
||||||
{
|
{
|
||||||
const gint program_length = strlen (program);
|
const size_t program_length = strlen (program);
|
||||||
gchar *pathext = g_build_path (";",
|
gchar *pathext = g_build_path (";",
|
||||||
".exe;.cmd;.bat;.com",
|
".exe;.cmd;.bat;.com",
|
||||||
g_getenv ("PATHEXT"),
|
g_getenv ("PATHEXT"),
|
||||||
|
@ -327,10 +327,10 @@ static gboolean
|
|||||||
token_stream_peek_string (TokenStream *stream,
|
token_stream_peek_string (TokenStream *stream,
|
||||||
const gchar *token)
|
const gchar *token)
|
||||||
{
|
{
|
||||||
gint length = strlen (token);
|
size_t length = strlen (token);
|
||||||
|
|
||||||
return token_stream_prepare (stream) &&
|
return token_stream_prepare (stream) &&
|
||||||
stream->stream - stream->this == length &&
|
(size_t) (stream->stream - stream->this) == length &&
|
||||||
memcmp (stream->this, token, length) == 0;
|
memcmp (stream->this, token, length) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ array_new_zero_terminated (void)
|
|||||||
garray = g_array_new (TRUE, FALSE, sizeof (gchar));
|
garray = g_array_new (TRUE, FALSE, sizeof (gchar));
|
||||||
g_assert_cmpuint (garray->len, ==, 0);
|
g_assert_cmpuint (garray->len, ==, 0);
|
||||||
|
|
||||||
g_array_append_vals (garray, "hello", strlen ("hello"));
|
g_array_append_vals (garray, "hello", (guint) strlen ("hello"));
|
||||||
g_assert_cmpuint (garray->len, ==, 5);
|
g_assert_cmpuint (garray->len, ==, 5);
|
||||||
g_assert_cmpstr (garray->data, ==, "hello");
|
g_assert_cmpstr (garray->data, ==, "hello");
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ invalid_mutation (const gchar *type_string)
|
|||||||
|
|
||||||
/* else, perform a random mutation at a random point */
|
/* else, perform a random mutation at a random point */
|
||||||
{
|
{
|
||||||
gint length, n;
|
size_t length, n;
|
||||||
gchar *new;
|
gchar *new;
|
||||||
gchar p;
|
gchar p;
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ typedef enum
|
|||||||
struct _GPatternSpec
|
struct _GPatternSpec
|
||||||
{
|
{
|
||||||
GMatchType match_type;
|
GMatchType match_type;
|
||||||
guint pattern_length;
|
size_t pattern_length;
|
||||||
guint min_length;
|
size_t min_length;
|
||||||
guint max_length;
|
size_t max_length;
|
||||||
gchar *pattern;
|
gchar *pattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ struct _CompileTest
|
|||||||
const gchar *src;
|
const gchar *src;
|
||||||
GMatchType match_type;
|
GMatchType match_type;
|
||||||
gchar *pattern;
|
gchar *pattern;
|
||||||
guint min;
|
size_t min;
|
||||||
};
|
};
|
||||||
|
|
||||||
static CompileTest compile_tests[] = {
|
static CompileTest compile_tests[] = {
|
||||||
@ -80,8 +80,8 @@ test_compilation (gconstpointer d)
|
|||||||
|
|
||||||
g_assert_cmpint (spec->match_type, ==, test->match_type);
|
g_assert_cmpint (spec->match_type, ==, test->match_type);
|
||||||
g_assert_cmpstr (spec->pattern, ==, test->pattern);
|
g_assert_cmpstr (spec->pattern, ==, test->pattern);
|
||||||
g_assert_cmpint (spec->pattern_length, ==, strlen (spec->pattern));
|
g_assert_cmpuint (spec->pattern_length, ==, strlen (spec->pattern));
|
||||||
g_assert_cmpint (spec->min_length, ==, test->min);
|
g_assert_cmpuint (spec->min_length, ==, test->min);
|
||||||
|
|
||||||
g_pattern_spec_free (spec);
|
g_pattern_spec_free (spec);
|
||||||
}
|
}
|
||||||
@ -97,8 +97,8 @@ test_copy (gconstpointer d)
|
|||||||
|
|
||||||
g_assert_cmpint (p2->match_type, ==, test->match_type);
|
g_assert_cmpint (p2->match_type, ==, test->match_type);
|
||||||
g_assert_cmpstr (p2->pattern, ==, test->pattern);
|
g_assert_cmpstr (p2->pattern, ==, test->pattern);
|
||||||
g_assert_cmpint (p2->pattern_length, ==, strlen (p1->pattern));
|
g_assert_cmpuint (p2->pattern_length, ==, strlen (p1->pattern));
|
||||||
g_assert_cmpint (p2->min_length, ==, test->min);
|
g_assert_cmpuint (p2->min_length, ==, test->min);
|
||||||
|
|
||||||
g_pattern_spec_free (p1);
|
g_pattern_spec_free (p1);
|
||||||
g_pattern_spec_free (p2);
|
g_pattern_spec_free (p2);
|
||||||
@ -186,7 +186,8 @@ test_match (gconstpointer d)
|
|||||||
r = g_utf8_strreverse (test->string, -1);
|
r = g_utf8_strreverse (test->string, -1);
|
||||||
g_assert_cmpint (g_pattern_spec_match (p, strlen (test->string), test->string, r), ==, test->match);
|
g_assert_cmpint (g_pattern_spec_match (p, strlen (test->string), test->string, r), ==, test->match);
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
g_assert_cmpint (g_pattern_match (p, strlen (test->string), test->string, r), ==, test->match);
|
g_assert_cmpuint (strlen (test->string), <=, G_MAXUINT);
|
||||||
|
g_assert_cmpint (g_pattern_match (p, (guint) strlen (test->string), test->string, r), ==, test->match);
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
g_free (r);
|
g_free (r);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ test_scanner_tokens (ScannerFixture *fix,
|
|||||||
gconstpointer test_data)
|
gconstpointer test_data)
|
||||||
{
|
{
|
||||||
gchar buf[] = "(\t\n\r\\){}";
|
gchar buf[] = "(\t\n\r\\){}";
|
||||||
const gint buflen = strlen (buf);
|
const size_t buflen = strlen (buf);
|
||||||
gchar tokbuf[] = "(\\){}";
|
gchar tokbuf[] = "(\\){}";
|
||||||
const gsize tokbuflen = strlen (tokbuf);
|
const gsize tokbuflen = strlen (tokbuf);
|
||||||
gsize i;
|
gsize i;
|
||||||
|
@ -36,7 +36,8 @@ WinMain (struct HINSTANCE__ *hInstance,
|
|||||||
{
|
{
|
||||||
int infd = atoi (__argv[2]);
|
int infd = atoi (__argv[2]);
|
||||||
int outfd = atoi (__argv[3]);
|
int outfd = atoi (__argv[3]);
|
||||||
int k, n;
|
SSIZE_T k;
|
||||||
|
size_t n;
|
||||||
char buf[100] = {0};
|
char buf[100] = {0};
|
||||||
|
|
||||||
if (infd < 0 || outfd < 0)
|
if (infd < 0 || outfd < 0)
|
||||||
@ -55,22 +56,28 @@ WinMain (struct HINSTANCE__ *hInstance,
|
|||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((k = read (infd, &n, sizeof (n))) != sizeof (n))
|
k = read (infd, &n, sizeof (n));
|
||||||
|
if (k < 0 || (size_t) k != sizeof (n))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "spawn-test-win32-gui: Got only %d bytes, wanted %d\n",
|
int errsv = errno;
|
||||||
k, (int)sizeof (n));
|
if (k < 0)
|
||||||
|
fprintf (stderr, "spawn-test-win32-gui: Read error: %s\n", strerror (errsv));
|
||||||
|
else
|
||||||
|
fprintf (stderr, "spawn-test-win32-gui: Got only %zu bytes, wanted %zu\n",
|
||||||
|
(size_t) k, sizeof (n));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (stderr, "spawn-test-win32-gui: Parent says %d bytes to read\n", n);
|
fprintf (stderr, "spawn-test-win32-gui: Parent says %zu bytes to read\n", n);
|
||||||
|
|
||||||
if ((k = read (infd, buf, n)) != n)
|
k = read (infd, buf, n);
|
||||||
|
if (k < 0 || (size_t) k != n)
|
||||||
{
|
{
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
if (k == -1)
|
if (k < 0)
|
||||||
fprintf (stderr, "spawn-test-win32-gui: Read error: %s\n", strerror (errsv));
|
fprintf (stderr, "spawn-test-win32-gui: Read error: %s\n", strerror (errsv));
|
||||||
else
|
else
|
||||||
fprintf (stderr, "spawn-test-win32-gui: Got only %d bytes\n", k);
|
fprintf (stderr, "spawn-test-win32-gui: Got only %zu bytes\n", (size_t) k);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ test_spawn_basics (void)
|
|||||||
gchar *output = NULL;
|
gchar *output = NULL;
|
||||||
gchar *erroutput = NULL;
|
gchar *erroutput = NULL;
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
int n;
|
size_t n;
|
||||||
char buf[100];
|
char buf[100];
|
||||||
int pipedown[2], pipeup[2];
|
int pipedown[2], pipeup[2];
|
||||||
gchar **argv = NULL;
|
gchar **argv = NULL;
|
||||||
|
@ -455,7 +455,7 @@ test_tree_insert (void)
|
|||||||
{
|
{
|
||||||
GTree *tree;
|
GTree *tree;
|
||||||
gchar *p;
|
gchar *p;
|
||||||
gint i;
|
size_t i;
|
||||||
gchar *scrambled;
|
gchar *scrambled;
|
||||||
|
|
||||||
tree = g_tree_new (my_compare);
|
tree = g_tree_new (my_compare);
|
||||||
@ -468,8 +468,8 @@ test_tree_insert (void)
|
|||||||
g_tree_unref (tree);
|
g_tree_unref (tree);
|
||||||
tree = g_tree_new (my_compare);
|
tree = g_tree_new (my_compare);
|
||||||
|
|
||||||
for (i = strlen (chars) - 1; i >= 0; i--)
|
for (i = strlen (chars); i > 0; i--)
|
||||||
g_tree_insert (tree, &chars[i], &chars[i]);
|
g_tree_insert (tree, &chars[i - 1], &chars[i - 1]);
|
||||||
p = chars;
|
p = chars;
|
||||||
g_tree_foreach (tree, check_order, &p);
|
g_tree_foreach (tree, check_order, &p);
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ static gchar*
|
|||||||
_g_module_build_path (const gchar *directory,
|
_g_module_build_path (const gchar *directory,
|
||||||
const gchar *module_name)
|
const gchar *module_name)
|
||||||
{
|
{
|
||||||
gint k;
|
size_t k;
|
||||||
|
|
||||||
k = strlen (module_name);
|
k = strlen (module_name);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ show_nodes (GType type,
|
|||||||
const gchar *indent)
|
const gchar *indent)
|
||||||
{
|
{
|
||||||
GType *children;
|
GType *children;
|
||||||
guint i;
|
size_t i;
|
||||||
|
|
||||||
if (!type)
|
if (!type)
|
||||||
return;
|
return;
|
||||||
|
@ -1073,7 +1073,7 @@ type_data_make_W (TypeNode *node,
|
|||||||
{
|
{
|
||||||
TypeData *data;
|
TypeData *data;
|
||||||
GTypeValueTable *vtable = NULL;
|
GTypeValueTable *vtable = NULL;
|
||||||
guint vtable_size = 0;
|
size_t vtable_size = 0;
|
||||||
|
|
||||||
g_assert (node->data == NULL && info != NULL);
|
g_assert (node->data == NULL && info != NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user