summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt-0.7.14/remove-redeclaration.patch
blob: 8d7c891545b293501d709a472455d85605332fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Fix build errors on gcc 4.7:

deb/deblistparser.cc: In member function 'virtual short unsigned int debListParser::VersionHash()':
deb/deblistparser.cc:212:13: error: redeclaration of 'char* I'
deb/deblistparser.cc:202:22: error: 'const char** I' previously declared here

Upstream-Status: Backport
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 apt-pkg/deb/deblistparser.cc |   10 +++++-----
 cmdline/apt-get.cc           |    8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -209,18 +209,18 @@ unsigned short debListParser::VersionHash()
       /* Strip out any spaces from the text, this undoes dpkgs reformatting
          of certain fields. dpkg also has the rather interesting notion of
          reformatting depends operators < -> <= */
-      char *I = S;
+      char *J = S;
       for (; Start != End; Start++)
       {
 	 if (isspace(*Start) == 0)
-	    *I++ = tolower(*Start);
+	    *J++ = tolower(*Start);
 	 if (*Start == '<' && Start[1] != '<' && Start[1] != '=')
-	    *I++ = '=';
+	    *J++ = '=';
 	 if (*Start == '>' && Start[1] != '>' && Start[1] != '=')
-	    *I++ = '=';
+	    *J++ = '=';
       }
 
-      Result = AddCRC16(Result,S,I - S);
+      Result = AddCRC16(Result,S,J - S);
    }
    
    return Result;
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1752,12 +1752,12 @@ bool DoInstall(CommandLine &CmdL)
 	 if ((*Cache)[I].Install() == false)
 	    continue;
 
-	 const char **J;
-	 for (J = CmdL.FileList + 1; *J != 0; J++)
-	    if (strcmp(*J,I.Name()) == 0)
+	 const char **K;
+	 for (K = CmdL.FileList + 1; *K != 0; K++)
+	    if (strcmp(*K,I.Name()) == 0)
 		break;
 	 
-	 if (*J == 0) {
+	 if (*K == 0) {
 	    List += string(I.Name()) + " ";
 	    VersionsList += string(Cache[I].CandVersion) + "\n";
 	 }
-- 
1.7.1