diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/restricted/aws/aws-c-common/source/math.c | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/aws/aws-c-common/source/math.c')
-rw-r--r-- | contrib/restricted/aws/aws-c-common/source/math.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/contrib/restricted/aws/aws-c-common/source/math.c b/contrib/restricted/aws/aws-c-common/source/math.c index 40d833c1a9..0659d3b064 100644 --- a/contrib/restricted/aws/aws-c-common/source/math.c +++ b/contrib/restricted/aws/aws-c-common/source/math.c @@ -1,24 +1,24 @@ -/** - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0. - */ - -#include <aws/common/math.h> -#include <stdarg.h> - -AWS_COMMON_API int aws_add_size_checked_varargs(size_t num, size_t *r, ...) { - va_list argp; - va_start(argp, r); - - size_t accum = 0; - for (size_t i = 0; i < num; ++i) { - size_t next = va_arg(argp, size_t); - if (aws_add_size_checked(accum, next, &accum) == AWS_OP_ERR) { - va_end(argp); - return AWS_OP_ERR; - } - } - *r = accum; - va_end(argp); - return AWS_OP_SUCCESS; -} +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include <aws/common/math.h> +#include <stdarg.h> + +AWS_COMMON_API int aws_add_size_checked_varargs(size_t num, size_t *r, ...) { + va_list argp; + va_start(argp, r); + + size_t accum = 0; + for (size_t i = 0; i < num; ++i) { + size_t next = va_arg(argp, size_t); + if (aws_add_size_checked(accum, next, &accum) == AWS_OP_ERR) { + va_end(argp); + return AWS_OP_ERR; + } + } + *r = accum; + va_end(argp); + return AWS_OP_SUCCESS; +} |