Mail Archives: djgpp/2007/05/04/18:02:21
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
From: | "Rod Pemberton" <do_not_have AT bitfoad DOT cmm>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: pointer from integer without a cast
|
Date: | Fri, 4 May 2007 18:00:30 -0400
|
Organization: | Aioe.org NNTP Server
|
Lines: | 51
|
Message-ID: | <f1gacr$nho$1@aioe.org>
|
References: | <20070504153021 DOT GI1835 AT freenet DOT de>
|
NNTP-Posting-Host: | IVw7K97ih4IohxRqyKkqFw.user.aioe.org
|
X-Complaints-To: | abuse AT aioe DOT org
|
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2800.1441
|
X-Priority: | 3
|
X-Newsreader: | Microsoft Outlook Express 6.00.2800.1437
|
X-MSMail-Priority: | Normal
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
"Michelle Konzack" <dos4michelle AT freenet DOT de> wrote in message
news:20070504153021 DOT GI1835 AT freenet DOT de...
>
> Hello,
>
> It ry to compile an old program "disktool" (X from Linux) and I get the
> errors:
>
> disktool.c:177: warning: passing argument 1 of 'statfs' makes pointer from
integer without a cast
> disktool.c:182: warning: passing argument 1 of 'atoi' makes pointer from
integer without a cast
>
> from the source:
>
> 173: #ifdef SOLARIS2
> 174: statvfs(xv_get(part_item[n],PANEL_LABEL_STRING), &buf);
> 175: num = (buf.f_bavail*buf.f_frsize/1024)/divisor[n];
> 176: #else
> 177: statfs(xv_get(part_item[n],PANEL_LABEL_STRING), &buf);
> 178: num = (buf.f_bavail*buf.f_bsize/1024)/divisor[n];
> 179: #endif
> 180: if(delta)
> 181: {
> 182: dnum = num - (long)atoi(xv_get(kbyte_item[n],
PANEL_LABEL_STRING));
> 183: sprintf(sbuf, "(%ld)", abs(dnum));
>
> Any help?
>
From what I see out on the Internet, xv_set() sets various attributes and
xv_get() returns the attribute. It appears that xv_get() is cast to the
appropriate type such as "int", "char *", "XID", "XNum", etc... Since
statfs() and statvfs() expect filenames for their first argument, I'd guess
that you are probably just missing the casts to "char *".
> 177: statfs(xv_get(part_item[n],PANEL_LABEL_STRING), &buf);
statfs((char *)xv_get(part_item[n],PANEL_LABEL_STRING), &buf);
> 182: dnum = num - (long)atoi(xv_get(kbyte_item[n],
PANEL_LABEL_STRING));
dnum = num - (long)atoi((char *)xv_get(kbyte_item[n],
PANEL_LABEL_STRING));
Rod Pemberton
- Raw text -