Skip to content

Commit 0454f4e

Browse files
committed
using unsigned where possible, avoiding 0 initializations
1 parent 1a96cbe commit 0454f4e

File tree

4 files changed

+214
-194
lines changed

4 files changed

+214
-194
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function(enable_asan target)
100100
target_compile_options(${target} PRIVATE $<$<CONFIG:DEBUG>:-fsanitize=address -fsanitize=undefined -fsanitize=bounds-strict>)
101101
target_link_options(${target} PRIVATE $<$<CONFIG:DEBUG>:-fsanitize=address -fsanitize=undefined -fsanitize=bounds-strict>)
102102
endif ()
103+
target_compile_options(${target} PRIVATE $<$<CONFIG:DEBUG>:-Wall -Wno-sign-compare>)
103104
endfunction()
104105

105106
# Utility function to link static/dynamic lib

include/finufft/defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// inline macro, to force inlining of small functions
4141
// this avoids the use of macros to implement functions
4242
#if defined(_MSC_VER)
43-
#define FINUFFT_ALWAYS_INLINE __forceinline
43+
#define FINUFFT_ALWAYS_INLINE __forceinline inline
4444
#define FINUFFT_NEVER_INLINE __declspec(noinline)
4545
#define FINUFFT_RESTRICT __restrict
4646
#define FINUFFT_UNREACHABLE __assume(0)

include/finufft/spreadinterp.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,26 @@ namespace spreadinterp {
3030

3131
// things external (spreadinterp) interface needs...
3232
FINUFFT_EXPORT int FINUFFT_CDECL spreadinterp(
33-
BIGINT N1, BIGINT N2, BIGINT N3, FLT *data_uniform, BIGINT M, FLT *kx, FLT *ky,
33+
UBIGINT N1, UBIGINT N2, UBIGINT N3, FLT *data_uniform, UBIGINT N, FLT *kx, FLT *ky,
3434
FLT *kz, FLT *data_nonuniform, const finufft_spread_opts &opts);
35-
FINUFFT_EXPORT int FINUFFT_CDECL spreadcheck(BIGINT N1, BIGINT N2, BIGINT N3, BIGINT M,
36-
FLT *kx, FLT *ky, FLT *kz,
35+
FINUFFT_EXPORT int FINUFFT_CDECL spreadcheck(UBIGINT N1, UBIGINT N2, UBIGINT N3,
36+
UBIGINT N, FLT *kx, FLT *ky, FLT *kz,
3737
const finufft_spread_opts &opts);
38-
FINUFFT_EXPORT int FINUFFT_CDECL indexSort(BIGINT *sort_indices, BIGINT N1, BIGINT N2,
39-
BIGINT N3, BIGINT M, FLT *kx, FLT *ky, FLT *kz,
40-
const finufft_spread_opts &opts);
38+
FINUFFT_EXPORT int FINUFFT_CDECL indexSort(BIGINT *sort_indices, UBIGINT N1, UBIGINT N2,
39+
UBIGINT N3, UBIGINT N, FLT *kx, FLT *ky,
40+
FLT *kz, const finufft_spread_opts &opts);
4141
FINUFFT_EXPORT int FINUFFT_CDECL interpSorted(
42-
const BIGINT *sort_indices, BIGINT N1, BIGINT N2, BIGINT N3,
43-
FLT *FINUFFT_RESTRICT data_uniform, BIGINT M, FLT *FINUFFT_RESTRICT kx,
42+
const BIGINT *sort_indices, UBIGINT N1, UBIGINT N2, UBIGINT N3,
43+
FLT *FINUFFT_RESTRICT data_uniform, UBIGINT N, FLT *FINUFFT_RESTRICT kx,
4444
FLT *FINUFFT_RESTRICT ky, FLT *FINUFFT_RESTRICT kz,
4545
FLT *FINUFFT_RESTRICT data_nonuniform, const finufft_spread_opts &opts);
4646
FINUFFT_EXPORT int FINUFFT_CDECL spreadSorted(
47-
const BIGINT *sort_indices, BIGINT N1, BIGINT N2, BIGINT N3, FLT *data_uniform,
48-
BIGINT M, FLT *kx, FLT *ky, FLT *kz, const FLT *data_nonuniform,
47+
const BIGINT *sort_indices, UBIGINT N1, UBIGINT N2, UBIGINT N3, FLT *data_uniform,
48+
UBIGINT N, FLT *kx, FLT *ky, FLT *kz, const FLT *data_nonuniform,
4949
const finufft_spread_opts &opts, int did_sort);
5050
FINUFFT_EXPORT int FINUFFT_CDECL spreadinterpSorted(
51-
const BIGINT *sort_indices, BIGINT N1, BIGINT N2, BIGINT N3,
52-
FLT *FINUFFT_RESTRICT data_uniform, BIGINT M, FLT *FINUFFT_RESTRICT kx,
51+
const BIGINT *sort_indices, UBIGINT N1, UBIGINT N2, UBIGINT N3,
52+
FLT *FINUFFT_RESTRICT data_uniform, UBIGINT N, FLT *FINUFFT_RESTRICT kx,
5353
FLT *FINUFFT_RESTRICT ky, FLT *FINUFFT_RESTRICT kz,
5454
FLT *FINUFFT_RESTRICT data_nonuniform, const finufft_spread_opts &opts, int did_sort);
5555
FINUFFT_EXPORT FLT FINUFFT_CDECL evaluate_kernel(FLT x, const finufft_spread_opts &opts);

0 commit comments

Comments
 (0)