formatting
This commit is contained in:
parent
439cc8d860
commit
0ce5a1ed87
@ -341,7 +341,7 @@ INTERNAL void inflate(u8 *dst, u8 *encoded)
|
||||
struct huffman lit_len_huffman = huffman_init(temp.arena, 15, lit_len_dist_table, hlit);
|
||||
struct huffman dist_huffman = huffman_init(temp.arena, 15, lit_len_dist_table + hlit, hdist);
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
u32 lit_len = huffman_decode(&lit_len_huffman, &bb);
|
||||
if (lit_len <= 255) {
|
||||
*dst++ = lit_len & 0xFF;
|
||||
|
||||
@ -70,7 +70,7 @@ INTERNAL struct asset *asset_cache_get_slot_locked(struct snc_lock *lock, struct
|
||||
(UNUSED)lock;
|
||||
|
||||
u64 index = hash % countof(G.lookup);
|
||||
while (1) {
|
||||
for (;;) {
|
||||
struct asset *slot = &G.lookup[index];
|
||||
if (slot->hash) {
|
||||
/* Occupied */
|
||||
|
||||
@ -171,7 +171,7 @@ INTERNAL struct gjk_result gjk_get_simplex(struct collider_shape *shape0, struct
|
||||
struct v2 removed_a = ZI;
|
||||
struct v2 removed_b = ZI;
|
||||
u32 num_removed = 0;
|
||||
while (1) {
|
||||
for (;;) {
|
||||
if (s.len == 1) {
|
||||
/* Second point is support point towards origin */
|
||||
dir = v2_neg(s.a.p);
|
||||
@ -346,7 +346,7 @@ INTERNAL struct epa_result epa_get_normal_from_gjk(struct collider_shape *shape0
|
||||
i32 winding = v2_winding(v2_sub(s.c.p, s.a.p), v2_sub(s.b.p, s.a.p));
|
||||
|
||||
u32 epa_iterations = 0;
|
||||
while (1) {
|
||||
for (;;) {
|
||||
++epa_iterations;
|
||||
|
||||
/* Find dir from origin to closest edge */
|
||||
@ -1001,7 +1001,7 @@ b32 collider_collision_boolean(struct collider_shape *shape0, struct collider_sh
|
||||
if (v2_dot(dir, p) >= 0) {
|
||||
s.b = s.a;
|
||||
s.a = p;
|
||||
while (1) {
|
||||
for (;;) {
|
||||
/* Third point is support point in direction of line normal towards origin */
|
||||
dir = v2_perp_towards_dir(v2_sub(s.b, s.a), v2_neg(s.a));
|
||||
p = get_menkowski_point(shape0, shape1, dir);
|
||||
|
||||
@ -478,7 +478,7 @@ INTERNAL void dx12_init_device(void)
|
||||
struct string error = LIT("Could not initialize GPU device.");
|
||||
struct string first_gpu_name = ZI;
|
||||
u32 adapter_index = 0;
|
||||
while (1) {
|
||||
for (;;) {
|
||||
{
|
||||
hr = IDXGIFactory6_EnumAdapterByGpuPreference(G.factory, adapter_index, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, &IID_IDXGIAdapter1, (void **)&adapter);
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ struct mp3_decode_result mp3_decode(struct arena *arena, struct string encoded,
|
||||
|
||||
res.pcm.samples = arena_push_dry(arena, i16);
|
||||
u64 sample_bytes_read = 0;
|
||||
while (1) {
|
||||
for (;;) {
|
||||
IMFSample *sample;
|
||||
DWORD sample_flags = 0;
|
||||
HRESULT hr = IMFSourceReader_ReadSample(reader, (DWORD)MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, 0, &sample_flags, 0, &sample);
|
||||
|
||||
@ -401,7 +401,7 @@ struct space_entry *space_iter_next(struct space_iter *iter)
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
for (;;) {
|
||||
if (next_node) {
|
||||
struct space_entry *entry = next_node->entry;
|
||||
struct aabb entry_aabb = entry->aabb;
|
||||
|
||||
@ -735,7 +735,7 @@ INTERNAL void refcount_add(struct cache_entry *e, i32 amount)
|
||||
i32 evictor_cycle = atomic32_fetch(&G.evictor_cycle.v);
|
||||
struct atomic64 *refcount_atomic = &e->refcount_struct.v;
|
||||
u64 old_refcount_uncast = atomic64_fetch(refcount_atomic);
|
||||
while (1) {
|
||||
for (;;) {
|
||||
struct cache_refcount new_refcount = *(struct cache_refcount *)&old_refcount_uncast;
|
||||
new_refcount.count += amount;
|
||||
new_refcount.last_ref_cycle = evictor_cycle;
|
||||
|
||||
@ -896,10 +896,9 @@ INTERNAL void job_fiber_entry(void *id_ptr)
|
||||
i16 id = (i32)(i64)id_ptr;
|
||||
struct fiber *fiber = fiber_from_id(id);
|
||||
__prof_fiber_enter(fiber->name_cstr, PROF_THREAD_GROUP_FIBERS + MEBI(fiber->job_pool) + fiber->id + 1);
|
||||
while (1) {
|
||||
for (;;) {
|
||||
/* Run job */
|
||||
{
|
||||
//__profn("Run job");
|
||||
volatile struct yield_param *yield_param = fiber->yield_param;
|
||||
yield_param->kind = YIELD_KIND_NONE;
|
||||
struct sys_job_data data = ZI;
|
||||
@ -911,6 +910,7 @@ INTERNAL void job_fiber_entry(void *id_ptr)
|
||||
MemoryBarrier();
|
||||
}
|
||||
}
|
||||
/* Yield */
|
||||
{
|
||||
volatile struct yield_param *yield_param = fiber->yield_param;
|
||||
yield_param->kind = YIELD_KIND_DONE;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user