Revision 15271,
1.2 KB
checked in by ghudson, 24 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r15270,
which included commits to RCS files with non-trunk default branches.
|
Line | |
---|
1 | These are just some suggestions, not hard and fast rules. However, |
---|
2 | following them makes everyone's life easier (IMHO). |
---|
3 | -- Elliot |
---|
4 | |
---|
5 | --------------------------------------------------------- |
---|
6 | |
---|
7 | Functions should return 0 upon success, and an error code upon failure |
---|
8 | |
---|
9 | Use the glib types whenever appropriate. |
---|
10 | |
---|
11 | Use the g_new/g_new0/g_malloc/g_strdup/g_free functions. Use |
---|
12 | GMemChunk's whenever possible, especially when allocating lots of |
---|
13 | fixed-size memory blocks (see allocators.h and allocator-defs.h for memory chunk stuff). |
---|
14 | |
---|
15 | If you have both a structure and a typedef mapping onto that structure, name the |
---|
16 | structure typename_struct, e.g. |
---|
17 | struct MyType_struct { ... }; |
---|
18 | typedef struct MyType_struct MyType; |
---|
19 | <Aside: it's nice to do this if you can, but I'm not sure the CORBA spec |
---|
20 | allows us to do it for IDL structures translated into the C mapping...? |
---|
21 | Does the CORBA spec require |
---|
22 | |
---|
23 | typedef struct foo { |
---|
24 | } foo; |
---|
25 | |
---|
26 | ? |
---|
27 | > |
---|
28 | |
---|
29 | Macros should be in uppercase as much as is sane, to distinguish them |
---|
30 | from regular functions. |
---|
31 | |
---|
32 | If you can, use the _ to separate parts of a function name |
---|
33 | (ORBit_typename_foo instead of ORBitTypenameFoo() ). |
---|
34 | |
---|
35 | If possible, name functions of the form: |
---|
36 | namespace_typename_method() |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.