From: Colin Patrick McCabe Date: Fri, 5 Aug 2011 22:49:30 +0000 (-0700) Subject: Remove unused dyn_sprintf X-Git-Tag: v0.33~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad31db9e2f40ffdfacc8daf4d9095ed6aa89ca4c;p=ceph.git Remove unused dyn_sprintf Signed-off-by: Colin McCabe --- diff --git a/src/Makefile.am b/src/Makefile.am index aa56950a0570..e45c4b4d1d27 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -746,7 +746,6 @@ libcommon_files = \ common/environment.cc\ common/sctp_crc32.c\ common/assert.cc \ - common/dyn_snprintf.c \ common/run_cmd.cc \ common/WorkQueue.cc \ common/ConfUtils.cc \ @@ -962,7 +961,6 @@ noinst_HEADERS = \ common/signal.h\ global/signal_handler.h\ common/simple_spin.h\ - common/dyn_snprintf.h\ common/run_cmd.h\ common/safe_io.h\ common/config.h\ diff --git a/src/common/config.cc b/src/common/config.cc index 46532912e987..9dc56268bcf7 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -17,7 +17,6 @@ #include "common/ceph_argparse.h" #include "common/common_init.h" #include "common/config.h" -#include "common/dyn_snprintf.h" #include "common/static_assert.h" #include "common/strtol.h" #include "common/version.h" diff --git a/src/common/dyn_snprintf.c b/src/common/dyn_snprintf.c deleted file mode 100644 index be03ae562b95..000000000000 --- a/src/common/dyn_snprintf.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include - -#define MAXARGS 32 - - -#define CALL_SNPRINTF(buf, size, format, args) snprintf(buf, size, format, args[0], args[1], args[2], args[3], \ - args[4], args[5], args[6], args[7], \ - args[8], args[9], args[10], args[11], \ - args[12], args[13], args[14], args[15], \ - args[16], args[17], args[18], args[19], \ - args[20], args[21], args[22], args[23], \ - args[24], args[25], args[26], args[27], \ - args[28], args[29], args[30], args[31]) - -int dyn_snprintf(char **pbuf, size_t *pmax_size, int nargs, const char *format, ...) -{ - int ret; - va_list vl; - char *old_buf = *pbuf; - char *args[MAXARGS]; - char *arg; - char *tmp_src = NULL; - int i; - - if (nargs > MAXARGS) - return -1; - - va_start(vl, format); - arg = va_arg(vl, char *); - for (i = 0; i= (int)*pmax_size) { - *pmax_size = ret * 2; - *pbuf = (char *)realloc(*pbuf, *pmax_size); - ret = CALL_SNPRINTF(*pbuf, *pmax_size, format, args); - } - - return ret; -} - diff --git a/src/common/dyn_snprintf.h b/src/common/dyn_snprintf.h deleted file mode 100644 index 09eb1a269a16..000000000000 --- a/src/common/dyn_snprintf.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CEPH_DYN_SNPRINTF_H -#define CEPH_DYN_SNPRINTF_H - -#ifdef __cplusplus -extern "C" { -#endif - -int dyn_snprintf(char **pbuf, size_t *pmax_size, int nargs, const char *format, ...); - -#ifdef __cplusplus -} -#endif - -#endif