Cleanup on aisle 5: normalizes the Lua code to follow common schema/model
authorHadriel Kaplan <hadrielk@yahoo.com>
Wed, 19 Feb 2014 08:22:55 +0000 (03:22 -0500)
committerEvan Huus <eapache@gmail.com>
Fri, 21 Feb 2014 02:05:35 +0000 (02:05 +0000)
commit9246a709bf826f2cc64581b25fbf1ebafa330db6
treeb63eb4c55d7e1673f98a371d8787de906807baaf
parentc65fbffc95b5e6b0caff6952faea8e8c9350cf7d
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@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
15 files changed:
epan/wslua/CMakeLists.txt
epan/wslua/Makefile.am
epan/wslua/wslua.h
epan/wslua/wslua_dumper.c
epan/wslua/wslua_field.c
epan/wslua/wslua_gui.c
epan/wslua/wslua_int64.c
epan/wslua/wslua_internals.c [new file with mode: 0644]
epan/wslua/wslua_listener.c
epan/wslua/wslua_pinfo.c
epan/wslua/wslua_proto.c
epan/wslua/wslua_struct.c
epan/wslua/wslua_tree.c
epan/wslua/wslua_tvb.c
epan/wslua/wslua_util.c