summaryrefslogtreecommitdiff
path: root/methods/rred.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-05-07 17:55:10 +0200
committerMichael Vogt <mvo@debian.org>2014-05-07 17:55:10 +0200
commit38d2959ffb8c6f5f291b2910014a67b1b352ab4c (patch)
treec5977b8f34aaf973ed3956952ec3ff43ac59f143 /methods/rred.cc
parentfce69e7a0f38299c57ef96ae1c1dd9a5379bfd5a (diff)
parent3fa4e98f62e469f4292d2811b4e15f4afb678fbd (diff)
Merge branch 'debian/sid' into debian/experimental
Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
Diffstat (limited to 'methods/rred.cc')
-rw-r--r--methods/rred.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index fe7ef7322..cabb3c456 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -8,19 +8,18 @@
#include <config.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/mmap.h>
#include <apt-pkg/error.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
+#include <stddef.h>
+#include <iostream>
#include <string>
#include <list>
#include <vector>
-#include <iterator>
-#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -469,7 +468,7 @@ class Patch {
void write_diff(FILE *f)
{
- size_t line = 0;
+ unsigned long long line = 0;
std::list<struct Change>::reverse_iterator ch;
for (ch = filechanges.rbegin(); ch != filechanges.rend(); ++ch) {
line += ch->offset + ch->del_cnt;
@@ -482,11 +481,11 @@ class Patch {
line -= ch->del_cnt;
if (ch->add_cnt > 0) {
if (ch->del_cnt == 0) {
- fprintf(f, "%lua\n", line);
+ fprintf(f, "%llua\n", line);
} else if (ch->del_cnt == 1) {
- fprintf(f, "%luc\n", line+1);
+ fprintf(f, "%lluc\n", line+1);
} else {
- fprintf(f, "%lu,%luc\n", line+1, line+ch->del_cnt);
+ fprintf(f, "%llu,%lluc\n", line+1, line+ch->del_cnt);
}
mg_i = ch;
@@ -496,9 +495,9 @@ class Patch {
fprintf(f, ".\n");
} else if (ch->del_cnt == 1) {
- fprintf(f, "%lud\n", line+1);
+ fprintf(f, "%llud\n", line+1);
} else if (ch->del_cnt > 1) {
- fprintf(f, "%lu,%lud\n", line+1, line+ch->del_cnt);
+ fprintf(f, "%llu,%llud\n", line+1, line+ch->del_cnt);
}
line -= ch->offset;
}