mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
cleanup:
- callbacks now have a uintptr_t "cbData" parameter (instead of haphazard void*/uintptr_t, cb/ctx/data) - resource loading code now more uniformly deals with u8* pointers instead of void* allocators: add support for page_aligned_alloc via boost::shared_ptr. add evil hack to avoid the need for default ctor and ensure alignment in SingleAllocator archive: improve Decompressor compression: . near complete rewrite (previous code was a poorly factored mess) . fix bug related to buffer allocation . no longer provide get_output API (prone to abuse) . add call to get max. size of output buffer (for preallocation) This was SVN commit r5370.
This commit is contained in:
@@ -50,9 +50,9 @@ struct BuildDirEntListState
|
||||
};
|
||||
|
||||
// called for each matching directory entry; add its full pathname to array.
|
||||
static void BuildDirEntListCB(const char* path, const DirEnt* UNUSED(ent), void* context)
|
||||
static void BuildDirEntListCB(const char* path, const DirEnt* UNUSED(ent), uintptr_t cbData)
|
||||
{
|
||||
BuildDirEntListState* s = (BuildDirEntListState*)context;
|
||||
BuildDirEntListState* s = (BuildDirEntListState*)cbData;
|
||||
|
||||
jsval val = ToJSVal( CStr ( path ) );
|
||||
// note: <path> is already directory + name!
|
||||
@@ -105,7 +105,7 @@ JSBool JSI_VFS::BuildDirEntList( JSContext* cx, JSObject* UNUSED(obj), uintN arg
|
||||
|
||||
// build array in the callback function
|
||||
BuildDirEntListState state(cx);
|
||||
vfs_dir_enum( path, flags, filter, BuildDirEntListCB, &state );
|
||||
vfs_dir_enum( path, flags, filter, BuildDirEntListCB, (uintptr_t)&state );
|
||||
|
||||
*rval = OBJECT_TO_JSVAL( state.filename_array );
|
||||
return( JS_TRUE );
|
||||
|
||||
Reference in New Issue
Block a user