mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 20:58:22 +00:00
membuf: Minor code-style improvements
Show the start in end in the comment. Comment a missing variable in membuf_readline() and fix its line length. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
142a3cb63c
commit
da8694a7d2
2 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,7 @@
|
||||||
*
|
*
|
||||||
* .............xxxxxxxxxxxxxxxx.........................
|
* .............xxxxxxxxxxxxxxxx.........................
|
||||||
* ^ ^
|
* ^ ^
|
||||||
* tail head
|
* ^start tail head ^end
|
||||||
*
|
*
|
||||||
* xxxxxxxxxxxxx................xxxxxxxxxxxxxxxxxxxxxxxxx
|
* xxxxxxxxxxxxx................xxxxxxxxxxxxxxxxxxxxxxxxx
|
||||||
* ^ ^
|
* ^ ^
|
||||||
|
@ -194,11 +194,13 @@ int membuf_free(struct membuf *mb);
|
||||||
* @mb: membuff to adjust
|
* @mb: membuff to adjust
|
||||||
* @str: Place to put the line
|
* @str: Place to put the line
|
||||||
* @maxlen: Maximum line length (excluding terminator)
|
* @maxlen: Maximum line length (excluding terminator)
|
||||||
|
* @minch: Minimum ASCII character to permit as part of the line (e.g. ' ')
|
||||||
* @must_fit: If true then str is empty if line doesn't fit
|
* @must_fit: If true then str is empty if line doesn't fit
|
||||||
* Return: number of bytes read (including terminator) if a line has been
|
* Return: number of bytes read (including terminator) if a line has been
|
||||||
* read, 0 if nothing was there or line didn't fit when must_fit is set
|
* read, 0 if nothing was there or line didn't fit when must_fit is set
|
||||||
*/
|
*/
|
||||||
int membuf_readline(struct membuf *mb, char *str, int maxlen, int minch, bool must_fit);
|
int membuf_readline(struct membuf *mb, char *str, int maxlen, int minch,
|
||||||
|
bool must_fit);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* membuf_extend_by() - expand a membuff
|
* membuf_extend_by() - expand a membuff
|
||||||
|
|
|
@ -287,7 +287,8 @@ int membuf_free(struct membuf *mb)
|
||||||
(mb->end - mb->start) - 1 - membuf_avail(mb);
|
(mb->end - mb->start) - 1 - membuf_avail(mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
int membuf_readline(struct membuf *mb, char *str, int maxlen, int minch, bool must_fit)
|
int membuf_readline(struct membuf *mb, char *str, int maxlen, int minch,
|
||||||
|
bool must_fit)
|
||||||
{
|
{
|
||||||
int len; /* number of bytes read (!= string length) */
|
int len; /* number of bytes read (!= string length) */
|
||||||
char *s, *end;
|
char *s, *end;
|
||||||
|
|
Loading…
Add table
Reference in a new issue