[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    RE: [PATCH] Add bc (Last patch)
From:       <dietmar.schindler () manrolandgoss ! com>
Date:       2018-10-31 7:04:02
Message-ID: 3e3e7f199c1a4c299098159e43863fed () AUSMXMBX04 ! mrws ! biz
[Download RAW message or body]

> From: busybox <busybox-bounces@busybox.net> On Behalf Of Gavin Howard
> Sent: Tuesday, October 30, 2018 12:30 AM
> 
> On Mon, Oct 29, 2018 at 4:46 PM Denys Vlasenko <vda.linux@googlemail.com> wrote:
> > 
> > On Mon, Oct 29, 2018 at 4:55 PM Gavin Howard <gavin.d.howard@gmail.com> wrote:
> > > ...
> > +    if (!(v->v = malloc(esize * BC_VEC_START_CAP))) return BC_STATUS_ALLOC_ERR;
> > 
> > (1) Please do not nest assignments:
> > 
> > v->v = malloc(esize * BC_VEC_START_CAP);
> > if (!v->v)
> > return BC_STATUS_ALLOC_ERR;
> 
> Oh boy. I was afraid of this.
> 
> The problem is that I am also trying to get this bc into toybox (might
> as well reduce duplication of effort), and as I am sure you know,
> Landley is very particular about the line count of commands. To be
> honest, I would prefer your style (except for putting if statements
> that on one line if possible), but this reduces line count.
> 
> I don't really know what to do here.

If by "nest" is meant "nest in another pair of parentheses", the two requirements are \
accordable:

    if (v->v = malloc(esize * BC_VEC_START_CAP), !v->v) ...
--
Regards,
Dietmar Schindler
________________________________
manroland Goss web systems GmbH | Managing Director: Alexander Wassermann
Registered Office: Augsburg | Trade Register: AG Augsburg | HRB-No.: 32609 | VAT: \
DE815764857

Confidentiality note:
This message and any attached documents may contain confidential or proprietary \
information of manroland|Goss. These materials are intended only for the use of the \
intended recipient. If you are not the intended recipient of this transmission, you \
are hereby notified that any distribution, disclosure, printing, copying, storage, \
modification or the taking of any action in reliance upon this transmission is \
strictly prohibited. Delivery of this message to any person other than the intended \
recipient shall not compromise or waive such confidentiality, privilege or exemption \
from disclosure as to this communication. If you have received this communication in \
error, please immediately notify the sender and delete the message from your system. \
All liability for viruses is excluded to the fullest extent permitted by law. \
________________________________ _______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic