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

Re: gnubol: IBM data format conversion routines



Tim,

Sorry about the delay in getting back.

I've made several of the fixes that you describe, the rest I hope to get done
this weekend.  See attached tar file.  I need to dust off a manual before I add
the precision tests to header file.

There is now a test driver called transtest.c and a makefile that builds it.
Each test will display the input, output, and title.  All output written to
stdout.

I changed the PD arguments so the output variable is a passed argument and a
return code is passed
back for an invalid Packed Decimal number.  This should remove one of the Thread
problems you
described.

From a multi-threaded point of view, Is it okay to have a static table (atoe &
etoa in the code) that is not modified?  Is there some easy way to ask the gnu C
compiler to report possible violations?

I'll try to write the reverse functions this weekend.

Good Luck - Ted Seward

Tim Josling wrote:

>
> Ted,
>
> Very good code. Well documented and easy to follow. I like this
> code.
>
> Would you mind doing some test cases for it even if they are very
> basic. Also can you use the header files to ensure that the long
> double on the system supports enough range to support the
> requirements for conversion. Should blow up on a conditional
> compilation (#error) if not. Finally is there any way to get rid
> of the static variables which make it not thread safe (eg have
> the caller pass the area to copy into).
>
> I guess conversions in the other direction would be more tricky
> as you cannot use the FP hardware to build up the numbers for
> you, will require bit fiddling but we can leave that until later.
>
> Regards,
> Tim Josling
>
> "Theodore J. Seward, Jr." wrote:
> >
> > Folks,
> >
> > I don't know if this is helpful or not, but I've attached a tar file
> > with a small library of conversion routines:
> >
> > cnvAtoE - Convert buffer from ASCII to EBCDIC
> > cnvEtoA - Convert buffer from EBCDIC to ASCII
> > cnvPDtoCH - Convert IBM Packed Decimal to character string (1 to 16
> > bytes, 1 to 31 digits)
> > cnvSPtoD - Convert IBM Single Precision Floating to C Double (4 bytes)
> > cnvDPtoD - Convert IBM Double Precision Floating to C Double (8 bytes)
> > cnvXPtoLD - COnvert IBM Extended Precision Floating to C Long Double (16
> > bytes)
>
> >
> > Good Luck - Ted Seward
>
> --
> This message was sent through the gnu-cobol mailing list.  To remove yourself
> from this mailing list, send a message to majordomo@lusars.net with the
> words "unsubscribe gnu-cobol" in the message body.  For more information on
> the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.

translate.tar.gz