MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

[SERVER] Interesting error on make with FUP (1.8) & 1.8.0b3



I sent this message about a week ago, listing the installation problems with
FUP 1.8, of which, there should be none, but they do exist.

Also included below is the bug fix that makes FUP write values of type FLOAT
correctly.  Enjoy.

>Concerning FUP, I had one compliation problem and numerous installation
>problems:
>
>files.c: In function `bf_filewrite':
>files.c:367: warning: double format, pointer arg (arg 3)
>files.c: In function `bf_fileappend':
>files.c:492: warning: double format, pointer arg (arg 3)
>  DUH!, TYPE_FLOAT is a pointer to a float, in order to make up for the fact
>that different systems have different size floats (I assume). 
> I changed the above lines to dereference the pointer to get to the REAL
>value, instead of interpreting the pointer as a float, as the above line
>does.  Seems weird that this is the case, since this, seemingly, would make
>the binary more portable, which is of dubious utility.  Who knows.  I'm not
>questioning the implementation of memory storage/handling in the server.
>
>Lines 367 and 492 of files.c look like this:
>       case TYPE_FLOAT:
>--->     fprintf (outFile, "%g\n",  arglist.v.list[3].v.list[i].v.fnum);
>         break;
>
>But should look like this:
>
>       case TYPE_FLOAT:
>--->     fprintf (outFile, "%g\n",  *(arglist.v.list[3].v.list[i].v.fnum));
>         break;
>
>Digging deeper into the server showed that all manlipuations of floats are
>done via pointers, so this is a correct fix, since 1) every other bit of
>code concerning floats works like that 2) it actually works.
>This should clear up the bug that I was told about concerning FUP not
>writing out floats correctly.  I don't know why this wasn't caught.
>This still doesn't clear up the precision of floats written to disk,
>however.  Values of type float are only written with a precision of 5
>decimal places.  I've always been tostr()ing data before writing it out to
>disk anyway7.
>
>Other problems with installing FUP 1.8, these appear in FUP.README
>
>- the lines you are susposed to add to Makefile.in, execute.po doesn't exist,
>  there is no section for .po files in 1.8 apparently.

Fix: Ignore installation of the .po line in the README.

>- the line to add telling what files.c depends on to Makefile.in includes
>  bytecodes.h, 1) from which files.c uses no structures, 2) doesn't exist in
>  1.8

Fix: Remove the reference to bytecodes.h from the files.c line in the Makefile

>- the line to add to server.c to tell of the existance of FUP in the log file
>  uses the log() function, which has been renamed to oklog() in 1.8

Fix: use oklog() instead of log()

>- definitions for version strings have been moved around, version.h needs an
>  extern reference and version.c gets the actual string.

Fix: Put the actual strings in version.c, extern references in version.h.
Use the MOO server version string as an example.



Follow-Ups:

Home | Subject Index | Thread Index