• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trying to Swap Byte on Floats
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to Swap Byte on Floats


  • Subject: Re: Trying to Swap Byte on Floats
  • From: Manfred Schwind <email@hidden>
  • Date: Thu, 21 Jun 2007 14:01:35 +0200

The binary file was encoded using a PowerPC big-endian format.

float SSR = NSConvertSwappedFloatToHost(NSConvertHostFloatToSwapped (tempSSR));

This doesn't do anything - it just converts the type from float to NSSwappedFloat and back to float, without doing any actual swapping.
I think this is the correct way in your case:


float SSR = NSSwapBigFloatToHost(NSConvertHostFloatToSwapped(tempSSR));

Regards,
Mani
--
http://www.mani.de
iVolume - Loudness adjustment for iTunes.
LittleSecrets - The encrypted notepad.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Trying to Swap Byte on Floats (From: "Peter J. Molfese" <email@hidden>)

  • Prev by Date: Re: NSFormatter interfering with bindings continuous update?
  • Next by Date: Run a process as root (asking only one time the root password)
  • Previous by thread: Trying to Swap Byte on Floats
  • Next by thread: Re: Cocoa-dev Digest, Vol 4, Issue 582
  • Index(es):
    • Date
    • Thread