Dropped lfs_*32/16 suffixed utils

We don't actually need these, all we need are utils defined for the
largest integer size we operate on, currently uint32_t.
Counterintuitively this should make it easier to adopt different integer
widths in the future.

Or maybe this will bite us when lfs_off_t >> lfs_size_t? Oh well, if
that's the case we can fix it then.

No code changes:

           code          stack
  before: 33886           2560
  after:  33886 (+0.0%)   2560 (+0.0%)
This commit is contained in:
Christopher Haster
2024-06-12 21:05:47 -05:00
parent 2719d6b234
commit 74d382b48f
6 changed files with 159 additions and 185 deletions
+6 -6
View File
@@ -817,7 +817,7 @@ code = '''
// choose a random location
lfs_off_t off = TEST_PRNG(&prng) % SIZE;
// and a random size, up to the chunk size
lfs_size_t chunk = lfs_min32(
lfs_size_t chunk = lfs_min(
TEST_PRNG(&prng) % CHUNK,
SIZE - off);
@@ -826,7 +826,7 @@ code = '''
sim[off+j] = 'a' + (TEST_PRNG(&prng) % 26);
}
if (chunk != 0) {
size = lfs_max32(size, off+chunk);
size = lfs_max(size, off+chunk);
}
// update file
@@ -2518,7 +2518,7 @@ code = '''
// choose a random location
lfs_off_t off = TEST_PRNG(&prng) % SIZE;
// and a random size, up to the chunk size
lfs_size_t chunk = lfs_min32(
lfs_size_t chunk = lfs_min(
TEST_PRNG(&prng) % CHUNK,
SIZE - off);
@@ -2527,7 +2527,7 @@ code = '''
sim[off+j] = 'a' + (TEST_PRNG(&prng) % 26);
}
if (chunk != 0) {
size = lfs_max32(size, off+chunk);
size = lfs_max(size, off+chunk);
}
// update file
@@ -4214,7 +4214,7 @@ code = '''
// choose a random location
lfs_off_t off = TEST_PRNG(&prng) % SIZE;
// and a random size, up to the chunk size
lfs_size_t chunk = lfs_min32(
lfs_size_t chunk = lfs_min(
(TEST_PRNG(&prng) % (CHUNK+1-1)) + 1,
SIZE - off);
@@ -4222,7 +4222,7 @@ code = '''
for (lfs_size_t j = 0; j < chunk; j++) {
sim[off+j] = 'a' + (TEST_PRNG(&prng) % 26);
}
size = lfs_max32(size, off+chunk);
size = lfs_max(size, off+chunk);
// update file
lfsr_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;