findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Findutils-patches] [PATCH 1/2] Eliminate some compiler warnings.


From: Eric Blake
Subject: Re: [Findutils-patches] [PATCH 1/2] Eliminate some compiler warnings.
Date: Tue, 14 Jun 2011 16:49:57 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/14/2011 04:46 PM, James Youngman wrote:
> * find/find.c: Remove definition of SAFE_CHDIR, which we don't
> use.
> * find/defs.h: Remove redundant declaration of launch.
> * find/parser.c (parse_false): Cast unused arguments to void.
> (parse_print0): Likewise.
> (pred_context): Likewise.
> (parse_newerXY): Add some parens for slightly greater clarity.
> (make_segment): Avoid switch-missing-default-case warning by
> turning it into an if statement.
> (check_path_safety): Remove unused argument.
> (insert_exec_ok): Don't pass the unwanted arugment to

s/arugment/argument/

> check_path_safety.
> (get_relative_timestamp): silence compiler warning by adding a
> case for the remaining enumberation value rather than using

s/enumberation/enumeration/

> @@ -1614,8 +1617,8 @@ parse_newerXY (const struct parser_table* entry, char 
> **argv, int *arg_ptr)
>  
>        /* -newertY (for any Y) is invalid. */
>        if (x == 't'
> -       || 0 == strchr (validchars, x)
> -       || 0 == strchr ( validchars, y))
> +       || (0 == strchr (validchars, x))
> +       || (0 == strchr ( validchars, y)))

strchr() returns a pointer, so I prefer to compare to NULL rather than
0.  Or even:

!strchr (validchars, x)

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]