[libbluray-devel] Fixed bit field types
hpi1
git at videolan.org
Tue Mar 5 10:49:13 CET 2013
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Mar 5 10:54:01 2013 +0200| [3929a05dcd1f7021544fe0a180336284d36fb59c] | committer: hpi1
Fixed bit field types
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=3929a05dcd1f7021544fe0a180336284d36fb59c
---
src/libbluray/bdnav/index_parse.h | 18 ++++-----
src/libbluray/bdnav/uo_mask_table.h | 72 +++++++++++++++++------------------
src/libbluray/hdmv/mobj_parse.h | 28 +++++++-------
3 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/src/libbluray/bdnav/index_parse.h b/src/libbluray/bdnav/index_parse.h
index e6b706e..9432477 100644
--- a/src/libbluray/bdnav/index_parse.h
+++ b/src/libbluray/bdnav/index_parse.h
@@ -62,25 +62,25 @@ typedef enum {
} indx_bdj_playback_type;
typedef struct {
- uint8_t initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */
- uint8_t content_exist_flag : 1;
- uint8_t video_format : 4;
- uint8_t frame_rate : 4;
+ unsigned int initial_output_mode_preference : 1; /* 0 - 2D, 1 - 3D */
+ unsigned int content_exist_flag : 1;
+ unsigned int video_format : 4;
+ unsigned int frame_rate : 4;
uint8_t user_data[32];
} INDX_APP_INFO;
typedef struct {
- uint8_t playback_type : 2;
+ uint8_t playback_type/* : 2*/;
char name[6];
} INDX_BDJ_OBJ;
typedef struct {
- uint8_t playback_type : 2;
+ uint8_t playback_type/* : 2*/;
uint16_t id_ref;
} INDX_HDMV_OBJ;
typedef struct {
- uint8_t object_type : 2;
+ uint8_t object_type/* : 2*/;
/*union {*/
INDX_BDJ_OBJ bdj;
INDX_HDMV_OBJ hdmv;
@@ -88,8 +88,8 @@ typedef struct {
} INDX_PLAY_ITEM;
typedef struct {
- uint8_t object_type : 2;
- uint8_t access_type : 2;
+ uint8_t object_type/* : 2*/;
+ uint8_t access_type/* : 2*/;
/*union {*/
INDX_BDJ_OBJ bdj;
INDX_HDMV_OBJ hdmv;
diff --git a/src/libbluray/bdnav/uo_mask_table.h b/src/libbluray/bdnav/uo_mask_table.h
index b5dceef..fb130f7 100644
--- a/src/libbluray/bdnav/uo_mask_table.h
+++ b/src/libbluray/bdnav/uo_mask_table.h
@@ -24,49 +24,49 @@
typedef struct bd_uo_mask_table_s
{
- uint8_t menu_call : 1;
- uint8_t title_search : 1;
- uint8_t chapter_search : 1;
- uint8_t time_search : 1;
- uint8_t skip_to_next_point : 1;
- uint8_t skip_to_prev_point : 1;
- uint8_t play_firstplay : 1;
- uint8_t stop : 1;
- uint8_t pause_on : 1;
- uint8_t pause_off : 1;
- uint8_t still : 1;
- uint8_t forward : 1;
- uint8_t backward : 1;
- uint8_t resume : 1;
- uint8_t move_up : 1;
- uint8_t move_down : 1;
- uint8_t move_left : 1;
- uint8_t move_right : 1;
- uint8_t select : 1;
- uint8_t activate : 1;
- uint8_t select_and_activate : 1;
- uint8_t primary_audio_change : 1;
- uint8_t angle_change : 1;
- uint8_t popup_on : 1;
- uint8_t popup_off : 1;
- uint8_t pg_enable_disable : 1;
- uint8_t pg_change : 1;
- uint8_t secondary_video_enable_disable : 1;
- uint8_t secondary_video_change : 1;
- uint8_t secondary_audio_enable_disable : 1;
- uint8_t secondary_audio_change : 1;
- uint8_t pip_pg_change : 1;
+ unsigned int menu_call : 1;
+ unsigned int title_search : 1;
+ unsigned int chapter_search : 1;
+ unsigned int time_search : 1;
+ unsigned int skip_to_next_point : 1;
+ unsigned int skip_to_prev_point : 1;
+ unsigned int play_firstplay : 1;
+ unsigned int stop : 1;
+ unsigned int pause_on : 1;
+ unsigned int pause_off : 1;
+ unsigned int still : 1;
+ unsigned int forward : 1;
+ unsigned int backward : 1;
+ unsigned int resume : 1;
+ unsigned int move_up : 1;
+ unsigned int move_down : 1;
+ unsigned int move_left : 1;
+ unsigned int move_right : 1;
+ unsigned int select : 1;
+ unsigned int activate : 1;
+ unsigned int select_and_activate : 1;
+ unsigned int primary_audio_change : 1;
+ unsigned int angle_change : 1;
+ unsigned int popup_on : 1;
+ unsigned int popup_off : 1;
+ unsigned int pg_enable_disable : 1;
+ unsigned int pg_change : 1;
+ unsigned int secondary_video_enable_disable : 1;
+ unsigned int secondary_video_change : 1;
+ unsigned int secondary_audio_enable_disable : 1;
+ unsigned int secondary_audio_change : 1;
+ unsigned int pip_pg_change : 1;
} BD_UO_MASK;
static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b)
{
BD_UO_MASK o;
- uint8_t *pa = (uint8_t*)&a;
- uint8_t *pb = (uint8_t*)&b;
- uint8_t *po = (uint8_t*)&o;
+ unsigned int *pa = (unsigned int*)&a;
+ unsigned int *pb = (unsigned int*)&b;
+ unsigned int *po = (unsigned int*)&o;
unsigned i;
- for (i = 0; i < sizeof(BD_UO_MASK); i++) {
+ for (i = 0; i < sizeof(BD_UO_MASK) / sizeof(unsigned int); i++) {
po[i] = pa[i] | pb[i];
}
diff --git a/src/libbluray/hdmv/mobj_parse.h b/src/libbluray/hdmv/mobj_parse.h
index 457c17d..ecb625a 100644
--- a/src/libbluray/hdmv/mobj_parse.h
+++ b/src/libbluray/hdmv/mobj_parse.h
@@ -25,20 +25,20 @@
#include <stdint.h>
typedef struct {
- uint8_t sub_grp : 3; /* command sub-group */
- uint8_t op_cnt : 3; /* operand count */
- uint8_t grp : 2; /* command group */
+ unsigned int sub_grp : 3; /* command sub-group */
+ unsigned int op_cnt : 3; /* operand count */
+ unsigned int grp : 2; /* command group */
- uint8_t branch_opt : 4; /* branch option */
- uint8_t reserved1 : 2;
- uint8_t imm_op2 : 1; /* I-flag for operand 2 */
- uint8_t imm_op1 : 1; /* I-flag for operand 1 */
+ unsigned int branch_opt : 4; /* branch option */
+ unsigned int reserved1 : 2;
+ unsigned int imm_op2 : 1; /* I-flag for operand 2 */
+ unsigned int imm_op1 : 1; /* I-flag for operand 1 */
- uint8_t cmp_opt : 4; /* compare option */
- uint8_t reserved2 : 4;
+ unsigned int cmp_opt : 4; /* compare option */
+ unsigned int reserved2 : 4;
- uint8_t set_opt : 5; /* set option */
- uint8_t reserved3 : 3;
+ unsigned int set_opt : 5; /* set option */
+ unsigned int reserved3 : 3;
} HDMV_INSN;
typedef struct bd_mobj_cmd_s {
@@ -48,9 +48,9 @@ typedef struct bd_mobj_cmd_s {
} MOBJ_CMD;
typedef struct {
- uint8_t resume_intention_flag : 1;
- uint8_t menu_call_mask : 1;
- uint8_t title_search_mask : 1;
+ uint8_t resume_intention_flag /*: 1*/;
+ uint8_t menu_call_mask /*: 1*/;
+ uint8_t title_search_mask /*: 1*/;
uint16_t num_cmds;
MOBJ_CMD *cmds;
More information about the libbluray-devel
mailing list