Commit 795b56d4 authored by Per Cederqvist's avatar Per Cederqvist

(do_add_member): Renamed local variable names to avoid warnings from gcc.

(do_sub_member): Likewise.
(locate_member): Likewise.
(check_membership): Likewise.
(set_membership_type): Likewise.
(rcsid): Added a missing const.
parent 14342a93
/*
* $Id: membership.c,v 0.32 1998/06/14 14:50:53 byers Exp $
* $Id: membership.c,v 0.33 1998/07/08 16:35:27 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -31,7 +31,8 @@
#define DEBUG_MARK_AS_READ
static char *rcsid = "$Id: membership.c,v 0.32 1998/06/14 14:50:53 byers Exp $";
static const char *
rcsid = "$Id: membership.c,v 0.33 1998/07/08 16:35:27 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -505,7 +506,7 @@ do_add_member(Conf_no conf_no, /* Conference to add a new member to. */
)
{
Membership * mship;
Member * member;
Member * mbr;
/* First add the conference in the person-struct.
* Make room for it.
......@@ -547,12 +548,11 @@ do_add_member(Conf_no conf_no, /* Conference to add a new member to. */
/* New members go to the end of the list */
member = (conf_c->members.members
+ conf_c->members.no_of_members - 1);
member->member = pers_no;
member->added_by = ACTPERS;
member->added_at = time(NULL);
member->type = *type;
mbr = (conf_c->members.members + conf_c->members.no_of_members - 1);
mbr->member = pers_no;
mbr->added_by = ACTPERS;
mbr->added_at = time(NULL);
mbr->type = *type;
mark_conference_as_changed( conf_no );
mark_person_as_changed( pers_no );
......@@ -601,7 +601,7 @@ forced_leave_conf(Pers_no pers_no,
Success
do_sub_member(Conf_no conf_no, /* Conf to delete member from. */
Conference * conf_c, /* May be NULL */
Member * member, /* May be NULL */
Member * mbr, /* May be NULL */
Pers_no pers_no, /* Person to be deleted. */
Person * pers_p, /* May be NULL */
Membership * mship) /* Pointer to the persons membership in
......@@ -616,7 +616,7 @@ do_sub_member(Conf_no conf_no, /* Conf to delete member from. */
if ( mship == NULL && (mship = locate_membership(conf_no, pers_p)) == NULL)
restart_kom("do_sub_member() - can't find mship\n");
if ( member == NULL && (member = locate_member(pers_no, conf_c)) == NULL)
if ( mbr == NULL && (mbr = locate_member(pers_no, conf_c)) == NULL)
restart_kom("do_sub_member() - can't find member.\n");
forced_leave_conf(pers_no, conf_no);
......@@ -635,10 +635,10 @@ do_sub_member(Conf_no conf_no, /* Conf to delete member from. */
/* Delete from Conference */
--conf_c->members.no_of_members;
while ( member < conf_c->members.members + conf_c->members.no_of_members )
while ( mbr < conf_c->members.members + conf_c->members.no_of_members )
{
*member = *(member + 1);
++member;
*mbr = *(mbr + 1);
++mbr;
}
mark_person_as_changed( pers_no );
......@@ -747,15 +747,15 @@ Member *
locate_member(Pers_no pers_no,
Conference * conf_c)
{
Member * member;
Member * mbr;
int i;
for(member = conf_c->members.members, i = conf_c->members.no_of_members;
i > 0; i--, member++)
for(mbr = conf_c->members.members, i = conf_c->members.no_of_members;
i > 0; i--, mbr++)
{
if ( member->member == pers_no )
if ( mbr->member == pers_no )
{
return member;
return mbr;
}
}
......@@ -944,7 +944,7 @@ check_membership(Pers_no pno,
const Conference *conf,
const Membership *mship)
{
int error=0;
int errors=0;
int i;
Local_text_no last=0;
int log_no=0;
......@@ -963,7 +963,7 @@ check_membership(Pers_no pno,
", which only has ",
(unsigned long)(conf->texts.first_local_no
+ conf->texts.no_of_texts - 1));
error++;
errors++;
}
last = mship->last_text_read;
......@@ -972,13 +972,13 @@ check_membership(Pers_no pno,
{
if ( mship->read_texts[i] <= last )
{
error++;
errors++;
}
last = mship->read_texts[i];
}
return error;
return errors;
}
#endif
......@@ -1436,7 +1436,7 @@ extern Success set_membership_type(Pers_no pers_no,
Conference *conf_c, *pers_c;
Person *pers_p;
Membership *membership;
Member *member;
Member *mbr;
Access acc;
/* Check for logon */
......@@ -1484,8 +1484,8 @@ extern Success set_membership_type(Pers_no pers_no,
/* FIXME: If this happens we should do something more drastic
since it indicates that the database is fucked up. */
member = locate_member(pers_no, conf_c);
if (member == NULL)
mbr = locate_member(pers_no, conf_c);
if (mbr == NULL)
{
err_stat = conf_no;
kom_errno = KOM_NOT_MEMBER;
......@@ -1503,7 +1503,7 @@ extern Success set_membership_type(Pers_no pers_no,
/* Modify member and membership */
membership->type = *type;
member->type = *type;
mbr->type = *type;
/* Mark the conference and person as changed */
mark_conference_as_changed(conf_no);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment