• 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: EndianU32_NtoB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EndianU32_NtoB


  • Subject: Re: EndianU32_NtoB
  • From: "Sean McBride" <email@hidden>
  • Date: Fri, 30 Oct 2009 12:35:39 -0400
  • Organization: Rogue Research Inc.

On 10/30/09 4:56 PM, gMail.com said:

>In the past I have successfully used EndianU32_NtoB to read a "long" on a
>PPC machine. Now I need to read and write an array of "unsigned int" and an
>array of "float". May you please tell me how to do?

For floats Apple provides no API, but you can use a union like this:

typedef union
{
	Float32 floatVal;
	uint32_t intVal;
} SwapUnion;

Then swap the int part with the int swapping APIs.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Follow-Ups:
    • Re: EndianU32_NtoB
      • From: Kyle Sluder <email@hidden>
References: 
 >EndianU32_NtoB (From: "gMail.com" <email@hidden>)

  • Prev by Date: Re: createbackupPath from boost library not working for MAC
  • Next by Date: Re: EndianU32_NtoB
  • Previous by thread: Re: EndianU32_NtoB
  • Next by thread: Re: EndianU32_NtoB
  • Index(es):
    • Date
    • Thread