[Matroska-devel] Re: Matroska-devel Digest, Vol 17, Issue 22

Moritz Bunkus moritz at bunkus.org
Sat Sep 25 10:48:06 CEST 2004


Hey,

> I got the output:
> ---
> ...
> |    + ChapterString: Faithless_We Come 1 (Rollo & Sister Bliss Remix)_02
> ...
> |   + ChapterAtom
> ...
> |    + ChapterTimeStart: 00:05:44.360000000
> ...
> |     + ChapterString: INDEX 00
> ...
> |    + ChapterTimeStart: 00:05:47.493333333
> ...
> |    + ChapterTimeStart: 00:05:47.506666666
> ...
> |     + ChapterString: INDEX 02
> ...
> |    + ChapterTimeStart: 00:05:49.493333333
> ...
> |     + ChapterString: INDEX 03
> ...
> |    + ChapterTimeStart: 00:05:53.493333333
> ...
> |     + ChapterString: INDEX 04
> ...
> |    + ChapterTimeStart: 00:05:57.493333333
> ...
> |     + ChapterString: INDEX 05
> ...
> ---
> 
> Is this ok? I haven't tested it much yet, but it's rather simple.

Looks fine, yes.

> Also, regarding coding standards, specifically indentation in the code, 
> replacing tabs with two spaces, adding spaces for nested parantheses to show 
> grouping, lining code up for legibility etc. 

Two spaces indentation, no tabs, parenthesis on the same line:

if (...) {
 ...
} else {
  ...
}

Not more than one "instruction" per line, not something like:

if (...) return 0;

but

if (...)
  return 0;

Lines not longer than 79 chars, indent function arguments at the opening
parenthesis...

This is basically emacs's indentation with
(c-set-offset 'case-label '+)
(setq default-tab-width 2)
(setq tabs-always-indent nil)
(setq-default indent-tabs-mode nil)
...
(c-basic-offset 2)
(standard-indent 2)
...

> Are there any formal standards I should use before submitting the
> code? 

Not really, I'll look over the code and reformat if it doesn't match my
preferences. Don't hesitate to re-indent code e.g. if you put a "if ()
{...}' or a loop around it. My aim is readability, not 'least possible
changes in the SVN repo'.

> In addition, how strict should preconditions be considered: 
> should the calling function carry the responsibility for testing 
> preconditions, or should the called? 

Hmm, I don't really have anything formal on that, but I think I'm
relying on the calling function to hand over useful stuff. Well, often
enough the called function does some checks, but most of the time they
don't (e.g. check for NULL pointers).

Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds



More information about the Matroska-devel mailing list