Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
6 crawler(s) on-line.
 100 guest(s) on-line.
 1 member(s) on-line.


 matthey

You are an anonymous user.
Register Now!
 matthey:  3 mins ago
 pavlor:  21 mins ago
 Seiya:  23 mins ago
 amigang:  34 mins ago
 DiscreetFX:  36 mins ago
 amigakit:  1 hr 10 mins ago
 zipper:  1 hr 23 mins ago
 Maijestro:  1 hr 43 mins ago
 Rassilon:  1 hr 54 mins ago
 OlafS25:  1 hr 59 mins ago

/  Forum Index
   /  Amiga General Chat
      /  Amiga Inc. Loses U.S. Trademarks
Register To Post

PosterThread
michalsc 
Re: Cloanto acquire Amiga Inc Trademark
Posted on 23-Apr-2021 6:46:14
#1 ]
AROS Core Developer
Joined: 14-Jun-2005
Posts: 377
From: Germany

@tygre

Quote:
So "unions" are evil! (Joke intended!)


They are evil if inproperly used. They are blessing if used properly :) With help of union one can do very nice endian swap routines which get recognized by most compilers



such construct works always and it will be inlined without any penalty when the requested endian matches endian of target cpu. If this is not the case, proper cpu instruction will be emitted, such as rev on arm, or bswap on x86/x86_64, or movbe if the target x86 cpu supports it.

But, not only unions are "evil", consider bitfields as another candidate ;)

Quote:
Ouch! I see... In such a case, is the problem only coming from the compiler optimisation? As you wrote in other posts above, would recompiling with the proper "endian" parameter remove the problem entirely?


Yes, in that case selecting correct target cpu solves the problem.

Quote:
Besides unions that should be carefully checked and binary data... are there other "constructs" that could mess up endianness?


None coming to my mind right now. But, is binary data not bad enough? Keep in mind, binary data does not mean only file parsing. Binary data means filesystems and access to any hardware or peripherals, including graphics cards, network cards, audio and everything else. In such cases even simple increase of variable may turn into a nightmare if you "forget" about endianess.

Last edited by michalsc on 23-Apr-2021 at 06:47 AM.

 Status: Offline
Profile     Report this post  
 Top | Parent



[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle