Skip to content

Commit a8ace10

Browse files
Fix various warnings from the nvc compiler.
1 parent a33da76 commit a8ace10

File tree

19 files changed

+128
-140
lines changed

19 files changed

+128
-140
lines changed

include/qt_alloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ void INTERNAL qt_internal_alignment_init(void);
2727
#pragma warning(disable : 191)
2828
#endif
2929
extern size_t _pagesize;
30-
#define pagesize ((const size_t)_pagesize)
30+
#define pagesize ((size_t)_pagesize)
3131
#endif // ifndef HAVE_QT_ALIGNED_ALLOC_H
3232
/* vim:set expandtab: */

src/affinity/hwloc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,21 +233,21 @@ void INTERNAL qt_affinity_init(qthread_shepherd_id_t *nbshepherds,
233233
/* first, look for an exact match in width and find the proper depth */
234234
unsigned int maxdepth = hwloc_topology_get_depth(topology);
235235
unsigned int realdepth;
236-
unsigned int fl_depth = -1; // first depth with #objs larger than nbsheps
236+
unsigned int fl_depth = (unsigned int)-1; // first depth with #objs larger than nbsheps
237237
for (realdepth = 0; realdepth < maxdepth && shep_depth == -1;
238238
++realdepth) {
239239
unsigned int num = num_usable_by_depth(realdepth);
240240
if (num == *nbshepherds) {
241241
shep_depth = realdepth;
242-
} else if ((num > *nbshepherds) && (fl_depth == -1)) {
242+
} else if ((num > *nbshepherds) && (fl_depth == (unsigned int)-1)) {
243243
fl_depth = realdepth;
244244
}
245245
}
246246
/* second, if we failed, try an approximate match... */
247247
/* should we use the last _smaller_, or the first _larger_ ? */
248248
/* first option means overlapping but we can use all the cores */
249249
/* second option means no overlapping, but cores will go unused */
250-
if ((shep_depth == -1) && (fl_depth != -1)) {
250+
if ((shep_depth == -1) && (fl_depth != (unsigned int)-1)) {
251251
/* first larger then */
252252
shep_depth = fl_depth;
253253
}

src/barrier/feb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void API_FUNC qt_barrier_enter(qt_barrier_t *b) {
9191
qthread_readFF(NULL, &b->out_gate);
9292
}
9393
/* I'm on the way out, so decrement the blocker count */
94-
waiters = qthread_incr(&b->blockers, -1) - 1;
94+
waiters = qthread_incr(&b->blockers, (aligned_t)-1) - 1u;
9595
if (waiters == 0) {
9696
/* last guy out of the barrier, close the out_gate, open the in_gate */
9797
qthread_empty(&b->out_gate);
@@ -119,7 +119,7 @@ void qt_global_barrier(void) {
119119

120120
void qt_global_barrier_init(size_t size, int debug) {
121121
if (global_barrier == NULL) {
122-
global_barrier = qt_barrier_create(size, 0);
122+
global_barrier = qt_barrier_create(size, REGION_BARRIER);
123123
assert(global_barrier);
124124
}
125125
}

src/ds/dictionary/dictionary_shavit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static inline int qt_hash_remove(qt_hash h, qt_key_t const key) {
386386
h->op_cleanup)) {
387387
return 0;
388388
}
389-
qthread_incr(&h->count, -1);
389+
qthread_incr(&h->count, (aligned_t)-1);
390390
return 1;
391391
}
392392

src/ds/qarray.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ void qarray_destroy(qarray *a) { /*{{{ */
422422
qthread_incr(
423423
&chunk_distribution_tracker[qarray_internal_segment_shep_read(
424424
a, segmenthead)],
425-
-1);
425+
(aligned_t)-1);
426426
}
427427
break;
428428
}
@@ -435,14 +435,14 @@ void qarray_destroy(qarray *a) { /*{{{ */
435435
for (segment = 0; segment < segment_count; segment++) {
436436
qthread_incr(&chunk_distribution_tracker[qarray_internal_shepof_segidx(
437437
a, segment)],
438-
-1);
438+
(aligned_t)-1);
439439
}
440440
break;
441441
}
442442
case ALL_SAME:
443443
qthread_incr(&chunk_distribution_tracker[a->dist_specific.dist_shep],
444-
-1 * (a->count / a->segment_size +
445-
((a->count % a->segment_size) ? 1 : 0)));
444+
((aligned_t)-1) * (a->count / a->segment_size +
445+
((a->count % a->segment_size) ? 1 : 0)));
446446
break;
447447
}
448448
#ifdef QTHREAD_HAVE_MEM_AFFINITY
@@ -1202,7 +1202,7 @@ void qarray_set_shepof(qarray *a,
12021202
#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */
12031203
qthread_incr(&chunk_distribution_tracker[shep], segment_count);
12041204
qthread_incr(&chunk_distribution_tracker[a->dist_specific.dist_shep],
1205-
-1 * segment_count);
1205+
((aligned_t)-1) * segment_count);
12061206
a->dist_specific.dist_shep = shep;
12071207
}
12081208
return;
@@ -1223,7 +1223,7 @@ void qarray_set_shepof(qarray *a,
12231223
}
12241224
#endif /* ifdef QTHREAD_HAVE_MEM_AFFINITY */
12251225
qthread_incr(&chunk_distribution_tracker[shep], 1);
1226-
qthread_incr(&chunk_distribution_tracker[cur_shep], -1);
1226+
qthread_incr(&chunk_distribution_tracker[cur_shep], (aligned_t)-1);
12271227
qarray_internal_segment_shep_write(a, seghead, shep);
12281228
}
12291229
}

