]> andersk Git - moira.git/blobdiff - dbck/phase3.pc
Code style cleanup. (No functional changes)
[moira.git] / dbck / phase3.pc
index 529c0e8a82a6ebe790ac509235d29894e5a4e0fe..2f7a27b9f9ad7d1c9aaae9fc77bbc01c2eaf607f 100644 (file)
@@ -6,77 +6,74 @@
  */
 
 #include <mit-copyright.h>
+#include <stdio.h>
 #include "dbck.h"
 
 static char phase3_qc_rcsid[] = "$Header$";
 
 
-empty_list_check(id, l, hint)
-int id, hint;
-struct list *l;
+empty_list_check(int id, struct list *l, int hint)
 {
-    if (l->members == 0 && l->list_id != 0)
-      printf("Warning: List %s is empty\n", l->name);
+  if (l->members == 0 && l->list_id != 0)
+    printf("Warning: List %s is empty\n", l->name);
 }
 
 
 /* Used by other parts of the program to check that a string_id is good.
- * This returns TRUE if it is, or FALSE if it is not, and as a side effect
+ * This returns the stringif it is, or NULL if it is not, and as a side effect
  * increments the string reference count.
  */
 
-struct string *string_check(id)
-int id;
+struct string *string_check(int id)
 {
-    register struct string *s;
+  register struct string *s;
 
-    s = (struct string *) hash_lookup(strings, id);
-    if (s == NULL)
-      return(s);
-    s->refc++;
-    return(s);
+  s = (struct string *) hash_lookup(strings, id);
+  if (!s)
+    return s;
+  s->refc++;
+  return s;
 }
 
 
-unref_string_check(id, s, hint)
-int id, hint;
-struct string *s;
+unref_string_check(int id, struct string *s, int hint)
 {
-    if (s->refc == 0) {
-       printf("Unreferenced string %s id %d\n", s->name, id);
-       if (single_fix("Delete", 1))
-         single_delete("strings", "string_id", id);
+  if (s->refc == 0)
+    {
+      printf("Unreferenced string %s id %d\n", s->name, id);
+      if (single_fix("Delete", 1))
+       single_delete("strings", "string_id", id);
     }
 }
 
 /*  This test was disabled because the MIT Moira server, which
- * initially only managed host information for workstations and
+ *  initially only managed host information for workstations and
  *  servers in the Athena Computing Environment, has been extended to
  *  manage all hosts in the MIT.EDU domain (but not subdomains).
  */
-/*
-noclu_mach_check(id, m, hint)
-int id, hint;
-struct machine *m;
+#ifndef ATHENA
+noclu_mach_check(int id, struct machine *m, int hint)
 {
-    if (m->clucount == 0 && m->mach_id != 0)
-      printf("Warning: machine %s is not in any clusters\n", m->name);
+  if (m->clucount == 0 && m->mach_id != 0)
+    printf("Warning: machine %s is not in any clusters\n", m->name);
 }
-*/
+#endif
 
-phase3()
+phase3(void)
 {
-    printf("Phase 3 - Finding unused objects\n");
+  printf("Phase 3 - Finding unused objects\n");
 
-    if (warn) {
-/*     dprintf("Checking machines...\n");
- *     hash_step(machines, noclu_mach_check, NULL);
- */
-       dprintf("Checking lists...\n");
-       hash_step(lists, empty_list_check, NULL);
+  if (warn)
+    {
+#ifndef ATHENA
+      dprintf("Checking machines...\n");
+      hash_step(machines, noclu_mach_check, NULL);
+#endif
+      dprintf("Checking lists...\n");
+      hash_step(lists, empty_list_check, NULL);
     }
 
-    dprintf("Checking strings...\n");
-    hash_step(strings, unref_string_check, NULL);
+  dprintf("Checking strings...\n");
+  hash_step(strings, unref_string_check, NULL);
 }
 
This page took 0.044805 seconds and 4 git commands to generate.