]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
FFI: Fix EnumWindows example in docs.
authorMike Pall <mike>
Tue, 15 Nov 2011 15:45:36 +0000 (16:45 +0100)
committerMike Pall <mike>
Tue, 15 Nov 2011 15:45:36 +0000 (16:45 +0100)
doc/ext_ffi_semantics.html

index 7e140e27ce4dffc565f737763bb6ffbfc1974d59..f3be0799a7d98a34a75942d6da5270c5daa1b813 100644 (file)
@@ -875,6 +875,7 @@ int EnumWindows(WNDENUMPROC func, intptr_t l);
 local count = 0
 ffi.C.EnumWindows(function(hwnd, l)
   count = count + 1
+  return true
 end, 0)
 -- The callback is permanent and its resources cannot be reclaimed!
 -- Ok, so this may not be a problem, if you do this only once.
@@ -898,6 +899,7 @@ on the cdata object:
 local count = 0
 local cb = ffi.cast("WNDENUMPROC", function(hwnd, l)
   count = count + 1
+  return true
 end)
 
 -- Pass it to a C function.