From 320f46f4df8bbf8f2feb66745572102dabe8a90d Mon Sep 17 00:00:00 2001
From: Per Cederqvist <ceder@lysator.liu.se>
Date: Wed, 8 Jul 1998 16:25:13 +0000
Subject: [PATCH] (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.

---
 src/server/dbck.c | 116 +++++++++++++++++++++++-----------------------
 1 file changed, 59 insertions(+), 57 deletions(-)

diff --git a/src/server/dbck.c b/src/server/dbck.c
index 9e69b871b..0c1e30012 100644
--- a/src/server/dbck.c
+++ b/src/server/dbck.c
@@ -1,5 +1,5 @@
 /*
- * $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.
  *
  * This file is part of the LysKOM server.
@@ -28,7 +28,8 @@
  * 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"
 USE(rcsid);
 
@@ -69,6 +70,7 @@ USE(rcsid);
 #include "manipulate.h"
 #include "version-info.h"
 #include "ram-output.h"
+#include "unused.h"
 
 
 #define OPT_PERS_PRESENTATION_CONF      1
@@ -201,9 +203,9 @@ restart_kom (format, a, b, c, d, e, f, g)
 #endif
 
 void 
-register_jubel(Pers_no pno,
-	       Text_no divis,
-	       Text_no tno)
+register_jubel(Pers_no UNUSED(pno),
+	       Text_no UNUSED(divis),
+	       Text_no UNUSED(tno))
 {
     /* Not needed in dbck.c, but called from conf-file.c. */
 }
@@ -312,15 +314,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;
 	}
     }
 
@@ -394,7 +396,7 @@ delete_misc (Text_stat *tstat,
 }
 
 static int
-confirm(char *question)
+confirm(const char *question)
 {
     if ( iflag )
     {
@@ -429,7 +431,7 @@ check_misc_infos(Text_no    tno,
     Conference *c;
     Text_stat *t;
 
-    long error=0;
+    long errors=0;
 
     while (previous = (Misc_info *)misc,
 	   group = parse_next_misc(&misc,
@@ -453,7 +455,7 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 		
 		break;
 	    }
@@ -468,7 +470,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)tno, (unsigned long)group.recipient,
 		    (unsigned long)group.local_no,
 		    (unsigned long)c->texts.first_local_no);
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
 		     < group.local_no )
@@ -478,7 +480,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)group.local_no,
 		    (unsigned long)(c->texts.first_local_no
 			     + c->texts.no_of_texts - 1));
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.texts[group.local_no
 				     - c->texts.first_local_no] != tno )
@@ -489,7 +491,7 @@ check_misc_infos(Text_no    tno,
 		    "that local number is mapped",
 		    (unsigned long)c->texts.texts[group.local_no
 					   - c->texts.first_local_no]);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -509,7 +511,7 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 		
 		break;
 	    }
@@ -524,7 +526,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)tno, (unsigned long)group.cc_recipient,
 		    (unsigned long)group.local_no,
 		    (unsigned long)c->texts.first_local_no);
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
 		     < group.local_no )
@@ -534,7 +536,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)group.local_no,
 		    (unsigned long)(c->texts.first_local_no
 			     + c->texts.no_of_texts - 1));
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.texts[group.local_no
 				     - c->texts.first_local_no] != tno )
@@ -545,7 +547,7 @@ check_misc_infos(Text_no    tno,
 		    "that local number is mapped",
 		    (unsigned long)c->texts.texts[group.local_no
 					   - c->texts.first_local_no]);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -565,7 +567,7 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 		
 		break;
 	    }
@@ -580,7 +582,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)tno, (unsigned long)group.bcc_recipient,
 		    (unsigned long)group.local_no,
 		    (unsigned long)c->texts.first_local_no);
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.first_local_no + c->texts.no_of_texts - 1
 		     < group.local_no )
@@ -590,7 +592,7 @@ check_misc_infos(Text_no    tno,
 		    (unsigned long)group.local_no,
 		    (unsigned long)(c->texts.first_local_no
 			     + c->texts.no_of_texts - 1));
-		error++;
+		errors++;
 	    }
 	    else if ( c->texts.texts[group.local_no
 				     - c->texts.first_local_no] != tno )
@@ -601,7 +603,7 @@ check_misc_infos(Text_no    tno,
 		    "that local number is mapped",
 		    (unsigned long)c->texts.texts[group.local_no
 					   - c->texts.first_local_no]);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -623,15 +625,15 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 		    
-		error++;
+		errors++;
 	    }
 	    else if (!is_comment_to(tno, t))
 	    {
 		log("Text %lu is a comment to %lu, but not the reverse.\n",
 		    (unsigned long)tno, (unsigned long)group.comment_to);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -653,13 +655,13 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 	    }
 	    else if (!is_commented_in(tno, t))
 	    {
 		log("Text %lu is commented in %lu, but not the reverse.\n",
 		    (unsigned long)tno, (unsigned long)group.commented_in);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -681,13 +683,13 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 	    }
 	    else if (!is_footnote_to(tno, t))
 	    {
 		log("Text %lu is a footnote to %lu, but not the reverse.\n",
 		    (unsigned long)tno, (unsigned long)group.footnote_to);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -709,13 +711,13 @@ check_misc_infos(Text_no    tno,
 		    misc = previous;
 		}
 		else
-		    error++;
+		    errors++;
 	    }
 	    else if (!is_footnoted_in(tno, t))
 	    {
 		log("Text %lu is footnoted in %lu, but not the reverse.\n",
 		    (unsigned long)tno, (unsigned long)group.footnoted_in);
-		error++;
+		errors++;
 	    }
 
 	    break;
