From 433eaef955c370142f0562414d1ae504758a1c4c Mon Sep 17 00:00:00 2001
From: William S Fulton
Date: Sat, 9 Dec 2006 08:39:22 +0000
Subject: [PATCH] Update for style guidelines
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9612 626c5289-ae23-0410-ae9c-e8d60b6d4f22
---
Doc/Devel/engineering.html | 9 +--------
Doc/Manual/Contents.html | 3 ++-
Doc/Manual/Extending.html | 27 +++++++++++++++++++++++++++
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/Doc/Devel/engineering.html b/Doc/Devel/engineering.html
index 43008e735..4fb266f2d 100644
--- a/Doc/Devel/engineering.html
+++ b/Doc/Devel/engineering.html
@@ -434,14 +434,7 @@ making your changes.
10. Miscellaneous Coding Guidelines
-
-
-- Do not use the ternary ?: operator. It is unnecessarily error prone,
-hard for people to read, and hard to maintain code that uses it.
-[I don't agree w/ this guideline. ?: operator can be abused
-just like everything else, but it can also be used cleanly. In some styles of
-programming, it is the best tool for the job. --ttn]
-
+These are largely covered in the main documentation in the Extending.html file.
11. CVS Tagging Conventions
diff --git a/Doc/Manual/Contents.html b/Doc/Manual/Contents.html
index 04acb08c1..83cf5a607 100644
--- a/Doc/Manual/Contents.html
+++ b/Doc/Manual/Contents.html
@@ -151,7 +151,7 @@
Linking to char *
Arrays
Creating read-only variables
-Renaming and ignoring declarations
+Renaming and ignoring declarations
Default/optional arguments
Pointers to functions and callbacks
@@ -1424,6 +1424,7 @@
Examples and test cases
Documentation
Prerequisites for adding a new language module to the SWIG distribution
+Coding style guidelines
Typemaps
Typemaps
@@ -3312,6 +3313,9 @@ details being outlined earlier on.
the language module.
+ Ensure your source code is formatted according to the coding style guidelines.
+
+
Finally, email the SWIG developers with a patch and a demonstration of
commitment to maintaining the language module,
certainly in the short term and ideally long term.
@@ -3326,6 +3330,29 @@ should be added should there be an area not already covered by
the existing tests.
+33.10.14 Coding style guidelines
+
+
+
+The coding guidelines for the C/C++ source code are pretty much K&R C style.
+The style can be inferred from the existing code base and is
+largely dictated by the indent code beautifier tool set to K&R style.
+The code can formatted using the make targets in the Source directory.
+Below is an example of how to format the emit.cxx file:
+
+
+
+
+$ cd Source
+$ make beautify-file INDENTFILE=Modules/emit.cxx
+
+
+
+
+Of particular note is indentation is set to 2 spaces and a tab is used instead of 8 spaces.
+The generated C/C++ code should also follow this style as close as possible. However, tabs
+should be avoided as unlike the SWIG developers, users will never have consistent tab settings.
+
33.11 Typemaps