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
This commit is contained in:
Gerald Combs 2013-09-03 18:50:17 +00:00
parent 4a226911da
commit b5e4fd5a01
2 changed files with 24 additions and 5 deletions

View File

@ -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).

View File

@ -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.