@@ -730,10 +732,10 @@ check_misc_infos(Text_no    tno,
     if ( group.type == m_error )
     {
 	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,
 {
     unsigned long i;
     Text_stat *t;
-    int error=0;
+    int errors=0;
 
     for ( i=0; i < created->no_of_texts; i++ )
     {
@@ -840,7 +842,7 @@ check_created_texts(Pers_no pno,
 		log("Person %lu is author of text %lu whose author is %lu.\n",
 		    (unsigned long)pno, (unsigned long)created->texts[i],
 		    (unsigned long)t->author);
-		error++;
+		errors++;
 	    }
 
 	    if ( t == NULL )
@@ -856,7 +858,7 @@ check_created_texts(Pers_no pno,
 		    log("Repaired: created_texts corrected.\n");
 		}
 		else
-		    error++;
+		    errors++;
 	    }
 	}
     }
@@ -873,17 +875,17 @@ check_created_texts(Pers_no pno,
 	    log("Repaired: created_texts adjusted.\n");
 	}
 	else
-	    error++;
+	    errors++;
     }
     
-    return error;
+    return errors;
 }
 
 static int
 check_membership(Pers_no pno,
 		 const Membership *mship)
 {
-    int error=0;
+    int errors=0;
     Conference *conf;
     int i;
     Local_text_no last=0;
@@ -893,7 +895,7 @@ check_membership(Pers_no pno,
     {
 	log("Person %lu is a member in the non-existing conference %lu.\n",
 	    (unsigned long)pno, (unsigned long)mship->conf_no);
-	error++;
+	errors++;
     }
     else
     {
@@ -908,7 +910,7 @@ check_membership(Pers_no pno,
 		(unsigned long)mship->conf_no,
 		(unsigned long)(conf->texts.first_local_no
 			 + conf->texts.no_of_texts - 1));
-	    error++;
+	    errors++;
 	}
 
 	for ( last = i = 0; i < mship->no_of_read; i++)
@@ -920,7 +922,7 @@ check_membership(Pers_no pno,
 		    "is corrupt: read text number",
 		    (unsigned long)mship->read_texts[i], (unsigned long)i,
 		    (unsigned long)last);
-		error++;
+		errors++;
 	    }
 
 	    last = mship->read_texts[i];
@@ -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",
 		(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,
 {
     unsigned long i;
     Text_stat *t;
-    int error=0;
+    int errors=0;
 
     for ( i=0; i < tlist->no_of_texts; i++ )
     {
@@ -1131,7 +1133,7 @@ check_texts_in_conf(Conf_no cc,
 			(unsigned long)cc);
 		}
 		else
-		    error++;
+		    errors++;
 	    }
 	    else
 	    {
@@ -1152,7 +1154,7 @@ check_texts_in_conf(Conf_no cc,
 			    (unsigned long)cc);
 		    }
 		    else
-			error++;
+			errors++;
 		}
 	    }
 	}
@@ -1170,10 +1172,10 @@ check_texts_in_conf(Conf_no cc,
 	    log("Repaired: text_list adjusted.\n");
 	}
 	else
-	    error++;
+	    errors++;
     }
     
-    return error;
+    return errors;
 }
 
 Membership *
@@ -1200,14 +1202,14 @@ check_member(Conf_no cc,
 	     Member *memb)
 {
     Person *pp;
-    int error=0;
+    int errors=0;
 
     pp = cached_get_person_stat(memb->member);
     if ( pp == NULL )
     {
 	log("Person %lu, supposedly a member in conf %lu, is nonexistent.\n",
 	    (unsigned long)memb->member, (unsigned long)cc);
-	error++;
+	errors++;
     }
     else
     {
@@ -1216,11 +1218,11 @@ check_member(Conf_no cc,
 	    log("Person %lu is not a member in conf %lu.\n",
 		(unsigned long)memb->member,
 		(unsigned long)cc);
-	    error++;
+	    errors++;
 	}
     }
 
-    return error;
+    return errors;
 }
 
 static int
@@ -1331,7 +1333,7 @@ check_data_base(void)
 }
 
 static void
-init_data_base(char *dbase_dir)
+init_data_base(void)
 {
     if ( vflag )
     {
@@ -1604,7 +1606,7 @@ main (int    argc,
 
     s_set_storage_management(smalloc, srealloc, sfree);
 
-    init_data_base(param.dbase_dir);
+    init_data_base();
     errors = check_data_base();
 
     if (truncated_texts == TRUE)
-- 
GitLab