TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Bo Simonsen
from: William McBrine
date: 2003-08-14 00:34:02
subject: Re: QWK problem(s)

One small change -- better make this_rec an unsigned long:


--- mb_qwk.c~	Tue Oct  1 13:04:04 2002
+++ mb_qwk.c	Thu Aug 14 01:30:44 2003
{at}{at} -781,16 +781,26 {at}{at}
 
 /* Generate the index record for this message */
 
-static int near BuildIndex(BROWSE *b, long this_rec, word this_conf)
+static int near BuildIndex(BROWSE *b, unsigned 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))


... According to my calculations the problem doesn't exist.
--- 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™.