diff --git a/src/misc/debug.c b/src/misc/debug.c index 8f53d1ad7..8a88f14e0 100644 --- a/src/misc/debug.c +++ b/src/misc/debug.c @@ -49,7 +49,7 @@ double timestamp(void) { struct timeval tv; - gettimeofday(&tv, 0); // more accurate than + gettimeofday(&tv, NULL); // more accurate than return (double)tv.tv_sec + 1e-6 * (double)tv.tv_usec; } diff --git a/src/moba/recon.c b/src/moba/recon.c index 012d1acaf..ba9b67df3 100644 --- a/src/moba/recon.c +++ b/src/moba/recon.c @@ -294,7 +294,7 @@ static void recon(const struct moba_conf* conf, struct moba_conf_s* data, mconf.b = conf->sobolev_b; mconf.cnstcoil_flags = TE_FLAG | CSHIFT_FLAG; - struct mobamod nl = { 0 }; + struct mobamod nl = { }; switch (conf->mode) { diff --git a/src/networks/nlinvnet.c b/src/networks/nlinvnet.c index 2b3c55b53..c7ac42a40 100644 --- a/src/networks/nlinvnet.c +++ b/src/networks/nlinvnet.c @@ -379,8 +379,9 @@ static nn_t nlinvnet_get_network_step(const struct nlinvnet_s* nlinvnet, struct auto dummy = nn_from_nlop_F(nlop_del_out_create(dom->N, dom->dims)); dummy = nn_set_input_name_F(dummy, 0, "ref_col"); - complex float zero[1] = { 0 }; - join = nn_set_input_const_F2(join, 1, 0, dom->N, dom->dims, MD_SINGLETON_STRS(dom->N), true, zero); + complex float zero[1] = { 0. }; + + join = nn_set_input_const_F2(join, 1, NULL, dom->N, dom->dims, MD_SINGLETON_STRS(dom->N), true, zero); join = nn_combine_FF(dummy, join); } @@ -722,7 +723,7 @@ static nn_t nlinvnet_valid_create(const struct nlinvnet_s* nlinvnet, struct name result = nn_chain2_FF(result, 0, NULL, nn_from_nlop_F(noir_decomp_create(model)), 0, NULL); auto cim_iov = named_data_list_get_iovec(valid_data, "ref"); - auto valid_loss = nn_chain2_FF(result, 0, 0, val_measure_create(nlinvnet->valid_loss, cim_iov->N, cim_iov->dims), 0, NULL); + auto valid_loss = nn_chain2_FF(result, 0, NULL, val_measure_create(nlinvnet->valid_loss, cim_iov->N, cim_iov->dims), 0, NULL); iovec_free(cim_iov); valid_loss = nn_set_input_name_F(valid_loss, 0, "ref"); diff --git a/src/nn/data_list.c b/src/nn/data_list.c index fa2efa520..2142bdd1f 100644 --- a/src/nn/data_list.c +++ b/src/nn/data_list.c @@ -135,7 +135,7 @@ extern const struct nlop_s* nn_batchgen_create(struct bat_gen_conf_s* config, nn if (IN_BATCH_GENERATOR == in_types[i]) { - assert(0 != names[i]); + assert(NULL != names[i]); N = MAX(N, nn_generic_domain(network, 0, names[i])->N); D++; diff --git a/src/nn/nn.c b/src/nn/nn.c index 649d286b8..7f78d75c7 100644 --- a/src/nn/nn.c +++ b/src/nn/nn.c @@ -794,7 +794,7 @@ void nn_export_graph(const char* filename, nn_t op) FILE *fp; fp = fopen(filename, "w+"); - assert(0 != fp); + assert(NULL != fp); fprintf(fp, "digraph {\nnewrank=true;\n"); fprintf(fp, "{\n%s}\n", str); diff --git a/src/noncart/nufft_chain.c b/src/noncart/nufft_chain.c index 08d0d4943..223c36f56 100644 --- a/src/noncart/nufft_chain.c +++ b/src/noncart/nufft_chain.c @@ -210,7 +210,7 @@ extern struct linop_s* nufft_create_chain(int N, ret = linop_chain_FF(ret, linop_fftc_create(N, os_cim_dims, flags)); - if (0 != basis) { + if (NULL != basis) { long ksp_max_dims[N]; md_max_dims(N, ~0UL, ksp_max_dims, ksp_dims, bas_dims); @@ -218,6 +218,7 @@ extern struct linop_s* nufft_create_chain(int N, ret = linop_chain_FF(ret, linop_interpolate_kb_create(N, flags, ksp_max_dims, os_cim_dims, traj_dims, traj, conf)); ret = linop_chain_FF(ret, linop_fmac_create(N, ksp_max_dims, ~md_nontriv_dims(N, ksp_dims), 0, ~md_nontriv_dims(N, bas_dims), basis)); + } else { ret = linop_chain_FF(ret, linop_interpolate_kb_create(N, flags, ksp_dims, os_cim_dims, traj_dims, traj, conf)); diff --git a/src/num/lapack.c b/src/num/lapack.c index 872c7dafb..be2c2ffd2 100644 --- a/src/num/lapack.c +++ b/src/num/lapack.c @@ -134,7 +134,7 @@ void lapack_schur(long N, complex float W[N], complex float VS[N][N], complex fl int sdim = 0; // On output, A overwritten by Schur form T - LAPACKE(cgees, 'V', 'N', 0, N, &A[0][0], N, &sdim, &W[0], &VS[0][0], N); + LAPACKE(cgees, 'V', 'N', NULL, N, &A[0][0], N, &sdim, &W[0], &VS[0][0], N); } void lapack_schur_double(long N, complex double W[N], complex double VS[N][N], complex double A[N][N]) @@ -142,7 +142,7 @@ void lapack_schur_double(long N, complex double W[N], complex double VS[N][N], c int sdim = 0; // On output, A overwritten by Schur form T - LAPACKE(zgees, 'V', 'N', 0, N, &A[0][0], N, &sdim, &W[0], &VS[0][0], N); + LAPACKE(zgees, 'V', 'N', NULL, N, &A[0][0], N, &sdim, &W[0], &VS[0][0], N); } // Solves the complex Sylvester matrix equation diff --git a/src/num/multind.c b/src/num/multind.c index 7b20b05d9..51f31b166 100644 --- a/src/num/multind.c +++ b/src/num/multind.c @@ -2391,7 +2391,7 @@ void* md_alloc_sameplace(int D, const long dimensions[D], size_t size, const voi #ifdef USE_CUDA return (cuda_ondevice(ptr) ? md_alloc_gpu : md_alloc)(D, dimensions, size); #else - assert(0 != ptr); + assert(NULL != ptr); return md_alloc(D, dimensions, size); #endif } diff --git a/src/num/vptr.c b/src/num/vptr.c index ec3365ad9..79a4efee1 100644 --- a/src/num/vptr.c +++ b/src/num/vptr.c @@ -247,7 +247,7 @@ static struct mem_s* vptr_create(int N, const long dims[N], size_t size, struct { long len = md_calc_size(N, dims) * (long)size; - void* ptr = mmap(0, (size_t)len, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + void* ptr = mmap(NULL, (size_t)len, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); PTR_ALLOC(struct mem_s, x);