From: =?windows-1250?Q?Ladislav_Dvo=F8=E1k?= To: Subject: Re: crashed when float = int / 2 Date: Tue, 20 Nov 2001 10:20:38 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01C171AD.00252600" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2469.0002 Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C171AD.00252600 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit I show crash dump. And there is Coprocessor not available.... I showed complete dump list as many as now. Previously I showed only latest line (display is too small). I enable floating-point emulation and I think, that is a solution. Thank you, for your help Lada Dvorak "Hans-Bernhard Broeker" < broeker AT physik DOT rwth-aachen DOT de > wrote in message news:9tbb2t$i06$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > Ladislav Dvo??k < dvorakl AT jednotacb DOT cz > wrote: > > Hi, > > I have a application. When I run this application in Windows 95 or in DOS > > (with cwsdpmi.exe), he works without problem. When I this application run on > > barcode scanner Falcon 330 with ROM-DOS 6.22 and AMD Elan AM486 processor I > > have this problem. > > > long vyhledzbo(char ean[20]) > > { > > FILE *ciselnik; > > int vpom,pozmez,prv,pzaznamu,pruchodu=18; > > long kurszmm,kurszm,vpozice; > > char cean[20]; > > float krok; > > int delkavety = 102; > > ciselnik = fopen("expean.txt","r"); > > fseek (ciselnik,-delkavety,SEEK_END); > > I suspect the error happens here, already. Note that you opened the > file in text mode, and then used fseek in SEEK_END mode on it, with a > nonzero offset. That's not guaranteed to do anything useful at all. > > It'd probably be better if you opened that file in binary mode. > > > pzaznamu = (ftell(ciselnik) / delkavety) + 1; > > krok = pzaznamu / 2; > > > On line >krok=pzaznamu /2;< program crashed. > > How exactly did it crash, and how certain are you that it was *this* > particular line? If you have a crash dump, please show it. > > My guess would be that it's not this line, but the one above it that's > going wrong. Int->float conversion should always be safe, whereas the > conversion from long to int involved in your calculation of pzaznamu > may or may not. > > BTW: you *did* #include somewhere before this snippet, I hope? > -- > Hans-Bernhard Broeker ( broeker AT physik DOT rwth-aachen DOT de ) > Even if all the snow were burnt, ashes would remain. ------=_NextPart_000_0000_01C171AD.00252600 Content-Type: text/html; charset="windows-1250" Content-Transfer-Encoding: quoted-printable

I show crash dump. And there is Coprocessor not available.... I showed
complete dump list as many as now. Previously I showed only latest = line
(display is too small). I enable floating-point emulation and I think, = that
is a solution.
Thank you, for your help
Lada Dvorak

"Hans-Bernhard Broeker" <broeker AT physik DOT rwth-aachen.= de> wrote in message
news:9tbb2t$i06$1 AT nets= 3.rz.RWTH-Aachen.DE...
> Ladislav Dvo??k <dvorakl AT jednotacb DOT cz> wrote:
> > Hi,
> > I have a application. When I run this application in Windows = 95 or in
DOS
> > (with cwsdpmi.exe), he works without problem. When I this = application
run on
> > barcode scanner Falcon 330 with ROM-DOS 6.22 and AMD Elan = AM486
processor I
> > have this problem.
>
> > long vyhledzbo(char ean[20])
> > {
> > FILE *ciselnik;
> > int vpom,pozmez,prv,pzaznamu,pruchodu=3D18;
> > long kurszmm,kurszm,vpozice;
> > char cean[20];
> > float krok;
> > int delkavety =3D 102;
> > ciselnik =3D fopen("expean.txt","r");
> > fseek (ciselnik,-delkavety,SEEK_END);
>
> I suspect the error happens here, already.  Note that you = opened the
> file in text mode, and then used fseek in SEEK_END mode on it, with = a
> nonzero offset. That's not guaranteed to do anything useful at = all.
>
> It'd probably be better if you opened that file in binary mode.
>
> > pzaznamu =3D (ftell(ciselnik) / delkavety) + 1;
> > krok =3D pzaznamu / 2;
>
> > On line >krok=3Dpzaznamu /2;< program crashed.
>
> How exactly did it crash, and how certain are you that it was = *this*
> particular line?  If you have a crash dump, please show = it.
>
> My guess would be that it's not this line, but the one above it = that's
> going wrong.  Int->float conversion should always be safe, = whereas the
> conversion from long to int involved in your calculation of = pzaznamu
> may or may not.
>
> BTW: you *did* #include <stdio.h> somewhere before this = snippet, I hope?
> --
> Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen.= de)
> Even if all the snow were burnt, ashes would = remain.

------=_NextPart_000_0000_01C171AD.00252600--