Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings
Home

[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]
To: rf13@xxxxxxxxxxxxxxxxxxxxxxxx
Cc: Reinier Post <rp@xxxxxxxxxx>, Dirk Stoecker <stoecker@xxxxxxxxxxxxxx>, freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 27 Jan 2001 18:02:12 +0000

On Sat, 27 Jan 2001, hawk@xxxxxxxxxxxxxxxxxxxxxxx wrote:

> 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().

I know how Amiga runtime shared libraries work, thanks.  I remember
writing the library base and jump table in assembler and then writing
my own .fd files.  (Ah, the memories of a misspent youth...)

But that's not what I was talking about.  I don't have my RKRMs at
hand, but IIRC as the OS was extended it was desirable to add new
fields to several publicly-accessible structures.  They couldn't be
extended at the end because these structures could also feature as the
first part of a larger structure.  So they added it just before the
beginning instead.

> 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.

Most of the Amiga OS, including the system libraries, was written in C
as well.  In that respect, there is little difference.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Hmmm...  a PINHEAD, during an EARTHQUAKE, encounters an ALL-MIDGET FIDDLE
 ORCHESTRA...  ha..  ha..



[Prev in Thread] Current Thread [Next in Thread]