diff --git a/src/obidmscolumn.c b/src/obidmscolumn.c index 606ed13..bf6e54c 100644 --- a/src/obidmscolumn.c +++ b/src/obidmscolumn.c @@ -1217,12 +1217,12 @@ int obi_enlarge_column(OBIDMS_column_p column) } column->data = mmap(NULL, - new_data_size, - PROT_READ | PROT_WRITE, - MAP_SHARED, - column_file_descriptor, - header_size - ); + new_data_size, + PROT_READ | PROT_WRITE, + MAP_SHARED, + column_file_descriptor, + header_size + ); if (column->data == MAP_FAILED) { obi_set_errno(OBICOL_UNKNOWN_ERROR); @@ -1282,29 +1282,29 @@ void obi_ini_to_NA_values(OBIDMS_column_p column, } break; - case OBI_QUAL: for (i=start;idata)) + i) = OBIIdx_NA; - } - break; - - case OBI_STR: for (i=start;idata)) + i) = OBIIdx_NA; - } - break; - - case OBI_SEQ: for (i=start;idata)) + i) = OBIIdx_NA; - } - break; - case OBI_IDX: for (i=start;idata)) + i) = OBIIdx_NA; } break; + + case OBI_QUAL: for (i=start;idata)) + i) = OBIIdx_NA; + } + break; + + case OBI_STR: for (i=start;idata)) + i) = OBIIdx_NA; + } + break; + + case OBI_SEQ: for (i=start;idata)) + i) = OBIIdx_NA; + } + break; } } @@ -1474,12 +1474,12 @@ int obi_column_prepare_to_set_value(OBIDMS_column_p column, index_t line_nb) } -int obi_column_prepare_to_get_value(OBIDMS_column_p column, index_t line_nb) +int obi_column_prepare_to_get_value(OBIDMS_column_p column, index_t line_nb) // TODO problem with some columns in a view being empty or shorter and triggering an error because they've been truncated when the view was closed. Fixed with obiview.c in update_lines() for now { if ((line_nb+1) > ((column->header)->line_count)) { obi_set_errno(OBICOL_UNKNOWN_ERROR); - obidebug(1, "\nError trying to get a value that is beyond the current number of lines used in the column"); + obidebug(1, "\nError trying to get a value that is beyond the current number of lines of the column"); return -1; } return 0; diff --git a/src/obiview.c b/src/obiview.c index 62ecff7..7d14d83 100644 --- a/src/obiview.c +++ b/src/obiview.c @@ -299,6 +299,7 @@ int update_lines(Obiview_p view, index_t line_count) // Enlarge the column if (obi_enlarge_column((view->columns)[i]) < 0) return -1; + (((view->columns)[i])->header)->lines_used = line_count; // TODO Discuss, this means that columns are not truncated below the number of lines in the view. Maybe they should be to save place. } }