Skip to content

Commit d4d1faa

Browse files
committed
fix review issues
1 parent 677d6a7 commit d4d1faa

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

src/mmdata.c

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,17 @@ vstring g_qsortKey; /* Used by qsortStringCmp; pointer only, do not deallocate *
180180
* similar, all pushed onto this stack. When the final operation is executed,
181181
* and its result is persisted in some variable, the dependency on its
182182
* temporary operands ceases. Consequently, they should be freed again. To
183-
* automate this operation, such a stack maintains a __start__ index. A
184-
* client saves this value and sets it to the current stack top, then starts
185-
* pushing dynamically allocated operands on the stack. After the result is
186-
* persisted, all entries beginning with the element at index __start__ are
187-
* deallocated again, and the stack top is reset to the __start__ value, while
188-
* the __start__ value is reset to the saved value, to accomodate nesting of
189-
* this procedure.
183+
* automate this operation, such a stack maintains a `start` index. A client
184+
* saves this value and sets it to the current stack top, then starts pushing
185+
* dynamically allocated operands on the stack. After the result is persisted,
186+
* all entries beginning with the element at index `start` are deallocated
187+
* again, and the stack top is reset to the `start` value, while the `start`
188+
* value is reset to the saved value, to accommodate nesting of this procedure.
190189
*
191190
* This scheme needs a few conditions to be met:
192191
* - No operand is used in more than one evaluation context;
193192
* - Operations are executed strictly sequential, or in a nested manner. No two
194193
* operations interleave pushing operands.
195-
* push operands interleaved
196194
*/
197195

198196
/* Memory pools are used to reduce the number of malloc and alloc calls that
@@ -213,16 +211,27 @@ vstring g_qsortKey; /* Used by qsortStringCmp; pointer only, do not deallocate *
213211
The pointer to an array always points to element 0 (recast to right size).
214212
*/
215213

