Minor fixes and refactors

This commit is contained in:
2025-08-28 22:01:36 +03:00
parent a690b3f285
commit a4c5ce98ce
4 changed files with 10 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ struct BH_Bitmap
};
const static struct FormatInfo formats[] =
static const struct FormatInfo formats[] =
{
/* BH_BITMAP_INDEX1 */
{TYPE_INDEX1, 7, {0x0001}, {7, 6, 5, 4, 3, 2, 1, 0}, 0},

View File

@@ -76,6 +76,7 @@ static int bytesSeek(BH_Bytes *bytes,
switch (info->whence)
{
default:
case BH_IO_SEEK_SET:
offset = MAX(info->offset, 0);
offset = MIN(offset, (int64_t)bytes->size);

View File

@@ -9,7 +9,7 @@
static int convertToTimespec(struct timespec *ts,
uint32_t timeout)
uint32_t timeout)
{
#if (_POSIX_TIMERS > 0) || defined(BH_USE_CLOCK_GETTIME)
if (clock_gettime(CLOCK_REALTIME, ts))