[comp.sys.sgi] Forms 1.2 under IRIX 3.2

englund@gdstech.grumman.com (Dave Englund) (05/07/91)

I've managed to hack Forms 1.2 to run under IRIX 3.2. There aren't
that many changes necessary, so I'll just list them here.

Changes in "forms.h"
line 36:   void (*form_call_back)(struct objs *); 
line 76:   void (*obj_call_back)(struct objs *, long);  

These changes in the header require these chnages in the ".c" files"
events.c :
	change all occurrences of:
		obj->form->call_back TO	obj->form->form_call_back
		obj->call_back       TO	obj->obj_call_back
objects.c
	change all occurrences of:
		form->call_back     TO	form->form_call_back
		ob->call_back       TO	ob->obj_call_back


Those changes are enough to get the package to compile, but alas are
not enough to make the package work correctly. The remaining problems
have to do with the C compiler promoting floats to doubles when
passing them as arguments. 

More changes in "forms.h"
All of the prototypes of the forms:
OBJECT  *add_{sometypeofobject}(int, float, float, float, float, char []);
should become:
OBJECT  *add_{sometypeofobject}(int, double, double, double, double, char []);

These changes require you to change the corresponding function headers
in the {sometypeofobject}.c files. The handle_{something} routines
also need their float arguments changed to double. Here is a list of
the routines that need there declarations changed:

NEW.c:static int handle_NEW
NEW.c:OBJECT *add_NEW
bitmap.c:static int handle_bitmap
bitmap.c:OBJECT *add_bitmap
box.c:static int handle_box
box.c:OBJECT *add_box
browser.c:static int handle_browser
browser.c:OBJECT *add_browser
button.c:static int handle_it
button.c:static OBJECT *add_it
button.c:OBJECT *add_button
button.c:OBJECT *add_lightbutton
button.c:OBJECT *add_roundbutton
choice.c:static int handle_choice
choice.c:OBJECT *add_choice
clock.c:static int handle_clock
clock.c:OBJECT *add_clock
default.c:static int handle_default
default.c:OBJECT *add_default
dial.c:static int handle_dial
dial.c:OBJECT *add_dial
free.c:OBJECT *add_free
input.c:static int handle_input
input.c:OBJECT *add_input
menu.c:static int handle_menu
menu.c:OBJECT *add_menu
positioner.c:static int handle_positioner
positioner.c:OBJECT *add_positioner
slider.c:static int handle_slider
slider.c:OBJECT *add_slider
text.c:static int handle_text
text.c:OBJECT *add_text

It looks like a lot, but something like a keyboard macro in emacs, the
changes are done pretty easily. Good Luck!

			Dave Englund | #include <stdio.h>
	 englund@gdstech.grumman.com | main() 
		       Grumman Corp. | {
	   Corporate Research Center | 	  printf("hello, world\n");
			Bethpage, NY | }

markov@cs.ruu.nl (Mark Overmars) (05/08/91)

In <9105071227.AA09119@gdstech.grumman.com> englund@gdstech.grumman.com (Dave Englund) writes:

>I've managed to hack Forms 1.2 to run under IRIX 3.2. There aren't
>that many changes necessary, so I'll just list them here.
>
>Changes in "forms.h"
>line 36:   void (*form_call_back)(struct objs *); 
>line 76:   void (*obj_call_back)(struct objs *, long);  
>
> (stuff deleted)
>
>Those changes are enough to get the package to compile, but alas are
>not enough to make the package work correctly.

I cannot imagine that has got anything to do with (but I am sure you are
right). Can you comment on why this has to be done?

> The remaining problems
>have to do with the C compiler promoting floats to doubles when
>passing them as arguments. 
>
If I remember correctly, adding the compiler option -float (or -floats)
should do all of that. I am not sure though because I cannot test it anymore.

By the way, release 1.3 is on its way. (You won't like it. It will require a
bit of work from all you FORMS users.)

Mark Overmars

loki@NAZGUL.PHYSICS.MCGILL.CA (Loki Jorgenson Rm421) (05/10/91)

	As an addendum to Mark Overmar's comments on Dave Englund's
fixes for Forms 1.2 running under IRIX 3.2:

	With the fixes that Dave suggested plus a few others, I have
been successful in making 1.2 work under IRIX 3.2.  I will be posting
diffs and instructions shortly.

	As Mark suggested, the -float option *ought* to correct the
float-to-double conversion problem but.... it doesn't.  At least not
under IRIX 3.2.  All the offending floats in function prototypes had
to be changed by hand.

Regards,
                             _ _         _ _
Loki Jorgenson              / / _ _ _ _ _ \ \  node:  loki@Physics.McGill.CA
Grad/Systems Manager      _/_/_/_/_/ \_\_\_\_\_BITNET: PY29@MCGILLA
Physics, McGill University \ \ \_\_\_/_/_/ / / fax:   (514) 398-3733
Montreal Quebec CANADA      \_\_         _/_/  phone: (514) 398-7027

                      -*  Anatomically  correct  *-