diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-07-11 13:13:27 -0400 |
---|---|---|
committer | Hadriel Kaplan <hadrielk@yahoo.com> | 2015-07-11 18:05:53 +0000 |
commit | e47826734e9d3d6ca2c3589883ff62fce08e7339 (patch) | |
tree | 448100474e2c68bdfa02621070bd706153985075 /epan/wslua | |
parent | 080c27f7ff697d99d9cc8699cc98ff02b0b22c52 (diff) |
Lua: fix docs and default base for ProtoField.framenum()
The ProtoField.framenum() Lua function says to use base.DEC, HEX, etc.
But it really can only allow base.NONE. Also, the code defaults
to base.DEC if none was given, and then errors if it's a FT_FRAMENUM;
instead the default base for FT_FRAMENUM should be base.NONE.
Change-Id: I0ec867069c66dbb58399ac2db4652469bfb39152
Reviewed-on: https://code.wireshark.org/review/9599
Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r-- | epan/wslua/wslua_proto.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index 8cd3907ad5..e78b39d9de 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -906,7 +906,8 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) { ProtoField f; const gchar* abbr = check_field_name(L,1,type); const gchar* name = luaL_optstring(L,2,abbr); - unsigned base = (unsigned)luaL_optinteger(L, 3, BASE_DEC); + unsigned default_base = (type == FT_FRAMENUM) ? BASE_NONE : BASE_DEC; + unsigned base = (unsigned)luaL_optinteger(L, 3, default_base); value_string* vs32 = NULL; val64_string* vs64 = NULL; guint32 mask = wslua_optguint32(L,5,0); @@ -1056,9 +1057,9 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) { /* _WSLUA_CONSTRUCTOR_ ProtoField_framenum Creates a `ProtoField` for a frame number (for hyperlinks between frames). */ /* WSLUA_ARG_Protofield_framenum_ABBR Abbreviated name of the field (the string used in filters). */ /* WSLUA_OPTARG_Protofield_framenum_NAME Actual name of the field (the string that appears in the tree). */ -/* WSLUA_OPTARG_Protofield_framenum_BASE One of `base.DEC`, `base.HEX` or `base.OCT`. */ +/* WSLUA_OPTARG_Protofield_framenum_BASE Only `base.NONE` is supported for framenum. */ /* WSLUA_OPTARG_Protofield_framenum_VALUESTRING A table containing the text that corresponds to the values. */ -/* WSLUA_OPTARG_Protofield_framenum_MASK Integer mask of this field. */ +/* WSLUA_OPTARG_Protofield_framenum_MASK Integer mask of this field, which must be 0 for framenum. */ /* WSLUA_OPTARG_Protofield_framenum_DESC Description of the field. */ /* _WSLUA_RETURNS_ A `ProtoField` object to be added to a table set to the `Proto.fields` attribute. */ |