214+
/*!
215+
* \page doc-todo Improvements in documentation
216+
*
217+
* - Revisit the \ref block "block", \ref stack "stack" references to check the
218+
* inserted wording.
219+
* - Check what the advantages of __p__ tag are and whether the are better
220+
* replaced with backtick pairs. (\p aParam vs `aParam`)
221+
* - Regularly check the warning in \ref pntrString to see whether it still
222+
* holds, or can be made more precise.
223+
*/
224+
216225
/*!
217226
* \def MEM_POOL_GROW
218227
* Amount that \ref memUsedPool and \ref memFreePool grows when it overflows.
219228
*/
220-
#define MEM_POOL_GROW 1000 /* Amount that a pool grows when it overflows. */
229+
#define MEM_POOL_GROW 1000
221230
/*??? Let user set this from menu. */
222231
/*!
223232
* \var long poolAbsoluteMax
224233
* The value is a memory amount in bytes.
225-
* \n
234+
*
226235
* The \ref suballocator scheme must not hold more memory than is short term
227236
* useful. To the operating system all memory in \ref memFreePool appears as
228237
* allocated, although it is not really in use. To prevent the system from
@@ -590,14 +599,13 @@ void addToUsedPool(void *ptr)
590599
* Starting with the last entry in \ref memFreePool, memory held in that pool
591600
* is returned to the system until all, or at least a sufficient amount is
592601
* freed again (see \p untilOK).
593-
* \param[in] untilOK if 1 freeing \ref block "blocks" stops the moment
594-
* \ref poolTotalFree gets within the range of \ref poolAbsoluteMax again.
595-
* Note that it is not guaranteed that the limit \ref poolAbsoluteMax is
596-
* undercut because still too much free memory might be held in the
597-
* \ref memUsedPool.
598-
* \n
599-
* If 0, all \ref memFreePool entries are freed, and the pool itself is
600-
* shrunk back to \ref MEM_POOL_GROW size.
602+
* \param[in] untilOK
603+
* - if 1 freeing \ref block "blocks" stops the moment \ref poolTotalFree
604+
* gets within the range of \ref poolAbsoluteMax again. Note that it is
605+
* not guaranteed that the limit \ref poolAbsoluteMax is undercut because
606+
* still too much free memory might be held in the \ref memUsedPool.
607+
* - If 0, all \ref memFreePool entries are freed, and the pool itself is
608+
* shrunk back to \ref MEM_POOL_GROW size.
601609
*/
602610
void memFreePoolPurge(flag untilOK)
603611
{

src/mmdata.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ typedef nmbrString temp_nmbrString;
166166
* \brief a single \ref pntrString element for use in a \ref stack "stack".
167167
*
168168
* These elements are pushed onto and popped off a \ref stack
169-
* "stack of temporary data". All pointer of this type should ONLY refer to
169+
* "stack of temporary data". Pointers of this type should ONLY refer to
170170
* dynamically allocated memory on the heap. Special commands support
171171
* dependency tracking and free all pointers on and after a particular one in
172172
* such a stack.
@@ -864,7 +864,6 @@ flag pntrEq(const pntrString *sout, const pntrString *sin);
864864
* - the elements of \p g are duplicated.
865865
* - a pointer to a NUL byte ("") constant is padded to the right. Make sure
866866
* the referenced memory is never overwritten.
867-
* \bug a pointer to constant data is added as a writeable void*.
868867
*/
869868
temp_pntrString *pntrAddElement(const pntrString *g);
870869

src/mminou.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,9 @@ void printLongLine(const char *line, const char *startNextLine, const char *brea
154154
*
155155
* No timeout is applied while waiting for user input from the console.
156156
*
157-
* Detected format errors result in following bug messages:
158-
* - 1507: The first read character is NUL
159-
* - 1508: line overflow, the last character is not NUL
160-
* - 1519: padding of LF failed, or first read character was NUL
161-
* - 1521: a NUL in first and second position was read
162-
* - 1523: NULL instead of a prompt text when user input is required
163-
* - 1525: missing terminating LF, not caused by an EOF.
164-
*
165-
* A bug message need not result in an execution stop. It is not directed to
166-
* the metamath bug function to avoid stacking up calls (bug calling cmdInput
167-
* again for scrolling etc.).
157+
* A bug message need not result in an execution stop. It is not directed to
158+
* the metamath bug function to avoid stacking up calls (bug calling cmdInput
159+
* again for scrolling etc.).
168160
*
169161
* \todo clarify recursive call to print2 and the role of backFromCmdInput.
170162
* \param[in] stream (not null) source to read the line from. _stdin_ is

src/mmvstr.h

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,23 @@ temp_vstring right(const char *sin, long n);
458458
* \fn temp_vstring edit(const char *sin, long control)
459459
* perform a combination of transformations on \p sin based on the set bits in
460460
* \p control. This is an ASCII based transformation.
461-
* Bit Effect
462-
* 1 Clear parity bits
463-
* 2 Discard all spaces and tabs
464-
* 4 Discard characters: CR, LF, FF, ESC, RUBOUT, and NULL
465-
* 8 Discard leading spaces and tabs
466-
* 16 Reduce spaces and tabs to one space
467-
* 32 Convert lowercase to uppercase
468-
* 64 Convert [ to ( and ] to )
469-
* 128 Discard trailing spaces and tabs
470-
* 256 Do not alter characters inside quotes
471-
* 512 Convert uppercase to lowercase
472-
* 1024 Tab the line (convert spaces to equivalent tabs)
473-
* 2048 Untab the line (convert tabs to equivalent spaces)
474-
* 4096 Convert VT220 screen print frame graphics to -,|,+ characters
475-
* 8192 Discard CR only (to assist DOS-to-Unix conversion)
476-
* 16384 Discard trailing spaces, tabs, and LFs
461+
* Bit | Effect
462+
* ----- | ------
463+
* 1 | Clear parity bits
464+
* 2 | Discard all spaces and tabs
465+
* 4 | Discard characters: CR, LF, FF, ESC, RUBOUT, and NULL
466+
* 8 | Discard leading spaces and tabs
467+
* 16 | Reduce spaces and tabs to one space
468+
* 32 | Convert lowercase to uppercase
469+
* 64 | Convert [ to ( and ] to )
470+
* 128 | Discard trailing spaces and tabs
471+
* 256 | Do not alter characters inside quotes
472+
* 512 | Convert uppercase to lowercase
473+
* 1024 | Tab the line (convert spaces to equivalent tabs)
474+
* 2048 | Untab the line (convert tabs to equivalent spaces)
475+
* 4096 | Convert VT220 screen print frame graphics to -,|,+ characters
476+
* 8192 | Discard CR only (to assist DOS-to-Unix conversion)
477+
* 16384 | Discard trailing spaces, tabs, and LFs
477478
* \param[in] sin (not null) NUL terminated string to convert
478479
* \param[in] control a combination of set bit requesting the desired
479480
* transformation(s)

0 commit comments

Comments
 (0)