From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20270 invoked by alias); 14 May 2011 17:53:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29285 Received: (qmail 165 invoked from network); 14 May 2011 17:52:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_FRT_ADULT2, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.220.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=kwsBgrasCLRNIHR780eMu66FP0/U0+Dx9oIuaCIAWcE=; b=W7LQ9PNNkDyH6oAnqXsgMqzCIFoHSTusTs8WdWRlJqcWSYWRZZVe+bEXx+yk6wR+EW y9jCOdaG+mBv+2sHOM6p4IExwanrO3LlCrLSduxQ/lXCLibYFtbOkzbYx7nOCa5xXBrI b+va0qxfcfhK9PnLJUoUJuy7bdQ5q28NOAcRo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=J00BP7iGi+GRyS6G/gKIr73JhRUHkcNE2jcmNXwGhRqVTrj6K7tg+IHgyOJa0WF7Yh fhLNsQhzupnW35jmycCs2L0CawUtJV5Un1L06/Hz28BpylCsi4gsk2XZaflAYujS1fm+ uqXvTv5Ce2Gy/nT4dkzxb82kLCKrUGGV68ecM= MIME-Version: 1.0 In-Reply-To: <1305332636-26241-1-git-send-email-mikachu@gmail.com> References: <1305332636-26241-1-git-send-email-mikachu@gmail.com> Date: Sat, 14 May 2011 19:52:47 +0200 Message-ID: Subject: Re: PATCH: Remove some unused assignments/checks noticed by clang From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 14 May 2011 02:23, Mikael Magnusson 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