]> git.pond.sub.org Git - empserver/commitdiff
Factor verify_table() out of ef_verify()
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 10 Jul 2011 15:08:03 +0000 (17:08 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 10 Jul 2011 19:16:41 +0000 (21:16 +0200)
src/lib/common/ef_verify.c

index dc380349815a72c7b81c1f819f286d78622173d9..2017c781eb4f86d2d8658a682a087137f1f8b9ac 100644 (file)
@@ -193,6 +193,20 @@ verify_row(int type, int row)
     return ret_val;
 }
 
+static int
+verify_table(int type)
+{
+    int retval = 0;
+    int i;
+
+    if (!ef_cadef(type))
+       return 0;
+    verify_ca(type);
+    for (i = 0; i < ef_nelem(type); i++)
+       retval |= verify_row(type, i);
+    return retval;
+}
+
 static int
 verify_planes(int may_put)
 {
@@ -308,16 +322,9 @@ ef_verify(int may_put)
 {
     struct empfile *ep;
     int retval = 0;
-    int i;
 
-    for (ep = empfile; ep->name; ep++) {
-       if (!ef_cadef(ep->uid))
-           continue;
-       verify_ca(ep->uid);
-       for (i = 0; i < ef_nelem(ep->uid); i++) {
-           retval |= verify_row(ep->uid, i);
-       }
-    }
+    for (ep = empfile; ep->name; ep++)
+       retval |= verify_table(ep->uid);
 
     /* Special checks */
     retval |= verify_planes(may_put);