icode cleanup + style, functionally equivalent - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70 hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70 1Log /scm/stagit-gopher/log.gph bitreich.org 70 1Files /scm/stagit-gopher/files.gph bitreich.org 70 1Refs /scm/stagit-gopher/refs.gph bitreich.org 70 1Tags /scm/stagit-gopher/tag bitreich.org 70 1README /scm/stagit-gopher/file/README.gph bitreich.org 70 1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit c13c4119501291e5c276d4d1217491b16a2a7ff9 /scm/stagit-gopher/commit/c13c4119501291e5c276d4d1217491b16a2a7ff9.gph bitreich.org 70 1parent 254f215e5007592127b9e760a01bd1747e1cf71e /scm/stagit-gopher/commit/254f215e5007592127b9e760a01bd1747e1cf71e.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Sun, 1 May 2016 14:09:42 +0200 Err bitreich.org 70 i Err bitreich.org 70 icode cleanup + style, functionally equivalent Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M stagit-index.c | 2 +- Err bitreich.org 70 i M stagit.c | 30 +++++++++++------------------- Err bitreich.org 70 i Err bitreich.org 70 i2 files changed, 12 insertions(+), 20 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/stagit-index.c b/stagit-index.c /scm/stagit-gopher/file/stagit-index.c.gph bitreich.org 70 i@@ -92,11 +92,11 @@ writefooter(FILE *fp) Err bitreich.org 70 i int Err bitreich.org 70 i writelog(FILE *fp) Err bitreich.org 70 i { Err bitreich.org 70 i- char *stripped_name = NULL, *p; Err bitreich.org 70 i git_commit *commit = NULL; Err bitreich.org 70 i const git_signature *author; Err bitreich.org 70 i git_revwalk *w = NULL; Err bitreich.org 70 i git_oid id; Err bitreich.org 70 i+ char *stripped_name = NULL, *p; Err bitreich.org 70 i int ret = 0; Err bitreich.org 70 i Err bitreich.org 70 i git_revwalk_new(&w, repo); Err bitreich.org 70 1diff --git a/stagit.c b/stagit.c /scm/stagit-gopher/file/stagit.c.gph bitreich.org 70 i@@ -141,7 +141,6 @@ commitinfo_free(struct commitinfo *ci) Err bitreich.org 70 i Err bitreich.org 70 i if (!ci) Err bitreich.org 70 i return; Err bitreich.org 70 i- Err bitreich.org 70 i if (ci->deltas) Err bitreich.org 70 i for (i = 0; i < ci->ndeltas; i++) Err bitreich.org 70 i deltainfo_free(ci->deltas[i]); Err bitreich.org 70 i@@ -158,15 +157,13 @@ commitinfo_getbyoid(const git_oid *id) Err bitreich.org 70 i { Err bitreich.org 70 i struct commitinfo *ci; Err bitreich.org 70 i git_diff_options opts; Err bitreich.org 70 i- const git_oid *oid; Err bitreich.org 70 i- int error; Err bitreich.org 70 i Err bitreich.org 70 i if (!(ci = calloc(1, sizeof(struct commitinfo)))) Err bitreich.org 70 i err(1, "calloc"); Err bitreich.org 70 i Err bitreich.org 70 i- ci->id = id; Err bitreich.org 70 i if (git_commit_lookup(&(ci->commit), repo, id)) Err bitreich.org 70 i goto err; Err bitreich.org 70 i+ ci->id = id; Err bitreich.org 70 i Err bitreich.org 70 i git_oid_tostr(ci->oid, sizeof(ci->oid), git_commit_id(ci->commit)); Err bitreich.org 70 i git_oid_tostr(ci->parentoid, sizeof(ci->parentoid), git_commit_parent_id(ci->commit, 0)); Err bitreich.org 70 i@@ -175,12 +172,10 @@ commitinfo_getbyoid(const git_oid *id) Err bitreich.org 70 i ci->summary = git_commit_summary(ci->commit); Err bitreich.org 70 i ci->msg = git_commit_message(ci->commit); Err bitreich.org 70 i Err bitreich.org 70 i- oid = git_commit_tree_id(ci->commit); Err bitreich.org 70 i- if ((error = git_tree_lookup(&(ci->commit_tree), repo, oid))) Err bitreich.org 70 i+ if (git_tree_lookup(&(ci->commit_tree), repo, git_commit_tree_id(ci->commit))) Err bitreich.org 70 i goto err; Err bitreich.org 70 i- if (!(error = git_commit_parent(&(ci->parent), ci->commit, 0))) { Err bitreich.org 70 i- oid = git_commit_tree_id(ci->parent); Err bitreich.org 70 i- if ((error = git_tree_lookup(&(ci->parent_tree), repo, oid))) { Err bitreich.org 70 i+ if (!git_commit_parent(&(ci->parent), ci->commit, 0)) { Err bitreich.org 70 i+ if (git_tree_lookup(&(ci->parent_tree), repo, git_commit_tree_id(ci->parent))) { Err bitreich.org 70 i ci->parent = NULL; Err bitreich.org 70 i ci->parent_tree = NULL; Err bitreich.org 70 i } Err bitreich.org 70 i@@ -188,9 +183,8 @@ commitinfo_getbyoid(const git_oid *id) Err bitreich.org 70 i Err bitreich.org 70 i git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION); Err bitreich.org 70 i opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; Err bitreich.org 70 i- if ((error = git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts))) Err bitreich.org 70 i+ if (git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts)) Err bitreich.org 70 i goto err; Err bitreich.org 70 i- Err bitreich.org 70 i if (commitinfo_getstats(ci) == -1) Err bitreich.org 70 i goto err; Err bitreich.org 70 i Err bitreich.org 70 i@@ -423,8 +417,7 @@ printshowfile(FILE *fp, struct commitinfo *ci) Err bitreich.org 70 i const git_diff_hunk *hunk; Err bitreich.org 70 i const git_diff_line *line; Err bitreich.org 70 i git_patch *patch; Err bitreich.org 70 i- size_t nhunks, nhunklines, changed, add, del, total; Err bitreich.org 70 i- size_t i, j, k; Err bitreich.org 70 i+ size_t nhunks, nhunklines, changed, add, del, total, i, j, k; Err bitreich.org 70 i char linestr[80]; Err bitreich.org 70 i Err bitreich.org 70 i printcommit(fp, ci); Err bitreich.org 70 i@@ -652,7 +645,7 @@ writeatom(FILE *fp) Err bitreich.org 70 i struct commitinfo *ci; Err bitreich.org 70 i git_revwalk *w = NULL; Err bitreich.org 70 i git_oid id; Err bitreich.org 70 i- size_t i, m = 100; /* max */ Err bitreich.org 70 i+ size_t i, m = 100; /* last 'm' commits */ Err bitreich.org 70 i Err bitreich.org 70 i fputs("\n" Err bitreich.org 70 i "\n", fp); Err bitreich.org 70 i@@ -682,8 +675,7 @@ writeatom(FILE *fp) Err bitreich.org 70 i int Err bitreich.org 70 i writeblob(git_object *obj, const char *fpath, const char *filename, git_off_t filesize) Err bitreich.org 70 i { Err bitreich.org 70 i- char tmp[PATH_MAX] = ""; Err bitreich.org 70 i- char *d; Err bitreich.org 70 i+ char tmp[PATH_MAX] = "", *d; Err bitreich.org 70 i const char *p; Err bitreich.org 70 i int lc = 0; Err bitreich.org 70 i FILE *fp; Err bitreich.org 70 i@@ -772,10 +764,10 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path) Err bitreich.org 70 i { Err bitreich.org 70 i const git_tree_entry *entry = NULL; Err bitreich.org 70 i git_submodule *module = NULL; Err bitreich.org 70 i- const char *entryname; Err bitreich.org 70 i- char filepath[PATH_MAX], entrypath[PATH_MAX]; Err bitreich.org 70 i git_object *obj = NULL; Err bitreich.org 70 i git_off_t filesize; Err bitreich.org 70 i+ const char *entryname; Err bitreich.org 70 i+ char filepath[PATH_MAX], entrypath[PATH_MAX]; Err bitreich.org 70 i size_t count, i; Err bitreich.org 70 i int lc, r, ret; Err bitreich.org 70 i Err bitreich.org 70 i@@ -889,7 +881,7 @@ writerefs(FILE *fp) Err bitreich.org 70 i git_reference *dref = NULL, *r, *ref = NULL; Err bitreich.org 70 i git_reference_iterator *it = NULL; Err bitreich.org 70 i git_reference **refs = NULL; Err bitreich.org 70 i- size_t count, i, j, refcount = 0; Err bitreich.org 70 i+ size_t count, i, j, refcount; Err bitreich.org 70 i const char *titles[] = { "Branches", "Tags" }; Err bitreich.org 70 i const char *ids[] = { "branches", "tags" }; Err bitreich.org 70 i const char *name; Err bitreich.org 70 .