Remove whitespace at end of lines, step 2.
- Replace '\s*$' with ''. git-svn-id: svn://svn.berlios.de/openocd/trunk@2398 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
2428bc2a5c
commit
fddbc58091
File diff suppressed because it is too large
Load Diff
|
@ -29,7 +29,7 @@ struct membuf {
|
||||||
// buflen is alway "+1" bigger then
|
// buflen is alway "+1" bigger then
|
||||||
// what is shown here, the +1 is for
|
// what is shown here, the +1 is for
|
||||||
// the NULL string terminator
|
// the NULL string terminator
|
||||||
#define DEFAULT_BUFSIZE 100
|
#define DEFAULT_BUFSIZE 100
|
||||||
size_t maxlen; // allocated size
|
size_t maxlen; // allocated size
|
||||||
size_t curlen; // where we are inserting at
|
size_t curlen; // where we are inserting at
|
||||||
char *_strtoklast;
|
char *_strtoklast;
|
||||||
|
@ -40,7 +40,7 @@ struct membuf {
|
||||||
#define space_avail(pBuf) (pBuf->maxlen - pBuf->curlen)
|
#define space_avail(pBuf) (pBuf->maxlen - pBuf->curlen)
|
||||||
#define dataend(pBuf) (((char *)(pBuf->buf)) + pBuf->curlen)
|
#define dataend(pBuf) (((char *)(pBuf->buf)) + pBuf->curlen)
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
membuf_len(struct membuf *pBuf)
|
membuf_len(struct membuf *pBuf)
|
||||||
{
|
{
|
||||||
return pBuf->curlen;
|
return pBuf->curlen;
|
||||||
|
@ -65,7 +65,7 @@ membuf_strtok(struct membuf *pBuf, const char *sep, void **pLast)
|
||||||
return strtok_r(NULL, sep, &(pBuf->_strtoklast));
|
return strtok_r(NULL, sep, &(pBuf->_strtoklast));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct membuf *
|
struct membuf *
|
||||||
|
@ -161,7 +161,7 @@ membuf_vsprintf(struct membuf *pBuf, const char *fmt, va_list ap)
|
||||||
// do work
|
// do work
|
||||||
r = vsnprintf(dataend(pBuf),
|
r = vsnprintf(dataend(pBuf),
|
||||||
sa,
|
sa,
|
||||||
fmt,
|
fmt,
|
||||||
ap);
|
ap);
|
||||||
if ((r > 0) && (((size_t)(r)) < sa)) {
|
if ((r > 0) && (((size_t)(r)) < sa)) {
|
||||||
// Success!
|
// Success!
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
* This is a simple 'string buffer' that auto-grows.
|
* This is a simple 'string buffer' that auto-grows.
|
||||||
*
|
*
|
||||||
* More correctly put, this is a "memory buffer"
|
* More correctly put, this is a "memory buffer"
|
||||||
* it may contain binary data
|
* it may contain binary data
|
||||||
*
|
*
|
||||||
* Note: Internally the buffer always has a 'null terminator'
|
* Note: Internally the buffer always has a 'null terminator'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* contents of this structure are 'opaque' */
|
/* contents of this structure are 'opaque' */
|
||||||
struct membuf;
|
struct membuf;
|
||||||
|
|
||||||
|
|
||||||
/** Create a new membuf
|
/** Create a new membuf
|
||||||
* By default the memory buffer has "some non-zero-size"
|
* By default the memory buffer has "some non-zero-size"
|
||||||
|
@ -34,7 +34,7 @@ void membuf_delete(struct membuf *pBuf);
|
||||||
|
|
||||||
|
|
||||||
/** grow/shrink a membuf by specified amount.
|
/** grow/shrink a membuf by specified amount.
|
||||||
* @param pBuf - the buffer
|
* @param pBuf - the buffer
|
||||||
* @param amount - the amount to grow or shrink by.
|
* @param amount - the amount to grow or shrink by.
|
||||||
*
|
*
|
||||||
* Symantics of 'realloc()' return NULL on failure
|
* Symantics of 'realloc()' return NULL on failure
|
||||||
|
@ -43,7 +43,7 @@ struct membuf *membuf_grow(struct membuf *pBuf, int amount);
|
||||||
|
|
||||||
/** how long is this buffer (memlen(), strlen())
|
/** how long is this buffer (memlen(), strlen())
|
||||||
* @param pBuf - the buffer
|
* @param pBuf - the buffer
|
||||||
*
|
*
|
||||||
* @returns: length of current buffer.
|
* @returns: length of current buffer.
|
||||||
*/
|
*/
|
||||||
size_t membuf_len(struct membuf *pBuf);
|
size_t membuf_len(struct membuf *pBuf);
|
||||||
|
@ -76,10 +76,10 @@ int membuf_sprintf(struct membuf *pBuf , const char *fmt, ...);
|
||||||
*/
|
*/
|
||||||
int membuf_vsprintf(struct membuf *pBuf , const char *fmt, va_list ap);
|
int membuf_vsprintf(struct membuf *pBuf , const char *fmt, va_list ap);
|
||||||
|
|
||||||
/** Tokenize lines using strtok()
|
/** Tokenize lines using strtok()
|
||||||
* @param pBuf - buffer to tokenize
|
* @param pBuf - buffer to tokenize
|
||||||
* @param delim - delimiter parameter for strtok_r()
|
* @param delim - delimiter parameter for strtok_r()
|
||||||
*
|
*
|
||||||
* Identical to "strtok()" - pass "pBuff = NULL" on second call
|
* Identical to "strtok()" - pass "pBuff = NULL" on second call
|
||||||
*
|
*
|
||||||
* NOTE: This call is <b > destructive</b> to the buffer.
|
* NOTE: This call is <b > destructive</b> to the buffer.
|
||||||
|
|
Loading…
Reference in New Issue