[lttng-dev] [lttng-tool PATCH] Remove stringify and add quotes directly in the configure

David Goulet david.goulet at polymtl.ca
Fri Jan 13 14:10:00 EST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Merged and pushed!

Thanks
David

On 12-01-13 10:23 AM, Yannick Brosseau wrote:
> Some part of the path where the same as some defined variable and
> the resulting string conversion gave the wrong result.
> 
> Remove the whole stringify function, since its use can be misleading
> 
> Signed-off-by: Yannick Brosseau <yannick.brosseau at gmail.com>
> ---
>  configure.ac           |    8 ++++----
>  lttng-sessiond/main.c  |   12 ++++--------
>  lttng-sessiond/utils.h |    5 -----
>  3 files changed, 8 insertions(+), 17 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 6bddf87..a9917dc 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -42,10 +42,10 @@ AC_ARG_WITH([consumer64d-libdir],
>  	[CONSUMERD64_LIBDIR=''])
>  AC_SUBST([CONSUMERD64_LIBDIR])
>  
> -AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], $CONSUMERD32_BIN, [Location of the 32-bit consumerd executable.])
> -AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], $CONSUMERD64_BIN, [Location of the 64-bit consumerd executable])
> -AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], $CONSUMERD32_LIBDIR, [Search for consumerd 32-bit libraries in this location.])
> -AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], $CONSUMERD64_LIBDIR, [Search for consumerd 64-bit libraries in this location.])
> +AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.])
> +AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable])
> +AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.])
> +AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_LIBDIR], "$CONSUMERD64_LIBDIR", [Search for consumerd 64-bit libraries in this location.])
>  
>  # Check for pthread
>  AC_CHECK_LIB([pthread], [pthread_create], [],
> diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c
> index f5f8dbe..a4788f7 100644
> --- a/lttng-sessiond/main.c
> +++ b/lttng-sessiond/main.c
> @@ -174,14 +174,10 @@ static struct ltt_session_list *session_list_ptr;
>  int ust_consumerd64_fd = -1;
>  int ust_consumerd32_fd = -1;
>  
> -static const char *consumerd32_bin =
> -	__stringify(CONFIG_CONSUMERD32_BIN);
> -static const char *consumerd64_bin =
> -	__stringify(CONFIG_CONSUMERD64_BIN);
> -static const char *consumerd32_libdir =
> -	__stringify(CONFIG_CONSUMERD32_LIBDIR);
> -static const char *consumerd64_libdir =
> -	__stringify(CONFIG_CONSUMERD64_LIBDIR);
> +static const char *consumerd32_bin = CONFIG_CONSUMERD32_BIN;
> +static const char *consumerd64_bin = CONFIG_CONSUMERD64_BIN;
> +static const char *consumerd32_libdir = CONFIG_CONSUMERD32_LIBDIR;
> +static const char *consumerd64_libdir = CONFIG_CONSUMERD64_LIBDIR;
>  
>  static
>  void setup_consumerd_path(void)
> diff --git a/lttng-sessiond/utils.h b/lttng-sessiond/utils.h
> index 7bcd1a8..e20ec4e 100644
> --- a/lttng-sessiond/utils.h
> +++ b/lttng-sessiond/utils.h
> @@ -18,11 +18,6 @@
>  #ifndef _LTT_UTILS_H
>  #define _LTT_UTILS_H
>  
> -#ifndef __stringify
> -#define __stringify1(x)	#x
> -#define __stringify(x)	__stringify1(x)
> -#endif
> -
>  const char *get_home_dir(void);
>  int notify_thread_pipe(int wpipe);
>  
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEcBAEBAgAGBQJPEIGIAAoJEELoaioR9I02HqsH/0LJt7myhbbI4ZpRrpc59EJ5
9EwNL/sZtXj2qFCNmDywemnWcWsbTEXbB0D2Q2x3OPaA6jmc5F72pD1X9xTtwGJN
+5/kX8gM4Fgv7UBoPVJKi+6JBt1Ygc3K3Zm/cW/+Nc0iIP8AMeCJi8Y7A+e09kAg
y1j8pdjGn1vvhcaTfUtwrUTkWOOelOORZQyMhNgRL9EivvQDHwPBoYtq0xJJDJJy
7Be2MQZng/B299Tx9/wXDO0AUbuNog9sKDQGO0vTss2WwCB8By+81Uq6Kr/gJe0d
Gax88hKAKlKCvaFgzpSjO5AMMJmD7LJZvu7Qm5THPQLfzT/DWG+NXjDZ03KRN+s=
=Fa88
-----END PGP SIGNATURE-----



More information about the lttng-dev mailing list