mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
changing {} style to match majority of previous style
This commit is contained in:
parent
da6cdf014b
commit
961d929f4d
320 changed files with 5502 additions and 10485 deletions
|
@ -32,16 +32,14 @@
|
|||
#include "mbedtls/threading.h"
|
||||
|
||||
#if defined(MBEDTLS_THREADING_PTHREAD)
|
||||
static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static void threading_mutex_init_pthread(mbedtls_threading_mutex_t *mutex) {
|
||||
if (mutex == NULL)
|
||||
return;
|
||||
|
||||
mutex->is_valid = pthread_mutex_init(&mutex->mutex, NULL) == 0;
|
||||
}
|
||||
|
||||
static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex) {
|
||||
if (mutex == NULL || !mutex->is_valid)
|
||||
return;
|
||||
|
||||
|
@ -49,8 +47,7 @@ static void threading_mutex_free_pthread(mbedtls_threading_mutex_t *mutex)
|
|||
mutex->is_valid = 0;
|
||||
}
|
||||
|
||||
static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex) {
|
||||
if (mutex == NULL || ! mutex->is_valid)
|
||||
return (MBEDTLS_ERR_THREADING_BAD_INPUT_DATA);
|
||||
|
||||
|
@ -60,8 +57,7 @@ static int threading_mutex_lock_pthread(mbedtls_threading_mutex_t *mutex)
|
|||
return (0);
|
||||
}
|
||||
|
||||
static int threading_mutex_unlock_pthread(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static int threading_mutex_unlock_pthread(mbedtls_threading_mutex_t *mutex) {
|
||||
if (mutex == NULL || ! mutex->is_valid)
|
||||
return (MBEDTLS_ERR_THREADING_BAD_INPUT_DATA);
|
||||
|
||||
|
@ -84,13 +80,11 @@ int (*mbedtls_mutex_unlock)(mbedtls_threading_mutex_t *) = threading_mutex_unloc
|
|||
#endif /* MBEDTLS_THREADING_PTHREAD */
|
||||
|
||||
#if defined(MBEDTLS_THREADING_ALT)
|
||||
static int threading_mutex_fail(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static int threading_mutex_fail(mbedtls_threading_mutex_t *mutex) {
|
||||
((void) mutex);
|
||||
return (MBEDTLS_ERR_THREADING_BAD_INPUT_DATA);
|
||||
}
|
||||
static void threading_mutex_dummy(mbedtls_threading_mutex_t *mutex)
|
||||
{
|
||||
static void threading_mutex_dummy(mbedtls_threading_mutex_t *mutex) {
|
||||
((void) mutex);
|
||||
return;
|
||||
}
|
||||
|
@ -106,8 +100,7 @@ int (*mbedtls_mutex_unlock)(mbedtls_threading_mutex_t *) = threading_mutex_fail;
|
|||
void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *),
|
||||
void (*mutex_free)(mbedtls_threading_mutex_t *),
|
||||
int (*mutex_lock)(mbedtls_threading_mutex_t *),
|
||||
int (*mutex_unlock)(mbedtls_threading_mutex_t *))
|
||||
{
|
||||
int (*mutex_unlock)(mbedtls_threading_mutex_t *)) {
|
||||
mbedtls_mutex_init = mutex_init;
|
||||
mbedtls_mutex_free = mutex_free;
|
||||
mbedtls_mutex_lock = mutex_lock;
|
||||
|
@ -121,8 +114,7 @@ void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *),
|
|||
/*
|
||||
* Free global mutexes
|
||||
*/
|
||||
void mbedtls_threading_free_alt(void)
|
||||
{
|
||||
void mbedtls_threading_free_alt(void) {
|
||||
#if defined(MBEDTLS_FS_IO)
|
||||
mbedtls_mutex_free(&mbedtls_threading_readdir_mutex);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue