diff options
Diffstat (limited to 'docs/development/submitting-patches.rst')
-rw-r--r-- | docs/development/submitting-patches.rst | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/docs/development/submitting-patches.rst b/docs/development/submitting-patches.rst index f8c8093c..fe2df431 100644 --- a/docs/development/submitting-patches.rst +++ b/docs/development/submitting-patches.rst @@ -78,78 +78,6 @@ C bindings More information on C bindings can be found in :doc:`the dedicated section of the documentation <c-bindings>`. -When binding C code with ``cffi`` we have our own style guide, it's pretty -simple. - -Don't name parameters: - -.. code-block:: c - - /* Good */ - long f(long); - /* Bad */ - long f(long x); - -...unless they're inside a struct: - -.. code-block:: c - - struct my_struct { - char *name; - int number; - ...; - }; - -Include ``void`` if the function takes no arguments: - -.. code-block:: c - - /* Good */ - long f(void); - /* Bad */ - long f(); - -Wrap lines at 80 characters like so: - -.. code-block:: c - - /* Pretend this went to 80 characters */ - long f(long, long, - int *) - -Include a space after commas between parameters: - -.. code-block:: c - - /* Good */ - long f(int, char *) - /* Bad */ - long f(int,char *) - -Use C-style ``/* */`` comments instead of C++-style ``//``: - -.. code-block:: c - - // Bad - /* Good */ - -Values set by ``#define`` should be assigned the appropriate type. If you see -this: - -.. code-block:: c - - #define SOME_INTEGER_LITERAL 0x0; - #define SOME_UNSIGNED_INTEGER_LITERAL 0x0001U; - #define SOME_STRING_LITERAL "hello"; - -...it should be added to the bindings like so: - -.. code-block:: c - - static const int SOME_INTEGER_LITERAL; - static const unsigned int SOME_UNSIGNED_INTEGER_LITERAL; - static const char *const SOME_STRING_LITERAL; - Tests ----- |