From: Daniel J S. <dan...@ie...> - 2004-07-10 20:17:38
|
Ethan A Merritt wrote: >For what it's worth - >After I apply the with-image patch df_readline contains 653 lines of >code, of which only 303 are shared by the two modes. > >The largest block of shared code is the section (lines 3362-3465) >checking for blank lines, skipped lines, and EOF. Is this even relevant >to binary mode? > That's correct. But my point is that they do pretty much similar things, i.e., loading the variables to prepare the next stage of the code that determines where to reroute them. >>And at the bottom >>of df_readline() is the important code which knows how and where to put >>data in the v[] variables >> >> > >Yes, that is clearly important to both modes. But perhaps it should be >split out into a common subroutine shared by two different input routines. > >At that point you might even find that 2 input stages + 1 shared output >stage have fewer lines of code jointly than the current single routine with >its tangle of #ifdefs. > I've no problem with a common subroutine, as that even makes it more obvious the common idea between the two. Recall, my premise with the #ifdefs was to have the code *exactly unaltered* when BINARY_DATA_FILE is disabled. Dan |