install packages, or to install packages that aren't installed by
default. */
-static char *cvsid =
+#if 0
+static const char *cvsid =
"\n%%% $Id$\n";
+#endif
#include "win32.h"
#include <stdio.h>
{
Dependency *dp;
Package *required;
- int c;
int changed = 0;
dp = pkg->required;
switch (pkg->action)
return "Source";
case ACTION_SKIP:
return "Skip";
+ default:
+ return "????";
}
return "???";
}
{
HDC hdc;
PAINTSTRUCT ps;
- int x, y, i, j, ii;
+ int x, y, i, ii;
hdc = BeginPaint (hwnd, &ps);
if (chooser->nlines == 0)
{
- static char *msg = "Nothing to Install/Update";
+ static const char *msg = "Nothing to Install/Update";
if (source == IDC_SOURCE_DOWNLOAD)
msg = "Nothing to Download";
TextOut (hdc, HMARGIN, header_height, msg, strlen (msg));
static void
scroll_common (HWND hwnd, int which, int *var, int code)
{
- int v = *var;
-
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_ALL;
if ((int) si.nPos < 0)
si.nPos = 0;
- if (si.nPos + si.nPage > si.nMax)
+ if (si.nPos + si.nPage > (unsigned int) si.nMax)
si.nPos = si.nMax - si.nPage;
si.fMask = SIF_POS;
/* if we are under the minimum display count ,
* set the offset to 0
*/
- if (si.nMax <= si.nPage)
+ if ((unsigned int) si.nMax <= si.nPage)
scroll_ulc_y = 0;
si.nPos = scroll_ulc_y;
}
static void
-note_width (struct _header *hdrs, HDC dc, char *string, int addend,
+note_width (struct _header *hdrs, HDC dc, const char *string, int addend,
int column)
{
if (!string)
static void
default_trust (HWND h, trusts trust)
{
- int i, t, c;
-
deftrust = trust;
for (Package * pkg = package; pkg->name; pkg++)
if (!pkg->exclude)
set_headers ();
}
-char *
+const char *
_view::mode_caption ()
{
switch (view_mode)
static void
set_view_mode (HWND h, views mode)
{
- int i;
chooser->set_view_mode (mode);
chooser->clear_view ();
static void
create_listview (HWND dlg, RECT * r)
{
- int i, t;
lv = CreateWindowEx (WS_EX_CLIENTEDGE,
"listview",
"listviewwindow",
default_trust (lv, TRUST_CURR);
set_view_mode (lv, VIEW_CATEGORY);
if (!SetDlgItemText (dlg, IDC_CHOOSE_VIEWCAPTION, chooser->mode_caption ()))
- log (LOG_BABBLE, "Failed to set View button caption %d", GetLastError ());
+ log (LOG_BABBLE, "Failed to set View button caption %ld", GetLastError ());
for (Package * foo = package; foo->name; foo++)
add_required (foo);
static int ta[] = { IDC_CHOOSE_CURR, 0 };
set_view_mode (lv, viewsplusplus (chooser->get_view_mode ()));
if (!SetDlgItemText
(h, IDC_CHOOSE_VIEWCAPTION, chooser->mode_caption ()))
- log (LOG_BABBLE, "Failed to set View button caption %d",
+ log (LOG_BABBLE, "Failed to set View button caption %ld",
GetLastError ());
break;
NEXT (0);
break;
}
+ return 0;
}
static void
static BOOL CALLBACK
dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
{
- int i, j;
HWND frame;
RECT r;
switch (message)
static void
read_installed_db ()
{
- int i;
if (!get_root_dir ())
return;
log (LOG_BABBLE, "Chooser results...");
for (Package * pkg = package; pkg->name; pkg++)
{
- static char *infos[] = { "nada", "prev", "curr", "test" };
+ static const char *infos[] = { "nada", "prev", "curr", "test" };
const char *trust = ((pkg->trust == TRUST_PREV) ? "prev"
: (pkg->trust == TRUST_CURR) ? "curr"
: (pkg->trust == TRUST_TEST) ? "test" : "unknown");
if (pkg->category)
{
/* List categories the package belongs to */
- char *categories = "";
int categories_len = 0;
Category *cp;
for (cp = pkg->category; cp; cp = cp->next)
if (categories_len > 0)
{
- categories = (char *) malloc (categories_len);
+ char *categories = (char *) malloc (categories_len);
strcpy (categories, pkg->category->name);
for (cp = pkg->category->next; cp; cp = cp->next)
if (cp->name)
if (pkg->required)
{
/* List other packages this package depends on */
- char *requires = "";
int requires_len = 0;
Dependency *dp;
for (dp = pkg->required; dp; dp = dp->next)
if (requires_len > 0)
{
- requires = (char *) malloc (requires_len);
+ char *requires = (char *) malloc (requires_len);
strcpy (requires, pkg->required->package);
for (dp = pkg->required->next; dp; dp = dp->next)
if (dp->package)
{
char *version; /* version part of filename */
char *install; /* file name to install */
- int install_size; /* in bytes */
+ unsigned int install_size; /* in bytes */
int install_exists; /* install file exists on disk */
int derived; /* True if we "figured out" that this version should
go here but it was not in setup.ini */
char *source; /* sources for installed binaries */
- int source_size; /* in bytes */
+ unsigned int source_size; /* in bytes */
int source_exists; /* source file exists on disk */
#ifdef __cplusplus
_Info (const char *_install, const char *_version,
void new_requirement (Package *package, char *dependson);
Category *getcategorybyname (const char *categoryname);
Category *getpackagecategorybyname (Package *pkg, const char *categoryname);
-Category *register_category (char *name);
+Category *register_category (const char *name);
void add_category (Package *package, Category *cat);
#ifdef __cplusplus