Commit 004213d5 authored by Pekka Pessi's avatar Pekka Pessi

soa_session.h: reverted type of struct soa_media_activity bitfields to unsigned

Some C99 compilers bitch when signed int is used as bitfield.

Thanks to Michael Jerris for reporting this problem.

darcs-hash:20070413152257-88462-d99f6e9af6a5f09033e3f056dfd23181e3e4913c.gz
parent 790cc203
......@@ -1799,49 +1799,65 @@ int soa_is_complete(soa_session_t const *ss)
/** Return true if audio has been activated. */
int soa_is_audio_active(soa_session_t const *ss)
{
return ss ? ss->ss_local_activity->ma_audio : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_local_activity->ma_audio : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if video has been activated. */
int soa_is_video_active(soa_session_t const *ss)
{
return ss ? ss->ss_local_activity->ma_video : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_local_activity->ma_video : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if image sharing has been activated. */
int soa_is_image_active(soa_session_t const *ss)
{
return ss ? ss->ss_local_activity->ma_image : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_local_activity->ma_image : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if messaging session has been activated. */
int soa_is_chat_active(soa_session_t const *ss)
{
return ss ? ss->ss_local_activity->ma_chat : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_local_activity->ma_chat : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if remote audio is active (not on hold). */
int soa_is_remote_audio_active(soa_session_t const *ss)
{
return ss ? ss->ss_remote_activity->ma_audio : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_remote_activity->ma_audio : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if remote video is active (not on hold). */
int soa_is_remote_video_active(soa_session_t const *ss)
{
return ss ? ss->ss_remote_activity->ma_video : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_remote_activity->ma_video : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if image sharing is active (not on hold). */
int soa_is_remote_image_active(soa_session_t const *ss)
{
return ss ? ss->ss_remote_activity->ma_image : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_remote_activity->ma_image : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/** Return true if chat session is active (not on hold). */
int soa_is_remote_chat_active(soa_session_t const *ss)
{
return ss ? ss->ss_remote_activity->ma_chat : SOA_ACTIVE_DISABLED;
int ma = ss ? ss->ss_remote_activity->ma_chat : SOA_ACTIVE_DISABLED;
if (ma >= 4) ma |= -8;
return ma;
}
/* ======================================================================== */
......
......@@ -163,10 +163,10 @@ struct soa_session
struct soa_media_activity
{
signed ma_audio:4; /**< Audio activity (send/recv) */
signed ma_video:4; /**< Video activity (send/recv) */
signed ma_image:4; /**< Image activity (send/recv) for JPIP */
signed ma_chat:4; /**< Chat activity (send/recv) */
unsigned ma_audio:4; /**< Audio activity (send/recv) */
unsigned ma_video:4; /**< Video activity (send/recv) */
unsigned ma_image:4; /**< Image activity (send/recv) for JPIP */
unsigned ma_chat:4; /**< Chat activity (send/recv) */
} ss_local_activity[1], ss_remote_activity[1];
/** Capabilities as specified by application */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment