From: Ethan M. <merritt@u.washington.edu> - 2004-08-12 22:33:10
|
On Thursday 12 August 2004 02:01 pm, Daniel J Sebald wrote: > 1. Clean up the df_readline() routine for neatness. If that means a > couple subroutines, that's fine. But even though that function is > somewhat big, it's flow of logic is pretty straightforward. Summarizing my comments of 10-July-2004: 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? My view of it is that you basically have two separate routines that are uneasily co-existing in the same block of code. I think there should be two routines: df_readline (existing code = 328 lines) df_readbinary (code path used by pixel/binary routines = ~450 lines) By my rough estimate there are at most about 200 lines of code that are common to both paths. I haven't tried to estimate how much of this may move easily into a shared subroutine. There are only 4 callers of df_readline anyway. It is the callers business to know whether a binary read or a formatted read is appropriate, and call one of the two alternative input routines. > >And please check one final time that the patched version of datafile.c > >does not inadvertantly back out other changes made since 4.0. > > How does one check that? The changes to datafile.c are so extensive that it is very hard to see exactly what is going on. Can you possibly rearrange all the brand new routines so that they are together at the end of the file? In fact, ideally I'd like to see a new file containing all the purely new routines and also containing the disentangled code from df_readline() that constitutes the code path for binary files only. The original df_readline would stay in datafile.c At that point the remaining changes to datafile.c will probably be small enough to understand, and much of your new code will be together in one place. -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |