Little and big endian
Jul 7, 2006 at 1:46pm
Little and big endian
I have some problem with coding my old external Sd2fregions with UB SDK. I load in a handle the ressource ‘ddrl from Sd2f file. (Yes, ressource in OS X is deprecead but, …).
code is here
err = LoadResForkFile( fileName, path, &sampRegionDataH, ‘ddRL’, 1000); // responsible for disposing of the Handle.
// Get the number of regions.
sysmem_copyptr( *sampRegionDataH + 14 , &numberOfRgns, 4);//kNumbOfRgnsOffset
numberOfRgns = numberOfRgns – 1;
I have crated a macro SWAP_32 in Sd2fregionsand code is running. But how can I do when I will use my code in a ppc machine.
Is there in cycling74 .h definition for do this ? I have see in byteorder. h code for double, 64 bit variable but not for long.
sorry for my bad english and my probably stupid question.
Jul 7, 2006 at 2:07pm
dominique ehret wrote:
> I have crated a macro SWAP_32 in Sd2fregionsand code is running. But how can I do when I will use my code in a ppc machine.
I recently came across a similar problem with defining a union… what I
Not really nice but it works. And note that I wasn’t even using Altivec,
Since the compiler more or less compiles two different versions of your
Jul 7, 2006 at 6:32pm
On Jul 7, 2006, at 7:07 AM, Olaf Matthes wrote:
You can use
Or rely on the macros in ext_byteorder.h such as BYTEORDER_MSBW32(x),
Lastly, if you prefer, the Apple specific macro to detect endianness
Jul 9, 2006 at 10:29am
thanks for reply. Yes, macro of byteorder.h do the job. UB SDK is a very nice work. I promise to read the Cycling74.h before posting.
Jul 10, 2006 at 7:49am
On 9 juil. 06, at 12:29, dominique ehret wrote:
> thanks for reply. Yes, macro of byteorder.h do the job. UB SDK is a
I didn’t discover these macro when I ported my object to UB neither but
I defined the following macros (the names SWAP/NO_SWAP are from a big
#define SWAP_16 CFSwapInt16LittleToHost
#define NO_SWAP_16 CFSwapInt16BigToHost
With these CFSwap*toHost functions, I don’t have to check on what
I don’t know if it’s a very efficient method, but for my object, I
Centre de Recherches et de Formation Musicales de Wallonie asbl
You must be logged in to reply to this topic.