Wireshark-commits: [Wireshark-commits] master 965248d: wslua: register attributes along with their
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 21 Jan 2019 11:51:09 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=965248dcfbf53c792ec797fc0c10ffbdd902abc9
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

965248d by Martin Kaiser (wireshark@xxxxxxxxx):

    wslua: register attributes along with their class
    
    At the moment, wslua first registers a class and then adds its
    attributes in a second step. This registration creates empty __getters
    and __setters tables which are later populated with the getter and
    setter methods of the attributes.
    
    Looking at the code and the comments, it seems that this was meant to be
    a temporary solution. Eventually, attributes should be stored in
    wslua_class' attrs field. The code to read and write attributes was
    already updated to handle this.
    
    Add new macros WSLUA_REGISTER_CLASS/_META_WITH_ATTRS that store the
    attributes in wslua_class. Defining new macros is simpler than modifying
    WSLUA_REGISTER_CLASS/_META to register attributes. If we did the latter,
    we'd have to add an empty attribute list for all classes without
    attributes.
    
    We can now drop the WSLUA_REGISTER_ATTRIBUTES macro and the
    wslua_reg_attributes function.
    
    Using this new way of registering attributes, the __getters and
    __setters tables are still available. The tests is the test suite that
    rely on those tables still pass.
    
    Change-Id: I526b9116435645c9c54ab69a05c3c7f3d459ec33
    Reviewed-on: https://code.wireshark.org/review/31417
    Reviewed-by: Martin Kaiser <wireshark@xxxxxxxxx>
    Petri-Dish: Martin Kaiser <wireshark@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  369c39a   NAS 5Gs: Updated 5Gs identity type
     add  965248d   wslua: register attributes along with their class


Summary of changes:
 epan/wslua/wslua.h              | 25 +++++++++++--------------
 epan/wslua/wslua_capture_info.c |  6 ++----
 epan/wslua/wslua_field.c        |  6 ++----
 epan/wslua/wslua_file.c         |  3 +--
 epan/wslua/wslua_file_handler.c |  3 +--
 epan/wslua/wslua_frame_info.c   |  6 ++----
 epan/wslua/wslua_internals.c    | 39 ---------------------------------------
 epan/wslua/wslua_listener.c     |  3 +--
 epan/wslua/wslua_nstime.c       |  3 +--
 epan/wslua/wslua_pinfo.c        |  3 +--
 epan/wslua/wslua_proto.c        |  3 +--
 epan/wslua/wslua_tree.c         |  3 +--
 12 files changed, 24 insertions(+), 79 deletions(-)