mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 16:38:43 +02:00
Update gio/xdgmime with commit 722325f of xdgmime project
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -20,10 +20,14 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include "xdgmimemagic.h"
|
||||
@@ -316,7 +320,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
||||
int c;
|
||||
int end_of_file;
|
||||
int indent = 0;
|
||||
int bytes_read;
|
||||
size_t bytes_read;
|
||||
|
||||
assert (magic_file != NULL);
|
||||
|
||||
@@ -403,7 +407,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
||||
return XDG_MIME_MAGIC_ERROR;
|
||||
}
|
||||
bytes_read = fread (matchlet->value, 1, matchlet->value_length, magic_file);
|
||||
if (bytes_read != matchlet->value_length)
|
||||
if (bytes_read != (size_t) matchlet->value_length)
|
||||
{
|
||||
_xdg_mime_magic_matchlet_free (matchlet);
|
||||
if (feof (magic_file))
|
||||
@@ -423,7 +427,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
||||
return XDG_MIME_MAGIC_ERROR;
|
||||
}
|
||||
bytes_read = fread (matchlet->mask, 1, matchlet->value_length, magic_file);
|
||||
if (bytes_read != matchlet->value_length)
|
||||
if (bytes_read != (size_t) matchlet->value_length)
|
||||
{
|
||||
_xdg_mime_magic_matchlet_free (matchlet);
|
||||
if (feof (magic_file))
|
||||
@@ -461,7 +465,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
||||
_xdg_mime_magic_matchlet_free (matchlet);
|
||||
return XDG_MIME_MAGIC_EOF;
|
||||
}
|
||||
if (matchlet->range_length == -1)
|
||||
if (matchlet->range_length == (unsigned int) -1)
|
||||
{
|
||||
_xdg_mime_magic_matchlet_free (matchlet);
|
||||
return XDG_MIME_MAGIC_ERROR;
|
||||
@@ -475,9 +479,7 @@ _xdg_mime_magic_parse_magic_line (FILE *magic_file,
|
||||
/* We clean up the matchlet, byte swapping if needed */
|
||||
if (matchlet->word_size > 1)
|
||||
{
|
||||
#if LITTLE_ENDIAN
|
||||
int i;
|
||||
#endif
|
||||
unsigned int i;
|
||||
if (matchlet->value_length % matchlet->word_size != 0)
|
||||
{
|
||||
_xdg_mime_magic_matchlet_free (matchlet);
|
||||
@@ -522,7 +524,7 @@ _xdg_mime_magic_matchlet_compare_to_data (XdgMimeMagicMatchlet *matchlet,
|
||||
const void *data,
|
||||
size_t len)
|
||||
{
|
||||
int i, j;
|
||||
unsigned int i, j;
|
||||
for (i = matchlet->offset; i < matchlet->offset + matchlet->range_length; i++)
|
||||
{
|
||||
int valid_matchlet = TRUE;
|
||||
|
Reference in New Issue
Block a user