aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2001-02-09 00:28:59 +0000
committerMark Whitley <markw@lineo.com>2001-02-09 00:28:59 +0000
commitd238a7bcc8412bb1ccc008d1e005007ed500e35b (patch)
tree96aff363d6774c2a8ac01b11936451a400fd499d
parent1d7026745028982980d17b1023c4ce8ec97ea946 (diff)
downloadbusybox-w32-d238a7bcc8412bb1ccc008d1e005007ed500e35b.tar.gz
busybox-w32-d238a7bcc8412bb1ccc008d1e005007ed500e35b.tar.bz2
busybox-w32-d238a7bcc8412bb1ccc008d1e005007ed500e35b.zip
Minor cleanups and clarifications.
-rw-r--r--docs/style-guide.txt24
1 files changed, 16 insertions, 8 deletions
diff --git a/docs/style-guide.txt b/docs/style-guide.txt
index ee7547f28..04fa5ef97 100644
--- a/docs/style-guide.txt
+++ b/docs/style-guide.txt
@@ -322,7 +322,12 @@ functions, (or *maybe* macros), which are used in the code.
322 322
323 (in .h header file) 323 (in .h header file)
324 324
325 #ifndef BB_FEATURE_FUNKY 325 #ifdef BB_FEATURE_FUNKY
326 static inline void maybe_do_funky_stuff (int bar, int baz)
327 {
328 /* lotsa code in here */
329 }
330 #else
326 static inline void maybe_do_funky_stuff (int bar, int baz) {} 331 static inline void maybe_do_funky_stuff (int bar, int baz) {}
327 #endif 332 #endif
328 333
@@ -334,7 +339,7 @@ functions, (or *maybe* macros), which are used in the code.
334 maybe_do_funky_stuff(bar, baz); 339 maybe_do_funky_stuff(bar, baz);
335 340
336The great thing about this approach is that the compiler will optimize away 341The great thing about this approach is that the compiler will optimize away
337the "no-op" case when the feature is turned off. 342the "no-op" case (the empty function) when the feature is turned off.
338 343
339Note also the use of the word 'maybe' in the function name to indicate 344Note also the use of the word 'maybe' in the function name to indicate
340conditional execution. 345conditional execution.
@@ -448,11 +453,14 @@ assigning them to a global pointer thusly:
448 453
449This last approach has some advantages (low code size, space not used until 454This last approach has some advantages (low code size, space not used until
450it's needed), but can be a problem in some low resource machines that have 455it's needed), but can be a problem in some low resource machines that have
451very limited stack space (e.g., uCLinux). busybox.h declares a macro that 456very limited stack space (e.g., uCLinux).
452implements compile-time selection between xmalloc() and stack creation, so 457
453you can code the line in question as 458A macro is declared in busybox.h that implements compile-time selection
459between xmalloc() and stack creation, so you can code the line in question as
460
454 RESERVE_BB_BUFFER(buffer, BUFSIZ); 461 RESERVE_BB_BUFFER(buffer, BUFSIZ);
455and the right thing will happen, based on the customer's configuration. 462
463and the right thing will happen, based on your configuration.
456 464
457 465
458 466
@@ -608,8 +616,8 @@ It'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 616to the mailing list, and especially before you commit a change to CVS. Here
609are some guildlines on testing your changes. 617are some guildlines on testing your changes.
610 618
611 - Always test busybox grep against GNU grep and make sure the behavior / 619 - Always test busybox applets against GNU counterparts and make sure the
612 output is identical between the two. 620 behavior / output is identical between the two.
613 621
614 - Try several different permutations and combinations of the features you're 622 - 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 623 adding and make sure they all work. (Make sure one feature does not