j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
a) C doesn't allow to cast pointers to integers v.v. etc. without going through a union;
That's not true unless you don't want to use type-casts.
char *foo; uint bar; foo = (char*)bar; bar = (uint)foo;
Gcc will warn if the sizes of "int" warn "char*" are not the same, which is easy to workaround with an additional typecast.
char *foo; /* assume 32-bit pointer */ uint64 bar; foo = (char*)(uint)bar; bar = (uint64)(uint)foo;
b) performance is king ;)
First make it run, then make it fast. It's a rare problem that requires the wrong results as fast as possible. :)
-- Parag
- To unsubscribe: send mail to majordomo@freiburg.linux.de with 'unsubscribe openbios' in the body of the message http://www.freiburg.linux.de/OpenBIOS/ - free your system..
Parag Patel wrote:
a) C doesn't allow to cast pointers to integers v.v. etc. without going through a union;
That's not true unless you don't want to use type-casts.
I should have said "C99 with strict pointers" ;)
b) performance is king ;)
First make it run, then make it fast. It's a rare problem that requires the wrong results as fast as possible. :)
Always keep performance in mind while designing a program (as well as several other factors; maintainability is also very high on the list).
The code doesn't have to run fast, but it should be structured in such a way that it is easy to make it go fast.
Well, that's (part of) my design philosophy, at least :)
Segher
- To unsubscribe: send mail to majordomo@freiburg.linux.de with 'unsubscribe openbios' in the body of the message http://www.freiburg.linux.de/OpenBIOS/ - free your system..