[freeciv-ai] (PR#7342) cm patch: heap-allocate the combinations
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7342 >
A note on style:
- Put spaces in between just about all elements, even when it makes
things uglier. E.g., do x[i - 1] rather than x[i-1].
- Use x++ instead of ++x in situations where it doesn't matter (just for
consistency).
- Don't cast the result of alloc calls. E.g.
int *x = malloc(sizeof(*x));
rather than
int *x = (int *)malloc(sizeof(int));
- Use variables instead of types in sizeof calls wherever possible. In
most cases this is more robust since the type's name may change. (See
the last example).
Hmm, that's probably it. (Perhaps some of this isn't just style but is
actually technical. But I think it's all in the docs somewhere.)
jason
|
|