Dick Hollenbeck wrote: > I am suggesting the attached patch because it: > > > 1) synchronizes the new enum tap_state names/spellings with the > corresponding string representation > > > 2) Is safer than an array lookup which is vulnerable to a bad index > and thereby a seg fault. > Thanks, (1) could be resolved by using C99 initializers in the array - that would make sure that the strings match the enum values, without requiring a switch.
Nevertheless, I think a lookup function for the names is a good idea since it can do the in-range-checking in one central place. cu Michael _______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
