#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
/*
* (3) Define a structure, idused, instead of an
#include "ptint.h"
#include "pterror.h"
#include "ptserver.h"
+#include "ptuser.h"
+#include "display.h"
struct prheader cheader;
int fd;
-char *pr_dbaseName;
+const char *pr_dbaseName;
char *whoami = "db_verify";
#define UBIK_HEADERSIZE 64
}
static afs_int32
-pr_Read(afs_int32 pos, char *buff, afs_int32 len)
+pr_Read(afs_int32 pos, void *buff, afs_int32 len)
{
afs_int32 code;
*/
afs_int32
-ReadHeader()
+ReadHeader(void)
{
afs_int32 code;
}
static afs_int32
-NameHash(register unsigned char *aname)
+NameHash(register char *aname)
{
/* returns hash bucket for aname */
register unsigned int hash = 0;
register int i;
/* stolen directly from the HashString function in the vol package */
for (i = strlen(aname), aname += i - 1; i--; aname--)
- hash = (hash * 31) + (*aname - 31);
+ hash = (hash * 31) + (*(unsigned char *)aname - 31);
return (hash % HASHSIZE);
}
/* now read the info */
r = read(fd, &uheader, sizeof(uheader));
if (r != sizeof(uheader)) {
- printf("error: read of %d bytes failed: %d %d\n", sizeof(uheader), r,
- errno);
+ printf("error: read of %" AFS_SIZET_FMT " bytes failed: %d %d\n",
+ sizeof(uheader), r, errno);
return (-1);
}
struct prentry c; /* continuation entry */
afs_int32 na; /* next thread */
int ni;
- afs_int32 eid;
- int count; /* number of members */
+ afs_int32 eid = 0;
+ int count = 0; /* number of members, set to > 9999 if */
+ /* list ends early */
int i;
int noErrors = 1;
int length; /* length of chain */
#if defined(SUPERGROUPS)
- int sgcount; /* number of sgentrys */
+ int sgcount = 0; /* number of sgentrys */
afs_int32 sghead;
#define g (((struct prentryg *)e))
#endif
head = ntohl(e->next);
eid = ntohl(e->id);
bit = MAP_CONT;
- count = 0; /* set to >9999 if list ends early */
#if defined(SUPERGROUPS)
- sgcount = 0;
sghead = ntohl(g->next);
#endif
for (i = 0; i < PRSIZE; i++) {
struct prentry c; /* continuation entry */
afs_int32 na; /* next thread */
int ni;
- afs_int32 eid;
+ afs_int32 eid = 0;
int length; /* length of chain */
if (e) {
n = eof / sizeof(struct prentry);
if ((eof < 0) || (n * sizeof(struct prentry) != eof)) {
code = PRDBBAD;
- afs_com_err(whoami, code, "eof ptr no good: eof=%d, sizeof(prentry)=%d",
+ afs_com_err(whoami, code,
+ "eof ptr no good: eof=%d, sizeof(prentry)=%" AFS_SIZET_FMT,
eof, sizeof(struct prentry));
abort:
return code;
#include "AFS_component_version_number.c"
int
-WorkerBee(struct cmd_syndesc *as, char *arock)
+WorkerBee(struct cmd_syndesc *as, void *arock)
{
afs_int32 code;
char *recreateFile;
zeromap(struct idused *idmap)
{
while (idmap) {
- memset((char *)idmap->idcount, 0, sizeof idmap->idcount);
+ memset(idmap->idcount, 0, sizeof idmap->idcount);
idmap = idmap->idnext;
}
}
fprintf(stderr, "IDCOUNT must be power of 2!\n");
exit(1);
}
- while (idmap = *idmapp) {
+ while ((idmap = *idmapp) != NULL) {
if (idmap->idstart == (id & ~(IDCOUNT - 1)))
break;
idmapp = &idmap->idnext;
perror("idmap");
exit(1);
}
- memset((char *)idmap, 0, sizeof idmap);
+ memset(idmap, 0, sizeof idmap);
idmap->idstart = id & ~(IDCOUNT - 1);
idmap->idnext = *idmapp;
*idmapp = idmap;
fprintf(stderr, "IDCOUNT must be power of 2!\n");
exit(1);
}
- while (idmap = *idmapp) {
+ while ((idmap = *idmapp) != NULL) {
if (idmap->idstart == (id & ~(IDCOUNT - 1))) {
return idmap->idcount[id & (IDCOUNT - 1)];
}