changing {} style to match majority of previous style

This commit is contained in:
Philippe Teuwen 2019-03-10 11:20:22 +01:00
commit 961d929f4d
320 changed files with 5502 additions and 10485 deletions

View file

@ -34,8 +34,7 @@
#if defined(MBEDTLS_PLATFORM_MEMORY)
#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
static void *platform_calloc_uninit(size_t n, size_t size)
{
static void *platform_calloc_uninit(size_t n, size_t size) {
((void) n);
((void) size);
return (NULL);
@ -45,8 +44,7 @@ static void *platform_calloc_uninit(size_t n, size_t size)
#endif /* !MBEDTLS_PLATFORM_STD_CALLOC */
#if !defined(MBEDTLS_PLATFORM_STD_FREE)
static void platform_free_uninit(void *ptr)
{
static void platform_free_uninit(void *ptr) {
((void) ptr);
}
@ -56,19 +54,16 @@ static void platform_free_uninit(void *ptr)
static void *(*mbedtls_calloc_func)(size_t, size_t) = MBEDTLS_PLATFORM_STD_CALLOC;
static void (*mbedtls_free_func)(void *) = MBEDTLS_PLATFORM_STD_FREE;
void *mbedtls_calloc(size_t nmemb, size_t size)
{
void *mbedtls_calloc(size_t nmemb, size_t size) {
return (*mbedtls_calloc_func)(nmemb, size);
}
void mbedtls_free(void *ptr)
{
void mbedtls_free(void *ptr) {
(*mbedtls_free_func)(ptr);
}
int mbedtls_platform_set_calloc_free(void *(*calloc_func)(size_t, size_t),
void (*free_func)(void *))
{
void (*free_func)(void *)) {
mbedtls_calloc_func = calloc_func;
mbedtls_free_func = free_func;
return (0);
@ -77,8 +72,7 @@ int mbedtls_platform_set_calloc_free(void *(*calloc_func)(size_t, size_t),
#if defined(_WIN32)
#include <stdarg.h>
int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...)
{
int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...) {
int ret;
va_list argp;
@ -108,8 +102,7 @@ int mbedtls_platform_win32_snprintf(char *s, size_t n, const char *fmt, ...)
* Make dummy function to prevent NULL pointer dereferences
*/
static int platform_snprintf_uninit(char *s, size_t n,
const char *format, ...)
{
const char *format, ...) {
((void) s);
((void) n);
((void) format);
@ -125,8 +118,7 @@ int (*mbedtls_snprintf)(char *s, size_t n,
int mbedtls_platform_set_snprintf(int (*snprintf_func)(char *s, size_t n,
const char *format,
...))
{
...)) {
mbedtls_snprintf = snprintf_func;
return (0);
}
@ -137,8 +129,7 @@ int mbedtls_platform_set_snprintf(int (*snprintf_func)(char *s, size_t n,
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static int platform_printf_uninit(const char *format, ...)
{
static int platform_printf_uninit(const char *format, ...) {
((void) format);
return (0);
}
@ -148,8 +139,7 @@ static int platform_printf_uninit(const char *format, ...)
int (*mbedtls_printf)(const char *, ...) = MBEDTLS_PLATFORM_STD_PRINTF;
int mbedtls_platform_set_printf(int (*printf_func)(const char *, ...))
{
int mbedtls_platform_set_printf(int (*printf_func)(const char *, ...)) {
mbedtls_printf = printf_func;
return (0);
}
@ -160,8 +150,7 @@ int mbedtls_platform_set_printf(int (*printf_func)(const char *, ...))
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static int platform_fprintf_uninit(FILE *stream, const char *format, ...)
{
static int platform_fprintf_uninit(FILE *stream, const char *format, ...) {
((void) stream);
((void) format);
return (0);
@ -173,8 +162,7 @@ static int platform_fprintf_uninit(FILE *stream, const char *format, ...)
int (*mbedtls_fprintf)(FILE *, const char *, ...) =
MBEDTLS_PLATFORM_STD_FPRINTF;
int mbedtls_platform_set_fprintf(int (*fprintf_func)(FILE *, const char *, ...))
{
int mbedtls_platform_set_fprintf(int (*fprintf_func)(FILE *, const char *, ...)) {
mbedtls_fprintf = fprintf_func;
return (0);
}
@ -185,8 +173,7 @@ int mbedtls_platform_set_fprintf(int (*fprintf_func)(FILE *, const char *, ...))
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static void platform_exit_uninit(int status)
{
static void platform_exit_uninit(int status) {
((void) status);
}
@ -195,8 +182,7 @@ static void platform_exit_uninit(int status)
void (*mbedtls_exit)(int status) = MBEDTLS_PLATFORM_STD_EXIT;
int mbedtls_platform_set_exit(void (*exit_func)(int status))
{
int mbedtls_platform_set_exit(void (*exit_func)(int status)) {
mbedtls_exit = exit_func;
return (0);
}
@ -209,8 +195,7 @@ int mbedtls_platform_set_exit(void (*exit_func)(int status))
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static mbedtls_time_t platform_time_uninit(mbedtls_time_t *timer)
{
static mbedtls_time_t platform_time_uninit(mbedtls_time_t *timer) {
((void) timer);
return (0);
}
@ -220,8 +205,7 @@ static mbedtls_time_t platform_time_uninit(mbedtls_time_t *timer)
mbedtls_time_t (*mbedtls_time)(mbedtls_time_t *timer) = MBEDTLS_PLATFORM_STD_TIME;
int mbedtls_platform_set_time(mbedtls_time_t (*time_func)(mbedtls_time_t *timer))
{
int mbedtls_platform_set_time(mbedtls_time_t (*time_func)(mbedtls_time_t *timer)) {
mbedtls_time = time_func;
return (0);
}
@ -234,8 +218,7 @@ int mbedtls_platform_set_time(mbedtls_time_t (*time_func)(mbedtls_time_t *timer)
/* Default implementations for the platform independent seed functions use
* standard libc file functions to read from and write to a pre-defined filename
*/
int mbedtls_platform_std_nv_seed_read(unsigned char *buf, size_t buf_len)
{
int mbedtls_platform_std_nv_seed_read(unsigned char *buf, size_t buf_len) {
FILE *file;
size_t n;
@ -252,8 +235,7 @@ int mbedtls_platform_std_nv_seed_read(unsigned char *buf, size_t buf_len)
return ((int)n);
}
int mbedtls_platform_std_nv_seed_write(unsigned char *buf, size_t buf_len)
{
int mbedtls_platform_std_nv_seed_write(unsigned char *buf, size_t buf_len) {
FILE *file;
size_t n;
@ -275,8 +257,7 @@ int mbedtls_platform_std_nv_seed_write(unsigned char *buf, size_t buf_len)
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static int platform_nv_seed_read_uninit(unsigned char *buf, size_t buf_len)
{
static int platform_nv_seed_read_uninit(unsigned char *buf, size_t buf_len) {
((void) buf);
((void) buf_len);
return (-1);
@ -289,8 +270,7 @@ static int platform_nv_seed_read_uninit(unsigned char *buf, size_t buf_len)
/*
* Make dummy function to prevent NULL pointer dereferences
*/
static int platform_nv_seed_write_uninit(unsigned char *buf, size_t buf_len)
{
static int platform_nv_seed_write_uninit(unsigned char *buf, size_t buf_len) {
((void) buf);
((void) buf_len);
return (-1);
@ -306,8 +286,7 @@ int (*mbedtls_nv_seed_write)(unsigned char *buf, size_t buf_len) =
int mbedtls_platform_set_nv_seed(
int (*nv_seed_read_func)(unsigned char *buf, size_t buf_len),
int (*nv_seed_write_func)(unsigned char *buf, size_t buf_len))
{
int (*nv_seed_write_func)(unsigned char *buf, size_t buf_len)) {
mbedtls_nv_seed_read = nv_seed_read_func;
mbedtls_nv_seed_write = nv_seed_write_func;
return (0);
@ -319,8 +298,7 @@ int mbedtls_platform_set_nv_seed(
/*
* Placeholder platform setup that does nothing by default
*/
int mbedtls_platform_setup(mbedtls_platform_context *ctx)
{
int mbedtls_platform_setup(mbedtls_platform_context *ctx) {
(void)ctx;
return (0);
@ -329,8 +307,7 @@ int mbedtls_platform_setup(mbedtls_platform_context *ctx)
/*
* Placeholder platform teardown that does nothing by default
*/
void mbedtls_platform_teardown(mbedtls_platform_context *ctx)
{
void mbedtls_platform_teardown(mbedtls_platform_context *ctx) {
(void)ctx;
}
#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */