TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Bo Simonsen
from: William McBrine
date: 2003-08-13 23:58:42
subject: Re: QWK problem(s)

OK, I've looked at the Maximus code. It's converting long to ieee and then 
ieee to msbin, so it is afflicted by the float format problem. Here's my 
version of NDX generation applied as a couple of patches to 3.02:


--- qwk.h~	Tue Oct  1 13:04:16 2002
+++ qwk.h	Thu Aug 14 00:39:09 2003
{at}{at} -68,7 +68,7 {at}{at}
 
 struct _qmndx
 {
-  unsigned long mks_rec;
+  unsigned char mks_rec[4];
   byte conf;
 };
 

--- mb_qwk.c~	Tue Oct  1 13:04:04 2002
+++ mb_qwk.c	Thu Aug 14 00:48:23 2003
{at}{at} -783,14 +783,24 {at}{at}
 
 static int near BuildIndex(BROWSE *b, long this_rec, word this_conf)
 {
-  long ieee;
   struct _qmndx qmndx;
   int rc=TRUE;
+  unsigned char exp='\0';
 
   /* Create the MSBinary-format .QWK index */
   
-  ieee=long_to_ieee(this_rec+1);
-  ieee_to_msbin((unsigned long *)&ieee, (unsigned long *)&qmndx.mks_rec);
+  this_rec++;
+  while (!(this_rec & 0x800000L)) {
+    exp++;
+    this_rec <<= 1;
+  }
+  this_rec &= 0x7fffffL;
+
+  qmndx.mks_rec[0] = this_rec & 0xff;
+  qmndx.mks_rec[1] = (this_rec >> 8) & 0xff;
+  qmndx.mks_rec[2] = (this_rec >> 16) & 0xff;
+  qmndx.mks_rec[3] = 152 - exp;
+
   qmndx.conf=(byte)(this_conf & 0xffu);
 
   if (!AddPersonalIndex(b, &qmndx))


Also, with this patch, I believe all the *ieee* stuff in /slib can be
thrown away, as nothing else uses it.

Note, this patch is UNTESTED. I haven't even compiled Max yet myself. Gotta 
do that...

... If a program is useless, it will have to be documented.
--- MultiMail/Linux v0.45
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.