More dead code removal.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 6 Nov 2009 04:49:01 +0000 (04:49 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Fri, 6 Nov 2009 04:49:01 +0000 (04:49 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@271 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_download.c
libopkg/opkg_install.c
libopkg/pkg.c
libopkg/pkg_depends.h
libopkg/pkg_hash.c

index 70d1195..94f416c 100644 (file)
@@ -259,9 +259,8 @@ int opkg_prepare_url_for_install(opkg_conf_t *conf, const char *url, char **name
 {
      int err = 0;
      pkg_t *pkg;
+
      pkg = pkg_new();
-     if (pkg == NULL)
-         return ENOMEM;
 
      if (str_starts_with(url, "http://")
         || str_starts_with(url, "ftp://")) {
index b3ece9c..4a1ff9a 100644 (file)
@@ -86,9 +86,6 @@ int opkg_install_from_file(opkg_conf_t *conf, const char *filename)
      char *old_version, *new_version;
 
      pkg = pkg_new();
-     if (pkg == NULL) {
-         return ENOMEM;
-     }
 
      err = pkg_init_from_file(pkg, filename);
      if (err) {
index dc00186..7f7a5f3 100644 (file)
@@ -80,11 +80,6 @@ pkg_t *pkg_new(void)
      pkg_t *pkg;
 
      pkg = xcalloc(1, sizeof(pkg_t));
-     if (pkg == NULL) {
-         fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
-         return NULL;
-     }
-
      pkg_init(pkg);
 
      return pkg;
index f77332a..18570cb 100644 (file)
@@ -95,7 +95,6 @@ int pkg_conflicts(pkg_t *pkg, pkg_t *conflicts);
 
 char *pkg_depend_str(pkg_t *pkg, int index);
 void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg);
-void freeDepends(pkg_t *pkg);
 int version_constraints_satisfied(depend_t * depends, pkg_t * pkg);
 int pkg_hash_fetch_unsatisfied_dependencies(opkg_conf_t *conf, pkg_t * pkg, pkg_vec_t *depends, char *** unresolved);
 pkg_vec_t * pkg_hash_fetch_conflicts(hash_table_t * hash, pkg_t * pkg);
index 976ec96..cba3599 100644 (file)
@@ -124,8 +124,6 @@ int pkg_hash_add_from_file(opkg_conf_t *conf, const char *file_name,
 
      while(*raw){         /* don't worry, we'll increment raw in the parsing function */
          pkg = pkg_new();
-         if (!pkg)
-              return -ENOMEM;
 
          if (pkg_parse_raw(pkg, &raw, src, dest) == 0) {
               if (!pkg->architecture) {