Dne p=E1 18. kv=ECten 2001 14:59 Guillaume Laurent napsal(a): > On Friday 18 May 2001 14:44, Lubos Lunak wrote: > > Hmm. Such a long patch for a one-line change. Is there any serious > > reason why you want to replace all the NULL's with 0's ? It's the sam= e. > > Not quite, according to Stroustrup use of NULL is discouraged, 0 is > preferred. I think it's because NULL is typed while '0' is "more flexib= le" > or something like that. I don't have my copy of TC++PL 3rd at hand. I can't find it in the C++ draft available on www, but IIRC : - NULL is either 0 or 0L, C++ forbids NULL to be (void*)0 - which means there's no real difference besides NULL being more readable= IMHO - it can cause trouble when overloading on both int and a pointer, but si= nce=20 NULL is just 0 it's not really different and everybody writing code depen= ding=20 on this is asking for trouble anyway, so that's no argument against NULL - some buggy platforms use #define NULL (void*)0 , because that's what it= =20 should be in ANSI C , but there is plenty of NULL's all over KDE sources = and=20 nobody complained yet AFAIK, so this is no argument either In other words, if you're going to convert NULL -> 0 in someone else's c= ode=20 just because you think you're doing a good thing, you're just wasting you= r=20 time. And unless it's written somewhere in ISO C++ that NULL is bad bad,=20 arguing against using NULL is wasting your time too. I'd feel like a comp= lete=20 idiot if I would have problems reading my own code. I can convert it to t= he=20 most often used style in the app sources after it's finished ( which is B= TW=20 different from the style used in this change ). Thank you Lubos Lunak -- l.lunak@email.cz ; l.lunak@kde.org http://dforce.sh.cvut.cz/~seli