TT#111150 Mark bit-fields explicitly with as unsigned

Whether a bit-field is signed or unsigned is implementation specific, so
we should be explicit about this.

Change-Id: I744df3d24bc08e95fa816ba4135f19cd3a5dcb17
Warned-by: lgtm
pull/1218/head
Guillem Jover 5 years ago
parent af6ef843da
commit 68797f4195

@ -130,15 +130,15 @@ struct codec_ssrc_handler {
uint64_t skip_pts; uint64_t skip_pts;
int rtp_mark:1; unsigned int rtp_mark:1;
}; };
struct transcode_packet { struct transcode_packet {
seq_packet_t p; // must be first seq_packet_t p; // must be first
unsigned long ts; unsigned long ts;
str *payload; str *payload;
struct codec_handler *handler; struct codec_handler *handler;
int marker:1, unsigned int marker:1,
ignore_seq:1; ignore_seq:1;
int (*func)(struct codec_ssrc_handler *, struct transcode_packet *, struct media_packet *); int (*func)(struct codec_ssrc_handler *, struct transcode_packet *, struct media_packet *);
int (*dup_func)(struct codec_ssrc_handler *, struct transcode_packet *, struct media_packet *); int (*dup_func)(struct codec_ssrc_handler *, struct transcode_packet *, struct media_packet *);
struct rtp_header rtp; struct rtp_header rtp;

@ -33,8 +33,8 @@ struct poller_item_int {
struct obj obj; struct obj obj;
struct poller_item item; struct poller_item item;
int blocked:1; unsigned int blocked:1;
int error:1; unsigned int error:1;
}; };
struct poller { struct poller {

@ -249,7 +249,7 @@ struct rtcp_process_ctx {
int json_init_len; int json_init_len;
// verdict // verdict
int discard:1; unsigned int discard:1;
}; };
// all available methods // all available methods
struct rtcp_handler { struct rtcp_handler {

@ -33,13 +33,13 @@ struct sdp_origin {
struct network_address address; struct network_address address;
unsigned long long version_num; unsigned long long version_num;
size_t version_output_pos; size_t version_output_pos;
int parsed:1; unsigned int parsed:1;
}; };
struct sdp_connection { struct sdp_connection {
str s; str s;
struct network_address address; struct network_address address;
int parsed:1; unsigned int parsed:1;
}; };
struct sdp_attributes { struct sdp_attributes {
@ -97,7 +97,7 @@ struct attribute_candidate {
str related_port_str; str related_port_str;
struct ice_candidate cand_parsed; struct ice_candidate cand_parsed;
int parsed:1; unsigned int parsed:1;
}; };
struct attribute_crypto { struct attribute_crypto {
@ -118,9 +118,9 @@ struct attribute_crypto {
u_int64_t lifetime; u_int64_t lifetime;
unsigned char mki[256]; unsigned char mki[256];
unsigned int mki_len; unsigned int mki_len;
int unencrypted_srtcp:1, unsigned int unencrypted_srtcp:1,
unencrypted_srtp:1, unencrypted_srtp:1,
unauthenticated_srtp:1; unauthenticated_srtp:1;
}; };
struct attribute_ssrc { struct attribute_ssrc {

@ -41,7 +41,7 @@ struct bencode_item {
struct bencode_buffer { struct bencode_buffer {
struct __bencode_buffer_piece *pieces; struct __bencode_buffer_piece *pieces;
struct __bencode_free_list *free_list; struct __bencode_free_list *free_list;
int error:1; /* set to !0 if allocation failed at any point */ unsigned int error:1; /* set to !0 if allocation failed at any point */
}; };

@ -234,7 +234,7 @@ struct endpoint_map {
unsigned int num_ports; unsigned int num_ports;
const struct logical_intf *logical_intf; const struct logical_intf *logical_intf;
GQueue intf_sfds; /* list of struct intf_list - contains stream_fd list */ GQueue intf_sfds; /* list of struct intf_list - contains stream_fd list */
int wildcard:1; unsigned int wildcard:1;
}; };
struct loop_protector { struct loop_protector {
@ -375,9 +375,9 @@ struct call_monologue {
unsigned long long sdp_version; unsigned long long sdp_version;
GString *last_sdp; GString *last_sdp;
int block_dtmf:1; unsigned int block_dtmf:1;
int block_media:1; unsigned int block_media:1;
int rec_forwarding:1; unsigned int rec_forwarding:1;
}; };
struct call { struct call {
@ -414,13 +414,13 @@ struct call {
struct recording *recording; struct recording *recording;
str metadata; str metadata;
int block_dtmf:1; unsigned int block_dtmf:1;
int block_media:1; unsigned int block_media:1;
int recording_on:1; unsigned int recording_on:1;
int rec_forwarding:1; unsigned int rec_forwarding:1;
int drop_traffic:1; unsigned int drop_traffic:1;
int foreign_call:1; // created_via_redis_notify call unsigned int foreign_call:1; // created_via_redis_notify call
int disable_jb:1; unsigned int disable_jb:1;
}; };

@ -63,70 +63,70 @@ struct sdp_ng_flags {
ICE_LITE_BKW, ICE_LITE_BKW,
ICE_LITE_BOTH, ICE_LITE_BOTH,
} ice_lite_option:2; } ice_lite_option:2;
int asymmetric:1, unsigned int asymmetric:1,
protocol_accept:1, protocol_accept:1,
no_redis_update:1, no_redis_update:1,
unidirectional:1, unidirectional:1,
trust_address:1, trust_address:1,
port_latching:1, port_latching:1,
no_port_latching:1, no_port_latching:1,
replace_origin:1, replace_origin:1,
replace_sess_conn:1, replace_sess_conn:1,
replace_sdp_version:1, replace_sdp_version:1,
replace_zero_address:1, replace_zero_address:1,
rtcp_mux_offer:1, rtcp_mux_offer:1,
rtcp_mux_require:1, rtcp_mux_require:1,
rtcp_mux_demux:1, rtcp_mux_demux:1,
rtcp_mux_accept:1, rtcp_mux_accept:1,
rtcp_mux_reject:1, rtcp_mux_reject:1,
no_rtcp_attr:1, no_rtcp_attr:1,
full_rtcp_attr:1, full_rtcp_attr:1,
generate_rtcp:1, generate_rtcp:1,
generate_rtcp_off:1, generate_rtcp_off:1,
generate_mid:1, generate_mid:1,
strict_source:1, strict_source:1,
media_handover:1, media_handover:1,
dtls_passive:1, dtls_passive:1,
dtls_reverse_passive:1, dtls_reverse_passive:1,
osrtp_accept:1, osrtp_accept:1,
osrtp_offer:1, osrtp_offer:1,
reset:1, reset:1,
all:1, all:1,
fragment:1, fragment:1,
record_call:1, record_call:1,
loop_protect:1, loop_protect:1,
original_sendrecv:1, original_sendrecv:1,
asymmetric_codecs:1, asymmetric_codecs:1,
symmetric_codecs:1, symmetric_codecs:1,
reorder_codecs:1, reorder_codecs:1,
single_codec:1, single_codec:1,
inject_dtmf:1, inject_dtmf:1,
t38_decode:1, t38_decode:1,
t38_force:1, t38_force:1,
t38_stop:1, t38_stop:1,
t38_no_ecm:1, t38_no_ecm:1,
t38_no_v17:1, t38_no_v17:1,
t38_no_v27ter:1, t38_no_v27ter:1,
t38_no_v29:1, t38_no_v29:1,
t38_no_v34:1, t38_no_v34:1,
t38_no_iaf:1, t38_no_iaf:1,
t38_fec:1, t38_fec:1,
supports_load_limit:1, supports_load_limit:1,
dtls_off:1, dtls_off:1,
sdes_off:1, sdes_off:1,
sdes_unencrypted_srtp:1, sdes_unencrypted_srtp:1,
sdes_unencrypted_srtcp:1, sdes_unencrypted_srtcp:1,
sdes_unauthenticated_srtp:1, sdes_unauthenticated_srtp:1,
sdes_encrypted_srtp:1, sdes_encrypted_srtp:1,
sdes_encrypted_srtcp:1, sdes_encrypted_srtcp:1,
sdes_authenticated_srtp:1, sdes_authenticated_srtp:1,
sdes_lifetime:1, sdes_lifetime:1,
sdes_pad:1, sdes_pad:1,
drop_traffic_start:1, drop_traffic_start:1,
drop_traffic_stop:1, drop_traffic_stop:1,
passthrough_on:1, passthrough_on:1,
passthrough_off:1, passthrough_off:1,
disable_jb:1; disable_jb:1;
}; };

@ -31,10 +31,10 @@ struct codec_handler {
int dtmf_payload_type; int dtmf_payload_type;
int cn_payload_type; int cn_payload_type;
codec_handler_func *func; codec_handler_func *func;
int kernelize:1; unsigned int kernelize:1;
int transcoder:1; unsigned int transcoder:1;
int dtmf_scaler:1; unsigned int dtmf_scaler:1;
int pcm_dtmf_detect:1; unsigned int pcm_dtmf_detect:1;
struct ssrc_hash *ssrc_hash; struct ssrc_hash *ssrc_hash;
struct codec_handler *output_handler; // == self, or other PT handler struct codec_handler *output_handler; // == self, or other PT handler

@ -63,9 +63,9 @@ struct crypto_suite {
}; };
struct crypto_session_params { struct crypto_session_params {
int unencrypted_srtcp:1, unsigned int unencrypted_srtcp:1,
unencrypted_srtp:1, unencrypted_srtp:1,
unauthenticated_srtp:1; unauthenticated_srtp:1;
}; };
struct crypto_params { struct crypto_params {
@ -95,7 +95,7 @@ struct crypto_context {
void *session_key_ctx[2]; void *session_key_ctx[2];
int have_session_key:1; unsigned int have_session_key:1;
}; };

@ -53,9 +53,9 @@ struct dtls_connection {
SSL *ssl; SSL *ssl;
BIO *r_bio, *w_bio; BIO *r_bio, *w_bio;
void *ptr; void *ptr;
int init:1, unsigned int init:1,
active:1, active:1,
connected:1; connected:1;
}; };

@ -99,7 +99,7 @@ struct ice_candidate_pair {
unsigned int retransmits; unsigned int retransmits;
struct ice_agent *agent; struct ice_agent *agent;
u_int64_t pair_priority; u_int64_t pair_priority;
int was_controlling:1, unsigned int was_controlling:1,
was_nominated:1; was_nominated:1;
}; };

@ -44,11 +44,11 @@ struct transport_protocol {
const char *name; const char *name;
enum transport_protocol_index avpf_proto; enum transport_protocol_index avpf_proto;
enum transport_protocol_index osrtp_proto; enum transport_protocol_index osrtp_proto;
int rtp:1; /* also set to 1 for SRTP */ unsigned int rtp:1; /* also set to 1 for SRTP */
int srtp:1; unsigned int srtp:1;
int osrtp:1; unsigned int osrtp:1;
int avpf:1; unsigned int avpf:1;
int tcp:1; unsigned int tcp:1;
}; };
extern const struct transport_protocol transport_protocols[]; extern const struct transport_protocol transport_protocols[];

@ -25,9 +25,9 @@ struct stun_attrs {
u_int64_t tiebreaker; u_int64_t tiebreaker;
endpoint_t mapped; endpoint_t mapped;
unsigned int error_code; unsigned int error_code;
int use:1, unsigned int use:1,
controlled:1, controlled:1,
controlling:1; controlling:1;
}; };

@ -12,17 +12,17 @@ struct t38_options {
int max_ifp; int max_ifp;
int max_datagram; int max_datagram;
int local_tcf:1; unsigned int local_tcf:1;
int fill_bit_removal:1; unsigned int fill_bit_removal:1;
int transcoding_mmr:1; unsigned int transcoding_mmr:1;
int transcoding_jbig:1; unsigned int transcoding_jbig:1;
int no_ecm:1; unsigned int no_ecm:1;
int no_v17:1; unsigned int no_v17:1;
int no_v27ter:1; unsigned int no_v27ter:1;
int no_v29:1; unsigned int no_v29:1;
int no_v34:1; unsigned int no_v34:1;
int no_iaf:1; unsigned int no_iaf:1;
}; };

@ -112,7 +112,7 @@ struct rtpengine_target_info {
unsigned int num_payload_types; unsigned int num_payload_types;
unsigned char tos; unsigned char tos;
int rtcp_mux:1, unsigned int rtcp_mux:1,
dtls:1, dtls:1,
stun:1, stun:1,
rtp:1, rtp:1,

@ -103,10 +103,10 @@ union codec_options_u {
unsigned int mode_set; // bitfield unsigned int mode_set; // bitfield
int mode_change_period; int mode_change_period;
int mode_change_interval; int mode_change_interval;
int octet_aligned:1; unsigned int octet_aligned:1;
int crc:1; unsigned int crc:1;
int robust_sorting:1; unsigned int robust_sorting:1;
int mode_change_neighbor:1; unsigned int mode_change_neighbor:1;
const unsigned int *bits_per_frame; const unsigned int *bits_per_frame;
const unsigned int *bitrates; const unsigned int *bitrates;
@ -142,12 +142,12 @@ struct codec_def_s {
// filled in by codeclib_init() // filled in by codeclib_init()
str rtpname_str; str rtpname_str;
int rfc_payload_type; int rfc_payload_type;
int support_encoding:1, unsigned int support_encoding:1,
support_decoding:1; support_decoding:1;
// flags // flags
int supplemental:1, unsigned int supplemental:1,
dtmf:1; // special case dtmf:1; // special case
const codec_type_t *codec_type; const codec_type_t *codec_type;

@ -33,7 +33,7 @@ struct rtp_payload_type {
const codec_def_t *codec_def; const codec_def_t *codec_def;
int for_transcoding:1; unsigned int for_transcoding:1;
}; };

@ -54,7 +54,7 @@ struct stream_s {
unsigned long tag; unsigned long tag;
int fd; int fd;
handler_t handler; handler_t handler;
int forwarding_on:1; unsigned int forwarding_on:1;
}; };
typedef struct stream_s stream_t; typedef struct stream_s stream_t;
@ -91,7 +91,7 @@ struct ssrc_s {
SSL *ssl; SSL *ssl;
struct streambuf *tls_fwd_stream; struct streambuf *tls_fwd_stream;
struct poller tls_fwd_poller; struct poller tls_fwd_poller;
int sent_intro:1; unsigned int sent_intro:1;
}; };
typedef struct ssrc_s ssrc_t; typedef struct ssrc_s ssrc_t;
@ -134,8 +134,8 @@ struct metafile_s {
int payload_ptimes[128]; int payload_ptimes[128];
int media_ptimes[4]; int media_ptimes[4];
int recording_on:1; unsigned int recording_on:1;
int forwarding_on:1; unsigned int forwarding_on:1;
}; };

@ -22,8 +22,8 @@ typedef struct {
wanted_protocol; wanted_protocol;
char unix_path[256]; char unix_path[256];
struct sockaddr_storage sockname; struct sockaddr_storage sockname;
int open:1, unsigned int open:1,
bound:1; bound:1;
} socket_t; } socket_t;
typedef struct { typedef struct {

Loading…
Cancel
Save