Skip to content

Commit

Permalink
Merge 1f0fd08 into 0179d1a
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 6, 2016
2 parents 0179d1a + 1f0fd08 commit a0a5215
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/apiPasses.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ let all pre api post =
|> pass "LengthParams" LengthParams.transform
|> pass "ThisParams" ThisParams.transform
|> pass "ErrorSplitFromFunction" ErrorSplitFromFunction.transform
|> pass "EnumBitmasks" EnumBitmasks.transform
|> pass "EnumBitmaskNONE" EnumBitmaskNONE.transform
|> pass "ExtractSymbols" (fun api -> ExtractSymbols.extract api, api)
|> pass "ScopeBinding" ScopeBinding.transform
|> pass "EventRename" EventRename.transform
Expand Down Expand Up @@ -46,7 +48,6 @@ let all pre api post =
|> pass "Constants" Constants.transform
|> pass "ScopeBinding" ScopeBinding.Inverse.transform
|> pass "StringToCharP" StringToCharP.transform
|> pass "EnumBitmasks" EnumBitmasks.transform
in

Option.may (Format.pp_print_string Format.str_formatter) pre;
Expand Down
22 changes: 22 additions & 0 deletions src/enumBitmaskNONE.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
open ApiAst
open ApiMap


let map_decl v state = function
| Decl_Enum (Enum_Bitmask, lname, enumerators) ->
let comment = Cmt_Doc [
Cmtf_Break;
Cmtf_Doc " The empty bit mask. None of the bits specified below are set.";
] in
let enumerators = Enum_Name (comment, "NONE", Some 0) :: enumerators in
Decl_Enum (Enum_Bitmask, lname, enumerators)

| decl ->
visit_decl v state decl


let v = { default with map_decl }


let transform decls =
visit_decls v () decls
2 changes: 1 addition & 1 deletion src/enumBitmasks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let add_bit_values enumerators =
let map_decl v state = function
| Decl_Enum (Enum_Bitmask, lname, enumerators) ->
let enumerators = add_bit_values enumerators in
Decl_Enum (Enum_Normal, lname, enumerators)
Decl_Enum (Enum_Bitmask, lname, enumerators)

| decl ->
visit_decl v state decl
Expand Down
5 changes: 5 additions & 0 deletions src/tests/bitmask.exp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
*/
enum TOXAV_CALL_STATE {

/**
* The empty bit mask. None of the bits specified below are set.
*/
TOXAV_CALL_STATE_NONE = 0,

/**
* The friend is sending audio (we are receiving).
*/
Expand Down
5 changes: 5 additions & 0 deletions src/tests/toxav.exp.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, ui

enum TOXAV_CALL_STATE {

/**
* The empty bit mask. None of the bits specified below are set.
*/
TOXAV_CALL_STATE_NONE = 0,

/**
* Set by the AV core if an error occurred on the remote end or if friend
* timed out. This is the final state after which no more state
Expand Down

0 comments on commit a0a5215

Please sign in to comment.