-ALL_CFLAGS=-g -O -Wall -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir)
+ALL_CFLAGS=-g -O -Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir)
libopkg_includedir=$(includedir)/libopkg
int i, err;
FILE *file;
- unsigned char *md5sum_hex;
+ char *md5sum_hex;
unsigned char md5sum_bin[md5sum_bin_len];
md5sum_hex = malloc(md5sum_hex_len + 1);
if (strcmp(type, "option") == 0) {
opkg_conf_set_option(options, name, value);
} else if (strcmp(type, "src") == 0) {
- if (!nv_pair_list_find(pkg_src_list, name)) {
+ if (!nv_pair_list_find((nv_pair_list_t*) pkg_src_list, name)) {
pkg_src_list_append (pkg_src_list, name, value, extra, 0);
} else {
opkg_message(conf, OPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
name, value);
}
} else if (strcmp(type, "src/gz") == 0) {
- if (!nv_pair_list_find(pkg_src_list, name)) {
+ if (!nv_pair_list_find((nv_pair_list_t*) pkg_src_list, name)) {
pkg_src_list_append (pkg_src_list, name, value, extra, 1);
} else {
opkg_message(conf, OPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
*/
#include "opkg.h"
-
+#include "sprintf_alloc.h"
#include "opkg_configure.h"
#include "opkg_state.h"
return 0;
}
-int pkg_name_version_and_architecture_compare(void *p1, void *p2)
+int pkg_name_version_and_architecture_compare(const void *p1, const void *p2)
{
- const pkg_t *a = *(const pkg_t **)p1;
- const pkg_t *b = *(const pkg_t **)p2;
+ const pkg_t *a = *(const pkg_t**) p1;
+ const pkg_t *b = *(const pkg_t**) p2;
int namecmp;
int vercmp;
if (!a->name || !b->name) {
return 0;
}
-int abstract_pkg_name_compare(void *p1, void *p2)
+int abstract_pkg_name_compare(const void *p1, const void *p2)
{
const abstract_pkg_t *a = *(const abstract_pkg_t **)p1;
const abstract_pkg_t *b = *(const abstract_pkg_t **)p2;
char *pkg_version_str_alloc(pkg_t *pkg);
int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
-int pkg_name_version_and_architecture_compare(void *a, void *b);
-int abstract_pkg_name_compare(void *a, void *b);
+int pkg_name_version_and_architecture_compare(const void *a, const void *b);
+int abstract_pkg_name_compare(const void *a, const void *b);
char * pkg_formatted_info(pkg_t *pkg );
char * pkg_formatted_field(pkg_t *pkg, const char *field );
void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg)
{
- int i;
int found = 0;
#if 0
return 0;
}
-typedef int (*compare_fcn_t)(const void *, const void *);
-void pkg_vec_sort(pkg_vec_t *vec, int (*compar)(pkg_t *, pkg_t *))
+void pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar)
{
- qsort(vec->pkgs, vec->len, sizeof(pkg_t *), (compare_fcn_t)compar);
+ qsort(vec->pkgs, vec->len, sizeof(pkg_t *), compar);
}
int pkg_vec_clear_marks(pkg_vec_t *vec)
*/
void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg)
{
- int i;
#if 0
/* look for a duplicate pkg by name */
return 0;
}
-void abstract_pkg_vec_sort(pkg_vec_t *vec, int (*compar)(abstract_pkg_t *, abstract_pkg_t *))
+void abstract_pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar)
{
- qsort(vec->pkgs, vec->len, sizeof(pkg_t *), (compare_fcn_t)compar);
+ qsort(vec->pkgs, vec->len, sizeof(pkg_t *), compar);
}
/* this one never munges pkg */
void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg);
int pkg_vec_contains(pkg_vec_t *vec, pkg_t *apkg);
-void pkg_vec_sort(pkg_vec_t *vec, int (*compar)(pkg_t *, pkg_t *));
+
+typedef int (*compare_fcn_t)(const void *, const void *);
+void pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar);
int pkg_vec_clear_marks(pkg_vec_t *vec);
int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern);
void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg);
abstract_pkg_t * abstract_pkg_vec_get(abstract_pkg_vec_t *vec, int i);
int abstract_pkg_vec_contains(abstract_pkg_vec_t *vec, abstract_pkg_t *apkg);
-void abstract_pkg_vec_sort(pkg_vec_t *vec, int (*compar)(abstract_pkg_t *, abstract_pkg_t *));
+void abstract_pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar);
#endif