Register group proposal

Eli Zaretskii eliz@is.elta.co.il
Thu Feb 22 00:59:00 GMT 2001


On Wed, 21 Feb 2001, Andrew Cagney wrote:

> I guess this is called as something like (I'll take the liberty of using
> slightly different names):
> 
> 	for (regnum = REGGROUP_FIRST_REGNUM (reggroup);
> 	     regnum >= 0;
> 	     retnum = REGGROUP_NEXT_REGNUM (reggroup, regnum))
> 	  {
> 	     apply regnum;
> 	  }

If we are to use an iterator, shouldn't the test in this loop be
abstracted as well, like this, for instance?

 	for (regnum = REGGROUP_FIRST_REGNUM (reggroup);
 	     REGGROUP_NOT_LAST_REGNUM (reggroup);
 	     regnum = REGGROUP_NEXT_REGNUM (reggroup, regnum))
 	  {
 	     apply regnum;
 	  }



More information about the Gdb mailing list