diff options
author | peter <peter@FreeBSD.org> | 2004-04-15 01:17:28 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2004-04-15 01:17:28 +0000 |
commit | 39ae581ddb391e383fd37d518ec522be89358f41 (patch) | |
tree | b312c05df2e7727eeb7186945c2c2e65f812ac05 /contrib/cvs/src/entries.c | |
parent | 3aa249bff61808355fd6b864b94fd531fd00b3b7 (diff) | |
download | FreeBSD-src-39ae581ddb391e383fd37d518ec522be89358f41.zip FreeBSD-src-39ae581ddb391e383fd37d518ec522be89358f41.tar.gz |
Initial merge of cvs-1.11.5 -> 1.11.15 changes onto mainline
Diffstat (limited to 'contrib/cvs/src/entries.c')
-rw-r--r-- | contrib/cvs/src/entries.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/contrib/cvs/src/entries.c b/contrib/cvs/src/entries.c index d506836..98cb006 100644 --- a/contrib/cvs/src/entries.c +++ b/contrib/cvs/src/entries.c @@ -27,6 +27,8 @@ static Entnode *subdir_record PROTO((int, const char *, const char *)); static FILE *entfile; static char *entfilename; /* for error messages */ + + /* * Construct an Entnode */ @@ -93,9 +95,7 @@ write_ent_proc (node, closure) Node *node; void *closure; { - Entnode *entnode; - - entnode = (Entnode *) node->data; + Entnode *entnode = node->data; if (closure != NULL && entnode->type != ENT_FILE) *(int *) closure = 1; @@ -148,7 +148,7 @@ write_entries (list) /* We didn't write out any directories. Check the list private data to see whether subdirectory information is known. If it is, we need to write out an empty D line. */ - sdtp = (struct stickydirtag *) list->list->data; + sdtp = list->list->data; if (sdtp == NULL || sdtp->subdirs) if (fprintf (entfile, "D\n") < 0) error (1, errno, "cannot write %s", entfilename); @@ -165,13 +165,15 @@ write_entries (list) error (0, errno, "cannot remove %s", CVSADM_ENTLOG); } + + /* * Removes the argument file from the Entries file if necessary. */ void Scratch_Entry (list, fname) List *list; - char *fname; + const char *fname; { Node *node; @@ -205,6 +207,8 @@ Scratch_Entry (list, fname) } } + + /* * Enters the given file name/version/time-stamp into the Entries file, * removing the old entry first, if necessary. @@ -212,13 +216,13 @@ Scratch_Entry (list, fname) void Register (list, fname, vn, ts, options, tag, date, ts_conflict) List *list; - char *fname; - char *vn; - char *ts; - char *options; - char *tag; - char *date; - char *ts_conflict; + const char *fname; + const char *vn; + const char *ts; + const char *options; + const char *tag; + const char *date; + const char *ts_conflict; { Entnode *entnode; Node *node; @@ -273,9 +277,8 @@ static void freesdt (p) Node *p; { - struct stickydirtag *sdtp; + struct stickydirtag *sdtp = p->data; - sdtp = (struct stickydirtag *) p->data; if (sdtp->tag) free (sdtp->tag); if (sdtp->date) @@ -491,7 +494,7 @@ Entries_Open (aflag, update_dir) sdtp->nonbranch = dirnonbranch; /* feed it into the list-private area */ - entries->list->data = (char *) sdtp; + entries->list->data = sdtp; entries->list->delproc = freesdt; } @@ -556,7 +559,7 @@ Entries_Open (aflag, update_dir) sdtp = (struct stickydirtag *) xmalloc (sizeof (*sdtp)); memset ((char *) sdtp, 0, sizeof (*sdtp)); sdtp->subdirs = 0; - entries->list->data = (char *) sdtp; + entries->list->data = sdtp; entries->list->delproc = freesdt; } @@ -595,9 +598,8 @@ static void Entries_delproc (node) Node *node; { - Entnode *p; + Entnode *p = node->data; - p = (Entnode *) node->data; Entnode_Destroy(p); } @@ -629,7 +631,7 @@ AddEntryNode (list, entdata) assume that the key is dynamically allocated. The user's free proc should be responsible for freeing the key. */ p->key = xstrdup (entdata->user); - p->data = (char *) entdata; + p->data = entdata; /* put the node into the list */ addnode (list, p); @@ -711,12 +713,12 @@ WriteTemplate (dir, update_dir) */ void WriteTag (dir, tag, date, nonbranch, update_dir, repository) - char *dir; - char *tag; - char *date; + const char *dir; + const char *tag; + const char *date; int nonbranch; - char *update_dir; - char *repository; + const char *update_dir; + const char *repository; { FILE *fout; char *tmp; @@ -869,11 +871,10 @@ void Subdirs_Known (entries) List *entries; { - struct stickydirtag *sdtp; + struct stickydirtag *sdtp = entries->list->data; /* If there is no list private data, that means that the subdirectory information is known. */ - sdtp = (struct stickydirtag *) entries->list->data; if (sdtp != NULL && ! sdtp->subdirs) { FILE *fp; |