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

-=> William McBrine wrote to Bo Simonsen <=-

 WM> OK, I've looked at the Maximus code. It's converting long to ieee and
 WM> then ieee to msbin, so it is afflicted by the float format problem.

I take it back -- I see that the existing Maximus *ieee* code uses all
integer math internally, so I'm not sure what the problem is. However, my 
version is still simpler, and simpler is usually better. :-)

On the other hand, if it really is an alignment problem, as you suggested
earlier, then try this patch:


--- mb_qwk.c~   Thu Aug 14 01:30:44 2003
+++ mb_qwk.c    Thu Aug 14 11:28:40 2003
{at}{at} -1509,7 +1509,9 {at}{at}
 {
   if (n_qidx)
   {
-    write(ndxfile, (char *)qidxs, sizeof(struct _qmndx)*n_qidx);
+    int i;
+    for (i = 0; i < n_qidx; i++)
+      write(ndxfile, (char *)(qidxs + i), 5);
     n_qidx=0;
   }
 }


By writing each index individually and hardwiring the size of '5' (could
be changed to a #define for style), it doesn't matter if the _qmndx struct
gets padded for alignment or not. Ideally this would be used with fwrite()
rather than write().

... All that glitters has a high index of refraction.
--- 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™.