mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[project] Lose the battle between tabs & spaces
I'm a tabs guy. I like tabs, it's an elegant way to represent indentation instead of brute-forcing it. But I have to admit that the world seems to be going towards spaces, and tooling tends not to play nice with tabs. So here we go, changing the whole repo to spaces since I'm getting tired of all the inconsistent formatting.
This commit is contained in:
committed by
Justin C. Miller
parent
d36b2d8057
commit
8f529046a9
@@ -11,38 +11,38 @@ namespace syscalls {
|
||||
template <typename T, typename... Args>
|
||||
T * construct_handle(j6_handle_t *handle, Args... args)
|
||||
{
|
||||
process &p = process::current();
|
||||
T *o = new T {args...};
|
||||
*handle = p.add_handle(o);
|
||||
return o;
|
||||
process &p = process::current();
|
||||
T *o = new T {args...};
|
||||
*handle = p.add_handle(o);
|
||||
return o;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T * get_handle(j6_handle_t handle)
|
||||
{
|
||||
process &p = process::current();
|
||||
kobject *o = p.lookup_handle(handle);
|
||||
if (!o || o->get_type() != T::type)
|
||||
return nullptr;
|
||||
return static_cast<T*>(o);
|
||||
process &p = process::current();
|
||||
kobject *o = p.lookup_handle(handle);
|
||||
if (!o || o->get_type() != T::type)
|
||||
return nullptr;
|
||||
return static_cast<T*>(o);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline kobject * get_handle<kobject>(j6_handle_t handle)
|
||||
{
|
||||
process &p = process::current();
|
||||
return p.lookup_handle(handle);
|
||||
process &p = process::current();
|
||||
return p.lookup_handle(handle);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T * remove_handle(j6_handle_t handle)
|
||||
{
|
||||
T *o = get_handle<T>(handle);
|
||||
if (o) {
|
||||
process &p = process::current();
|
||||
p.remove_handle(handle);
|
||||
}
|
||||
return o;
|
||||
T *o = get_handle<T>(handle);
|
||||
if (o) {
|
||||
process &p = process::current();
|
||||
p.remove_handle(handle);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user