src/qloop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ static aligned_t qqloop_wrapper(void *arg_void) { /*{{{*/
10171017
if (!qthread_shep_ok()) {
10181018
/* my shepherd has been disabled while I was running */
10191019
safeexit = 0;
1020-
qthread_incr(&(stat->activesheps), -1);
1020+
qthread_incr(&(stat->activesheps), (aligned_t)-1);
10211021
break;
10221022
}
10231023
} while (get_iters(iq, stat, &range));
@@ -1131,7 +1131,7 @@ void API_FUNC qt_loop_queue_addworker(
11311131
if (loop->stat.donecount == 0) {
11321132
qthread_fork_to((qthread_f)qqloop_wrapper, loop->qwa + shep, NULL, shep);
11331133
} else {
1134-
qthread_incr(&(loop->stat.activesheps), -1);
1134+
qthread_incr(&(loop->stat.activesheps), (aligned_t)-1);
11351135
}
11361136
} /*}}}*/
11371137

src/qthread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ int API_FUNC qthread_initialize(void) { /*{{{ */
694694

695695
/* initialize the shepherds as having no affinity */
696696
for (i = 0; i < nshepherds; i++) {
697-
qlib->shepherds[i].node = -1;
697+
qlib->shepherds[i].node = UINT32_MAX;
698698
qlib->shepherds[i].shep_dists = NULL;
699699
qlib->shepherds[i].sorted_sheplist = NULL;
700700
qlib->shepherds[i].workers =
@@ -1287,7 +1287,7 @@ API_FUNC void *qthread_tos(void) {
12871287
API_FUNC void *qthread_bos(void) {
12881288
qthread_t const *f = qthread_internal_self();
12891289

1290-
return f->rdata->stack + qlib->qthread_stack_size;
1290+
return (void *)((char *)f->rdata->stack + qlib->qthread_stack_size);
12911291
}
12921292

12931293
size_t API_FUNC qthread_stackleft(void) { /*{{{ */

src/queue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ int API_FUNC qthread_queue_release_one(qthread_queue_t q) {
110110
break;
111111
case NEMESIS_LENGTH:
112112
t = qthread_queue_internal_NEMESIS_dequeue(&q->q.nemesis);
113-
qthread_incr(&q->q.nemesis.length, -1);
113+
qthread_incr(&q->q.nemesis.length, (aligned_t)-1);
114114
break;
115115
case CAPPED: t = qthread_queue_internal_capped_dequeue(&q->q.capped); break;
116116
default: QTHREAD_TRAP();
@@ -284,7 +284,7 @@ void INTERNAL qthread_queue_internal_capped_enqueue(qthread_queue_capped_t *q,
284284
offset = qthread_incr(&q->membercount, 1);
285285
qassert_retvoid(offset >= q->maxmembers);
286286
q->members[offset] = t;
287-
qthread_incr(&q->busy, -1);
287+
qthread_incr(&q->busy, (aligned_t)-1);
288288
}
289289

290290
qthread_t INTERNAL *

src/shepherds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ qthread_disable_shepherd(qthread_shepherd_id_t const shep) { /*{{{ */
159159
return QTHREAD_NOT_ALLOWED;
160160
}
161161
qthread_internal_incr(
162-
&(qlib->nshepherds_active), &(qlib->nshepherds_active_lock), -1);
162+
&(qlib->nshepherds_active), &(qlib->nshepherds_active_lock), (aligned_t)-1);
163163
(void)QT_CAS(qlib->shepherds[shep].active, 1, 0);
164164
return QTHREAD_SUCCESS;
165165
} /*}}} */

src/sincs/donecount.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void API_FUNC qt_sinc_submit(qt_sinc_t *restrict sinc_,
292292
}
293293

294294
// Update counter
295-
qt_sinc_count_t count = qthread_incr(&sinc->counter, -1);
295+
qt_sinc_count_t count = qthread_incr(&sinc->counter, (aligned_t)-1);
296296
assert(count > 0);
297297
if (1 == count) { // This is the final submit
298298
qt_sinc_internal_collate(sinc_);

0 commit comments

Comments
 (0)