[FreeVMS] RE: new libgetef.c

FreeVMS freevms at sympatico.ca
Jeu 11 Aou 20:03:45 CEST 2005


Roger, and whomever:

	I been doing some work in the librtl area, maybe we should coordinate our
work in this area so we don't "step on each others toes".

	Or if anyone can suggest another area that needs work. I have been in this
area what seems like for ever :-)

	Back in July 20, Joel was writing about pre-built images. Is he
talking/writing about an "installer program". To partion and format a hard
drive, or are we too early to be thinking about this?

	Is Zakaria still working on formatting a partion? This might be a nice
chance of scenery.

	Andrew

-----Original Message-----
From: freevms-bounces at systella.fr [mailto:freevms-bounces at systella.fr]On
Behalf Of Roger Tucker
Sent: Wednesday, August 10, 2005 3:40 PM
To: 'Roger Tucker'
Cc: freevms at systella.fr
Subject: [FreeVMS] RE: new libgetef.c


Not sure what to do next,
I was looking at the routines in librtl and a lot of the routines need help.

For example, str$copy_r(), and str$copy_r_64() does a strlen() on the
source.  VMS uses descriptors - not null terminated strings - for a reason,
so they have a length and a pointer and you can have a null in the string if
you wish.  This routine doesn't work correctly but once people start using
it incorrectly it might be hard to change.  It also doesn't handle all the
different types of descriptors.  Maybe I'll work on it.

My goal was to work on simple things before I move more into the kernel.
I need to get freevms built correctly and working before I can do that.
Other stuff I can test on regular VMS or Linux.

What do you think,
Roger

-----Original Message-----
From: Roger Tucker [mailto:roger.tucker at mci.com]
Sent: Wednesday, August 10, 2005 12:18 PM
To: 'Roar Thronæs'
Subject: RE: new libgetef.c


OK.  Here is a new copy of libgetef.c that fixes all the compiler warnings.
I'll compile with -Wall from now on.
I'm not sure why gcc couldn't find ffsll(), I just added an external forward
declaration for now and it works - I'll work on it again later.  It has
something to do with the wrong string.h being included.  It finds the one in
the freevms/linux... before the one usr/include/ or something like that, but
I'm not sure...  :-(

I corrected the unsigned long status to be unsigned int.
I'll try to remember long vs ints.  I think we should assume "short" will be
16 bits, "int" will be 32 bits, and "long long" will be 64.  I guess we
should avoid using just "long" since we're not sure what size it is.

Sorry about the Microsoft client, that's all I have right now, until I
figure out how to get sendmail working on my new Linux box.  I have so much
to learn when it comes to Linux.

I think the source code to freevms should be very well commented and very
readable.  I don't like looking at the linux source code for that reason.

Just so you know, on multi-issue CPU's (like all modern CPUs) something like
this is actually faster.
   int status = xxxx;		// assume success
   if (x) status = yyyy;	// return bad status
over:
    int status;
    if (x) status = yyyy;
    else status = xxxxy;

status will be loaded at the same time as x is evaluated, so it' free.
And there is one less branch if x is false.
It also happens to be easier to read in most cases.
Just so you know why I write that way.  I also create variables only when I
need them and drop them out of scope and not just at the top of the
function.  This makes things easier to read and cuts down on bugs as well.

Now back to trying to get freevms built.

Roger




_______________________________________________
FreeVMS mailing list
FreeVMS at systella.fr
http://rayleigh.systella.fr/cgi-bin/mailman/listinfo/freevms




Plus d'informations sur la liste de diffusion FreeVMS