[Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Jan 27, 2001 at 02:35:11PM +0000, Gaute B Strokkenes wrote:
> On Fri, 26 Jan 2001, rp@xxxxxxxxxx wrote:
>
> >> So lets take another example. On Amiga there are some structures,
> >> which have negative offset fields. And I still prefer to access
> >> them *(seglist-1) instead of seglist[-1] :-)
> >
> > Wow, I didn't know structures with negative offsets were actually
> > used by *design*.
>
> Backwards compatibility. They couldn't make the struct any larger at
Wrong. An Amiga library could be accessed by base address (always in
a6 and like C++'s this). Above the base address is a general struct
which contains version, number entries, open count and so on. Above
the general struct are fields which are private to the library. At
addresses below the base address are jump entries. It is basically an
address table (like C++'s vtable). The first entries were predefined
and used to permit the library to execute code on open(), close().
IMHO the designer had done a very good job. It is a clean and
expandable interface. So you have the same OOP like you have today in
a linux kernel. However the linux kernel is in C and the Amiga can be
programmed (quite easy) in assembler.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"USENET is *not* the non-clickable part of WWW!"
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, David Pfitzner, 2001/01/24
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Dirk Stoecker, 2001/01/25
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Reinier Post, 2001/01/25
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Dirk Stoecker, 2001/01/26
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Reinier Post, 2001/01/26
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings,
Raimar Falke <=
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Raimar Falke, 2001/01/27
- [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/27
[Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings, Gaute B Strokkenes, 2001/01/25
|
|