From 7c2caf2b9750e82bf14e6ff39e517afef593c2fe Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 1 Dec 2011 09:35:54 -0500 Subject: [PATCH] Use unsigned int instead of int for bitfields Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-events.h | 6 +++--- libringbuffer/backend_types.h | 4 ++-- libringbuffer/frontend_types.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 6b4863fd..45358d42 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -229,7 +229,7 @@ struct ltt_event { } u; struct cds_list_head list; /* Event list */ struct ust_pending_probe *pending_probe; - int metadata_dumped:1; + unsigned int metadata_dumped:1; }; struct channel; @@ -289,7 +289,7 @@ struct ltt_channel { struct ltt_channel_ops *ops; int header_type; /* 0: unset, 1: compact, 2: large */ struct lttng_ust_shm_handle *handle; /* shared-memory handle */ - int metadata_dumped:1; + unsigned int metadata_dumped:1; /* Channel ID, available for consumer too */ unsigned int id; @@ -307,7 +307,7 @@ struct ltt_session { struct cds_list_head list; /* Session list */ unsigned int free_chan_id; /* Next chan ID to allocate */ uuid_t uuid; /* Trace session unique ID */ - int metadata_dumped:1; + unsigned int metadata_dumped:1; }; struct ltt_transport { diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 7300309f..3d8bd3cb 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -53,7 +53,7 @@ struct lttng_ust_lib_ring_buffer_backend { DECLARE_SHMP(struct channel, chan); /* Associated channel */ int cpu; /* This buffer's cpu. -1 if global. */ union v_atomic records_read; /* Number of records read */ - unsigned int allocated:1; /* Bool: is buffer allocated ? */ + unsigned int allocated:1; /* is buffer allocated ? */ }; struct lttng_ust_lib_ring_buffer_shmp { @@ -69,7 +69,7 @@ struct channel_backend { * for writer. */ unsigned int buf_size_order; /* Order of buffer size */ - int extra_reader_sb:1; /* Bool: has extra reader subbuffer */ + unsigned int extra_reader_sb:1; /* has extra reader subbuffer ? */ unsigned long num_subbuf; /* Number of sub-buffers for writer */ uint64_t start_tsc; /* Channel creation TSC value */ DECLARE_SHMP(void *, priv_data);/* Client-specific information */ diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index 32462f6b..961c90e5 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -104,9 +104,9 @@ struct lttng_ust_lib_ring_buffer { unsigned long get_subbuf_consumed; /* Read-side consumed */ unsigned long prod_snapshot; /* Producer count snapshot */ unsigned long cons_snapshot; /* Consumer count snapshot */ - int get_subbuf:1; /* Sub-buffer being held by reader */ - int switch_timer_enabled:1; /* Protected by ring_buffer_nohz_lock */ - int read_timer_enabled:1; /* Protected by ring_buffer_nohz_lock */ + unsigned int get_subbuf:1, /* Sub-buffer being held by reader */ + switch_timer_enabled:1, /* Protected by ring_buffer_nohz_lock */ + read_timer_enabled:1; /* Protected by ring_buffer_nohz_lock */ /* shmp pointer to self */ DECLARE_SHMP(struct lttng_ust_lib_ring_buffer, self); } __attribute__((aligned(CAA_CACHE_LINE_SIZE))); -- 2.34.1