From 231a7b676c93b98bc01257806d9c9a2f222eb162 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Sun, 4 Jan 2009 17:26:59 +0000 Subject: [PATCH] - Try to match style(9). - Remove old comments. --- contrib/csup/detailer.c | 4 +-- contrib/csup/rcsfile.c | 69 +++++++++++++++++------------------------ contrib/csup/updater.c | 9 +++--- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/contrib/csup/detailer.c b/contrib/csup/detailer.c index c03d6d239c96..559265555674 100644 --- a/contrib/csup/detailer.c +++ b/contrib/csup/detailer.c @@ -532,7 +532,7 @@ detailer_checkrcsattr(struct detailer *d, struct coll *coll, char *name, char *attr, *path; int error; - /* + /* * I don't think we can use the status file, since it only records file * attributes in cvsmode. */ @@ -572,7 +572,7 @@ detailer_send_details(struct detailer *d, struct coll *coll, char *name, int error; size_t len; - /* + /* * Try to check if the file exists either live or dead to see if we can * edit it and put it live or dead, rather than receiving the entire * file. diff --git a/contrib/csup/rcsfile.c b/contrib/csup/rcsfile.c index 00ed23e05a95..6a111b02797d 100644 --- a/contrib/csup/rcsfile.c +++ b/contrib/csup/rcsfile.c @@ -123,7 +123,6 @@ struct rcsfile { struct branch *trunk; /* The tip delta. */ LIST_HEAD(, delta) deltatable; - LIST_HEAD(, delta) deltatable_dates; char *desc; }; @@ -144,7 +143,6 @@ static struct stream *rcsfile_getdeltatext(struct rcsfile *, struct delta *, static void rcsdelta_writestring(char *, size_t, struct stream *); static void rcsdelta_insertbranch(struct delta *, struct branch *); - /* Space formatting of RCS file. */ const char *head_space = "\t"; const char *branch_space = "\t"; @@ -408,12 +406,6 @@ rcsfile_write(struct rcsfile *rf, struct stream *dest) stream_printf(dest, "desc\n@@"); d = LIST_FIRST(&rf->trunk->deltalist); - /* - * XXX: We do not take as much care as cvsup to cope with hand-hacked - * RCS-files, and therefore we'll just let them be updated. If having - * them correct is important, it will be catched by the checksum anyway. - */ - /* Write out deltatexts. */ error = rcsfile_write_deltatext(rf, dest); stream_printf(dest, "\n"); @@ -815,10 +807,6 @@ rcsfile_freedelta(struct delta *d) buf_free(d->text); /* Free all subbranches of a delta. */ - /* XXX: Is this ok? Since the branchpoint is removed, there is no good - * reason for the branch to exists, but we might still have deltas in - * these branches. - */ while (!LIST_EMPTY(&d->branchlist)) { b = LIST_FIRST(&d->branchlist); LIST_REMOVE(b, branch_next); @@ -903,7 +891,7 @@ rcsfile_deletetag(struct rcsfile *rf, char *tag, char *revnum) } } -/* +/* * Searches the global deltalist for a delta. */ struct delta * @@ -925,38 +913,38 @@ rcsfile_setval(struct rcsfile *rf, int field, char *val) size_t len; switch (field) { - case RCSFILE_HEAD: - if (rf->head != NULL) - free(rf->head); - rf->head = xstrdup(val); + case RCSFILE_HEAD: + if (rf->head != NULL) + free(rf->head); + rf->head = xstrdup(val); break; - case RCSFILE_BRANCH: - if (rf->branch != NULL) - free(rf->branch); - rf->branch = (val == NULL) ? NULL : xstrdup(val); + case RCSFILE_BRANCH: + if (rf->branch != NULL) + free(rf->branch); + rf->branch = (val == NULL) ? NULL : xstrdup(val); break; - case RCSFILE_STRICT: - if (val != NULL) - rf->strictlock = 1; + case RCSFILE_STRICT: + if (val != NULL) + rf->strictlock = 1; break; - case RCSFILE_COMMENT: - if (rf->comment != NULL) - free(rf->comment); - rf->comment = xstrdup(val); + case RCSFILE_COMMENT: + if (rf->comment != NULL) + free(rf->comment); + rf->comment = xstrdup(val); break; - case RCSFILE_EXPAND: - len = strlen(val) - 1; - val++; - val[len - 1] = '\0'; - rf->expand = keyword_decode_expand(val); + case RCSFILE_EXPAND: + len = strlen(val) - 1; + val++; + val[len - 1] = '\0'; + rf->expand = keyword_decode_expand(val); break; - case RCSFILE_DESC: - if (rf->desc != NULL) - free(rf->desc); - rf->desc = xstrdup(val); + case RCSFILE_DESC: + if (rf->desc != NULL) + free(rf->desc); + rf->desc = xstrdup(val); break; - default: - lprintf(-1, "Setting invalid RCSfile value.\n"); + default: + lprintf(-1, "Setting invalid RCSfile value.\n"); break; } } @@ -1123,10 +1111,9 @@ rcsfile_importdelta(struct rcsfile *rf, char *revnum, char *revdate, char *autho rcsfile_insertdelta(b, d, 1); else { rcsfile_insertdelta(b, d, 0); - /* + /* * On import we need to set the diffbase to our * branchpoint for writing out later. - * XXX: this could perhaps be done at a better time. */ if (LIST_FIRST(&b->deltalist) == d) { brev = rcsrev_prefix(d->revnum); diff --git a/contrib/csup/updater.c b/contrib/csup/updater.c index d73775bed3e3..3dc10c59c9b8 100644 --- a/contrib/csup/updater.c +++ b/contrib/csup/updater.c @@ -613,7 +613,7 @@ updater_docoll(struct updater *up, struct file_update *fup, int isfixups) return (error); break; case 'I': - /* + /* * Create directory and add DirDown entry in status * file. */ @@ -661,7 +661,7 @@ updater_docoll(struct updater *up, struct file_update *fup, int isfixups) } break; case 'J': - /* + /* * Set attributes of directory and update DirUp entry in * status file. */ @@ -802,7 +802,8 @@ updater_docoll(struct updater *up, struct file_update *fup, int isfixups) name = proto_get_ascii(&line); attr = proto_get_ascii(&line); pos = proto_get_ascii(&line); - if (name == NULL || attr == NULL || pos == NULL || line != NULL) + if (name == NULL || attr == NULL || pos == NULL || + line != NULL) return (UPDATER_ERR_PROTO); error = fup_prepare(fup, name, 0); fup->temppath = tempname(fup->destpath); @@ -1050,7 +1051,7 @@ updater_setdirattrs(struct updater *up, struct coll *coll, fup->temppath, fup->destpath, strerror(errno)); return (UPDATER_ERR_MSG); } - /* + /* * Now, make sure they were set and record what was set in the status * file. */