[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?
From: |
Jim Meyering |
Subject: |
Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ? |
Date: |
Sat, 29 Nov 2008 16:05:10 +0100 |
"James Youngman" <address@hidden> wrote:
>> +static void
>> +set_stat_type (struct stat *st, unsigned int dtype)
>> +{
>> + mode_t type;
>> + switch (dtype)
>> + {
>> + case DT_BLK:
>> + type = S_IFBLK;
>> + break;
>> + case DT_CHR:
>> + type = S_IFCHR;
>> + break;
>> + case DT_DIR:
>> + type = S_IFDIR;
>> + break;
>> + case DT_FIFO:
>> + type = S_IFIFO;
>> + break;
>> + case DT_LNK:
>> + type = S_IFLNK;
>> + break;
>> + case DT_REG:
>> + type = S_IFREG;
>> + break;
>> + case DT_SOCK:
>> + type = S_IFSOCK;
>> + break;
>> + default:
>> + type = 0;
>> + }
>> + st->st_mode = dtype << s_ifmt_shift_bits ();
>> +}
>
> As far as I can see, the variable type is assigned in the function
> above, but never used. Did you mean to use "type" rather than
> "dtype" in the expression which assigns to st->st_mode?
Doesn't (didn't) gcc warn about that?
It doesn't for me, now, with gcc-4.3.x.
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Eric Blake, 2008/11/27
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, James Youngman, 2008/11/28
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/28
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, James Youngman, 2008/11/29
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/29
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?,
Jim Meyering <=
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/29
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/29
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, James Youngman, 2008/11/29
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, James Youngman, 2008/11/30
- Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/29
- Fwd: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, James Youngman, 2008/11/29
- Re: Fwd: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Jim Meyering, 2008/11/29
Re: [Patch] Add dirent.d_type support to Cygwin 1.7 ?, Christian Franke, 2008/11/28