Cleanup a bit.
authorMichael Matz <matz@suse.de>
Thu, 14 Feb 2008 14:56:16 +0000 (14:56 +0000)
committerMichael Matz <matz@suse.de>
Thu, 14 Feb 2008 14:56:16 +0000 (14:56 +0000)
src/CMakeLists.txt
src/fastlz.c
src/repo_solv.c
src/repodata.c

index b396727..db14219 100644 (file)
@@ -1,6 +1,6 @@
 
 SET(libsatsolver_SRCS bitmap.c  poolarch.c  poolvendor.c  poolid.c strpool.c dirpool.c
-solver.c repo_solv.c repo_helix.c evr.c pool.c queue.c   repo.c  repodata.c util.c policy.c)
+solver.c repo_solv.c repo_helix.c evr.c pool.c queue.c   repo.c  repodata.c util.c policy.c fastlz.c)
 
 ADD_LIBRARY(satsolver STATIC ${libsatsolver_SRCS})
 
index 02049c3..18ae722 100644 (file)
@@ -53,7 +53,7 @@
 */
 
 
-static unsigned int
+unsigned int
 compress_buf (const unsigned char *in, unsigned int in_len,
              unsigned char *out, unsigned int out_len)
 {
@@ -267,7 +267,7 @@ compress_buf (const unsigned char *in, unsigned int in_len,
   return oo;
 }
 
-static unsigned int
+unsigned int
 unchecked_decompress_buf (const unsigned char *in, unsigned int in_len,
                          unsigned char *out,
                          unsigned int out_len __attribute__((unused)))
index 695e5f4..e7ca7ee 100644 (file)
@@ -25,9 +25,6 @@
 
 #include "repo_solv.h"
 #include "util.h"
-#if 0
-#include "attr_store_p.h"
-#endif
 
 #define INTERESTED_START       SOLVABLE_NAME
 #define INTERESTED_END         SOLVABLE_FRESHENS
@@ -515,9 +512,6 @@ repo_add_solv_parent(Repo *repo, FILE *fp, Repodata *parent)
   int i, l;
   unsigned int numid, numrel, numdir, numsolv;
   unsigned int numkeys, numschemata, numinfo;
-#if 0
-  Attrstore *embedded_store = 0;
-#endif
 
   Offset sizeid;
   Offset *str;                        /* map Id -> Offset into string space */
@@ -699,16 +693,10 @@ repo_add_solv_parent(Repo *repo, FILE *fp, Repodata *parent)
   strsp[sizeid] = 0;                  /* make string space \0 terminated */
   sp = strsp;
 
-  /* make sure first entry is "" for a store */
   if (parent)
     {
       /* no shared pool, thus no idmap and no unification */
       idmap = 0;
-      if (0 && *sp)
-       {
-         pool_debug(pool, SAT_ERROR, "store strings don't start with ''\n");
-         return SOLV_ERROR_CORRUPT;
-       }
       spool->nstrings = numid;
       str[0] = 0;
       for (i = 1; i < spool->nstrings; i++)
@@ -1260,19 +1248,6 @@ fprintf(stderr, "solv %d name %d type %d class %d\n", i, id, keys[key].type, key
                POOL_DEBUG(SAT_DEBUG_STATS,"  %s\n", dep2str(pool, repo->idarraydata[ido]));
 #endif
              break;
-#if 0
-           case TYPE_VOID:
-
-           case TYPE_ATTR_INT:
-           case TYPE_ATTR_CHUNK:
-           case TYPE_ATTR_STRING:
-           case TYPE_ATTR_INTLIST:
-           case TYPE_ATTR_LOCALIDS:
-             if (!embedded_store)
-               embedded_store = new_store (pool);
-             add_attr_from_file (embedded_store, i, id, keys[key].type, idmap, numid, &data, keys[key].size);
-             break;
-#endif
            case TYPE_DIRNUMNUMARRAY:
              for (;;)
                {
@@ -1369,16 +1344,6 @@ fprintf(stderr, "solv %d name %d type %d class %d\n", i, id, keys[key].type, key
     }
 
   sat_free(exists);
-#if 0
-  if (embedded_store)
-    {
-      attr_store_pack (embedded_store);
-      /* If we have any attributes we also have pages.  */
-      read_or_setup_pages (fp, embedded_store);
-      /* The NULL name here means embedded attributes.  */
-      repo_add_attrstore (repo, embedded_store, NULL);
-    }
-#endif
   sat_free(idmap);
   mypool = 0;
   return data.error;
@@ -1394,7 +1359,6 @@ static void
 repodata_load_solv(Repodata *data)
 {
   FILE *fp;
-#if 1
   Pool *pool = data->repo->pool;
   if (!pool->loadcallback)
     {   
@@ -1402,9 +1366,6 @@ repodata_load_solv(Repodata *data)
       return;
     }   
   fp = pool->loadcallback(pool, data, pool->loadcallbackdata);
-#else
-  fp = 0;
-#endif
 
   if (!fp)
     {   
index 6fb9459..59782b1 100644 (file)
 #include "poolid_private.h"
 #include "util.h"
 
-#include "fastlz.c"
+extern unsigned int compress_buf (const unsigned char *in, unsigned int in_len,
+                                 unsigned char *out, unsigned int out_len);
+extern unsigned int unchecked_decompress_buf (const unsigned char *in,
+                                             unsigned int in_len,
+                                             unsigned char *out,
+                                             unsigned int out_len);
 
-unsigned char *
+static unsigned char *
 data_read_id(unsigned char *dp, Id *idp)
 {
   Id x = 0;