From: FX (fxcoudert_at_gmail.com)
Date: Tue Apr 28 2020 - 05:07:10 CDT

Hi John,

> The Surf code is written in K&R C (not even early 90s ANSI C) and this
> has presented a problem for compiling the binary on MacOS X Catalina that
> I haven't resolved yet.

I can compile Surf on recent macOS (Catalina, clang from latest Xcode) simply with the attached changes to 5 prototypes, adding a couple of “void” where needed, and providing 3 function declarations ahead of time.

FX

diff -pu surf.orig/compute.c surf/compute.c
--- surf.orig/compute.c 1994-03-22 16:18:07.000000000 +0100
+++ surf/compute.c 2019-12-05 14:23:49.000000000 +0100
@@ -23,6 +23,10 @@ Vector Bounding_Tetra[4];
 double Extents[3][2];
 short Neighbor_list[MAX_CONSTRAINT];
 
+void find_tes_origin(int, Vector *);
+void compute_components(int, Vector *);
+void find_components(int, Vector *);
+
 /*---------------------------------------------------------------------------------
 init_and_compute initializes the data structures and starts off the computation.
 ----------------------------------------------------------------------------------*/
@@ -202,7 +206,7 @@ compute_bounding_tetra()
 compute_components is in some sense the central routine. This makes calls to others
 for computing the surface.
 ----------------------------------------------------------------------------------*/
-compute_components(atom_id, constraints)
+void compute_components(atom_id, constraints)
 int atom_id;
 Vector *constraints;
 {
@@ -582,7 +586,7 @@ find_components identifies the arcs form
 with the extended-radius sphere of atom atom_id and accordingly makes appropriate
 calls to generates the patches.
 ----------------------------------------------------------------------------------*/
-find_components(atom_id, cons)
+void find_components(atom_id, cons)
 int atom_id;
 Vector *cons;
 {
@@ -627,7 +631,7 @@ This assumes that int_pts, end_pts, etc,
 (the origin of the system is the center of the atom atom_id).
 This returns tes_origin in global coord system.
 ----------------------------------------------------------------------------------*/
-find_tes_origin(atom_id, cons)
+void find_tes_origin(atom_id, cons)
 int atom_id;
 Vector *cons;
 {
diff -pu surf.orig/tessel_convex.c surf/tessel_convex.c
--- surf.orig/tessel_convex.c 1994-03-21 10:33:09.000000000 +0100
+++ surf/tessel_convex.c 2019-12-05 14:25:07.000000000 +0100
@@ -15,7 +15,7 @@ gen_convex generates convex spherical pa
 regular atom surface.
 Here, p = sph_pts, q = tor_pts
 ----------------------------------------------------------------------------------*/
-gen_convex(comp_verts, p, probe_centers, q, num_p, num_q, same_order, flip, atom_id, full_torus)
+void gen_convex(comp_verts, p, probe_centers, q, num_p, num_q, same_order, flip, atom_id, full_torus)
 POINT *comp_verts, *probe_centers;
 VertexType *p, *q;
 int num_p, num_q;
diff -pu surf.orig/utils.c surf/utils.c
--- surf.orig/utils.c 1994-03-21 10:33:15.000000000 +0100
+++ surf/utils.c 2019-12-05 14:24:32.000000000 +0100
@@ -76,7 +76,7 @@ find_ray_sphere_int computes the inters
 uses method given in Graphics Gems I, pp 388-389.
 the direction vector of the ray need not be normalized.
 ----------------------------------------------------------------------------------*/
-find_ray_sphere_int(int_point, ray_pt, ray_dir, center, radius)
+void find_ray_sphere_int(int_point, ray_pt, ray_dir, center, radius)
 float int_point[3], center[3];
 float ray_pt[3], ray_dir[3];
 float radius;