From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28524 invoked by alias); 6 Jan 2015 00:31:07 -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: 34099 Received: (qmail 25454 invoked from network); 6 Jan 2015 00:30:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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_FSL_HELO_BARE_IP_2 autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1420503885; bh=l4m00LPir+sEX/MlGrWgNdETkXhKwEWEicsnKaREEfs=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=AqV+TuMLYgcPofHGJrklA+BY/Nu4vmLFliXTJKwYP3OaNn99MNCg74Ucw3ucjRSj7 DxHNrMQWfAfWg+zlarrBdyEodz9ha7eCGxZTrS2VKbMGVCVM7WCrpadeZzrCMuCegS bobXVjOn0/3wUnl0AeKJ7uTW8DxJFhXpSubpyc68= From: ZyX To: Mikael Magnusson , Peter Stephenson Cc: zsh workers In-Reply-To: References: Subject: Re: Fishier code in handlefeatures MIME-Version: 1.0 Message-Id: <1999441420503885@web17g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 06 Jan 2015 03:24:45 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r 06.01.2015, 03:21, "Mikael Magnusson" : > mod_export int > handlefeatures(Module m, Features f, int **enables) > { > ššššif (!enables || *enables) > ššššššreturn setfeatureenables(m, f, *enables); > šššš*enables = getfeatureenables(m, f); > ššššreturn 0; > } > > so if enables is NULL, we immediately do *enables? I'm not sure what's > intended here but obviously it somehow works. NULL is false, so if enables is NULL !enables is true and *enables is not evaluated due to short-circuiting. Nothing wrong here. > > -- > Mikael Magnusson