From 35506d0bdc8d007e56381776c50f77ec79db8e1d Mon Sep 17 00:00:00 2001
From: Miles Bader <miles@gnu.org>
Date: Mon, 23 Sep 1996 16:56:40 +0000
Subject: (store_decode):   Change CLASSES to be a vector of class pointers.

---
 libstore/decode.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(limited to 'libstore')

diff --git a/libstore/decode.c b/libstore/decode.c
index 5ce4c66e..e21c6e72 100644
--- a/libstore/decode.c
+++ b/libstore/decode.c
@@ -157,7 +157,7 @@ store_with_decoded_runs (struct store_enc *enc, size_t num_runs,
    0, STORE_STD_CLASSES is used.  If nothing else is to be done with ENC, its
    contents may then be freed using store_enc_dealloc.  */
 error_t
-store_decode (struct store_enc *enc, struct store_class *classes,
+store_decode (struct store_enc *enc, const struct store_class *const *classes,
 	      struct store **store)
 {
   if (enc->cur_int >= enc->num_ints)
@@ -167,12 +167,14 @@ store_decode (struct store_enc *enc, struct store_class *classes,
   if (! classes)
     classes = store_std_classes;
 
-  while (classes)
-    if (classes->id == enc->ints[enc->cur_int])
-      if (classes->decode)
-	return (*classes->decode) (enc, classes, store);
+  while (*classes)
+    if ((*classes)->id == enc->ints[enc->cur_int])
+      if ((*classes)->decode)
+	return (*(*classes)->decode) (enc, classes, store);
       else
 	return EOPNOTSUPP;
+    else
+      classes++;
 
   return EINVAL;
 }
-- 
cgit v1.2.3