From c1b8c06bb49e3382c51e343659fa9c25dc9bafc7 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 13 Jul 2025 17:48:21 +0300 Subject: [PATCH] clean up trailing whitespace --- src/builtins/cells.c | 2 +- src/builtins/fold.c | 2 +- src/builtins/sysfn.c | 6 +++--- src/builtins/transpose.c | 2 +- src/ffi.c | 2 +- src/singeli/src/fold.singeli | 4 ++-- src/singeli/src/scan.singeli | 2 +- src/utils/file.c | 6 +++--- src/utils/mut.c | 4 ++-- src/windows/sh.h | 12 ++++++------ src/windows/utf16.h | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/builtins/cells.c b/src/builtins/cells.c index 09963888..6e010bfa 100644 --- a/src/builtins/cells.c +++ b/src/builtins/cells.c @@ -185,7 +185,7 @@ NOINLINE B toKCells(B x, ur k) { B r; if (cam==0) { - r = empty_frame(xsh, k); + r = empty_frame(xsh, k); } else { S_KSLICES(x, xsh, k, cam, 1) M_HARR(r, cam) diff --git a/src/builtins/fold.c b/src/builtins/fold.c index de199923..4da2e6ec 100644 --- a/src/builtins/fold.c +++ b/src/builtins/fold.c @@ -219,7 +219,7 @@ B fold_c1(Md1D* d, B x) { B f = d->f; u64* xp = bitany_ptr(x); f64 r; switch (rtid) { default: goto base; - case n_mul: + case n_mul: case n_and:case n_floor: r = bit_has (xp, ia, 0) ^ 1; break; case n_or: case n_ceil: r = bit_has (xp, ia, 1); break; case n_add: r = bit_sum (xp, ia); break; diff --git a/src/builtins/sysfn.c b/src/builtins/sysfn.c index cb06bea3..64cad854 100644 --- a/src/builtins/sysfn.c +++ b/src/builtins/sysfn.c @@ -1219,12 +1219,12 @@ static i32 sh_core(bool raw, B x, usz xia, B inObj, u64 iLen, B* s_outp, B* s_er if (iLen>0) { if (raw) free_chars(iBufRaw); else TFREE(iBuf); } // FREE_INPUT TSFREE(arg); if (dwResult != ERROR_SUCCESS) { - thrF("•SH: Failed to run command: %S", winErrorEx(dwResult)); + thrF("•SH: Failed to run command: %S", winErrorEx(dwResult)); } // prepare output - u8* op; *s_outp = m_c8arrv(&op, oLen); - u8* ep; *s_errp = m_c8arrv(&ep, eLen); + u8* op; *s_outp = m_c8arrv(&op, oLen); + u8* ep; *s_errp = m_c8arrv(&ep, eLen); if (oBuf!=NULL) { memcpy(op, oBuf, oLen*sizeof(char)); free(oBuf); } if (eBuf!=NULL) { memcpy(ep, eBuf, eLen*sizeof(char)); free(eBuf); } return (i32)code; diff --git a/src/builtins/transpose.c b/src/builtins/transpose.c index 8f26eaa6..87c19f89 100644 --- a/src/builtins/transpose.c +++ b/src/builtins/transpose.c @@ -102,7 +102,7 @@ Arr* join_cells(B w, B x, ur k) { // consumes w,x; join k-cells, 𝕨 ∾○⥊ u8 xe = TI(x,elType); u8 re = we==xe? we : el_or(we, xe); - if (0) { goto to_equal_types; to_equal_types:; + if (0) { goto to_equal_types; to_equal_types:; // delay doing this until it's known that there will be code that can utilize it if (re!=we) w = toEltypeArr(w, re).obj; if (re!=xe) x = toEltypeArr(x, re).obj; diff --git a/src/ffi.c b/src/ffi.c index fea64400..7f79caa3 100644 --- a/src/ffi.c +++ b/src/ffi.c @@ -725,7 +725,7 @@ static void genObj_writePtr(void* res, B c, B expEl, B* sourceObjs) { if (!ty_equal(ptrh_type(h), expEl)) thrF("FFI: Pointer object type isn't compatible with argument type"); #endif *(void**)res = ptrh_ptr(h); - if (sourceObjs!=NULL) *sourceObjs = vec_addN(*sourceObjs, incG(c)); + if (sourceObjs!=NULL) *sourceObjs = vec_addN(*sourceObjs, incG(c)); } void genObj(B o, B c, void* ptr, B* sourceObjs) { // doesn't consume if (isC32(o)) { // scalar diff --git a/src/singeli/src/fold.singeli b/src/singeli/src/fold.singeli index 63bd9941..f947c1b2 100644 --- a/src/singeli/src/fold.singeli +++ b/src/singeli/src/fold.singeli @@ -188,7 +188,7 @@ def extract_column_modperm{x0, r0, nv, l, el, vl} = { if (p2 == 0) { loop{{r, i, write} => write{swap_ms{r}}} } else { - # Store results + # Store results def add_res = { ra := V**0 # Accumulator i := make{V, iota{vl}%16} @@ -276,7 +276,7 @@ def fold_rows_bit_lt64{ def ss = 1< loop_T{u32, {x} => extract{op{x, x>>1}}}} } else if (l == 4) { m:u64 = 64w2b0001; t := m<<3 diff --git a/src/singeli/src/scan.singeli b/src/singeli/src/scan.singeli index dbd66b09..5c028f4d 100644 --- a/src/singeli/src/scan.singeli +++ b/src/singeli/src/scan.singeli @@ -775,6 +775,6 @@ fn scan_stride_bool_assoc{op}(x:*u64, r:*u64, nl:usz, l:usz) : void = { } } export_tab{ - 'si_scan_bool_stride', + 'si_scan_bool_stride', each{scan_stride_bool_assoc, tup{|, &, ^}} } diff --git a/src/utils/file.c b/src/utils/file.c index efa23651..22696a9a 100644 --- a/src/utils/file.c +++ b/src/utils/file.c @@ -20,7 +20,7 @@ #define toOsStr toCStr #define freeOsStr freeCStr #define OsStrDecode0 utf8Decode0 -#else +#else typedef WCHAR* OsStr; #define OS_C(C) L##C #define toOsStr toWStr @@ -373,7 +373,7 @@ B mmap_file(B path) { WCHAR* p = toWStr(path); dec(path); HANDLE hFile = CreateFileW( - p, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, + p, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); freeWStr(p); if (hFile==INVALID_HANDLE_VALUE) thrF("Failed to open file: %S", winError()); @@ -388,7 +388,7 @@ B mmap_file(B path) { if (hMapFile==INVALID_HANDLE_VALUE) { CloseHandle(hFile); thrF("Failed to create file mapping: %S", winError()); - } + } u8* arr_data = MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0); // TODO should ensure ALLOC_PADDING padding around allocated memory if (arr_data==NULL) { diff --git a/src/utils/mut.c b/src/utils/mut.c index 7cfc38e9..bcbba748 100644 --- a/src/utils/mut.c +++ b/src/utils/mut.c @@ -405,7 +405,7 @@ DEF_G(void, copy, B, (void* a, usz ms, B x, usz xs, usz l), ms, x, x #define COPY0_TO(WHERE, RE, MS, X, XE, LEN) copyFns[el_##RE](WHERE, MS, X, 0, LEN) void basic_copy_bit_bit(void* rp, void* xp, u64 len) { bit_cpyN(rp, 0, xp, 0, len); } - #define BASIC_COPY_BIT_NUM(XE) + #define BASIC_COPY_BIT_NUM(XE) #define BASIC_COPY_NUM(RE, XE) void basic_copy_##XE##_##RE(void* rp, void* xp, u64 len) { vfor (ux i = 0; i < len; i++) ((RE*)rp)[i] = ((XE*)xp)[i]; } #define BASIC_COPY_NUM_ROW(RE) BASIC_COPY_NUM(RE, i8) BASIC_COPY_NUM(RE, i16) BASIC_COPY_NUM(RE, i32) BASIC_COPY_NUM(RE, f64) @@ -585,7 +585,7 @@ ApdFn* const apd_tot_fns[]; ApdFn* const apd_sh0_fns[]; ApdFn* const apd_sh1_f #define APD_POS(EB) JOIN0(APD_POS_,EB)() #define APD_WIDEN(TY, A) do { apd_widen(m, A, apd_##TY##_fns); return; } while(0) -#define APD_INC_POS(EB) +#define APD_INC_POS(EB) #define APD_MK0(E, FEB, EB, TY, TARR, CIA, T0, CS) \ NOINLINE void apd_##TY##_##E(ApdMut* m, B x) { T0 \ usz cia=CIA; CS; MAYBE_UNUSED u8 xe=TI(x,elType); \ diff --git a/src/windows/sh.h b/src/windows/sh.h index 370af097..4b779e74 100644 --- a/src/windows/sh.h +++ b/src/windows/sh.h @@ -58,10 +58,10 @@ static unsigned int __stdcall winThreadRead(void* arg0) { return dwResult; } -static DWORD winCmd(WCHAR* arg, - u64 iLen, char* iBuf, - DWORD* code, - u64* oLen, char** oBuf, +static DWORD winCmd(WCHAR* arg, + u64 iLen, char* iBuf, + DWORD* code, + u64* oLen, char** oBuf, u64* eLen, char** eBuf) { DWORD dwResult = ERROR_SUCCESS; @@ -69,7 +69,7 @@ static DWORD winCmd(WCHAR* arg, HANDLE hOutR, hOutW; HANDLE hErrR, hErrW; - // Create pipes + // Create pipes SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); sa.lpSecurityDescriptor = NULL; @@ -83,7 +83,7 @@ static DWORD winCmd(WCHAR* arg, SetHandleInformation(hOutR, HANDLE_FLAG_INHERIT, 0); SetHandleInformation(hErrR, HANDLE_FLAG_INHERIT, 0); - // Set up + // Set up STARTUPINFOW si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); diff --git a/src/windows/utf16.h b/src/windows/utf16.h index 1ad28383..ede6c097 100644 --- a/src/windows/utf16.h +++ b/src/windows/utf16.h @@ -50,7 +50,7 @@ static B utf16Decode(const WCHAR* s, i64 len) { u64 p = 0; for (i64 i = 0; i < len; ++i) { if (UTF16_IS_HI(s[i]) && i+1