summaryrefslogtreecommitdiff
path: root/CODING_STYLE
Commit message (Collapse)AuthorAgeFilesLines
* update CODING_STYLELennart Poettering2015-10-061-1/+5
|
* update CODING_STYLE with various additionsLennart Poettering2015-10-011-0/+17
|
* tree-wide: never use the off_t unless glibc makes us use itLennart Poettering2015-09-101-0/+10
| | | | | | | | | | | off_t is a really weird type as it is usually 64bit these days (at least in sane programs), but could theoretically be 32bit. We don't support off_t as 32bit builds though, but still constantly deal with safely converting from off_t to other types and back for no point. Hence, never use the type anymore. Always use uint64_t instead. This has various benefits, including that we can expose these values directly as D-Bus properties, and also that the values parse the same in all cases.
* CODING_STYLE: mandate alphabetical include orderDavid Herrmann2015-09-051-19/+9
| | | | | | | | | | | | | | | | | | | | systemd-internal headers must not rely on include order. That means, they either must contain forward-declarations of used types/functions, or they must include all dependencies on their own. Therefore, there is no reason to mandate an include order on the call-side. However, global includes should always be ordered first. We don't want local definitions to leak into global includes, possible changing their behavior. Apparently, namespacing is a complex problem that people are incapable of implementing properly.. Apart from "global before local", there is no reason to mandate a random include order (which we happen to do right now). Instead, mandate alphabetical ordering. The current rules do not have any benefit at all. They neither reduce include-complexity, nor allow easy auditing of include files. But with alphabetical ordering, we get duplicate-detection for free, it gets *much much* easier to figure out whether a header is already included, and it is trivial to add new headers.
* CODING_STYLE: say that "for (;;)" is better than "while (1)"Lennart Poettering2015-07-311-0/+7
|
* Stop talking about the "XDG" version of basename()Simon McVittie2015-06-171-3/+4
| | | | | | | | | | | | | | | | XDG refers to X Desktop Group, a former name for freedesktop.org. This group is responsible for specifications like basedirs, .desktop files and icon naming, but as far as I know, it has never tried to redefine basename(). I think these references were meant to say XPG (X/Open Portability Guide), a precursor of POSIX. POSIX is better-known and less easily confused with XDG, and is how the basename(3) man page describes the libgen.h version of basename(). The other version of basename() is glibc-specific and is described in basename(3) as "the GNU version"; specifically mention that version, to disambiguate.
* CODING_STYLE: document order in which to #include headersLennart Poettering2015-05-291-0/+21
|
* CODING_STYLE: document that we should avoid kernel types like u32Lennart Poettering2015-05-181-1/+3
|
* CODING_STYLE: document that EXIT_FAILURE and EXIT_SUCCESS should be usedLennart Poettering2015-05-151-0/+3
|
* CODING_STYLE: document best practices when initializing structsLennart Poettering2015-05-151-0/+18
|
* CODING_STYLE: document alloca() DONTSLennart Poettering2015-05-151-1/+11
|
* CODING_STYLE: document that we prefer /* comments */ over // commentsLennart Poettering2015-04-221-0/+4
|
* CODING_STYLE: document how destructors should workLennart Poettering2015-04-211-0/+16
|
* CODING_STYLE: mention that dup() should not be usedLennart Poettering2015-04-031-0/+7
|
* CODING_STYLE: clarify that exit() is never OK to callLennart Poettering2015-04-021-0/+6
|
* CODING_STYLE: mention casting of function invocations to (void)Lennart Poettering2015-03-101-0/+14
|
* update TODOLennart Poettering2015-02-281-0/+4
|
* tree-wide: whenever we include libgen.h, immediately undefine basename()Lennart Poettering2015-02-111-0/+6
| | | | Also, document in adjacent comments and in CODING_STYLE why we do that.
* CODING_STYLE: elaborate on O_CLOEXEC a bitLennart Poettering2015-02-101-1/+7
|
* Reindent man pages to 2chZbigniew Jędrzejewski-Szmek2015-02-031-1/+2
|
* CODING_STYLE: clarify that we really should use O_CLOEXEC everywhereLennart Poettering2014-10-301-0/+5
|
* CODING_STYLE: don't clobber arguments on failureLennart Poettering2014-10-271-1/+5
|
* CODING_STYLE: clarify that single-line if blocks should not be enclosed in {}Lennart Poettering2014-10-221-2/+13
|
* Fix a few more typosRuben Kerkhof2014-08-301-1/+1
|
* CODING_STYLE: document that we don't break lines at 80chLennart Poettering2014-08-211-1/+4
|
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-031-0/+5
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* doc: use expanded forms for written styleJan Engelhardt2014-06-281-12/+12
|
* doc: typographical improvements and choice of wordsJan Engelhardt2014-06-281-5/+5
|
* doc: grammatical correctionsJan Engelhardt2014-06-281-12/+12
|
* Fix several small typosJonathan Boulle2014-05-241-1/+1
|
* extend CODING_STYLE document a bitLennart Poettering2013-12-091-17/+63
|
* trivial coding style clean upsThomas Hindoe Paaboel Andersen2013-12-031-1/+1
| | | | | | | | | | | | | | - Add space between if/for and the opening parentheses - Place the opening brace on same line as the function (not for udev) From the CODING_STYLE Try to use this: void foo() { } instead of this: void foo() { }
* analyze: various cleanupsLennart Poettering2013-03-081-9/+105
| | | | | | | | | | | | | | | | | | Update systemd-analyze to follow the coding style of the other tools more closely. Also, update the CODING_STYLE to document this for future additions. Changes: - Always use usec_t for time units, so that we always use the same types everywhere, and format times the same way as everywhere else. - Add "static" to global variables - Make sure we can always distuingish OOM and other errors: ensure we always return useful error codes from all functions. - Always free unit_times array
* Clarify sentenceTollef Fog Heen2013-01-291-1/+1
|
* Minor typoTollef Fog Heen2012-10-011-1/+1
|
* Be consistent about "." vs no "." at the end of lines"Tollef Fog Heen2012-10-011-4/+4
|
* Spelling CorrectionsHarald Hoyer2011-02-281-1/+1
| | | | Just some lame spelling corrections with no functionality.
* CODING_STYLE: minor updatesLennart Poettering2010-02-141-0/+11
|
* CODING_STYLE: add missing -Lennart Poettering2009-11-181-1/+1
|
* initial commitLennart Poettering2009-11-181-0/+16