From c92aabd43433dfb3d5d26a1dec315693a94d9ec2 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 29 Aug 2013 23:11:14 +0200 Subject: [PATCH] Fix build of pkgman with gcc2. * I have no idea why, but gcc2 considers BSolverRepository* and PackageManager::InstalledRepository* as distinct pointer types, which it doesn't like to compare without a cast. Circumvent by static casting to BSolverRepository*. --- src/bin/pkgman/command_search.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/pkgman/command_search.cpp b/src/bin/pkgman/command_search.cpp index 3ae8d3a1af..35902c7865 100644 --- a/src/bin/pkgman/command_search.cpp +++ b/src/bin/pkgman/command_search.cpp @@ -60,7 +60,7 @@ get_terminal_width() struct winsize windowSize; if (isatty(fd) == 1 && ioctl(fd, TIOCGWINSZ, &windowSize) == 0) return windowSize.ws_col; - + return INT_MAX; } @@ -185,11 +185,14 @@ SearchCommand::Execute(int argc, const char* const* argv) BSolverPackage* package = packages.ItemAt(i); const char* installed = ""; - if (package->Repository() == packageManager.SystemRepository()) + if (package->Repository() == static_cast( + packageManager.SystemRepository())) installed = "system"; - else if (package->Repository() == packageManager.CommonRepository()) + else if (package->Repository() == static_cast( + packageManager.CommonRepository())) installed = "common"; - else if (package->Repository() == packageManager.HomeRepository()) + else if (package->Repository() == static_cast( + packageManager.HomeRepository())) installed = "home"; printf("%-*s %-*s %-*.*s\n",