Wireshark-commits: [Wireshark-commits] master 9246a70: Cleanup on aisle 5: normalizes the Lua code
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 21 Feb 2014 02:05:37 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=9246a709bf826f2cc64581b25fbf1ebafa330db6
Submitter: Evan Huus (eapache@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

9246a70 by Hadriel Kaplan (hadrielk@xxxxxxxxx):

    Cleanup on aisle 5: normalizes the Lua code to follow common schema/model
    
    Over time the various wslua classes/functions have gotten moldy, with different
    ways of doing similar things. Some of it can't be changed without breaking
    backwards compatibility for Lua scripts, so I didn't do that. But I did what
    I could. The biggest change is a refactoring of how accessors/attributes
    are handled in the code, so that most of them work the same way using the
    same code.
    
    Specific changes made:
     * Added null/expired checking macro to class declarations for many classes
     * Removed extraneous pointer/expired checking, since checkFoo() does that already
     * Fixed "errors" reported by clang static analyzer; they were false positives, but it was easier to get it to stop complaining by changing the code
     * Moved internal wslua functions from wslua_utils.c into a new 'wslua_internals.c' file
     * Changed Listener/NSTime/Pinfo/Proto to use a common setter/getter accessor/attribute code model, instead of each of them doing their own
     * Fixed some API doc mistakes, mostly around attributes that were documented as read-only but were actually read-write
    
    Change-Id: Idddafc5fbd3545ebff29e063acc767e1c743a1a9
    Reviewed-on: https://code.wireshark.org/review/271
    Reviewed-by: Evan Huus <eapache@xxxxxxxxx>
    Tested-by: Evan Huus <eapache@xxxxxxxxx>
    

Actions performed:

    from  c65fbff   Force "printing" if -T is specified, even if -w is also specified.
    adds  9246a70   Cleanup on aisle 5: normalizes the Lua code to follow common schema/model


Summary of changes:
 epan/wslua/CMakeLists.txt    |    3 +-
 epan/wslua/Makefile.am       |    3 +-
 epan/wslua/wslua.h           |  144 ++++++--
 epan/wslua/wslua_dumper.c    |    4 +-
 epan/wslua/wslua_field.c     |  174 +++------
 epan/wslua/wslua_gui.c       |   85 +----
 epan/wslua/wslua_int64.c     |  162 +++++----
 epan/wslua/wslua_internals.c |  302 ++++++++++++++++
 epan/wslua/wslua_listener.c  |   84 ++---
 epan/wslua/wslua_pinfo.c     |  815 ++++++++++++++----------------------------
 epan/wslua/wslua_proto.c     |  315 +++++++---------
 epan/wslua/wslua_struct.c    |    6 +-
 epan/wslua/wslua_tree.c      |  104 ++----
 epan/wslua/wslua_tvb.c       |  178 ++++-----
 epan/wslua/wslua_util.c      |   62 +---
 15 files changed, 1081 insertions(+), 1360 deletions(-)
 create mode 100644 epan/wslua/wslua_internals.c