From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Remove some unused assignments/checks noticed by clang
Date: Sat, 14 May 2011 19:52:47 +0200 [thread overview]
Message-ID: <BANLkTikpSefJyoD8Qq-1DfmgNBo9SZaGHQ@mail.gmail.com> (raw)
In-Reply-To: <1305332636-26241-1-git-send-email-mikachu@gmail.com>
On 14 May 2011 02:23, Mikael Magnusson <mikachu@gmail.com> wrote:
> Only two changes result in different code for me, curiously both of the
> ones in exec.c, even though they are trivially useless, while none of
> the other changes have any effect... That's gcc for you.
>
> Changes that might look strange on first inspection are the removals
> of the null checks in compresult.c, note that the first line after each
> loop does the same dereference anyway.
>
> There is a big thing removed in zle_tricky.c, yes, that really doesn't
> do anything.
> --- a/Src/module.c
> +++ b/Src/module.c
> @@ -426,14 +426,13 @@ static int
> add_autobin(const char *module, const char *bnam, int flags)
> {
> Builtin bn;
> - int ret;
>
> bn = zshcalloc(sizeof(*bn));
> bn->node.nam = ztrdup(bnam);
> bn->optstr = ztrdup(module);
> if (flags & FEAT_AUTOALL)
> bn->node.flags |= BINF_AUTOALL;
> - if ((ret = addbuiltin(bn))) {
> + if (addbuiltin(bn)) {
> builtintab->freenode(&bn->node);
> if (!(flags & FEAT_IGNORE))
> return 1;
Should this slightly out of view "return 0;" perhaps change to "return
ret;" instead?
--
Mikael Magnusson
prev parent reply other threads:[~2011-05-14 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-14 0:23 Mikael Magnusson
2011-05-14 17:22 ` Wayne Davison
2011-05-14 17:43 ` Mikael Magnusson
2011-05-14 19:25 ` Bart Schaefer
2011-05-14 17:52 ` Mikael Magnusson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTikpSefJyoD8Qq-1DfmgNBo9SZaGHQ@mail.gmail.com \
--to=mikachu@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).