GELINASJ@CMR001.BITNET (04/10/90)
This is an answer to <1990Apr8.161841.14435@bath.ac.uk> from @bloom-beacon.mit.edu%gdt.bath.ac.uk%gdt%dcl-cs% ukc%mcsun%sunic%luth%eru.uucp@umix.cc.umich.edu > > status_$t status; > gpr_$***(...,...,&status) > > Why is status passed as &status? > > I'm using SR9.7 > The calling conventions have changed -- for the better, I think-- at SR10 to reflect the wider use of the ANSI C compiler. Since the "status" parameter must be set by GPR, a pointer to it must be passed in C. This does not explain why "&status" was not needed before... Maybe you can explain that if you know Pascal --hum, hum...-- the APOLLO Pascal that was used for a large part of the AEGIS software. Since you plan to change, i would advise to use the following: #ifdef __STDC__ /* For Domain/OS SR10.1 */ #include <apollo/base.h> #include <apollo/pad.h> #include <apollo/gpr.h> #include <apollo/error.h> #define OUT & #else #include "/sys/ins/base.ins.c" #include "/sys/ins/pad.ins.c" #include "/sys/ins/gpr.ins.c" #include "/sys/ins/error.ins.c" #define OUT #endif #define sysdebug if((status.all)!=0) error_$print(status) gpr_$init( ..., bla ..., etcetera, ... , OUT status); sysdebug; The __STDC__ test was used in dviapollo by L. Zubkoff who went so far as duplicating the whole code for his TeX previewer. Since your problem is to adapt "&status" to SR9.7, it should be easy to use UNIX tools to change that to "OUT status". The problem is that, like me, you do not yet have the SR10 manual for GPR --does it exist?-- and you will have to check each and every parameter of each call since your (non ansi) C compiler cannot help you! Good luck.
ccsmm@bath.ac.uk (Martin Maclaren) (04/11/90)
GELINASJ@CMR001.BITNET writes: > The calling conventions have changed -- for the better, I think-- >at SR10 to reflect the wider use of the ANSI C compiler. Since the >"status" parameter must be set by GPR, a pointer to it must be passed >in C. This does not explain why "&status" was not needed before... >Maybe you can explain that if you know Pascal --hum, hum...-- the >APOLLO Pascal that was used for a large part of the AEGIS software. > At SR9, the ..._$... system calls were declared as std_$call in the /sys/ins/....ins.c files. This told the compiler that parameters should be passed by reference to these calls - i.e. cc would no doubt add the necessary &'s Yes, SR10's way looks better - people porting large system call code to SR10 must have had great fun :-) Sorry about my previous message, I was using Pnews which was obviously not set up to handle the way I had things. Also, could somebody tell me the original author of bgc.pas - or could the author get in touch? (I lost the original message.) Should software be posted in this group? I know most of the stuff posted here has been pretty small, but then the old stuff is not readily available from archive sites which have comp.sources.??? etc. Martin