ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 2bad3f9886427443070129351dc3f3d87606d22a
Parent: 9552e14d27258c9178e2061c9d14588e1744b076
Author: Randy Palamar
Date:   Wed, 28 Jan 2026 05:55:31 -0700

cleanup GCC sign conversion errors

Diffstat:
Mbuild.c | 2+-
Mintrinsics.c | 2+-
Mos_linux.c | 6+++---
Mutil.c | 2+-
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/build.c b/build.c @@ -1818,7 +1818,7 @@ meta_pack_shader_bake_parameters(MetaContext *ctx, MetaEntry *e, iz entry_count, for (MetaEntry *row = scope.start; row != scope.one_past_last; row++, row_index++) { bp->names_upper[row_index] = row->arguments[0].string; bp->names_lower[row_index] = row->arguments[1].string; - bp->floating_point |= (row->kind == MetaEntryKind_BakeFloat) << row_index; + bp->floating_point |= (u32)(row->kind == MetaEntryKind_BakeFloat) << row_index; } } diff --git a/intrinsics.c b/intrinsics.c @@ -106,7 +106,7 @@ #define exp_f64(a) __builtin_exp(a) #define sqrt_f64(a) __builtin_sqrt(a) - #define popcount_u64(a) __builtin_popcountll(a) + #define popcount_u64(a) (u64)__builtin_popcountll(a) #endif #if COMPILER_MSVC diff --git a/os_linux.c b/os_linux.c @@ -28,7 +28,7 @@ os_write_file(i32 file, void *data, i64 length) { i64 offset = 0; while (offset < length) { - iz r = write(file, (u8 *)data + offset, length - offset); + iz r = write(file, (u8 *)data + offset, (u64)(length - offset)); if (r < 0 && errno != EINTR) break; if (r >= 0) offset += r; } @@ -72,7 +72,7 @@ os_number_of_processors(void) function OS_ALLOC_ARENA_FN(os_alloc_arena) { Arena result = {0}; - capacity = round_up_to(capacity, ARCH_X64? KB(4) : getauxval(AT_PAGESZ)); + capacity = round_up_to(capacity, ARCH_X64? (i64)KB(4) : (i64)getauxval(AT_PAGESZ)); void *memory = mmap(0, (uz)capacity, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); if (memory != MAP_FAILED) { result.beg = memory; @@ -90,7 +90,7 @@ BEAMFORMER_IMPORT OS_READ_ENTIRE_FILE_FN(os_read_entire_file) if (fd >= 0 && fstat(fd, &sb) >= 0) { if (buffer_capacity >= sb.st_size) { do { - i64 rlen = read(fd, (u8 *)buffer + result, sb.st_size - result); + i64 rlen = read(fd, (u8 *)buffer + result, (u64)(sb.st_size - result)); if (rlen > 0) result += rlen; } while (result != sb.st_size && errno != EINTR); if (result != sb.st_size) result = 0; diff --git a/util.c b/util.c @@ -22,7 +22,7 @@ mem_copy(void *restrict dest, void *restrict src, uz n) { for (; n >= 64; n -= 64, s += 64, d += 64) _mm512_storeu_epi8(d, _mm512_loadu_epi8(s)); - __mmask64 k = _cvtu64_mask64(_bzhi_u64(-1, n)); + __mmask64 k = _cvtu64_mask64(_bzhi_u64(-1ULL, n)); _mm512_mask_storeu_epi8(d, k, _mm512_maskz_loadu_epi8(k, s)); } #else