Skip to content

Commit

Permalink
util/path: Fix type which is longer than 8 bit for MinGW
Browse files Browse the repository at this point in the history
While dirent->d_type is 8 bit for most systems, it is 32 bit for MinGW.
Reducing it to 8 bit results in a compiler warning because the macro
is_dir_maybe compares that 8 bit value with 32 bit constants.

Using 'unsigned' instead of 'unsigned char' matches the declaration for
MinGW and does not harm the other systems.

MinGW-w64 is not affected: it does not declare d_type.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
stweil authored and Michael Tokarev committed Oct 5, 2013
1 parent 8af0020 commit ddd2363
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int strneq(const char *s1, unsigned int n, const char *s2)
}

static struct pathelem *add_entry(struct pathelem *root, const char *name,
unsigned char type);
unsigned type);

static struct pathelem *new_entry(const char *root,
struct pathelem *parent,
Expand Down Expand Up @@ -82,7 +82,7 @@ static struct pathelem *add_dir_maybe(struct pathelem *path)
}

static struct pathelem *add_entry(struct pathelem *root, const char *name,
unsigned char type)
unsigned type)
{
struct pathelem **e;

Expand Down

0 comments on commit ddd2363

Please sign in to comment.