]>
Commit | Line | Data |
---|---|---|
17adfc44 AM |
1 | diff -urBb poldek-0.18.9.org/main.c poldek-0.18.9/main.c |
2 | --- poldek-0.18.9.org/main.c 2005-07-03 13:04:16.000000000 +0000 | |
3 | +++ poldek-0.18.9/main.c 2005-10-01 19:58:23.000000000 +0000 | |
8d3d5750 AM |
4 | @@ -124,8 +124,8 @@ |
5 | #define INDEXTYPE_TXTZ 2 | |
6 | ||
7 | struct split_conf { | |
8 | - int size; | |
9 | - int first_free_space; | |
266d33c8 AM |
10 | + unsigned long long size; |
11 | + unsigned long long first_free_space; | |
8d3d5750 AM |
12 | char *conf; |
13 | char *prefix; | |
14 | }; | |
17adfc44 AM |
15 | @@ -930,11 +930,11 @@ |
16 | argsp->mjrmode = MODE_SPLIT; | |
17 | ||
18 | if ((p = strrchr(arg, ':'))) { | |
19 | - rc = sscanf(arg, "%d:%d", &argsp->split_conf.size, | |
20 | + rc = sscanf(arg, "%lld:%lld", &argsp->split_conf.size, | |
21 | &argsp->split_conf.first_free_space); | |
22 | rc = (rc == 2); | |
23 | } else { | |
24 | - rc = sscanf(arg, "%d", &argsp->split_conf.size); | |
25 | + rc = sscanf(arg, "%lld", &argsp->split_conf.size); | |
26 | rc = (rc == 1); | |
27 | } | |
28 | if (!rc) { | |
29 | diff -urBb poldek-0.18.9.org/split.c poldek-0.18.9/split.c | |
30 | --- poldek-0.18.9.org/split.c 2002-06-12 15:50:57.000000000 +0000 | |
31 | +++ poldek-0.18.9/split.c 2005-10-01 19:59:02.000000000 +0000 | |
c15ff026 AM |
32 | @@ -35,8 +35,8 @@ |
33 | ||
34 | struct chunk { | |
35 | int no; | |
36 | - unsigned size; | |
37 | - unsigned maxsize; | |
266d33c8 AM |
38 | + unsigned long long size; |
39 | + unsigned long long maxsize; | |
c15ff026 AM |
40 | int items; |
41 | tn_array *pkgs; | |
42 | }; | |
43 | @@ -46,7 +46,7 @@ | |
44 | char mask[0]; | |
45 | }; | |
46 | ||
47 | -static struct chunk *chunk_new(int no, int maxsize) | |
266d33c8 | 48 | +static struct chunk *chunk_new(int no, unsigned long long maxsize) |
c15ff026 AM |
49 | { |
50 | struct chunk *chunk; | |
51 | ||
52 | @@ -238,7 +238,7 @@ | |
53 | ||
54 | ||
55 | static | |
56 | -int try_package(int deep, unsigned *chunk_size, unsigned maxsize, | |
17adfc44 | 57 | +int try_package(int deep, unsigned long long *chunk_size, unsigned long long maxsize, |
c15ff026 AM |
58 | struct pkg *pkg, tn_array *stack) |
59 | { | |
60 | int i, rc = 1; | |
61 | @@ -253,7 +253,7 @@ | |
62 | n_array_push(stack, pkg_link(pkg)); | |
63 | *chunk_size += pkg->fsize; | |
64 | ||
65 | - DBGF("trying %s: %d (%d) > %d\n", pkg_snprintf_s(pkg), *chunk_size, | |
17adfc44 | 66 | + DBGF("trying %s: %lld (%d) > %lld\n", pkg_snprintf_s(pkg), *chunk_size, |
c15ff026 AM |
67 | pkg->fsize, maxsize); |
68 | ||
69 | if (*chunk_size > maxsize) | |
06dd8aa7 AM |
70 | @@ -278,7 +278,7 @@ |
71 | int chunk_add(struct chunk *chunk, struct pkg *pkg) | |
72 | { | |
73 | int i, rc = 0; | |
74 | - int chunk_size = 0; | |
75 | + unsigned long long chunk_size = 0; | |
76 | tn_array *stack = NULL; | |
77 | ||
78 | ||
c15ff026 AM |
79 | @@ -319,7 +319,7 @@ |
80 | ||
81 | ||
82 | static | |
83 | -int make_chunks(tn_array *pkgs, unsigned split_size, unsigned first_free_space, | |
266d33c8 | 84 | +int make_chunks(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space, |
c15ff026 AM |
85 | const char *outprefix) |
86 | { | |
87 | int i, chunk_no = 0, rc = 1; | |
88 | @@ -371,7 +371,7 @@ | |
89 | ||
90 | snprintf(path, sizeof(path), "%s.%d", outprefix, chunk->no); | |
91 | ||
92 | - msgn(0, _("Writing %s (%4d packages, % 10d bytes, " | |
93 | + msgn(0, _("Writing %s (%4d packages, % 15ld bytes, " | |
94 | "pri min, max = %d, %d)"), | |
95 | path, chunk->items, chunk->size, pri_min, pri_max); | |
96 | ||
17adfc44 AM |
97 | @@ -379,8 +379,8 @@ |
98 | if ((vf = vfile_open(path, VFT_STDIO, VFM_RW)) == NULL) | |
99 | return 0; | |
100 | ||
101 | -#if 0 | |
102 | - fprintf(vf->vf_stream, "# chunk #%d: %d packages, %d bytes\n", | |
103 | +#if 0 | |
104 | + fprintf(vf->vf_stream, "# chunk #%d: %d packages, %lld bytes\n", | |
105 | i, chunk->items, chunk->size); | |
106 | #endif | |
107 | chunk_dump(chunk, vf->vf_stream); | |
8489de1b AM |
108 | @@ -427,7 +427,7 @@ |
109 | } | |
110 | ||
111 | ||
112 | -int packages_split(tn_array *pkgs, unsigned split_size, unsigned first_free_space, | |
266d33c8 | 113 | +int packages_split(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space, |
8489de1b AM |
114 | const char *splitconf_path, const char *outprefix) |
115 | { | |
116 | tn_array *defs = NULL, *packages = NULL, *ordered_pkgs = NULL; | |
17adfc44 AM |
117 | diff -urBb poldek-0.18.9.org/split.h poldek-0.18.9/split.h |
118 | --- poldek-0.18.9.org/split.h 2001-09-11 16:08:37.000000000 +0000 | |
119 | +++ poldek-0.18.9/split.h 2005-10-01 19:00:42.000000000 +0000 | |
c15ff026 AM |
120 | @@ -4,7 +4,7 @@ |
121 | ||
122 | int packages_set_priorities(tn_array *pkgs, const char *splitconf_path); | |
123 | ||
124 | -int packages_split(tn_array *pkgs, unsigned split_size, unsigned first_free_space, | |
266d33c8 | 125 | +int packages_split(tn_array *pkgs, unsigned long long split_size, unsigned long long first_free_space, |
c15ff026 AM |
126 | const char *splitconf_path, const char *outprefix); |
127 | ||
128 | #endif |