[lttng-dev] [RFC patch] [Babeltrace python bindings] Added missing call to _bt_ctf_get_decl_from_def in get_int_len(), and defined ssize_t
Jérémie Galarneau
jeremie.galarneau at efficios.com
Mon Aug 19 11:10:24 EDT 2013
Inlining for review.
Please note that both patches in this series are missing your "signed-off
by" line.
Also, the issues addressed in this patch are unrelated and should be fixed
separately.
> From c3474a73eb137b2bb7984d3195094a263c024e65 Mon Sep 17 00:00:00 2001
> From: Amit Margalit <amitm at il.ibm.com>
> Date: Mon, 19 Aug 2013 14:08:40 +0300
> Subject: [PATCH 1/2] Added missing call to _bt_ctf_get_decl_from_def in
> get_int_len(), and defined ssize_t
>
> ---
> bindings/python/babeltrace.i.in | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/bindings/python/babeltrace.i.in b/bindings/python/
babeltrace.i.in
> index dd2dacc..6c1f6fb 100644
> --- a/bindings/python/babeltrace.i.in
> +++ b/bindings/python/babeltrace.i.in
> @@ -53,6 +53,7 @@ trace to it."
> typedef unsigned long long uint64_t;
> typedef long long int64_t;
> typedef int bt_intern_str;
> +typedef unsigned long ssize_t;
On which system is ssize_t undefined?
I'd personally use ptrdiff_t, but maybe it is undefined there too?
These typedefs should be handled at config time, is it something you would
be interested in providing a patch for?
>
> /* =================================================================
> CONTEXT.H, CONTEXT-INTERNAL.H
> @@ -866,7 +867,7 @@ class ctf:
> Return the size, in bits, of an int or a negative
> value on error.
> """
> - return _bt_ctf_get_int_len(self._d)
> + return _bt_ctf_get_int_len(_bt_ctf_get_decl_from_def(self._d))
Good catch!
>
> def get_encoding(self):
> """
> --
> 1.7.11.7
>
On Mon, Aug 19, 2013 at 7:15 AM, Amit Margalit <AMITM at il.ibm.com> wrote:
> In some systems, the system headers use ssize_t, which was not defined,
> causing get_int_len() to return a pointer to a python object instead of
> returning the integer.
> Also, the python code that called _bt_ctf_get_int_len() failed to wrap
> self._d with the call to _bt_ctf_get_decl_from_def.
>
> I'm attaching this patch to (hopefully) avoid line formatting issues.
>
>
>
>
> Amit Margalit
> IBM XIV - *Storage Reinvented*
> XIV-NAS Development Team
> Tel. 03-689-7774
> Fax. 03-689-7230
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20130819/c0b579e2/attachment.html>
More information about the lttng-dev
mailing list