[comp.unix.questions] pathalias compilation problem

time@citi.umich.EDU (12/21/87)

Eric,
  It appears from my compilation here that you are
  having difficulty compiling the funcion "fixnet()".
  In fact, I'm quite sure that "somehow" you have dropped
  the function's "begin code" curly brace. This in turn
  makes it look like you want to declare "member",
  "nextnet" and "l", as parameters to the function,
  when in reality they are local variables. Here is the
  code for you to check against:

static void
fixnet(network, nlist, cost, netchar, netdir)
	register node *network;
	node *nlist;
	Cost cost;
	char netchar, netdir;
{	register node *member, *nextnet;
	link *l;

	network->n_flag |=  0x0080;

	
	for (member = nlist ; member; member = nextnet) {
		
		l = addlink(network, member, (Cost) 0, netchar, netdir);
		if ( (((network)->n_flag & ( 0x0080 |  0x0010)) == ( 0x0080 |  0x0010) ||  ((network)->n_name[0] == '.')) &&  (((member)->n_flag & ( 0x0080 |  0x0010)) == ( 0x0080 |  0x0010) ||  ((member)->n_name[0] == '.')))
			l->l_flag |=  0x0080;

		
		(void) addlink(member, network, cost, netchar, netdir);
		nextnet = member->un1.nu_net;
		member->un1.nu_net = 0;	
	}
}

As you can see, the way this code is layed out, it
is very easy to lose that "{" between the parameters
and the local variables. If this is not your problem
let me know, I've got Honeyman in the office next
to me (what an illustrious author).

Tim Endres
UofM Center for Information Technology Integration (CITI)
time@citi.umich.edu