DragonFly BSD
DragonFly submit List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: 5 more simple patches for usr.bin/make


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Sat, 13 Nov 2004 18:39:13 +0100

On Wed, Nov 10, 2004 at 04:02:32PM -0800, Max Okumoto wrote:
> Here are five more independent patches for make.  The description
> of the patch is at the top of the patch files. They are all cosmetic
> and do not change functionality.
> 
> 				Max

One thing you can improve is the use of static strings with write.
E.g. instead of write(2, "BLA", 3); something either like
const char msg_bla[] = "BLA";
write(2, msg_bla, sizeof(msg_bla));

or 

#define WRITE(fd, str) write(fd, str, sizeof(str))

would be useful, the hardwired string length is evil. Be careful though,
the sizeof only works with char[], not char * !

Joerg



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