[libsoup] Fix some signed/unsigned missmatch warnings
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Fix some signed/unsigned missmatch warnings
- Date: Mon, 2 Nov 2015 14:20:52 +0000 (UTC)
commit 3854da0ea27e7adc3acecdaca27a685f55b87835
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Oct 26 11:53:25 2015 +0100
Fix some signed/unsigned missmatch warnings
https://bugzilla.gnome.org/show_bug.cgi?id=757146
libsoup/soup-auth-manager.c | 4 ++--
libsoup/soup-content-sniffer.c | 18 +++++++++---------
libsoup/soup-message-headers.c | 7 ++++---
libsoup/soup-multipart.c | 4 ++--
libsoup/soup-path-map.c | 5 +++--
libsoup/soup-session.c | 4 ++--
libsoup/soup-value-utils.c | 2 +-
libsoup/soup-xmlrpc-old.c | 2 +-
8 files changed, 24 insertions(+), 22 deletions(-)
---
diff --git a/libsoup/soup-auth-manager.c b/libsoup/soup-auth-manager.c
index 6aa4dad..0709c42 100644
--- a/libsoup/soup-auth-manager.c
+++ b/libsoup/soup-auth-manager.c
@@ -190,7 +190,7 @@ soup_auth_manager_remove_feature (SoupSessionFeature *feature, GType type)
{
SoupAuthManagerPrivate *priv = SOUP_AUTH_MANAGER (feature)->priv;
SoupAuthClass *auth_class;
- int i;
+ guint i;
if (!g_type_is_a (type, SOUP_TYPE_AUTH))
return FALSE;
@@ -215,7 +215,7 @@ soup_auth_manager_has_feature (SoupSessionFeature *feature, GType type)
{
SoupAuthManagerPrivate *priv = SOUP_AUTH_MANAGER (feature)->priv;
SoupAuthClass *auth_class;
- int i;
+ guint i;
if (!g_type_is_a (type, SOUP_TYPE_AUTH))
return FALSE;
diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
index e3dfb78..1517782 100644
--- a/libsoup/soup-content-sniffer.c
+++ b/libsoup/soup-content-sniffer.c
@@ -91,12 +91,12 @@ sniff_media (SoupContentSniffer *sniffer,
int table_length)
{
const guchar *resource = (const guchar *)buffer->data;
- int resource_length = MIN (512, buffer->length);
+ guint resource_length = MIN (512, buffer->length);
int i;
for (i = 0; i < table_length; i++) {
SoupContentSnifferMediaPattern *type_row = &(table[i]);
- int j;
+ guint j;
if (resource_length < type_row->pattern_length)
continue;
@@ -226,9 +226,9 @@ static gboolean
sniff_mp4 (SoupContentSniffer *sniffer, SoupBuffer *buffer)
{
const char *resource = (const char *)buffer->data;
- int resource_length = MIN (512, buffer->length);
+ guint resource_length = MIN (512, buffer->length);
guint32 box_size = *((guint32*)resource);
- int i;
+ guint i;
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
box_size = ((box_size >> 24) |
@@ -490,8 +490,8 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
{
char *sniffed_type = NULL;
const guchar *resource = (const guchar *)buffer->data;
- int resource_length = MIN (512, buffer->length);
- int i;
+ guint resource_length = MIN (512, buffer->length);
+ guint i;
for (i = 0; i < G_N_ELEMENTS (types_table); i++) {
SoupContentSnifferPattern *type_row = &(types_table[i]);
@@ -500,8 +500,8 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
continue;
if (type_row->has_ws) {
- int index_stream = 0;
- int index_pattern = 0;
+ guint index_stream = 0;
+ guint index_pattern = 0;
gboolean skip_row = FALSE;
while ((index_stream < resource_length) &&
@@ -538,7 +538,7 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
return g_strdup (type_row->sniffed_type);
}
} else {
- int j;
+ guint j;
if (resource_length < type_row->pattern_length)
continue;
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
index 23738a1..f850926 100644
--- a/libsoup/soup-message-headers.c
+++ b/libsoup/soup-message-headers.c
@@ -135,7 +135,7 @@ void
soup_message_headers_clear (SoupMessageHeaders *hdrs)
{
SoupHeader *hdr_array = (SoupHeader *)hdrs->array->data;
- int i;
+ guint i;
for (i = 0; i < hdrs->array->len; i++)
g_free (hdr_array[i].value);
@@ -575,7 +575,7 @@ soup_message_headers_foreach (SoupMessageHeaders *hdrs,
gpointer user_data)
{
SoupHeader *hdr_array = (SoupHeader *)hdrs->array->data;
- int i;
+ guint i;
for (i = 0; i < hdrs->array->len; i++)
func (hdr_array[i].name, hdr_array[i].value, user_data);
@@ -945,7 +945,6 @@ soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs,
GSList *range_list, *r;
GArray *array;
char *spec, *end;
- int i;
guint status = SOUP_STATUS_OK;
if (!range || strncmp (range, "bytes", 5) != 0)
@@ -1004,6 +1003,8 @@ soup_message_headers_get_ranges_internal (SoupMessageHeaders *hdrs,
}
if (total_length) {
+ guint i;
+
g_array_sort (array, sort_ranges);
for (i = 1; i < array->len; i++) {
SoupRange *cur = &((SoupRange *)array->data)[i];
diff --git a/libsoup/soup-multipart.c b/libsoup/soup-multipart.c
index d6e08e6..dd57f9a 100644
--- a/libsoup/soup-multipart.c
+++ b/libsoup/soup-multipart.c
@@ -412,7 +412,7 @@ soup_multipart_to_message (SoupMultipart *multipart,
const char *name, *value;
GString *str;
GHashTable *params;
- int i;
+ guint i;
params = g_hash_table_new (g_str_hash, g_str_equal);
g_hash_table_insert (params, "boundary", multipart->boundary);
@@ -476,7 +476,7 @@ static SoupMultipart *
soup_multipart_copy (SoupMultipart *multipart)
{
SoupMultipart *copy;
- int i;
+ guint i;
copy = soup_multipart_new_internal (g_strdup (multipart->mime_type),
g_strdup (multipart->boundary));
diff --git a/libsoup/soup-path-map.c b/libsoup/soup-path-map.c
index a157a60..7b7527a 100644
--- a/libsoup/soup-path-map.c
+++ b/libsoup/soup-path-map.c
@@ -58,7 +58,7 @@ void
soup_path_map_free (SoupPathMap *map)
{
SoupPathMapping *mappings = (SoupPathMapping *)map->mappings->data;
- int i;
+ guint i;
for (i = 0; i < map->mappings->len; i++) {
g_free (mappings[i].path);
@@ -79,7 +79,8 @@ static gboolean
mapping_lookup (SoupPathMap *map, const char *path, int *match, int *insert)
{
SoupPathMapping *mappings = (SoupPathMapping *)map->mappings->data;
- int i, path_len;
+ guint i;
+ int path_len;
gboolean exact = FALSE;
*match = -1;
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 5f03c63..9831172 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -445,7 +445,7 @@ accept_languages_from_system (void)
GPtrArray *langs = NULL;
char *lang, *langs_str;
int delta;
- int i;
+ guint i;
lang_names = g_get_language_names ();
g_return_val_if_fail (lang_names != NULL, NULL);
@@ -1818,7 +1818,7 @@ get_connection_for_host (SoupSession *session,
SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
SoupConnection *conn;
GSList *conns;
- int num_pending = 0;
+ guint num_pending = 0;
if (priv->disposed)
return FALSE;
diff --git a/libsoup/soup-value-utils.c b/libsoup/soup-value-utils.c
index 8ff2d86..014eb5b 100644
--- a/libsoup/soup-value-utils.c
+++ b/libsoup/soup-value-utils.c
@@ -324,7 +324,7 @@ soup_value_array_to_args (GValueArray *array, va_list args)
{
GType type;
GValue *value;
- int i;
+ guint i;
for (i = 0; i < array->n_values; i++) {
type = va_arg (args, GType);
diff --git a/libsoup/soup-xmlrpc-old.c b/libsoup/soup-xmlrpc-old.c
index 2f325d4..c57086b 100644
--- a/libsoup/soup-xmlrpc-old.c
+++ b/libsoup/soup-xmlrpc-old.c
@@ -102,7 +102,7 @@ insert_value (xmlNode *parent, GValue *value)
} else if (type == G_TYPE_VALUE_ARRAY) {
GValueArray *va = g_value_get_boxed (value);
xmlNode *node;
- int i;
+ guint i;
node = xmlNewChild (xvalue, NULL,
(const xmlChar *)"array", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]