{"action":"created","issue":{"url":"https://api.github.com/repos/uclouvain/openjpeg/issues/805","repository_url":"https://api.github.com/repos/uclouvain/openjpeg","labels_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/805/comments","events_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/805/events","html_url":"https://github.com/uclouvain/openjpeg/pull/805","id":167796328,"number":805,"title":"Bit fields type","user":{"login":"smuehlst","id":98944,"avatar_url":"https://avatars.githubusercontent.com/u/98944?v=3","gravatar_id":"","url":"https://api.github.com/users/smuehlst","html_url":"https://github.com/smuehlst","followers_url":"https://api.github.com/users/smuehlst/followers","following_url":"https://api.github.com/users/smuehlst/following{/other_user}","gists_url":"https://api.github.com/users/smuehlst/gists{/gist_id}","starred_url":"https://api.github.com/users/smuehlst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smuehlst/subscriptions","organizations_url":"https://api.github.com/users/smuehlst/orgs","repos_url":"https://api.github.com/users/smuehlst/repos","events_url":"https://api.github.com/users/smuehlst/events{/privacy}","received_events_url":"https://api.github.com/users/smuehlst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-27T08:13:43Z","updated_at":"2016-09-07T19:53:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/uclouvain/openjpeg/pulls/805","html_url":"https://github.com/uclouvain/openjpeg/pull/805","diff_url":"https://github.com/uclouvain/openjpeg/pull/805.diff","patch_url":"https://github.com/uclouvain/openjpeg/pull/805.patch"},"body":"The definition of bit-fields with type OPJ_UINT32 caused compilation errors\r\non IBM iSeries, because OPJ_UINT32 is defined as uint32_t, and\r\nuint32_t is defined as unsigned long in `<stdint.h>` on IBM iSeries:\r\n\r\n    228       |typedef struct opj_simple_mcc_decorrelation_data                                                  \r\n    229       |{                                                                                                \r\n    230       | OPJ_UINT32    m_index;                                                                          \r\n    231       | OPJ_UINT32    m_nb_comps;                                                                       \r\n    232       | opj_mct_data_t *  m_decorrelation_array;                                                        \r\n    233       | opj_mct_data_t *  m_offset_array;                                                               \r\n    234       | OPJ_UINT32    m_is_irreversible : 1;                                                            \r\n    ==========> .........................................a........................................................\r\n    =SEVERE==========> a - CZM0009  Bit field m_is_irreversible must be of type signed int, unsigned int or int. \r\n    235       |}  \r\n\r\nThe definition of bit-fields with an integer type of  a specific size doesn't make sense anyway. Therefore I introduced a new typedef `OPJ_BITFIELD` defined as `unsigned int`, and changed all bit-fields in structures to use this typedef."},"comment":{"url":"https://api.github.com/repos/uclouvain/openjpeg/issues/comments/245396713","html_url":"https://github.com/uclouvain/openjpeg/pull/805#issuecomment-245396713","issue_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/805","id":245396713,"user":{"login":"mayeut","id":9768336,"avatar_url":"https://avatars.githubusercontent.com/u/9768336?v=3","gravatar_id":"","url":"https://api.github.com/users/mayeut","html_url":"https://github.com/mayeut","followers_url":"https://api.github.com/users/mayeut/followers","following_url":"https://api.github.com/users/mayeut/following{/other_user}","gists_url":"https://api.github.com/users/mayeut/gists{/gist_id}","starred_url":"https://api.github.com/users/mayeut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mayeut/subscriptions","organizations_url":"https://api.github.com/users/mayeut/orgs","repos_url":"https://api.github.com/users/mayeut/repos","events_url":"https://api.github.com/users/mayeut/events{/privacy}","received_events_url":"https://api.github.com/users/mayeut/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T19:53:16Z","updated_at":"2016-09-07T19:53:16Z","body":"@stweil, as you mention, all bitfields are used for boolean values in the code.\r\nHowever `bool` type (which is in fact `_Bool`) only exist since C99 so not always usable here.\r\nI guess to get true meaning at first glance, `OPJ_BOOL_BITFIELD` makes sense but defined as `unsigned int`... This means there won't be any \"semantic\" checking by the compiler: one could do `OPJ_BOOL_BITFIELD member:3` with no warning. Unless if it's defined as `_Bool` when C99 is supported (all slaves on travis CI). Given that both versions will be checked by CI (>=C99 on unix/ < C99 on windows), I think it could be OK. Any thoughts ?\r\n\r\n@detonin, \r\n\r\n> Maybe we should at least define a new section in opj_includes.h with \"Internal types\" or sth like this\r\n\r\nwith only one `typedef` for the moment, I think what @smuehlst is enough for now."}}
{"actor":{"display_login":"mayeut"}}