Revision: 57011
http://sourceforge.net/p/brlcad/code/57011
Author: brlcad
Date: 2013-08-21 03:33:46 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
the naming rules aren't / weren't specific to just variables. we want to keep
things consistent for function names too.
Modified Paths:
--------------
brlcad/trunk/HACKING
Modified: brlcad/trunk/HACKING
===================================================================
--- brlcad/trunk/HACKING 2013-08-21 03:03:54 UTC (rev 57010)
+++ brlcad/trunk/HACKING 2013-08-21 03:33:46 UTC (rev 57011)
@@ -719,9 +719,8 @@
4) Names
-Prefer mixed-case names over underscore-separated ones. (this one is
-less important, as there are vast quantities of both in the code)
-Variable names should start with a lowercase letter.
+Variable and public API function names should almost always begin with
+a lowercase letter.
double localVariable; /* ok */
double LocalVariable; /* bad (looks like class or constructor) */
double _localVar; /* bad (looks like member variable) */
@@ -741,6 +740,17 @@
static const int MAX_READ = 2; /* ok */
static const int arraySize = 8; /* bad */
+Public API (global) function names are in lowercase with underscores
+to separate words. Most functions within the core libraries are named
+with the following convention: [library]_[group]_[action]
+ bu_vls_strcat()
+ bn_mat_transpose()
+
+Naming exceptions are allowed where the API intentionally mirrors some
+other familiar programming construct (e.g., bu_malloc()+bu_free()),
+but care should otherwise be taken to be as consistent as possible
+within a file and across a library's API.
+
5) Debugging
Compilation preprocessor defines should never change the size of
@@ -812,7 +822,8 @@
* Computes the answer to the meaning of life, the universe, and
* everything.
*/
-int the_answer()
+int
+the_answer(void)
{
return 42;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits