Re: Fix up ugly open-coded "alloc_nr()" user in object.c

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

 



On Sat, Jun 16, 2007 at 02:21:34PM -0400, Jeff King wrote:
> How about using the new ALLOC_GROW macro to make it even shorter? I also
> got rid of the aliased variables, which IMO just make it harder to see

> what's going on.
> +	ALLOC_GROW(array->objects, array->nr, array->alloc);
> +	array->objects[array->nr].item = obj;
> +	array->objects[array->nr].name = name;
> +	array->objects[array->nr].mode = mode;
> +	array->nr++;

Unless the ALLOC_GROW semantics are weird, shouldn't that be:
  ALLOC_GROW(array->objects, array->nr+1, array->alloc);

  OG.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux