spoolss: clear info on GetPrintProcessorDirectory error
[obnox/samba/samba-obnox.git] / README.Coding
index 12997ccf9addaa925f62d1622c5cb55f51aaa29e..0bbba9fc45e5fd756ff2b77df54e86a0cebeb607 100644 (file)
@@ -21,9 +21,10 @@ coding style (See Documentation/CodingStyle in the kernel source tree). This
 closely matches what most Samba developers use already anyways, with a few
 exceptions as mentioned below.
 
-The coding style for Python code is documented in PEP8, http://www.python.org/pep/pep8.
-If you have ever worked on another free software python project, you are probably
-already familiar with it.
+The coding style for Python code is documented in PEP8,
+http://www.python.org/pep/pep8 (with spaces). 
+If you have ever worked on another free software Python project, you are
+probably already familiar with it.
 
 But to save you the trouble of reading the Linux kernel style guide, here
 are the highlights.
@@ -363,3 +364,27 @@ Bad Example:
        ret = some_function_my_name(get_some_name());
        ...
 
+Control-Flow changing macros
+----------------------------
+
+Macros like NT_STATUS_NOT_OK_RETURN that change control flow
+(return/goto/etc) from within the macro are considered bad, because
+they look like function calls that never change control flow. Please
+do not use them in new code.
+
+The only exception is the test code that depends repeated use of calls
+like CHECK_STATUS, CHECK_VAL and others.
+
+
+Function names in DEBUG statements
+----------------------------------
+
+Many DEBUG statements contain the name of the function they appear in. This is
+not a good idea, as this is prone to bitrot. Function names change, code
+moves, but the DEBUG statements are not adapted. Use %s and __func__ for this:
+
+Bad Example:
+       DEBUG(0, ("strstr_m: src malloc fail\n"));
+
+Good Example:
+       DEBUG(0, ("%s: src malloc fail\n", __func__));