Hi!

At some point in the cgit source code, I see constructs like the
following from ui-repolist.c:32:

    static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime)

Though *repo is declared `const', you want to modify it, so you place
a "writable" version on the stack:

    struct cgit_repo *r = (struct cgit_repo *)repo;

IMO this breaks semantics; why not just declare the parameter `struct
cgit_repo *', so that it's clear the called function may (or indeed
does) modify it?

Julius

_______________________________________________
cgit mailing list
[email protected]
http://hjemli.net/mailman/listinfo/cgit

Reply via email to