|
From: Daniel J S. <dan...@ie...> - 2008-02-01 08:29:44
|
Ethan Merritt wrote:
> Dan:
>
> The binary data file supposedly contains 1 set of 7 points
> (yes the original poster counted wrong but it shouldn't matter since
> the error is on the *first* point, not the last one).
[snip]
OK, I follow now...
>>>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>>--- gnuplot/src/datafile.c 2008-01-25 12:59:41.000000000 -0800
>>>+++ gnuplot-cvs/src/datafile.c 2008-01-30 23:01:30.000000000 -0800
>>>@@ -4937,7 +4937,7 @@
>>> }
>>> }
>>> } else { /* Not matrix file, general binray. */
>>>- df_datum = point_count;
>>>+ df_datum = point_count+1; /* EAM DEBUG */
>>> if (i != df_no_bin_cols) {
>>> if (feof(data_fp)) {
>>> if (i != 0)
>>>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I believe your fix is correct. Feel free to check it in...
The reason for not incrementing df_datum directly, as is done with ASCII case, is that datum could also come from the gnuplot binary matrix as well. Hence the tie in to point_count. However, I might have moved a hunk of code around at some point and the incrementing of point_count comes later:
/* update point_count. ignore point if
point_count%everypoint != 0 */
if (++point_count < firstpoint
|| point_count > lastpoint
|| (point_count - firstpoint) % everypoint != 0)
continue;
/*}}} */
so point_count is still at -1 (first time) when df_datum was first set. In the case of "array =" a different variable
v[output] = m_value*delta[0];
is used instead of df_datum. Your change will mean both cases now start at 0.
Dan
|