diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-09-12 12:05:05 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-09-12 12:05:05 (GMT) |
commit | 801f6a504c1092aa7abb12983ee56a783759ae68 (patch) | |
tree | 8f981a7ba69d4bf8adcac728dcfbde285dd9a688 /tools/lib | |
parent | e5fa6451ca4a36b9ae87ff8c59b81d66cad6157c (diff) | |
download | hdf5-801f6a504c1092aa7abb12983ee56a783759ae68.zip hdf5-801f6a504c1092aa7abb12983ee56a783759ae68.tar.gz hdf5-801f6a504c1092aa7abb12983ee56a783759ae68.tar.bz2 |
[svn-r27763] Merges from trunk:
- tools: 27238, 27252, 27267, 27656
- inline markup: 27278
- bin/bbrelease: 27280, 27283, 27624
- h5vers: 27475
- C++ Doxygen: 27494-6
- FUNC_ENTER macro bug: 27581
- H5is_library_threadsafe: 27587, 27601
- release_docs: 27597
- Autotools freshening: 27641, 27653, 27675, 27686, 27692, 27699, 27722
27731, 27734, 27752
- MANIFEST comments: 27642
Tested on: ostrich & koala
various combinations of --enable-threadsafe
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_str.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 4def001..e2bb9cd 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -57,6 +57,7 @@ typedef struct H5LD_memb_t { static char *h5tools_escape(char *s, size_t size); static hbool_t h5tools_str_is_zero(const void *_mem, size_t size); static void h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch); +void h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, h5tools_context_t *ctx); /*------------------------------------------------------------------------- * Function: h5tools_str_close @@ -153,16 +154,16 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); HDva_end(ap); - /* Note: HDvsnprintf() behaves differently on Windows as Unix, when - * buffer is smaller than source string. On Unix, this function - * returns length of the source string and copy string upto the - * buffer size with NULL at the end of the buffer. However on - * Windows with the same condition, this function returns -1 and + /* Note: HDvsnprintf() behaves differently on Windows as Unix, when + * buffer is smaller than source string. On Unix, this function + * returns length of the source string and copy string upto the + * buffer size with NULL at the end of the buffer. However on + * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. * Because of this different return results, the strlen of the new string * is used to handle when HDvsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more - * buffer size before return NULL. + * buffer size before return NULL. */ if (nchars < 0) { /* failure, such as bad format */ @@ -289,7 +290,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) if (HDstrchr(fmt, '%')) { size_t n = sizeof(_temp); if (str->len - start + 1 > n) { - n = str->len - start + 1; + n = str->len - start + 1; temp = (char*)HDmalloc(n); HDassert(temp); } @@ -677,15 +678,15 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, * * PVN, 28 March 2006 * added H5T_NATIVE_LDOUBLE case - * + * * Vailin Choi; August 2010 * Modified to handle printing of selected compound fields for h5watch. * * Raymond Lu, 2011-09-01 * CLANG compiler complained about the line (about 800): * tempint = (tempint >> packed_data_offset) & packed_data_mask; - * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is - * 32-bit or more. For every kind of native integers, I changed the code + * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is + * 32-bit or more. For every kind of native integers, I changed the code * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the * size of integer. *------------------------------------------------------------------------- @@ -1436,14 +1437,14 @@ h5tools_str_is_zero(const void *_mem, size_t size) * * Purpose: replace all occurrences of substring. * - * Return: char * + * Return: char * * * Programmer: Peter Cao * March 8, 2012 * * Notes: - * Applications need to call free() to free the memoery allocated for - * the return string + * Applications need to call free() to free the memoery allocated for + * the return string * *------------------------------------------------------------------------- */ @@ -1476,6 +1477,6 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } - + return newstr; } |