aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-09-03 18:50:17 +0000
committerGerald Combs <gerald@wireshark.org>2013-09-03 18:50:17 +0000
commitb5e4fd5a012193853dd32d149cad7969305e4a58 (patch)
tree74e5674ca62d956078fe67a6e8d8b39399a29ab7 /doc
parent4a226911daad922dcdd4e5fc0cdbee626493ee28 (diff)
Document the current state of naming in ui/qt. Say it's OK to use C++
comments in C++ code. svn path=/trunk/; revision=51739
Diffstat (limited to 'doc')
-rw-r--r--doc/README.developer9
-rw-r--r--doc/README.qt20
2 files changed, 24 insertions, 5 deletions
diff --git a/doc/README.developer b/doc/README.developer
index 0581df56be..4c5a85307c 100644
--- a/doc/README.developer
+++ b/doc/README.developer
@@ -72,10 +72,11 @@ different compilers; here are some rules for writing code that will work
on multiple platforms.
Don't use C++-style comments (comments beginning with "//" and running
-to the end of the line); Wireshark's dissectors are written in C, and
-thus run through C rather than C++ compilers, and not all C compilers
-support C++-style comments (GCC does, but IBM's C compiler for AIX, for
-example, doesn't do so by default).
+to the end of the line) in C code. Wireshark's dissectors are written in
+C, and thus run through C rather than C++ compilers, and not all C
+compilers support C++-style comments (GCC does, but IBM's C compiler for
+AIX, for example, doesn't do so by default). C++-style comments can be
+used in C++ code, of course.
In general, don't use C99 features since some C compilers used to compile
Wireshark don't support C99 (E.G. Microsoft C).
diff --git a/doc/README.qt b/doc/README.qt
index 7b9130503d..fd3490159f 100644
--- a/doc/README.qt
+++ b/doc/README.qt
@@ -149,7 +149,25 @@ DO NOT simply port things over. Every feature, window, and element should be
re-thought. For example, should the user have to navigate two dialogs to get
HTTP request statistics?
-2.1 Changes
+2.1 Coding guidelines
+
+2.1.1 Name conventions
+
+Most of the code in the ui/qt directory uses three APIs: Qt (which uses
+InterCapConvention), GLib (which uses underscore_convention), and the Wireshark
+API (which also uses underscore_convention). As a general rule Wireshark's Qt
+code uses InterCapConvention for class names and methods and
+underscore_convention for variables, with a trailing underscore for member
+variables.
+
+2.1.2 Mixing C and C++
+
+Sometimes we have to call C++ functions from one of Wireshark's C callbacks and
+pass C++ objects to or from C. The C++ FAQ describes how to do this safely:
+
+http://www.parashift.com/c++-faq/mixing-c-and-cpp.html
+
+2.2 Changes
- The display filter entry has been significantly reworked.