Mercurial > hg > octave-nkf
changeset 14005:f8556baf1949
rename octave_vsnprintf and octave_snprintf
* utils.h, utils.cc (octave_vasprintf): Rename from octave_vsnprintf.
Use gnulib:: tag for calling vasprintf. Change all callers
(octave_asprintf): Rename from octave_snprintf. Change all callers.
* build-aux/bootstrap.conf (gnulib_modules): Delete vsnprintf from the
list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 07 Dec 2011 06:47:15 -0500 |
parents | 92e45016eb48 |
children | 54f76558c41a |
files | build-aux/bootstrap.conf src/utils.cc src/utils.h |
diffstat | 3 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/build-aux/bootstrap.conf +++ b/build-aux/bootstrap.conf @@ -75,7 +75,6 @@ unistd unlink vasprintf - vsnprintf " # Additional xgettext options to use. Use "\\\newline" to break lines.
--- a/src/utils.cc +++ b/src/utils.cc @@ -1214,7 +1214,7 @@ size_t octave_vformat (std::ostream& os, const char *fmt, va_list args) { - std::string s = octave_vsnprintf (fmt, args); + std::string s = octave_vasprintf (fmt, args); os << s; @@ -1222,13 +1222,13 @@ } std::string -octave_vsnprintf (const char *fmt, va_list args) +octave_vasprintf (const char *fmt, va_list args) { std::string retval; char *result; - int status = vasprintf (&result, fmt, args); + int status = gnulib::vasprintf (&result, fmt, args); if (status >= 0) { @@ -1240,14 +1240,14 @@ } std::string -octave_snprintf (const char *fmt, ...) +octave_asprintf (const char *fmt, ...) { std::string retval; va_list args; va_start (args, fmt); - retval = octave_vsnprintf (fmt, args); + retval = octave_vasprintf (fmt, args); va_end (args);
--- a/src/utils.h +++ b/src/utils.h @@ -109,9 +109,10 @@ extern OCTINTERP_API size_t octave_vformat (std::ostream& os, const char *fmt, va_list args); -extern OCTINTERP_API std::string octave_vsnprintf (const char *fmt, va_list args); +extern OCTINTERP_API std::string +octave_vasprintf (const char *fmt, va_list args); -extern OCTINTERP_API std::string octave_snprintf (const char *fmt, ...); +extern OCTINTERP_API std::string octave_asprintf (const char *fmt, ...); extern OCTINTERP_API void octave_sleep (double seconds);