This type of construct seems popular in the wine source:
while (isspace(*GL_Extensions)) GL_Extensions++; Start = GL_Extensions;
Or even worse (I've seen this in winex11.drv, and it took me quite a long time until I understood it - it was part of a larger block with a lot these constructs):
if (cond) do_sth(); do_sth_else();
This indentation is so utterly stupid, it makes my brain hurt (I'm sure I'm not the only one)!! I don't know what AJs stance is on code readability and I know that there are no official coding style guidelines, but can we please avoid this? Can we agree on a set of fundamental style rules? To make peer-reviewing patches easier? And for people not familiar with the code easier to understand it? Please?
tom
On 06/08/07, Tomas Carnecky tom@dbservice.com wrote:
This type of construct seems popular in the wine source:
while (isspace(*GL_Extensions)) GL_Extensions++; Start = GL_Extensions;
Other than the questionable variable naming I see nothing wrong with that construction?
Or even worse (I've seen this in winex11.drv, and it took me quite a long time until I understood it - it was part of a larger block with a lot these constructs):
if (cond) do_sth(); do_sth_else();
That one is slightly misleading of course.
Or even worse (I've seen this in winex11.drv, and it took me quite a long time until I understood it - it was part of a larger block with a lot these constructs):
if (cond) do_sth(); do_sth_else();
I think you are speaking about the opengl code there. There are quite a number of pieces like that left. They are remnants of the old opengl code. During the move to winex11.drv I fixed the indentation in those functions a bit as before it was a lot worse. You had (and still have) perhaps 10 layers of indentation in some functions but at that time the indentation wasn't there.
Roderick
On Mon, 2007-08-06 at 10:37 +0200, Roderick Colenbrander wrote:
Or even worse (I've seen this in winex11.drv, and it took me quite a long time until I understood it - it was part of a larger block with a lot these constructs):
if (cond) do_sth(); do_sth_else();
I think you are speaking about the opengl code there. There are quite a number of pieces like that left. They are remnants of the old opengl code. During the move to winex11.drv I fixed the indentation in those functions a bit as before it was a lot worse. You had (and still have) perhaps 10 layers of indentation in some functions but at that time the indentation wasn't there.
Easy solution to that. I'm in absolute heaven with this feature...
Eclipse 3.3 with CDT has an automatic code formatting feature, Ctrl +Shift+F, my favorite keyboard shortcut now. =)
May want to load some files into that and run that over the file to instantly clean up stuff like that. You can tweak the code style to your liking too.
Stephan
On Monday 06 August 2007 12:52:08 Stephan Rose wrote:
Easy solution to that. I'm in absolute heaven with this feature...
Eclipse 3.3 with CDT has an automatic code formatting feature, Ctrl +Shift+F, my favorite keyboard shortcut now. =)
May want to load some files into that and run that over the file to instantly clean up stuff like that. You can tweak the code style to your liking too.
Is there an option to make git commit ignore whitespace-only changes? Otherwise you'll be in hell of a mess trying to commit your changes. Formatting-only patches usually aren't accepted.
Cheers, Kai