1
1
openmpi/oshmem/util/oshmem_util.c
Jeff Squyres f4693c9afd oshmem: fix compiler warning
Compiler warning that ret was used before it was assigned.  Since this
part of the code is not performance-critical, just throw in an extra
assignment and be done with it.
2015-01-16 12:48:36 -08:00

72 строки
1.5 KiB
C

/*
* Copyright (c) 2014 Mellanox Technologies, Inc.
* All rights reserved.
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "oshmem_config.h"
#include <stdarg.h>
#include <stdio.h>
#include "opal/util/output.h"
#include "oshmem/constants.h"
#include "oshmem/util/oshmem_util.h"
void oshmem_output_verbose(int level, int output_id, const char* prefix,
const char* file, int line, const char* function, const char* format, ...)
{
va_list args;
char *buff, *str;
int ret = 0;
if (level < opal_output_get_verbosity(output_id)) {
UNREFERENCED_PARAMETER(ret);
va_start(args, format);
ret = vasprintf(&str, format, args);
assert(-1 != ret);
ret = asprintf(&buff, "%s %s", prefix, str);
assert(-1 != ret);
opal_output(output_id, buff, file, line, function);
va_end(args);
free(buff);
free(str);
}
}
void oshmem_output(int output_id, const char* prefix, const char* file,
int line, const char* function, const char* format, ...)
{
va_list args;
char *buff, *str;
int ret = 0;
UNREFERENCED_PARAMETER(ret);
va_start(args, format);
ret = vasprintf(&str, format, args);
assert(-1 != ret);
ret = asprintf(&buff, "%s %s", prefix, str);
assert(-1 != ret);
opal_output(output_id, buff, file, line, function);
va_end(args);
free(buff);
free(str);
}