[futurebasic] Re: [FB] a few FBtoC questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2008 : Group Archive : Group : All Groups

From: Mark Chappell <chappell@...>
Date: Wed, 17 Sep 2008 07:48:23 -0700
Robert:  thanks much but this suggestion fails with the following  
errors:


FBtoC: translating project LabAnalyst X PGM to LabAnalyst_X_PGM.c
•• Unknown function in line 354 of LA main loops.Incl:  
SwapSingleBigToHost
  354:  TempFloat = fn SwapSingleBigToHost (TempFloat)
                                          ^
•• Redefined parameter in line 44 of Subs FloatByteSwapping.incl: a
  44:  local fn SwapDoubleBigToHost( a as double ) as double
                                      ^
•• Redefined parameter in line 51 of Subs FloatByteSwapping.incl: a
  51:  local fn SwapDoubleHostToBig( a as double ) as double
                                      ^
•• Redefined parameter in line 58 of Subs FloatByteSwapping.incl: a
  58:  local fn SwapSingleBigToHost( a as single ) as single
                                      ^
•• Redefined parameter in line 65 of Subs FloatByteSwapping.incl: a
  65:  local fn SwapSingleHostToBig( a as single ) as single
                                      ^
Translation failed with 5 errors


On Sep 16, 2008, at 5:51 PM, Robert Purves wrote:
>>
>>
>> What's the simplest way to convert these large arrays of floating- 
>> point values into Intel-readable byte order?   I poked around in  
>> the Tlbx CFByteOrder.incl and Subs FloatByteSwapping.incl  in the  
>> Headers folder but did not come away sufficiently enlightened.
>
> include "Subs FloatByteSwapping.incl"
> dim as single value
> // read big-endian value from disk
> //read #1, value
> value = fn SwapSingleBigToHost!( value )
> // value is now host-endian, ready for use
> //...
> value = fn SwapSingleHostToBig!( value )
> // write big-endian value to disk
> //write #1, value
>
> This code works in PPC and Intel, FB4 or FB5.
> If your project is FBtoC-only, you can remove the ugly '!' suffices  
> from the swapping functions.
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>



________________________________________
Mark Chappell, Professor
  Biology Department
University of California, Riverside, CA 92521, USA
      Office:  2312 Spieth, 951 827-7709 ; fax -4286
      Lab:  University Lab Building 104, 951 827-6418
      email:  chappell@...
      web:  http://biology.ucr.edu/people/faculty/Chappell.html