This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Register group proposal



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;
 	  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]