2 # remove (numerous) compile warnings
4 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/file_util.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/file_util.c
5 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/file_util.c 2006-05-09 02:06:48.000000000 +0200
6 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/file_util.c 2006-05-09 02:16:48.000000000 +0200
9 int file_mkdir_hier(const char *path, long mode)
11 - return bb_make_directory(path, mode, FILEUTILS_RECUR);
12 + return bb_make_directory((char *)path, mode, FILEUTILS_RECUR);
15 char *file_md5sum_alloc(const char *file_name)
16 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_cmd.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_cmd.c
17 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_cmd.c 2006-05-09 02:23:37.000000000 +0200
18 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_cmd.c 2006-05-09 02:23:17.000000000 +0200
20 in = fopen (tmp_file_name, "r");
21 out = fopen (list_file_name, "w");
23 - inflate_unzip (in, out);
24 + inflate_unzip (fileno(in), fileno(out));
29 pkg_vec_free(available);
31 pkg_vec_t *installed_pkgs = pkg_vec_alloc();
33 int flagged_pkg_count = 0;
36 pkg_hash_fetch_all_installed(&conf->pkg_hash, installed_pkgs);
38 for (i = 0; i < installed_pkgs->len; i++) {
39 - pkg_t *pkg = installed_pkgs->pkgs[i];
40 + pkg = installed_pkgs->pkgs[i];
41 if (pkg->state_flag & SF_USER) {
47 for (i = 0; i < installed_pkgs->len; i++) {
48 - pkg_t *pkg = installed_pkgs->pkgs[i];
49 + pkg = installed_pkgs->pkgs[i];
50 if (!(pkg->state_flag & SF_USER)
51 && !pkg_has_installed_dependents(conf, pkg->parent, pkg, NULL)) {
57 - const char *flags = argv[0];
58 + char *flags = argv[0];
61 signal(SIGINT, sigint_handler);
62 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_conf.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_conf.c
63 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_conf.c 2006-05-09 02:12:04.000000000 +0200
64 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_conf.c 2006-05-09 02:16:48.000000000 +0200
66 if (strcmp(type, "option") == 0) {
67 ipkg_conf_set_option(options, name, value);
68 } else if (strcmp(type, "src") == 0) {
69 - if (!nv_pair_list_find(pkg_src_list, name)) {
70 + if (!nv_pair_list_find((nv_pair_list_t *)pkg_src_list, name)) {
71 pkg_src_list_append (pkg_src_list, name, value, extra, 0);
73 ipkg_message(conf, IPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
76 } else if (strcmp(type, "src/gz") == 0) {
77 - if (!nv_pair_list_find(pkg_src_list, name)) {
78 + if (!nv_pair_list_find((nv_pair_list_t *)pkg_src_list, name)) {
79 pkg_src_list_append (pkg_src_list, name, value, extra, 1);
81 ipkg_message(conf, IPKG_ERROR, "ERROR: duplicate src declaration. Skipping:\n\t src %s %s\n",
82 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_download.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_download.c
83 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/ipkg_download.c 2006-05-09 02:12:04.000000000 +0200
84 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/ipkg_download.c 2006-05-09 02:22:51.000000000 +0200
88 pkg->local_filename = strdup(url);
89 - ipkg_message(conf, IPKG_DEBUG2, "Package %s provided by hand \(%s\).\n", pkg->name,pkg->local_filename);
90 + ipkg_message(conf, IPKG_DEBUG2, "Package %s provided by hand (%s).\n", pkg->name,pkg->local_filename);
91 pkg->provided_by_hand = 1;
94 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/libipkg.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/libipkg.c
95 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/libipkg.c 2006-05-09 02:12:05.000000000 +0200
96 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/libipkg.c 2006-05-09 02:16:48.000000000 +0200
99 ipkg_op (int argc, char *argv[])
102 + int err, opt_index;
106 @@ -453,13 +453,13 @@
110 - optind = args_parse (&args, argc, argv);
111 - if (optind == argc || optind < 0)
112 + opt_index = args_parse (&args, argc, argv);
113 + if (opt_index == argc || opt_index < 0)
115 args_usage ("ipkg must have one sub-command argument");
118 - cmd_name = argv[optind++];
119 + cmd_name = argv[opt_index++];
120 /* Pigi: added a flag to disable the checking of structures if the command does not need to
121 read anything from there.
127 - if (cmd->requires_args && optind == argc)
128 + if (cmd->requires_args && opt_index == argc)
131 "%s: the ``%s'' command requires at least one argument\n",
136 - err = ipkg_cmd_exec (cmd, &ipkg_conf, argc - optind, (const char **) (argv + optind), NULL);
137 + err = ipkg_cmd_exec (cmd, &ipkg_conf, argc - opt_index, (const char **) (argv + opt_index), NULL);
139 ipkg_conf_deinit (&ipkg_conf);
141 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/md5.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/md5.c
142 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/md5.c 2006-05-09 02:06:48.000000000 +0200
143 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/md5.c 2006-05-09 02:16:48.000000000 +0200
145 int md5_stream(FILE *stream, void *resblock)
150 if( (fd = fileno(stream)) == -1 ) {
151 bb_error_msg("bad file descriptor");
152 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg.c
153 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg.c 2006-05-09 02:12:05.000000000 +0200
154 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg.c 2006-05-09 02:16:48.000000000 +0200
156 char * pkg_formatted_field(pkg_t *pkg, const char *field )
158 static size_t LINE_LEN = 128;
159 + char line_str[LINE_LEN];
160 char * temp = (char *)malloc(1);
162 int flag_provide_false = 0;
164 if (strcasecmp(field, "Conffiles") == 0) {
166 conffile_list_elt_t *iter;
167 - char confstr[LINE_LEN];
169 if (pkg->conffiles.head == NULL) {
171 @@ -588,15 +588,14 @@
172 strncpy(temp, "Conffiles:\n", 12);
173 for (iter = pkg->conffiles.head; iter; iter = iter->next) {
174 if (iter->data->name && iter->data->value) {
175 - snprintf(confstr, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
176 - strncat(temp, confstr, strlen(confstr));
177 + snprintf(line_str, LINE_LEN, "%s %s\n", iter->data->name, iter->data->value);
178 + strncat(temp, line_str, strlen(line_str));
181 } else if (strcasecmp(field, "Conflicts") == 0) {
184 if (pkg->conflicts_count) {
185 - char conflictstr[LINE_LEN];
187 for(i = 0; i < pkg->conflicts_count; i++) {
188 len = len + (strlen(pkg->conflicts_str[i])+5);
191 strncpy(temp, "Conflicts:", 11);
192 for(i = 0; i < pkg->conflicts_count; i++) {
193 - snprintf(conflictstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->conflicts_str[i]);
194 - strncat(temp, conflictstr, strlen(conflictstr));
195 + snprintf(line_str, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->conflicts_str[i]);
196 + strncat(temp, line_str, strlen(line_str));
198 strncat(temp, "\n", strlen("\n"));
203 if (pkg->depends_count) {
204 - char depstr[LINE_LEN];
206 for(i = 0; i < pkg->depends_count; i++) {
207 len = len + (strlen(pkg->depends_str[i])+4);
210 strncpy(temp, "Depends:", 10);
211 for(i = 0; i < pkg->depends_count; i++) {
212 - snprintf(depstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->depends_str[i]);
213 - strncat(temp, depstr, strlen(depstr));
214 + snprintf(line_str, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->depends_str[i]);
215 + strncat(temp, line_str, strlen(line_str));
217 strncat(temp, "\n", strlen("\n"));
220 /* Replaces | Recommends*/
221 if (strcasecmp (field, "Replaces") == 0) {
222 if (pkg->replaces_count) {
223 - char replstr[LINE_LEN];
225 for (i = 0; i < pkg->replaces_count; i++) {
226 len = len + (strlen(pkg->replaces_str[i])+5);
227 @@ -817,14 +814,13 @@
229 strncpy(temp, "Replaces:", 12);
230 for (i = 0; i < pkg->replaces_count; i++) {
231 - snprintf(replstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->replaces_str[i]);
232 - strncat(temp, replstr, strlen(replstr));
233 + snprintf(line_str, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->replaces_str[i]);
234 + strncat(temp, line_str, strlen(line_str));
236 strncat(temp, "\n", strlen("\n"));
238 } else if (strcasecmp (field, "Recommends") == 0) {
239 if (pkg->recommends_count) {
240 - char recstr[LINE_LEN];
242 for(i = 0; i < pkg->recommends_count; i++) {
243 len = len + (strlen( pkg->recommends_str[i])+5);
246 strncpy(temp, "Recommends:", 13);
247 for(i = 0; i < pkg->recommends_count; i++) {
248 - snprintf(recstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->recommends_str[i]);
249 - strncat(temp, recstr, strlen(recstr));
250 + snprintf(line_str, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->recommends_str[i]);
251 + strncat(temp, line_str, strlen(line_str));
253 strncat(temp, "\n", strlen("\n"));
256 } else if (strcasecmp(field, "Suggests") == 0) {
257 if (pkg->suggests_count) {
259 - char sugstr[LINE_LEN];
261 for(i = 0; i < pkg->suggests_count; i++) {
262 len = len + (strlen(pkg->suggests_str[i])+5);
265 strncpy(temp, "Suggests:", 10);
266 for(i = 0; i < pkg->suggests_count; i++) {
267 - snprintf(sugstr, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->suggests_str[i]);
268 - strncat(temp, sugstr, strlen(sugstr));
269 + snprintf(line_str, LINE_LEN, "%s %s", i == 0 ? "" : ",", pkg->suggests_str[i]);
270 + strncat(temp, line_str, strlen(line_str));
272 strncat(temp, "\n", strlen("\n"));
274 @@ -1140,10 +1135,8 @@
278 -int pkg_name_version_and_architecture_compare(void *p1, void *p2)
279 +int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b)
281 - const pkg_t *a = *(const pkg_t **)p1;
282 - const pkg_t *b = *(const pkg_t **)p2;
285 if (!a->name || !b->name) {
286 @@ -1170,10 +1163,8 @@
290 -int abstract_pkg_name_compare(void *p1, void *p2)
291 +int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b)
293 - const abstract_pkg_t *a = *(const abstract_pkg_t **)p1;
294 - const abstract_pkg_t *b = *(const abstract_pkg_t **)p2;
295 if (!a->name || !b->name) {
296 fprintf(stderr, "abstract_pkg_name_compare: a=%p a->name=%p b=%p b->name=%p\n",
297 a, a->name, b, b->name);
298 @@ -1193,7 +1184,7 @@
302 - sprintf_alloc(&epoch_str, "%d:", pkg->epoch);
303 + sprintf_alloc(&epoch_str, "%d:", (int)(pkg->epoch));
305 epoch_str = strdup("");
307 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg.h busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg.h
308 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg.h 2006-05-09 02:12:05.000000000 +0200
309 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg.h 2006-05-09 02:16:48.000000000 +0200
311 char *pkg_version_str_alloc(pkg_t *pkg);
313 int pkg_compare_versions(const pkg_t *pkg, const pkg_t *ref_pkg);
314 -int pkg_name_version_and_architecture_compare(void *a, void *b);
315 -int abstract_pkg_name_compare(void *a, void *b);
316 +int pkg_name_version_and_architecture_compare(pkg_t *a, pkg_t *b);
317 +int abstract_pkg_name_compare(abstract_pkg_t *a, abstract_pkg_t *b);
319 char * pkg_formatted_info(pkg_t *pkg );
320 char * pkg_formatted_field(pkg_t *pkg, const char *field );
321 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_depends.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_depends.c
322 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_depends.c 2006-05-09 02:12:05.000000000 +0200
323 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_depends.c 2006-05-09 02:16:48.000000000 +0200
325 pkg_vec_t *unsatisfied, char *** unresolved)
327 pkg_t * satisfier_entry_pkg;
328 - register int i, j, k;
329 + register int i, j, k, l;
332 abstract_pkg_t * ab_pkg;
334 abstract_pkg_vec_t *ab_provider_vec = abpkg->provided_by;
335 int nposs = ab_provider_vec->len;
336 abstract_pkg_t **ab_providers = ab_provider_vec->pkgs;
338 for (l = 0; l < nposs; l++) {
339 pkg_vec_t *test_vec = ab_providers[l]->pkgs;
340 /* if no depends on this one, try the first package that Provides this one */
344 if (newstuff == NULL) {
347 - for (i = 0; i < rc; i++) {
348 - pkg_t *p = tmp_vec->pkgs[i];
349 + for (l = 0; l < rc; l++) {
350 + pkg_t *p = tmp_vec->pkgs[l];
351 if (p->state_want == SW_INSTALL)
353 ipkg_message(conf, IPKG_DEBUG, "not installing %s due to requirement for %s\n", pkg_scout->name, p->name);
354 @@ -814,27 +812,27 @@
355 * [npredepends+nrecommends,npredepends+nrecommends+nsuggests) -> returns recommends_str[index]
356 * [npredepends+nrecommends+nsuggests,npredepends+nrecommends+nsuggests+ndepends) -> returns depends_str[index]
358 -char *pkg_depend_str(pkg_t *pkg, int index)
359 +char *pkg_depend_str(pkg_t *pkg, int pkg_index)
361 - if (index < pkg->pre_depends_count) {
362 - return pkg->pre_depends_str[index];
363 + if (pkg_index < pkg->pre_depends_count) {
364 + return pkg->pre_depends_str[pkg_index];
366 - index -= pkg->pre_depends_count;
367 + pkg_index -= pkg->pre_depends_count;
369 - if (index < pkg->recommends_count) {
370 - return pkg->recommends_str[index];
371 + if (pkg_index < pkg->recommends_count) {
372 + return pkg->recommends_str[pkg_index];
374 - index -= pkg->recommends_count;
375 + pkg_index -= pkg->recommends_count;
377 - if (index < pkg->suggests_count) {
378 - return pkg->suggests_str[index];
379 + if (pkg_index < pkg->suggests_count) {
380 + return pkg->suggests_str[pkg_index];
382 - index -= pkg->suggests_count;
383 + pkg_index -= pkg->suggests_count;
385 - if (index < pkg->depends_count) {
386 - return pkg->depends_str[index];
387 + if (pkg_index < pkg->depends_count) {
388 + return pkg->depends_str[pkg_index];
390 - fprintf(stderr, "pkg_depend_str: index %d out of range for pkg=%s\n", index, pkg->name);
391 + fprintf(stderr, "pkg_depend_str: index %d out of range for pkg=%s\n", pkg_index, pkg->name);
395 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_depends.h busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_depends.h
396 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_depends.h 2006-05-09 02:06:48.000000000 +0200
397 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_depends.h 2006-05-09 02:16:48.000000000 +0200
400 int pkg_conflicts(pkg_t *pkg, pkg_t *conflicts);
402 -char *pkg_depend_str(pkg_t *pkg, int index);
403 +char *pkg_depend_str(pkg_t *pkg, int pkg_index);
404 void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg);
405 void freeDepends(pkg_t *pkg);
406 void printDepends(pkg_t * pkg);
407 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_hash.c busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_hash.c
408 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_hash.c 2006-05-09 02:12:05.000000000 +0200
409 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_hash.c 2006-05-09 02:17:35.000000000 +0200
411 pkg_t *pkg_hash_fetch_best_installation_candidate(ipkg_conf_t *conf, abstract_pkg_t *apkg,
412 int (*constraint_fcn)(pkg_t *pkg, void *cdata), void *cdata, int quiet)
418 pkg_vec_t *matching_pkgs = pkg_vec_alloc();
419 @@ -209,11 +209,10 @@
420 /* now check for supported architecture */
425 /* count packages matching max arch priority and keep track of last one */
426 - for (i = 0; i < vec->len; i++) {
427 - pkg_t *maybe = vec->pkgs[i];
428 + for (j = 0; j < vec->len; j++) {
429 + pkg_t *maybe = vec->pkgs[j];
430 ipkg_message(conf, IPKG_DEBUG, " %s arch=%s arch_priority=%d version=%s \n",
431 maybe->name, maybe->architecture, maybe->arch_priority, maybe->version);
432 if (maybe->arch_priority > 0) {
433 diff -ruN busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_vec.h busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_vec.h
434 --- busybox-1.1.2+ipkg-0.99.162/archival/libipkg/pkg_vec.h 2006-05-09 02:06:48.000000000 +0200
435 +++ busybox-1.1.2+ipkg-0.99.162-no_warnings/archival/libipkg/pkg_vec.h 2006-05-09 02:16:48.000000000 +0200
438 typedef struct abstract_pkg_vec abstract_pkg_vec_t;
440 +typedef int (*pkg_compar_t)(pkg_t *, pkg_t *);
441 +typedef int (*abstract_pkg_compar_t)(abstract_pkg_t *, abstract_pkg_t *);
443 pkg_vec_t * pkg_vec_alloc(void);
444 void pkg_vec_free(pkg_vec_t *vec);