Skip to content

Commit

Permalink
signed conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
uecker committed May 20, 2024
1 parent 6d83e8d commit aab5ede
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ static void do_test(const long dims[BENCH_DIMS], complex float* out, long scale,
{
printf("%30.30s |", str);

int N = dims[REPETITION_IND];
int N = (int)dims[REPETITION_IND];
double sum = 0.;
double min = 1.E10;
double max = 0.;
Expand Down Expand Up @@ -695,7 +695,7 @@ int main_bench(int argc, char* argv[argc])

if (threads) {

num_set_num_threads(pos[THREADS_IND] + 1);
num_set_num_threads((int)pos[THREADS_IND] + 1);
debug_printf(DP_INFO, "%02d threads. ", pos[THREADS_IND] + 1);
}

Expand Down
15 changes: 7 additions & 8 deletions src/misc/opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,17 +476,16 @@ static void process_option(char c, const char* optarg, const char* name, const c

for (int i = 0; i < n; i++) {

if (opts[i].c == c) {
if (opts[i].c != c)
continue;

if (opt_dispatch(opts[i].type, opts[i].ptr, opts[i].conv, c, optarg)) {

if (opt_dispatch(opts[i].type, opts[i].ptr, opts[i].conv, c, optarg)) {

print_usage(stderr, name, usage_str, n, opts);
error("process_option: failed to convert value\n");
}

return;
print_usage(stderr, name, usage_str, n, opts);
error("process_option: failed to convert value\n");
}

return;
}

print_usage(stderr, name, usage_str, n, opts);
Expand Down
6 changes: 3 additions & 3 deletions src/moba/iter_l1.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static void inverse_admm(iter_op_data* _data, float alpha, float* dst, const flo
struct iter_op_p_s a_prox_ops[D ?:1];


for (unsigned int i = 0; i < D; i++) {
for (int i = 0; i < D; i++) {

a_ops[i].forward = OPERATOR2ITOP(trafos[i]->forward),
a_ops[i].normal = OPERATOR2ITOP(trafos[i]->normal);
Expand All @@ -319,7 +319,7 @@ static void inverse_admm(iter_op_data* _data, float alpha, float* dst, const flo

long z_dims[D ?: 1];

for (unsigned int i = 0; i < D; i++)
for (int i = 0; i < D; i++)
z_dims[i] = 2 * md_calc_size(linop_codomain(trafos[i])->N, linop_codomain(trafos[i])->dims);


Expand All @@ -339,7 +339,7 @@ static const struct operator_p_s* create_prox(const long img_dims[DIMS], unsigne
{
bool randshift = true;
long minsize[DIMS] = { [0 ... DIMS - 1] = 1 };
unsigned int wflags = 0;
unsigned long wflags = 0;

for (int i = 0; i < DIMS; i++) {

Expand Down
4 changes: 2 additions & 2 deletions src/networks/unet.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ static nn_t unet_lowest_level_create(struct network_unet_s* unet, int N, const l
bool init_same = true;
bool last_same = true;

for (unsigned int i = 0; i < N; i++){
for (int i = 0; i < N; i++){

if (MD_IS_SET(igroup_flag, i) && (kdims[i] != idims[i])) {

Expand Down Expand Up @@ -697,7 +697,7 @@ static nn_t unet_level_create(struct network_unet_s* unet, int N, const long odi
bool init_same = true;
bool last_same = true;

for (unsigned int i = 0; i < N; i++){
for (int i = 0; i < N; i++){

if (MD_IS_SET(igroup_flag, i) && (kdims[i] != idims[i])) {

Expand Down
2 changes: 1 addition & 1 deletion src/num/convcorr.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static bool detect_convcorr( int N,
long test_strides[] = { istrs[i] / istrs_triv, 1, 2, 3, 4, 5, 6, 7, 8 };
bool found = false;

for (int j = 0; !found && j < ARRAY_SIZE(test_strides); j++) {
for (int j = 0; !found && j < (int)ARRAY_SIZE(test_strides); j++) {

strides[i] = test_strides[j];

Expand Down

0 comments on commit aab5ede

Please sign in to comment.