From 83b0c254833ff0c22ebf1b2d1c89343f548b15fd Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 3 Oct 2010 12:23:18 +0200 Subject: [PATCH] Add comments informing the caller about side effects --- src/data/casereader.c | 2 +- src/math/sort.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data/casereader.c b/src/data/casereader.c index 98c10273..9f3d5cf9 100644 --- a/src/data/casereader.c +++ b/src/data/casereader.c @@ -331,7 +331,7 @@ casereader_advance (struct casereader *reader, casenumber n) /* Copies all the cases in READER to WRITER, propagating errors - appropriately. */ + appropriately. READER is destroyed by this function */ void casereader_transfer (struct casereader *reader, struct casewriter *writer) { diff --git a/src/math/sort.c b/src/math/sort.c index 8719d877..5b82277c 100644 --- a/src/math/sort.c +++ b/src/math/sort.c @@ -169,7 +169,9 @@ static struct casewriter_class sort_casewriter_class = }; /* Reads all the cases from INPUT. Sorts the cases according to - ORDERING. Returns the sorted cases in a new casereader. */ + ORDERING. Returns the sorted cases in a new casereader. + INPUT is destroyed by this function. + */ struct casereader * sort_execute (struct casereader *input, const struct subcase *ordering) { @@ -181,7 +183,7 @@ sort_execute (struct casereader *input, const struct subcase *ordering) /* Reads all the cases from INPUT. Sorts the cases in ascending order according to VARIABLE. Returns the sorted cases in a - new casereader. */ + new casereader. INPUT is destroyed by this function. */ struct casereader * sort_execute_1var (struct casereader *input, const struct variable *var) { -- 2.30.2