summaryrefslogtreecommitdiff
path: root/dselect
diff options
context:
space:
mode:
authorAdam Heath <doogie@debian.org>2001-04-23 08:59:02 +0000
committerAdam Heath <doogie@debian.org>2001-04-23 08:59:02 +0000
commitea93ed48c17445d01b67f3fa8a20a5a644a89e5b (patch)
tree2883c9ea2b0833ef770fb5ff68fa18ba0acc2973 /dselect
parentecb9054f73b151acfa0fa81f1e89ce85ce8350c4 (diff)
downloaddpkg-ea93ed48c17445d01b67f3fa8a20a5a644a89e5b.tar.gz
Fixed up several warning types: const, casting, incorrect sizes,
signed/unsigned comparisons.
Diffstat (limited to 'dselect')
-rw-r--r--dselect/pkglist.cc12
-rw-r--r--dselect/pkglist.h2
-rw-r--r--dselect/pkgtop.cc2
3 files changed, 8 insertions, 8 deletions
diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc
index 98833fed1..8ef3d4b18 100644
--- a/dselect/pkglist.cc
+++ b/dselect/pkglist.cc
@@ -32,8 +32,8 @@ extern "C" {
#include "dselect.h"
#include "bindings.h"
-int packagelist::compareentries(struct perpackagestate *a,
- struct perpackagestate *b) {
+int packagelist::compareentries(const struct perpackagestate *a,
+ const struct perpackagestate *b) {
switch (statsortorder) {
case sso_avail:
if (a->ssavail != b->ssavail) return a->ssavail - b->ssavail;
@@ -123,8 +123,8 @@ void packagelist::addheading(enum ssavailval ssavail,
struct pkginfo *newhead= new pkginfo;
newhead->name= 0;
newhead->priority= priority;
- newhead->otherpriority= (char*)otherpriority;
- newhead->section= (char*)section;
+ newhead->otherpriority= otherpriority;
+ newhead->section= section;
struct perpackagestate *newstate= new perpackagestate;
newstate->pkg= newhead;
@@ -140,8 +140,8 @@ void packagelist::addheading(enum ssavailval ssavail,
static packagelist *sortpackagelist;
int qsort_compareentries(const void *a, const void *b) {
- return sortpackagelist->compareentries(*(perpackagestate**)a,
- *(perpackagestate**)b);
+ return sortpackagelist->compareentries((const struct perpackagestate*)&a,
+ (const struct perpackagestate*)&b);
}
void packagelist::sortinplace() {
diff --git a/dselect/pkglist.h b/dselect/pkglist.h
index 4bfc84352..232227afb 100644
--- a/dselect/pkglist.h
+++ b/dselect/pkglist.h
@@ -141,7 +141,7 @@ class packagelist : public baselist {
// Miscellaneous internal routines
void redraw1package(int index, int selected);
- int compareentries(struct perpackagestate *a, struct perpackagestate *b);
+ int compareentries(const struct perpackagestate *a, const struct perpackagestate *b);
friend int qsort_compareentries(const void *a, const void *b);
pkginfo::pkgwant reallywant(pkginfo::pkgwant, struct perpackagestate*);
int describemany(char buf[], const char *prioritystring, const char *section,
diff --git a/dselect/pkgtop.cc b/dselect/pkgtop.cc
index 4c6d763a0..1a9bb617f 100644
--- a/dselect/pkgtop.cc
+++ b/dselect/pkgtop.cc
@@ -183,7 +183,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
wmove(listpad,index,priority_column-1); waddch(listpad,' ');
if (pkg->priority == pkginfo::pri_other) {
int i;
- char *p;
+ const char *p;
for (i=priority_width, p=pkg->otherpriority;
i > 0 && *p;
i--, p++)