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 70d11955d781543933fb688f48652782338aed1c..94f416c7782d5c1a30bdc05b67e28031fbf958b7 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 b3ece9c80de3d271f208ca0c6cbc994bec8cf3ec..4a1ff9ac441cd7dd402145af1f0e2446d5c23640 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 dc001863078e41f4edd7c51cceb5a59689d94e0d..7f7a5f35ece0bedb637b83ed5b732926a33dac6c 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 f77332af84cb1e1c2ae6a9156f882214c1341482..18570cb31e06dbc07713a9776d4747692662d540 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 976ec96e28a979e0e9096bf920aa3268306e0d35..cba3599fe3417cd87cab466ba315253189814bb9 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) {