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

List:       busybox
Subject:    resend2:PATCH: save a few bytes in arping
From:       walter harms <WHarms () bfs ! de>
Date:       2008-04-25 9:04:25
Message-ID: 48119E99.5020909 () bfs ! de
[Download RAW message or body]

this should fix the problems.
unfortunaly the saving is less now, but the readability is still better.

re,
 wh


Denys Vlasenko wrote:
> On Friday 25 April 2008 09:11, walter harms wrote:
>> +static void *cp_step(void *_dst,void *_src, size_t n)
>> +{
>> +  memcpy(_dst, _src, n);
> 
> Indentation is inconsistent with the rest of the file.
> 
>> +
>> +  return _dst += n;
> 
> Incrementing the pointer of type void* is a gcc'ism.
> 
>>         ah->ar_op = option_mask32 & ADVERT ? htons(ARPOP_REPLY) : htons(ARPOP_REQUEST);
>> +       p=cp_step(p, &ME->sll_addr, ah->ar_hln);
> 
> Style is not consistent. See how = looks like in preceding line.
> 
> -               opt_complementary = "=1:Df:AU:c+";
> +               //              opt_complementary = "=1:Df:AU:c+";
> 
> Why did you kill -c option?
> --
> vda
> 
> 
> 

["arping.diff" (text/x-patch)]

68a69,76
> 
> static void *cp_step(void *_dst,void *_src, size_t n)
> {
> 	return (char *) memcpy (_dst, _src, n) + n;
> }
> 
> 
> 
82a91
> 	p = cp_step(p, &ME->sll_addr, ah->ar_hln);
84,88c93
< 	memcpy(p, &ME->sll_addr, ah->ar_hln);
< 	p += ME->sll_halen;
< 
< 	memcpy(p, src_addr, 4);
< 	p += 4;
---
> 	p = cp_step(p, src_addr, 4);
91c96
< 		memcpy(p, &ME->sll_addr, ah->ar_hln);
---
> 		p = cp_step(p, &ME->sll_addr, ah->ar_hln);
93,94c98
< 		memcpy(p, &HE->sll_addr, ah->ar_hln);
< 	p += ah->ar_hln;
---
> 		p = cp_step(p, &HE->sll_addr, ah->ar_hln);
96,97c100
< 	memcpy(p, dst_addr, 4);
< 	p += 4;
---
> 	p = cp_step(p, dst_addr, 4);


_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

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

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