osmo_util: define #pointcode{} record instead of manual 3-tuple
This commit is contained in:
parent
9baab6dbc9
commit
ba0ada720f
|
@ -8,3 +8,10 @@
|
||||||
spec_name :: prim_spec_name(),
|
spec_name :: prim_spec_name(),
|
||||||
parameters
|
parameters
|
||||||
}).
|
}).
|
||||||
|
|
||||||
|
-type pointcode_repr() :: 'itu' | 'ansi' | 'ttc'.
|
||||||
|
|
||||||
|
-record(pointcode, {
|
||||||
|
repr :: pointcode_repr(),
|
||||||
|
value
|
||||||
|
}).
|
||||||
|
|
|
@ -143,8 +143,8 @@ make_prim(Subsys, GenName, SpecName, Param) ->
|
||||||
spec_name = SpecName, parameters = Param}.
|
spec_name = SpecName, parameters = Param}.
|
||||||
|
|
||||||
% parse a 3-tuple pointcode into a raw integer
|
% parse a 3-tuple pointcode into a raw integer
|
||||||
pointcode2int({pointcode, Std, Param}) ->
|
pointcode2int(#pointcode{repr=Type, value=Value}) ->
|
||||||
pointcode2int(Std, Param);
|
pointcode2int(Type, Value);
|
||||||
pointcode2int({Std, Param}) ->
|
pointcode2int({Std, Param}) ->
|
||||||
pointcode2int(Std, Param).
|
pointcode2int(Std, Param).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue