[lttng-dev] [PATCH] Use uint32_t for lttng_viewer_stream.metadata_flag

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Thu Jan 30 17:54:46 EST 2014


Using a char should be OK here. 

----- Original Message -----

> From: "Marc-André Laperle" <marc-andre.laperle at ericsson.com>
> To: "Simon Marchi" <simon.marchi at polymtl.ca>
> Cc: lttng-dev at lists.lttng.org
> Sent: Monday, January 20, 2014 3:25:07 PM
> Subject: Re: [lttng-dev] [PATCH] Use uint32_t for
> lttng_viewer_stream.metadata_flag

> I'm not sure that's possible. Whether I change them to uint8_t or int8_t, I
> get warnings because they get used with strncpy which wants char. Any idea
> how to solve this?

> Marc-André

> From: thundersim at gmail.com [thundersim at gmail.com] on behalf of Simon Marchi
> [simon.marchi at polymtl.ca]
> Sent: Friday, 17 January 2014 9:31 PM
> To: Marc-André Laperle
> Cc: lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] [PATCH] Use uint32_t for
> lttng_viewer_stream.metadata_flag

> While you are at it, you could change the char fields as well, since char is
> not exact-width either.

> On 17 January 2014 18:47, Marc-Andre Laperle <
> marc-andre.laperle at ericsson.com > wrote:

> > This struct is meant to be sent over the network so members should be
> 
> > of exact-width.
> 

> > Signed-off-by: Marc-Andre Laperle < marc-andre.laperle at ericsson.com >
> 
> > ---
> 
> > src/bin/lttng-relayd/lttng-viewer.h | 2 +-
> 
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> 

> > diff --git a/src/bin/lttng-relayd/lttng-viewer.h
> > b/src/bin/lttng-relayd/lttng-viewer.h
> 
> > index 1977a43..6330270 100644
> 
> > --- a/src/bin/lttng-relayd/lttng-viewer.h
> 
> > +++ b/src/bin/lttng-relayd/lttng-viewer.h
> 
> > @@ -100,7 +100,7 @@ struct lttng_viewer_session {
> 
> > struct lttng_viewer_stream {
> 
> > uint64_t id;
> 
> > uint64_t ctf_trace_id;
> 
> > - int metadata_flag;
> 
> > + uint32_t metadata_flag;
> 
> > char path_name[LTTNG_VIEWER_PATH_MAX];
> 
> > char channel_name[LTTNG_VIEWER_NAME_MAX];
> 
> > } __attribute__((__packed__));
> 
> > --
> 
> > 1.8.3.2
> 

> > _______________________________________________
> 
> > lttng-dev mailing list
> 
> > lttng-dev at lists.lttng.org
> 
> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140130/a6b1f8a6/attachment.html>


More information about the lttng-dev mailing list