Commit 320f46f4 authored by Per Cederqvist's avatar Per Cederqvist

(register_jubel): Flag unused arguments.

(locate_member): Renamed local variable names to avoid warnings from gcc.
(check_misc_infos): Likewise.
(check_created_texts): Likewise.
(check_membership): Likewise.
(check_texts_in_conf): Likewise.
(confirm): Added const qualifier to argument question.
(check_member): Likewise.
(init_data_base): Removed the unused dbase_dir argument.  All callers updated.
parent a8ab2b98
/* /*
* $Id: dbck.c,v 0.38 1997/09/13 15:32:05 byers Exp $ * $Id: dbck.c,v 0.39 1998/07/08 16:25:13 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
* Author: Per Cederqvist. * Author: Per Cederqvist.
*/ */
static char *rcsid = "$Id: dbck.c,v 0.38 1997/09/13 15:32:05 byers Exp $"; static const char *
rcsid = "$Id: dbck.c,v 0.39 1998/07/08 16:25:13 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -69,6 +70,7 @@ USE(rcsid); ...@@ -69,6 +70,7 @@ USE(rcsid);
#include "manipulate.h" #include "manipulate.h"
#include "version-info.h" #include "version-info.h"
#include "ram-output.h" #include "ram-output.h"
#include "unused.h"
#define OPT_PERS_PRESENTATION_CONF 1 #define OPT_PERS_PRESENTATION_CONF 1
...@@ -201,9 +203,9 @@ restart_kom (format, a, b, c, d, e, f, g) ...@@ -201,9 +203,9 @@ restart_kom (format, a, b, c, d, e, f, g)
#endif #endif
void void
register_jubel(Pers_no pno, register_jubel(Pers_no UNUSED(pno),
Text_no divis, Text_no UNUSED(divis),
Text_no tno) Text_no UNUSED(tno))
{ {
/* Not needed in dbck.c, but called from conf-file.c. */ /* Not needed in dbck.c, but called from conf-file.c. */
} }
...@@ -312,15 +314,15 @@ Member * ...@@ -312,15 +314,15 @@ Member *
locate_member(Pers_no pers_no, locate_member(Pers_no pers_no,
Conference * conf_c) Conference * conf_c)
{ {
Member * member; Member * mbr;
int i; int i;
for(member = conf_c->members.members, i = conf_c->members.no_of_members; for(mbr = conf_c->members.members, i = conf_c->members.no_of_members;
i > 0; i--, member++) i > 0; i--, mbr++)
{ {
if ( member->member == pers_no ) if ( mbr->member == pers_no )
{ {
return member; return mbr;
} }
} }
...@@ -394,7 +396,7 @@ delete_misc (Text_stat *tstat, ...@@ -394,7 +396,7 @@ delete_misc (Text_stat *tstat,
} }
static int static int
confirm(char *question) confirm(const char *question)
{ {
if ( iflag ) if ( iflag )
{ {
...@@ -429,7 +431,7 @@ check_misc_infos(Text_no tno, ...@@ -429,7 +431,7 @@ check_misc_infos(Text_no tno,
Conference *c; Conference *c;
Text_stat *t; Text_stat *t;
long error=0; long errors=0;
while (previous = (Misc_info *)misc, while (previous = (Misc_info *)misc,
group = parse_next_misc(&misc, group = parse_next_misc(&misc,
...@@ -453,7 +455,7 @@ check_misc_infos(Text_no tno, ...@@ -453,7 +455,7 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
break; break;
} }
...@@ -468,7 +470,7 @@ check_misc_infos(Text_no tno, ...@@ -468,7 +470,7 @@ check_misc_infos(Text_no tno,
(unsigned long)tno, (unsigned long)group.recipient, (unsigned long)tno, (unsigned long)group.recipient,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)c->texts.first_local_no); (unsigned long)c->texts.first_local_no);
error++; errors++;
} }
else if ( c->texts.first_local_no + c->texts.no_of_texts - 1 else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
< group.local_no ) < group.local_no )
...@@ -478,7 +480,7 @@ check_misc_infos(Text_no tno, ...@@ -478,7 +480,7 @@ check_misc_infos(Text_no tno,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)(c->texts.first_local_no (unsigned long)(c->texts.first_local_no
+ c->texts.no_of_texts - 1)); + c->texts.no_of_texts - 1));
error++; errors++;
} }
else if ( c->texts.texts[group.local_no else if ( c->texts.texts[group.local_no
- c->texts.first_local_no] != tno ) - c->texts.first_local_no] != tno )
...@@ -489,7 +491,7 @@ check_misc_infos(Text_no tno, ...@@ -489,7 +491,7 @@ check_misc_infos(Text_no tno,
"that local number is mapped", "that local number is mapped",
(unsigned long)c->texts.texts[group.local_no (unsigned long)c->texts.texts[group.local_no
- c->texts.first_local_no]); - c->texts.first_local_no]);
error++; errors++;
} }
break; break;
...@@ -509,7 +511,7 @@ check_misc_infos(Text_no tno, ...@@ -509,7 +511,7 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
break; break;
} }
...@@ -524,7 +526,7 @@ check_misc_infos(Text_no tno, ...@@ -524,7 +526,7 @@ check_misc_infos(Text_no tno,
(unsigned long)tno, (unsigned long)group.cc_recipient, (unsigned long)tno, (unsigned long)group.cc_recipient,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)c->texts.first_local_no); (unsigned long)c->texts.first_local_no);
error++; errors++;
} }
else if ( c->texts.first_local_no + c->texts.no_of_texts - 1 else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
< group.local_no ) < group.local_no )
...@@ -534,7 +536,7 @@ check_misc_infos(Text_no tno, ...@@ -534,7 +536,7 @@ check_misc_infos(Text_no tno,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)(c->texts.first_local_no (unsigned long)(c->texts.first_local_no
+ c->texts.no_of_texts - 1)); + c->texts.no_of_texts - 1));
error++; errors++;
} }
else if ( c->texts.texts[group.local_no else if ( c->texts.texts[group.local_no
- c->texts.first_local_no] != tno ) - c->texts.first_local_no] != tno )
...@@ -545,7 +547,7 @@ check_misc_infos(Text_no tno, ...@@ -545,7 +547,7 @@ check_misc_infos(Text_no tno,
"that local number is mapped", "that local number is mapped",
(unsigned long)c->texts.texts[group.local_no (unsigned long)c->texts.texts[group.local_no
- c->texts.first_local_no]); - c->texts.first_local_no]);
error++; errors++;
} }
break; break;
...@@ -565,7 +567,7 @@ check_misc_infos(Text_no tno, ...@@ -565,7 +567,7 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
break; break;
} }
...@@ -580,7 +582,7 @@ check_misc_infos(Text_no tno, ...@@ -580,7 +582,7 @@ check_misc_infos(Text_no tno,
(unsigned long)tno, (unsigned long)group.bcc_recipient, (unsigned long)tno, (unsigned long)group.bcc_recipient,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)c->texts.first_local_no); (unsigned long)c->texts.first_local_no);
error++; errors++;
} }
else if ( c->texts.first_local_no + c->texts.no_of_texts - 1 else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
< group.local_no ) < group.local_no )
...@@ -590,7 +592,7 @@ check_misc_infos(Text_no tno, ...@@ -590,7 +592,7 @@ check_misc_infos(Text_no tno,
(unsigned long)group.local_no, (unsigned long)group.local_no,
(unsigned long)(c->texts.first_local_no (unsigned long)(c->texts.first_local_no
+ c->texts.no_of_texts - 1)); + c->texts.no_of_texts - 1));
error++; errors++;
} }
else if ( c->texts.texts[group.local_no else if ( c->texts.texts[group.local_no
- c->texts.first_local_no] != tno ) - c->texts.first_local_no] != tno )
...@@ -601,7 +603,7 @@ check_misc_infos(Text_no tno, ...@@ -601,7 +603,7 @@ check_misc_infos(Text_no tno,
"that local number is mapped", "that local number is mapped",
(unsigned long)c->texts.texts[group.local_no (unsigned long)c->texts.texts[group.local_no
- c->texts.first_local_no]); - c->texts.first_local_no]);
error++; errors++;
} }
break; break;
...@@ -623,15 +625,15 @@ check_misc_infos(Text_no tno, ...@@ -623,15 +625,15 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
error++; errors++;
} }
else if (!is_comment_to(tno, t)) else if (!is_comment_to(tno, t))
{ {
log("Text %lu is a comment to %lu, but not the reverse.\n", log("Text %lu is a comment to %lu, but not the reverse.\n",
(unsigned long)tno, (unsigned long)group.comment_to); (unsigned long)tno, (unsigned long)group.comment_to);
error++; errors++;
} }
break; break;
...@@ -653,13 +655,13 @@ check_misc_infos(Text_no tno, ...@@ -653,13 +655,13 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
} }
else if (!is_commented_in(tno, t)) else if (!is_commented_in(tno, t))
{ {
log("Text %lu is commented in %lu, but not the reverse.\n", log("Text %lu is commented in %lu, but not the reverse.\n",
(unsigned long)tno, (unsigned long)group.commented_in); (unsigned long)tno, (unsigned long)group.commented_in);
error++; errors++;
} }
break; break;
...@@ -681,13 +683,13 @@ check_misc_infos(Text_no tno, ...@@ -681,13 +683,13 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
} }
else if (!is_footnote_to(tno, t)) else if (!is_footnote_to(tno, t))
{ {
log("Text %lu is a footnote to %lu, but not the reverse.\n", log("Text %lu is a footnote to %lu, but not the reverse.\n",
(unsigned long)tno, (unsigned long)group.footnote_to); (unsigned long)tno, (unsigned long)group.footnote_to);
error++; errors++;
} }
break; break;
...@@ -709,13 +711,13 @@ check_misc_infos(Text_no tno, ...@@ -709,13 +711,13 @@ check_misc_infos(Text_no tno,
misc = previous; misc = previous;
} }
else else
error++; errors++;
} }
else if (!is_footnoted_in(tno, t)) else if (!is_footnoted_in(tno, t))
{ {
log("Text %lu is footnoted in %lu, but not the reverse.\n", log("Text %lu is footnoted in %lu, but not the reverse.\n",
(unsigned long)tno, (unsigned long)group.footnoted_in); (unsigned long)tno, (unsigned long)group.footnoted_in);
error++; errors++;
} }
break; break;
...@@ -730,10 +732,10 @@ check_misc_infos(Text_no tno, ...@@ -730,10 +732,10 @@ check_misc_infos(Text_no tno,
if ( group.type == m_error ) if ( group.type == m_error )
{ {
log("Text %lu has a bad misc_info_list.\n", (unsigned long)tno); log("Text %lu has a bad misc_info_list.\n", (unsigned long)tno);
error++; errors++;
} }
return error; return errors;
} }
...@@ -828,7 +830,7 @@ check_created_texts(Pers_no pno, ...@@ -828,7 +830,7 @@ check_created_texts(Pers_no pno,
{ {
unsigned long i; unsigned long i;
Text_stat *t; Text_stat *t;
int error=0; int errors=0;
for ( i=0; i < created->no_of_texts; i++ ) for ( i=0; i < created->no_of_texts; i++ )
{ {
...@@ -840,7 +842,7 @@ check_created_texts(Pers_no pno, ...@@ -840,7 +842,7 @@ check_created_texts(Pers_no pno,
log("Person %lu is author of text %lu whose author is %lu.\n", log("Person %lu is author of text %lu whose author is %lu.\n",
(unsigned long)pno, (unsigned long)created->texts[i], (unsigned long)pno, (unsigned long)created->texts[i],
(unsigned long)t->author); (unsigned long)t->author);
error++; errors++;
} }
if ( t == NULL ) if ( t == NULL )
...@@ -856,7 +858,7 @@ check_created_texts(Pers_no pno, ...@@ -856,7 +858,7 @@ check_created_texts(Pers_no pno,
log("Repaired: created_texts corrected.\n"); log("Repaired: created_texts corrected.\n");
} }
else else
error++; errors++;
} }
} }
} }
...@@ -873,17 +875,17 @@ check_created_texts(Pers_no pno, ...@@ -873,17 +875,17 @@ check_created_texts(Pers_no pno,
log("Repaired: created_texts adjusted.\n"); log("Repaired: created_texts adjusted.\n");
} }
else else
error++; errors++;
} }
return error; return errors;
} }
static int static int
check_membership(Pers_no pno, check_membership(Pers_no pno,
const Membership *mship) const Membership *mship)
{ {
int error=0; int errors=0;
Conference *conf; Conference *conf;
int i; int i;
Local_text_no last=0; Local_text_no last=0;
...@@ -893,7 +895,7 @@ check_membership(Pers_no pno, ...@@ -893,7 +895,7 @@ check_membership(Pers_no pno,
{ {
log("Person %lu is a member in the non-existing conference %lu.\n", log("Person %lu is a member in the non-existing conference %lu.\n",
(unsigned long)pno, (unsigned long)mship->conf_no); (unsigned long)pno, (unsigned long)mship->conf_no);
error++; errors++;
} }
else else
{ {
...@@ -908,7 +910,7 @@ check_membership(Pers_no pno, ...@@ -908,7 +910,7 @@ check_membership(Pers_no pno,
(unsigned long)mship->conf_no, (unsigned long)mship->conf_no,
(unsigned long)(conf->texts.first_local_no (unsigned long)(conf->texts.first_local_no
+ conf->texts.no_of_texts - 1)); + conf->texts.no_of_texts - 1));
error++; errors++;
} }
for ( last = i = 0; i < mship->no_of_read; i++) for ( last = i = 0; i < mship->no_of_read; i++)
...@@ -920,7 +922,7 @@ check_membership(Pers_no pno, ...@@ -920,7 +922,7 @@ check_membership(Pers_no pno,
"is corrupt: read text number", "is corrupt: read text number",
(unsigned long)mship->read_texts[i], (unsigned long)i, (unsigned long)mship->read_texts[i], (unsigned long)i,
(unsigned long)last); (unsigned long)last);
error++; errors++;
} }
last = mship->read_texts[i]; last = mship->read_texts[i];
...@@ -931,11 +933,11 @@ check_membership(Pers_no pno, ...@@ -931,11 +933,11 @@ check_membership(Pers_no pno,
{ {
log("Person %lu is a member in %lu in which he isn't a member.\n", log("Person %lu is a member in %lu in which he isn't a member.\n",
(unsigned long)pno, (unsigned long)mship->conf_no); (unsigned long)pno, (unsigned long)mship->conf_no);
error++; errors++;
} }
} }
return error; return errors;
} }
...@@ -1107,7 +1109,7 @@ check_texts_in_conf(Conf_no cc, ...@@ -1107,7 +1109,7 @@ check_texts_in_conf(Conf_no cc,
{ {
unsigned long i; unsigned long i;
Text_stat *t; Text_stat *t;
int error=0; int errors=0;
for ( i=0; i < tlist->no_of_texts; i++ ) for ( i=0; i < tlist->no_of_texts; i++ )
{ {
...@@ -1131,7 +1133,7 @@ check_texts_in_conf(Conf_no cc, ...@@ -1131,7 +1133,7 @@ check_texts_in_conf(Conf_no cc,
(unsigned long)cc); (unsigned long)cc);
} }
else else
error++; errors++;
} }
else else
{ {
...@@ -1152,7 +1154,7 @@ check_texts_in_conf(Conf_no cc, ...@@ -1152,7 +1154,7 @@ check_texts_in_conf(Conf_no cc,
(unsigned long)cc); (unsigned long)cc);
} }
else else
error++; errors++;
} }
} }
} }
...@@ -1170,10 +1172,10 @@ check_texts_in_conf(Conf_no cc, ...@@ -1170,10 +1172,10 @@ check_texts_in_conf(Conf_no cc,
log("Repaired: text_list adjusted.\n"); log("Repaired: text_list adjusted.\n");
} }
else else
error++; errors++;
} }
return error; return errors;
} }
Membership * Membership *
...@@ -1200,14 +1202,14 @@ check_member(Conf_no cc, ...@@ -1200,14 +1202,14 @@ check_member(Conf_no cc,
Member *memb) Member *memb)
{ {
Person *pp; Person *pp;
int error=0; int errors=0;
pp = cached_get_person_stat(memb->member); pp = cached_get_person_stat(memb->member);
if ( pp == NULL ) if ( pp == NULL )
{ {
log("Person %lu, supposedly a member in conf %lu, is nonexistent.\n", log("Person %lu, supposedly a member in conf %lu, is nonexistent.\n",
(unsigned long)memb->member, (unsigned long)cc); (unsigned long)memb->member, (unsigned long)cc);
error++; errors++;
} }
else else
{ {
...@@ -1216,11 +1218,11 @@ check_member(Conf_no cc, ...@@ -1216,11 +1218,11 @@ check_member(Conf_no cc,
log("Person %lu is not a member in conf %lu.\n", log("Person %lu is not a member in conf %lu.\n",
(unsigned long)memb->member, (unsigned long)memb->member,
(unsigned long)cc); (unsigned long)cc);
error++; errors++;
} }
} }
return error; return errors;
} }
static int static int
...@@ -1331,7 +1333,7 @@ check_data_base(void) ...@@ -1331,7 +1333,7 @@ check_data_base(void)
} }
static void static void
init_data_base(char *dbase_dir) init_data_base(void)
{ {
if ( vflag ) if ( vflag )
{ {
...@@ -1604,7 +1606,7 @@ main (int argc, ...@@ -1604,7 +1606,7 @@ main (int argc,
s_set_storage_management(smalloc, srealloc, sfree); s_set_storage_management(smalloc, srealloc, sfree);
init_data_base(param.dbase_dir); init_data_base();
errors = check_data_base(); errors = check_data_base();
if (truncated_texts == TRUE) if (truncated_texts == TRUE)
......
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