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
eid = ntohl(e->id);
bit = MAP_CONT;
#if defined(SUPERGROUPS)
- sgcount = 0;
sghead = ntohl(g->next);
#endif
for (i = 0; i < PRSIZE; i++) {
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;
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)];
}
#ifdef SUPERGROUPS
#include <errno.h>
+#include <string.h>
#include "map.h"
#ifdef STDLIB_HAS_MALLOC_PROTOS
#include <stdlib.h>
{
struct prentryg *tentryg = (struct prentryg *)&tentry;
nptr = tentryg->nextsg;
- while (nptr != NULL) {
+ while (nptr != 0) {
struct contentry centry;
int i;
afs_int32 gid, afs_int32 depth) ;
#endif /* SUPERGROUPS */
+/* ptutils.c */
+#ifdef SUPERGROUPS
+extern afs_int32 AddToSGEntry(struct ubik_trans *tt, struct prentry *entry,
+ afs_int32 loc, afs_int32 aid);
+extern afs_int32 GetSGList(struct ubik_trans *at, struct prentry *tentry,
+ prlist *alist);
+extern afs_int32 RemoveFromSGEntry(struct ubik_trans *at, afs_int32 aid,
+ afs_int32 bid);
+extern void pt_hook_write(void);
+#endif
+
extern afs_int32 NameHash(register unsigned char *aname);
extern afs_int32 pr_Write(struct ubik_trans *tt, afs_int32 afd, afs_int32 pos,
void *buff, afs_int32 len);
* so we can always tell if we're writing a group record.
*/
-int (*pt_save_dbase_write) ();
+int (*pt_save_dbase_write)(struct ubik_dbase *, afs_int32, void *, afs_int32,
+ afs_int32);
int
-pt_mywrite(struct ubik_dbase *tdb, afs_int32 fno, char *bp, afs_int32 pos, afs_int32 count)
+pt_mywrite(struct ubik_dbase *tdb, afs_int32 fno, void *bp, afs_int32 pos, afs_int32 count)
{
afs_uint32 headersize = ntohl(cheader.headerSize);
*/
void
-pt_hook_write()
+pt_hook_write(void)
{
extern struct ubik_dbase *ubik_dbase;
if (ubik_dbase->write != pt_mywrite) {
afs_int32 nptr;
afs_int32 last; /* addr of last cont. block */
afs_int32 first = 0;
- afs_int32 cloc;
+ afs_int32 cloc = 0;
afs_int32 slot = -1;
if (entry->id == aid)
ChangeEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 cid, char *name, afs_int32 oid, afs_int32 newid)
{
afs_int32 code;
- afs_int32 i, nptr, pos;
+ afs_int32 i, pos;
#if defined(SUPERGROUPS)
afs_int32 nextpos;
+#else
+ afs_int32 nptr;
#endif
- struct contentry centry;
struct prentry tentry, tent;
afs_int32 loc;
afs_int32 oldowner;