aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-02-03 00:20:14 +0000
committerMark Whitley <markw@lineo.com>2001-02-03 00:20:14 +0000
commit925edb828df9665714d2ce71a6ef8242bbf4eb15 (patch)
tree68168437ab047f5ca43131ad9a890744b0d5be62
parentc3fc3c5e7a35f96f23a543d0886b5297c49d565c (diff)
downloadbusybox-w32-925edb828df9665714d2ce71a6ef8242bbf4eb15.tar.gz
busybox-w32-925edb828df9665714d2ce71a6ef8242bbf4eb15.tar.bz2
busybox-w32-925edb828df9665714d2ce71a6ef8242bbf4eb15.zip
Added some more on paren spacing and a section on testing guidelines.
-rw-r--r--docs/style-guide.txt40
1 files changed, 38 insertions, 2 deletions
diff --git a/docs/style-guide.txt b/docs/style-guide.txt
index 1a04e4474..ee7547f28 100644
--- a/docs/style-guide.txt
+++ b/docs/style-guide.txt
@@ -107,23 +107,26 @@ between it and the opening control block statement. Examples:
107 Don't do this either: 107 Don't do this either:
108 108
109 while (!done){ 109 while (!done){
110
110 do{ 111 do{
111 112
112 And for heaven's sake, don't do this: 113 And for heaven's sake, don't do this:
113 114
114 while (!done) 115 while (!done)
115 { 116 {
117
116 do 118 do
117 { 119 {
118 120
119 Do this instead: 121 Do this instead:
120 122
121 while (!done) { 123 while (!done) {
124
122 do { 125 do {
123 126
124 127
125Paren Spacing 128Spacing around Parentheses
126~~~~~~~~~~~~~ 129~~~~~~~~~~~~~~~~~~~~~~~~~~
127 130
128Put a space between C keywords and left parens, but not between 131Put a space between C keywords and left parens, but not between
129function names and the left paren that starts it's parameter list (whether it 132function names and the left paren that starts it's parameter list (whether it
@@ -145,6 +148,19 @@ is being declared or called). Examples:
145 ... 148 ...
146 baz = my_func(1, 2); 149 baz = my_func(1, 2);
147 150
151Also, don't put a space between the left paren and the first term, nor between
152the last arg and the right paren.
153
154 Don't do this:
155
156 if ( x < 1 )
157 strcmp( thisstr, thatstr )
158
159 Do this instead:
160
161 if (x < 1)
162 strcmp(thisstr, thatstr)
163
148 164
149Cuddled Elses 165Cuddled Elses
150~~~~~~~~~~~~~ 166~~~~~~~~~~~~~
@@ -583,3 +599,23 @@ illustrates emphasizing logical blocks:
583 /* clean up */ 599 /* clean up */
584 free(line); 600 free(line);
585 } 601 }
602
603
604Testing Guidelines
605~~~~~~~~~~~~~~~~~~
606
607It's considered good form to test your new feature before you submit a patch
608to the mailing list, and especially before you commit a change to CVS. Here
609are some guildlines on testing your changes.
610
611 - Always test busybox grep against GNU grep and make sure the behavior /
612 output is identical between the two.
613
614 - Try several different permutations and combinations of the features you're
615 adding and make sure they all work. (Make sure one feature does not
616 interfere with another, etc.)
617
618 - Make sure you test compiling against the source both with the feature
619 turned on and turned off in Config.h and make sure busybox compiles cleanly
620 both ways.
621