Skip to content

Commit

Permalink
physh: make code c89 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
let-def committed Jul 10, 2018
1 parent 5a48bf1 commit 05ed16c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions physh/ml_physh_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ static void flush_minor (value t, value null)
/* promote minor to major */
if (t_minor_fill(t) > 0)
{
size_t fill = 0;
size_t fill = 0, i;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value k = Field(minor, i * 2);
if (k == null) continue;
Expand Down Expand Up @@ -232,18 +232,18 @@ static void rehash_minor (value t, value null, size_t new_sz)

CAMLlocal2(minor_old, minor_new);
minor_old = t_minor_get(t);
size_t sz = t_minor_size(t);
size_t sz = t_minor_size(t), i;

/* rehash minor */

minor_new = caml_alloc_small(new_sz * 2, 0);

for (size_t i = 0; i < new_sz * 2; ++i)
for (i = 0; i < new_sz * 2; ++i)
Store_field(minor_new, i, null);

size_t fill = 0;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value k = Field(minor_old, i * 2);
if (k == null) continue;
Expand Down Expand Up @@ -272,18 +272,18 @@ static void rehash_major (value t, value null, size_t new_sz)

CAMLlocal2(major_old, major_new);
major_old = t_major_get(t);
size_t sz = t_major_size(t);
size_t sz = t_major_size(t), i;

/* rehash major */

major_new = caml_alloc(new_sz * 2, 0);

for (size_t i = 0; i < new_sz * 2; ++i)
for (i = 0; i < new_sz * 2; ++i)
Store_field(major_new, i, null);

size_t fill = 0;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value k = Field(major_old, i * 2);
if (k == null) continue;
Expand Down
16 changes: 8 additions & 8 deletions physh/ml_physh_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ static void flush_minor (value t, value null)
/* promote minor to major */
if (t_minor_fill(t) > 0)
{
size_t fill = 0;
size_t fill = 0, i;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value v = Field(minor, i);
if (v == null) continue;
Expand Down Expand Up @@ -227,18 +227,18 @@ static void rehash_minor (value t, value null, size_t new_sz)

CAMLlocal2(minor_old, minor_new);
minor_old = t_minor_get(t);
size_t sz = t_minor_size(t);
size_t sz = t_minor_size(t), i;

/* rehash minor */

minor_new = caml_alloc_small(new_sz, 0);

for (size_t i = 0; i < new_sz; ++i)
for (i = 0; i < new_sz; ++i)
Field(minor_new, i) = null;

size_t fill = 0;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value v = Field(minor_old, i);
if (v == null) continue;
Expand Down Expand Up @@ -266,18 +266,18 @@ static void rehash_major (value t, value null, size_t new_sz)

CAMLlocal2(major_old, major_new);
major_old = t_major_get(t);
size_t sz = t_major_size(t);
size_t sz = t_major_size(t), i;

/* rehash major */

major_new = caml_alloc(new_sz, 0);

for (size_t i = 0; i < new_sz; ++i)
for (i = 0; i < new_sz; ++i)
Field(major_new, i) = null;

size_t fill = 0;

for (size_t i = 0; i < sz; ++i)
for (i = 0; i < sz; ++i)
{
value v = Field(major_old, i);
if (v == null) continue;
Expand Down

0 comments on commit 05ed16c

Please sign in to comment.