From 3c51639de7808c896deda8163e160656415f950c Mon Sep 17 00:00:00 2001 From: Robin Wellner Date: Mon, 15 Feb 2016 14:12:51 +0100 Subject: [PATCH] travis-based fixes --- .travis.yml | 2 +- bitser.lua | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index f948839..8a61cdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: - luarocks install luacov-coveralls script: - - luacheck --std max+busted *.lua spec + - luacheck --std max+busted bitser.lua spec - busted --verbose --coverage after_success: diff --git a/bitser.lua b/bitser.lua index b724894..9f13823 100644 --- a/bitser.lua +++ b/bitser.lua @@ -7,12 +7,12 @@ local setmetatable = setmetatable local ffi = require("ffi") -function Buffer_newWriter(size) +local function Buffer_newWriter(size) size = size or 4096 return {size = size, pos = 0, buf = ffi.new("uint8_t[?]", size)} end -function Buffer_newReader(str) +local function Buffer_newReader(str) local buf = ffi.new("uint8_t[?]", #str) ffi.copy(buf, str, #str) return {size = #str, pos = 0, buf = buf} @@ -318,7 +318,7 @@ end, register = function(name, resource) end, unregister = function(name) resource_name_registry[resource_registry[name]] = nil resource_registry[name] = nil -end, registerClass = function(name, class, classkey, deserialize) +end, registerClass = function(name, class, classkey, deserializer) if not class then class = name name = class.__name__ or class.name @@ -334,26 +334,26 @@ end, registerClass = function(name, class, classkey, deserialize) -- assume hump.class, Slither, or something else that doesn't store the -- class directly on the instance end - if not deserialize then + if not deserializer then if class.__instanceDict then -- assume MiddleClass - deserialize = deserialize_MiddleClass + deserializer = deserialize_MiddleClass elseif class.__baseclass then -- assume SECL - deserialize = deserialize_SECL + deserializer = deserialize_SECL elseif class.__index == class then -- assume hump.class - deserialize = deserialize_humpclass + deserializer = deserialize_humpclass elseif class.__name__ then -- assume Slither - deserialize = deserialize_Slither + deserializer = deserialize_Slither else error("no deserializer given for unsupported class library") end end class_registry[name] = class classkey_registry[name] = classkey - class_deserialize_registry[name] = deserialize + class_deserialize_registry[name] = deserializer class_name_registry[class] = name end, unregisterClass = function(name) class_name_registry[class_registry[name]] = nil