Mercurial > geeqie
comparison CODING @ 611:f31ae0d9e163
Update CODING and HACKING files, and add po/README file for translators.
author | zas_ |
---|---|
date | Fri, 09 May 2008 08:03:25 +0000 |
parents | 86f4c42afeab |
children | f20e7cebcb12 |
comparison
equal
deleted
inserted
replaced
610:33a375d16181 | 611:f31ae0d9e163 |
---|---|
1 Please keep the general coding style of Geeqie: | 1 Please keep the general coding style of Geeqie: |
2 | 2 |
3 Space after if, while and for: | 3 Space after if, while and for: |
4 ------------------------------ | |
4 | 5 |
5 while (...) | 6 while (...) |
6 for (...) | 7 for (...) |
7 if (...) | 8 if (...) |
8 | 9 |
9 Indentation of {}: | 10 Indentation of {}: |
11 ------------------ | |
10 | 12 |
11 while (...) | 13 while (...) |
12 { | 14 { |
13 ... | 15 ... |
14 } | 16 } |
21 { | 23 { |
22 ... | 24 ... |
23 } | 25 } |
24 | 26 |
25 Spaces around operators: | 27 Spaces around operators: |
28 ------------------------ | |
26 | 29 |
27 i = 2; | 30 i = 2; |
31 x = i * (j / 2); | |
32 | |
28 | 33 |
29 Space after comma: | 34 Space after comma: |
35 ------------------ | |
30 func(a, b, c); | 36 func(a, b, c); |
31 | 37 |
32 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()). | 38 Functions without any parameter should be declared using void: |
39 -------------------------------------------------------------- | |
40 gint function(void) | |
41 { | |
42 ... | |
43 } | |
44 | |
45 Use glib types: | |
46 --------------- | |
33 Please use glib types when possible (ie. gint and gchar instead of int and char) | 47 Please use glib types when possible (ie. gint and gchar instead of int and char) |
34 . | 48 . |
35 | 49 |
50 Use glib functions: | |
51 ------------------- | |
52 Use glib functions when possible (ie. g_ascii_isspace() instead of isspace()). | |
53 Check if used functions are not deprecated. | |
54 | |
55 Others: | |
56 ------- | |
36 Check twice the indentation and spurious whitespaces. | 57 Check twice the indentation and spurious whitespaces. |
37 | 58 |
38 Try to use explicit variable and function names | 59 Try to use explicit variable and function names. |