Skip to content

Commit 7838bc7

Browse files
committed
Silence the gcc12 complaints
Just need to encapsulate nspace names in pmix_nspace_t. We already were consistent in use of char* for keys. Signed-off-by: Ralph Castain <[email protected]>
1 parent e68b7b4 commit 7838bc7

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

examples/server.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ int main(int argc, char **argv)
200200
uid_t uid = geteuid();
201201
pmix_info_t *info;
202202
struct stat buf;
203+
pmix_nspace_t ncache;
203204

204205
/* define and pass a personal tmpdir to protect the system */
205206
if (NULL == (tdir = getenv("TMPDIR"))) {
@@ -290,8 +291,9 @@ int main(int argc, char **argv)
290291
PMIX_RELEASE(x);
291292

292293
/* prep the local node for launch */
294+
PMIX_LOAD_NSPACE(ncache, "foobar");
293295
x = PMIX_NEW(myxfer_t);
294-
if (PMIX_SUCCESS != (rc = PMIx_server_setup_local_support("foobar", NULL, 0, opcbfunc, x))) {
296+
if (PMIX_SUCCESS != (rc = PMIx_server_setup_local_support(ncache, NULL, 0, opcbfunc, x))) {
295297
fprintf(stderr, "Setup local support failed: %d\n", rc);
296298
PMIx_server_finalize();
297299
system(cleanup);
@@ -301,7 +303,7 @@ int main(int argc, char **argv)
301303
PMIX_RELEASE(x);
302304

303305
/* fork/exec the test */
304-
PMIX_LOAD_NSPACE(proc.nspace, "foobar");
306+
PMIX_LOAD_NSPACE(proc.nspace, ncache);
305307
for (n = 0; n < nprocs; n++) {
306308
proc.rank = n;
307309
if (PMIX_SUCCESS != (rc = PMIx_server_setup_fork(&proc, &client_env))) { // n

test/simple/gwtest.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ int main(int argc, char **argv)
273273
mylock_t mylock;
274274
pmix_data_array_t *darray;
275275
pmix_info_t *iarray;
276+
pmix_nspace_t ncache;
276277

277278
/* smoke test */
278279
if (PMIX_SUCCESS != 0) {
@@ -411,9 +412,10 @@ int main(int argc, char **argv)
411412
PMIX_INFO_LOAD(&iarray[3], PMIX_ALLOC_NETWORK_SEC_KEY, NULL, PMIX_BOOL);
412413
/* now load the array */
413414
PMIX_INFO_LOAD(&info[0], PMIX_ALLOC_NETWORK, darray, PMIX_DATA_ARRAY);
415+
PMIX_LOAD_NSPACE(ncache, "foobar");
414416

415-
if (PMIX_SUCCESS
416-
!= (rc = PMIx_server_setup_application("foobar", info, ninfo, sacbfunc, (void *) x))) {
417+
rc = PMIx_server_setup_application(ncache, info, ninfo, sacbfunc, (void *) x);
418+
if (PMIX_SUCCESS != rc) {
417419
return rc;
418420
}
419421
DEBUG_WAIT_THREAD(&x->lock);
@@ -422,8 +424,8 @@ int main(int argc, char **argv)
422424

423425
/* pass any returned data down */
424426
DEBUG_CONSTRUCT_LOCK(&x->lock);
425-
if (PMIX_SUCCESS
426-
!= (rc = PMIx_server_setup_local_support("foobar", x->info, x->ninfo, opcbfunc, x))) {
427+
rc = PMIx_server_setup_local_support(ncache, x->info, x->ninfo, opcbfunc, x);
428+
if (PMIX_SUCCESS != rc) {
427429
return rc;
428430
}
429431
DEBUG_WAIT_THREAD(&x->lock);
@@ -489,7 +491,7 @@ int main(int argc, char **argv)
489491

490492
/* deregister the nspace */
491493
x = PMIX_NEW(myxfer_t);
492-
PMIx_server_deregister_nspace("foobar", opcbfunc, (void *) x);
494+
PMIx_server_deregister_nspace(ncache, opcbfunc, (void *) x);
493495
DEBUG_WAIT_THREAD(&x->lock);
494496
PMIX_RELEASE(x);
495497

test/simple/simpfabric.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ int main(int argc, char **argv)
108108
pmix_cpuset_t mycpuset;
109109
pmix_device_distance_t *distances;
110110
size_t ndist;
111-
pmix_device_type_t type = PMIX_DEVTYPE_OPENFABRICS | PMIX_DEVTYPE_NETWORK | PMIX_DEVTYPE_COPROC
112-
| PMIX_DEVTYPE_GPU;
111+
pmix_device_type_t type = PMIX_DEVTYPE_OPENFABRICS |
112+
PMIX_DEVTYPE_NETWORK |
113+
PMIX_DEVTYPE_COPROC |
114+
PMIX_DEVTYPE_GPU;
115+
pmix_nspace_t ncache;
113116
PMIX_HIDE_UNUSED_PARAMS(argc, argv);
114117

115118
/* smoke test */
@@ -200,10 +203,10 @@ int main(int argc, char **argv)
200203
PMIX_INFO_LOAD(&info[1], PMIX_ALLOC_NETWORK_SEC_KEY, NULL, PMIX_BOOL);
201204

202205
PMIX_INFO_LOAD(&iptr[3], PMIX_SETUP_APP_ENVARS, NULL, PMIX_BOOL);
203-
206+
PMIX_LOAD_NSPACE(ncache, "SIMPSCHED");
204207
DEBUG_CONSTRUCT_LOCK(&cd.lock);
205-
if (PMIX_SUCCESS
206-
!= (rc = PMIx_server_setup_application("SIMPSCHED", iptr, 4, setup_cbfunc, &cd))) {
208+
rc = PMIx_server_setup_application(ncache, iptr, 4, setup_cbfunc, &cd);
209+
if (PMIX_SUCCESS != rc) {
207210
pmix_output(0, "[%s:%d] PMIx_server_setup_application failed: %s", __FILE__, __LINE__,
208211
PMIx_Error_string(rc));
209212
DEBUG_DESTRUCT_LOCK(&cd.lock);
@@ -214,9 +217,8 @@ int main(int argc, char **argv)
214217

215218
/* setup the local subsystem */
216219
DEBUG_CONSTRUCT_LOCK(&lock);
217-
if (PMIX_SUCCESS
218-
!= (rc = PMIx_server_setup_local_support("SIMPSCHED", cd.info, cd.ninfo, local_cbfunc,
219-
&lock))) {
220+
rc = PMIx_server_setup_local_support(ncache, cd.info, cd.ninfo, local_cbfunc, &lock);
221+
if (PMIX_SUCCESS != rc) {
220222
pmix_output(0, "[%s:%d] PMIx_server_setup_local_support failed: %s", __FILE__, __LINE__,
221223
PMIx_Error_string(rc));
222224
DEBUG_DESTRUCT_LOCK(&lock);

test/simple/simpsched.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ int main(int argc, char **argv)
104104
mylock_t lock;
105105
mycaddy_t cd;
106106
pmix_value_t *val;
107+
pmix_nspace_t ncache;
107108
PMIX_HIDE_UNUSED_PARAMS(argc, argv);
108109

109110
/* smoke test */
@@ -178,10 +179,10 @@ int main(int argc, char **argv)
178179
PMIX_INFO_LOAD(&info[1], PMIX_ALLOC_NETWORK_SEC_KEY, NULL, PMIX_BOOL);
179180

180181
PMIX_INFO_LOAD(&iptr[3], PMIX_SETUP_APP_ENVARS, NULL, PMIX_BOOL);
181-
182+
PMIX_LOAD_NSPACE(ncache, "SIMPSCHED");
182183
DEBUG_CONSTRUCT_LOCK(&cd.lock);
183-
if (PMIX_SUCCESS
184-
!= (rc = PMIx_server_setup_application("SIMPSCHED", iptr, 4, setup_cbfunc, &cd))) {
184+
rc = PMIx_server_setup_application(ncache, iptr, 4, setup_cbfunc, &cd);
185+
if (PMIX_SUCCESS != rc) {
185186
pmix_output(0, "[%s:%d] PMIx_server_setup_application failed: %s", __FILE__, __LINE__,
186187
PMIx_Error_string(rc));
187188
DEBUG_DESTRUCT_LOCK(&cd.lock);
@@ -192,9 +193,8 @@ int main(int argc, char **argv)
192193

193194
/* setup the local subsystem */
194195
DEBUG_CONSTRUCT_LOCK(&lock);
195-
if (PMIX_SUCCESS
196-
!= (rc = PMIx_server_setup_local_support("SIMPSCHED", cd.info, cd.ninfo, local_cbfunc,
197-
&lock))) {
196+
rc = PMIx_server_setup_local_support(ncache, cd.info, cd.ninfo, local_cbfunc, &lock);
197+
if (PMIX_SUCCESS != rc) {
198198
pmix_output(0, "[%s:%d] PMIx_server_setup_local_support failed: %s", __FILE__, __LINE__,
199199
PMIx_Error_string(rc));
200200
DEBUG_DESTRUCT_LOCK(&lock);

0 commit comments

Comments
 (0)