Commit Graph

11 Commits

Author SHA1 Message Date
Lucas De Marchi 5a8a8c9014 Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci

This should convert all cases where there's a comparison to NULL to simpler
forms. This patch applies the following transformations:

code before patch               ||code after patch
===============================================================

return a == NULL;                 return !a;

return a != NULL;                 return !!a;

func(a == NULL);                  func(!a);

func(a != NULL);                  func(!!a);

b = a == NULL;                    b = !a;

b = a != NULL;                    b = !!a;

b = a == NULL ? c : d;            b = !a ? c : d;

b = a != NULL ? c : d;            b = a ? c : d;


other cases:

a == NULL                         !a
a != NULL                         a




SVN revision: 51487
2010-08-21 13:52:25 +00:00
Lucas De Marchi 13d2d20efa Remove comparisons to NULL
Rather than using "== NULL" or "!= NULL", use expression or !expression where
possible.

Patch automatically generated by coccinelle from badnull.cocci and
badnull2.cocci



SVN revision: 51023
2010-08-11 20:35:26 +00:00
Lucas De Marchi 0a4617ae38 FORMATTING
* Remove vim modelines:
 find . -name '*.[chx]' -exec sed -i '/\/\*$/ {N;N;/ \* vim:ts/d}' \{\} \;
 find . -name '*.[chx]' -exec sed -i '/\/[\*\/] *vim:/d' \{\} \;

* Remove leading blank lines:
 find . -name '*.[cxh]' -exec sed -i '/./,$!d'

If you use vim, use this in your .vimrc:
set ts=8 sw=3 sts=8 expandtab cino=>5n-3f0^-2{2(0W1st0



SVN revision: 50816
2010-08-04 16:57:32 +00:00
doursse a86946850d remove trailing spaces and add indent doc for vi
SVN revision: 34246
2008-04-11 19:06:18 +00:00
doursse 5b899a19e3 initialize correctly the stuctures
SVN revision: 34243
2008-04-11 05:29:33 +00:00
tsauerbeck 7b41e4e522 include config.h
SVN revision: 14188
2005-04-13 20:36:07 +00:00
tsauerbeck 9becc884d2 removed unused function
SVN revision: 14187
2005-04-13 20:34:51 +00:00
tsauerbeck 155dc59a6f removed duplicatestring(), which was horribly broken and pretty useless
SVN revision: 14186
2005-04-13 20:27:03 +00:00
tsauerbeck 44a33d1f1d fixed some warnings
SVN revision: 10778
2004-07-11 09:50:42 +00:00
Carsten Haitzler 0d755cb255 formatting and all sorts of cleanup stuff... not anywhere near done or
perfect... :(


SVN revision: 9805
2004-04-20 03:50:11 +00:00
Carsten Haitzler 7b4b36e5d2 and E cvs did givbe birth to an Embryo! :)
SVN revision: 9445
2004-03-24 09:48:28 +00:00