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: Gaute B Strokkenes <gs234@xxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: (offtopic) C subscripts; was Re: Compiler-warnings
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Jan 2001 19:25:37 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxxxx

On Sat, Jan 27, 2001 at 06:02:12PM +0000, Gaute B Strokkenes wrote:
> 
> 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...)

.fd files?

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

I don't know what do you mean. But this is ok if you speak about a
post 2.0 thing.

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

I meant: the libraries can easily be used from assembler. Think OOP
assembler. You can also do OOP assembler today but I don't think it
would be this easy. The systems today are just a bit more complex.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Make a software that is foolproof, and only fools will want to use it.



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