CryptoPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the CryptoPkg package

Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:54 -08:00
committed by mergify[bot]
parent 2b16a4fb91
commit 7c34237831
101 changed files with 4323 additions and 3711 deletions

View File

@@ -10,21 +10,38 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Base.h>
#include <Library/BaseMemoryLib.h>
#if defined(__clang__) && !defined(__APPLE__)
#if defined (__clang__) && !defined (__APPLE__)
/* Copies bytes between buffers */
static __attribute__((__used__))
void * __memcpy (void *dest, const void *src, unsigned int count)
static __attribute__ ((__used__))
void *
__memcpy (
void *dest,
const void *src,
unsigned int count
)
{
return CopyMem (dest, src, (UINTN)count);
}
__attribute__((__alias__("__memcpy")))
void * memcpy (void *dest, const void *src, unsigned int count);
__attribute__ ((__alias__ ("__memcpy")))
void *
memcpy (
void *dest,
const void *src,
unsigned int count
);
#else
/* Copies bytes between buffers */
void * memcpy (void *dest, const void *src, unsigned int count)
void *
memcpy (
void *dest,
const void *src,
unsigned int count
)
{
return CopyMem (dest, src, (UINTN)count);
}
#endif

View File

@@ -11,7 +11,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* Floating point to integer conversion.
*/
__declspec(naked) void _ftol2 (void)
__declspec(naked) void
_ftol2 (
void
)
{
_asm {
fistp qword ptr [esp-8]

View File

@@ -8,16 +8,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
/*
* Shifts a 64-bit signed value left by a particular number of bits.
*/
__declspec(naked) void __cdecl _allshl (void)
__declspec(naked) void __cdecl
_allshl (
void
)
{
_asm {
;
; Handle shifting of 64 or more bits (return 0)
;
cmp cl, 64
jae short ReturnZero

View File

@@ -8,11 +8,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
/*
* Shifts a 64-bit unsigned value right by a certain number of bits.
*/
__declspec(naked) void __cdecl _aullshr (void)
__declspec(naked) void __cdecl
_aullshr (
void
)
{
_asm {
;
@@ -41,8 +43,9 @@ More32:
ret
;
; Invalid number (less then 32bits), return 0
; Invalid number (less then 32bits), return 0
;
_Exit:
xor eax, eax
xor edx, edx

View File

@@ -11,20 +11,25 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
typedef UINTN size_t;
typedef UINTN size_t;
#if defined(__GNUC__) || defined(__clang__)
#define GLOBAL_USED __attribute__((used))
#if defined (__GNUC__) || defined (__clang__)
#define GLOBAL_USED __attribute__((used))
#else
#define GLOBAL_USED
#define GLOBAL_USED
#endif
/* OpenSSL will use floating point support, and C compiler produces the _fltused
symbol by default. Simply define this symbol here to satisfy the linker. */
int GLOBAL_USED _fltused = 1;
int GLOBAL_USED _fltused = 1;
/* Sets buffers to a specified character */
void * memset (void *dest, int ch, size_t count)
void *
memset (
void *dest,
int ch,
size_t count
)
{
//
// NOTE: Here we use one base implementation for memset, instead of the direct
@@ -49,12 +54,21 @@ void * memset (void *dest, int ch, size_t count)
}
/* Compare bytes in two buffers. */
int memcmp (const void *buf1, const void *buf2, size_t count)
int
memcmp (
const void *buf1,
const void *buf2,
size_t count
)
{
return (int)CompareMem(buf1, buf2, count);
return (int)CompareMem (buf1, buf2, count);
}
int strcmp (const char *s1, const char *s2)
int
strcmp (
const char *s1,
const char *s2
)
{
return (int)AsciiStrCmp(s1, s2);
return (int)AsciiStrCmp (s1, s2);
}