Commit Graph

18 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
Sebastian Dransfeld 604892a3c4 make clang happy
SVN revision: 45192
2010-01-15 19:44:25 +00:00
Vincent Torri 190d1aea83 fix PATH_MAX detection
SVN revision: 45071
2010-01-12 22:44:25 +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 9817e365b1 fix gettimeofday on windows and add __UNUSED__ for unused parameters
SVN revision: 34245
2008-04-11 05:59:42 +00:00
sebastid 95b180caa0 Don't use strlen to check if a string is empty.
SVN revision: 18270
2005-11-04 08:16:24 +00:00
tsauerbeck 0335fea64d properly include config.h
SVN revision: 14184
2005-04-13 20:01:23 +00:00
tsauerbeck 3559fa001e cleanup
SVN revision: 14182
2005-04-13 19:50:58 +00:00
tsauerbeck ad337df8cf fuck windows-isms
SVN revision: 14179
2005-04-13 19:45:19 +00:00
tsauerbeck 8b6e8a16c9 some more cleanup
SVN revision: 14177
2005-04-13 19:37:01 +00:00
Carsten Haitzler 7e672d79f8 ok that's it. fuck stdtypes.
SVN revision: 11588
2004-09-09 00:48:12 +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 552e101418 and fix this to work on PPC (big endian)
still have to check for 64bit... that is borken, i think...


SVN revision: 9472
2004-03-25 09:29:16 +00:00
Carsten Haitzler 6685ca7a70 portable portable damnit! need help cleaning this code! its horrid!
SVN revision: 9452
2004-03-25 02:07:28 +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