warnings fixed
This commit is contained in:
parent
572aa7b76a
commit
0f2260d116
|
|
@ -20,7 +20,7 @@ function printHelp()
|
|||
end
|
||||
|
||||
if #arg < 2 then
|
||||
printHelp(arg)
|
||||
printHelp()
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -141,8 +141,8 @@ if handle == nil then
|
|||
end
|
||||
|
||||
local lines = handle:lines()
|
||||
local sip_str, eip_str, s_region, region = "", "", "", ""
|
||||
local sip, mip, eip, err = 0, 0, 0, 0
|
||||
local sip_str, eip_str, s_region, region = "", "", "", nil
|
||||
local sip, eip, err = nil, nil, nil
|
||||
local count, c_time = 0, 0
|
||||
local s_time = xdb.now()
|
||||
for l in lines do
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ function printHelp()
|
|||
end
|
||||
|
||||
if #arg < 1 then
|
||||
printHelp(arg)
|
||||
printHelp()
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ print(string.format([[
|
|||
ip2region xdb searcher test program
|
||||
source xdb: %s (%s, %s)
|
||||
type 'quit' to exit]], dbFile, version.name, cachePolicy))
|
||||
local region, err = "", nil
|
||||
local region, err = nil, nil
|
||||
local ip_bytes, s_time, c_time = nil, 0, 0
|
||||
while true do
|
||||
io.write("ip2region>> ");
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ function xdb:search(ip_bytes)
|
|||
local index_size, ip_sub_compare = version.index_size, version.ip_sub_compare
|
||||
local bytes, d_bytes = version.bytes, version.bytes << 1
|
||||
local data_ptr, data_len, p = 0, 0, 0
|
||||
local sip, eip, err, buff = 0, 0, ""
|
||||
local buff, err = nil, nil
|
||||
local l, m, h = 0, 0, (e_ptr - s_ptr) / index_size
|
||||
while l <= h do
|
||||
m = (l + h) >> 1
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function printHelp()
|
|||
end
|
||||
|
||||
if #arg < 2 then
|
||||
printHelp(arg)
|
||||
printHelp()
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ for l in lines do
|
|||
|
||||
-- check the region
|
||||
if region ~= s_region then
|
||||
printf(string.format("failed search(%s) with (%s != %s)\n", xdb.ip_to_string(ip_bytes), region, s_region))
|
||||
print(string.format("failed search(%s) with (%s != %s)\n", xdb.ip_to_string(ip_bytes), region, s_region))
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ function printHelp()
|
|||
end
|
||||
|
||||
if #arg < 1 then
|
||||
printHelp(arg)
|
||||
printHelp()
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue