mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Rename some generated iterate variables
This commit is contained in:
1 parent
81edda0413
commit
a23681d1ba
3 files changed
+23
-20
No files matched your search
@@ -243,7 +243,8 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
|
|||||||
|
|
||||||
unroll := n.Unroll().SmallPowerOf2Value()
|
unroll := n.Unroll().SmallPowerOf2Value()
|
||||||
step := n.Step().SmallPowerOf2Value()
|
step := n.Step().SmallPowerOf2Value()
|
||||||
if uStep := unroll * step; uStep != 1 {
|
|
||||||
|
if uStep := unroll * step; uStep > 1 {
|
||||||
b.printf("%s%s.len = %d;\n", vPrefix, name, step)
|
b.printf("%s%s.len = %d;\n", vPrefix, name, step)
|
||||||
b.printf("uint8_t* %send0_%s = %sslice_%s.ptr + (%sslice_%s.len / %d) * %d;\n",
|
b.printf("uint8_t* %send0_%s = %sslice_%s.ptr + (%sslice_%s.len / %d) * %d;\n",
|
||||||
iPrefix, name, iPrefix, name, iPrefix, name, uStep, uStep)
|
iPrefix, name, iPrefix, name, iPrefix, name, uStep, uStep)
|
||||||
@@ -259,21 +260,23 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
|
|||||||
b.writes("}\n")
|
b.writes("}\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
b.printf("%s%s.len = %d;\n", vPrefix, name, 1)
|
{
|
||||||
b.printf("uint8_t* %send1_%s = %sslice_%s.ptr + %sslice_%s.len;\n",
|
b.printf("%s%s.len = %d;\n", vPrefix, name, 1)
|
||||||
iPrefix, name, iPrefix, name, iPrefix, name)
|
b.printf("uint8_t* %send2_%s = %sslice_%s.ptr + %sslice_%s.len;\n",
|
||||||
b.printf("while (%s%s.ptr < %send1_%s) {\n", vPrefix, name, iPrefix, name)
|
iPrefix, name, iPrefix, name, iPrefix, name)
|
||||||
tail := n.Tail()
|
b.printf("while (%s%s.ptr < %send2_%s) {\n", vPrefix, name, iPrefix, name)
|
||||||
if step == 1 {
|
tail := n.Tail()
|
||||||
tail = n.Body()
|
if step == 1 {
|
||||||
}
|
tail = n.Body()
|
||||||
for _, o := range tail {
|
|
||||||
if err := g.writeStatement(b, o, depth); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
for _, o := range tail {
|
||||||
|
if err := g.writeStatement(b, o, depth); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
b.printf("%s%s.ptr += 1;\n", vPrefix, name)
|
||||||
|
b.writes("}\n")
|
||||||
}
|
}
|
||||||
b.printf("%s%s.ptr++;\n", vPrefix, name)
|
|
||||||
b.writes("}\n")
|
|
||||||
|
|
||||||
b.writes("}\n")
|
b.writes("}\n")
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+3
-3
@@ -1693,11 +1693,11 @@ uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
|
|||||||
v_p.ptr += 1;
|
v_p.ptr += 1;
|
||||||
}
|
}
|
||||||
v_p.len = 1;
|
v_p.len = 1;
|
||||||
uint8_t* i_end1_p = i_slice_p.ptr + i_slice_p.len;
|
uint8_t* i_end2_p = i_slice_p.ptr + i_slice_p.len;
|
||||||
while (v_p.ptr < i_end1_p) {
|
while (v_p.ptr < i_end2_p) {
|
||||||
v_s1 += ((uint32_t)(v_p.ptr[0]));
|
v_s1 += ((uint32_t)(v_p.ptr[0]));
|
||||||
v_s2 += v_s1;
|
v_s2 += v_s1;
|
||||||
v_p.ptr++;
|
v_p.ptr += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v_s1 %= 65521;
|
v_s1 %= 65521;
|
||||||
|
|||||||
+3
-3
@@ -2033,11 +2033,11 @@ uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self,
|
|||||||
v_p.ptr += 8;
|
v_p.ptr += 8;
|
||||||
}
|
}
|
||||||
v_p.len = 1;
|
v_p.len = 1;
|
||||||
uint8_t* i_end1_p = i_slice_p.ptr + i_slice_p.len;
|
uint8_t* i_end2_p = i_slice_p.ptr + i_slice_p.len;
|
||||||
while (v_p.ptr < i_end1_p) {
|
while (v_p.ptr < i_end2_p) {
|
||||||
v_s = (wuffs_crc32__ieee_table[0][((uint8_t)((v_s & 255))) ^ v_p.ptr[0]] ^
|
v_s = (wuffs_crc32__ieee_table[0][((uint8_t)((v_s & 255))) ^ v_p.ptr[0]] ^
|
||||||
(v_s >> 8));
|
(v_s >> 8));
|
||||||
v_p.ptr++;
|
v_p.ptr += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self->private_impl.f_state = (4294967295 ^ v_s);
|
self->private_impl.f_state = (4294967295 ^ v_s);
|
||||||
|
|||||||
Reference in new issue
Block a user