MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -5,40 +5,49 @@
|
||||
|
||||
#include "Bra.h"
|
||||
|
||||
#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
|
||||
#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
|
||||
|
||||
SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
|
||||
SizeT
|
||||
x86_Convert (
|
||||
Byte *data,
|
||||
SizeT size,
|
||||
UInt32 ip,
|
||||
UInt32 *state,
|
||||
int encoding
|
||||
)
|
||||
{
|
||||
SizeT pos = 0;
|
||||
UInt32 mask = *state & 7;
|
||||
if (size < 5)
|
||||
return 0;
|
||||
size -= 4;
|
||||
ip += 5;
|
||||
SizeT pos = 0;
|
||||
UInt32 mask = *state & 7;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
Byte *p = data + pos;
|
||||
const Byte *limit = data + size;
|
||||
for (; p < limit; p++)
|
||||
if ((*p & 0xFE) == 0xE8)
|
||||
if (size < 5) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size -= 4;
|
||||
ip += 5;
|
||||
|
||||
for ( ; ;) {
|
||||
Byte *p = data + pos;
|
||||
const Byte *limit = data + size;
|
||||
for ( ; p < limit; p++) {
|
||||
if ((*p & 0xFE) == 0xE8) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
SizeT d = (SizeT)(p - data - pos);
|
||||
SizeT d = (SizeT)(p - data - pos);
|
||||
pos = (SizeT)(p - data);
|
||||
if (p >= limit)
|
||||
{
|
||||
if (p >= limit) {
|
||||
*state = (d > 2 ? 0 : mask >> (unsigned)d);
|
||||
return pos;
|
||||
}
|
||||
if (d > 2)
|
||||
|
||||
if (d > 2) {
|
||||
mask = 0;
|
||||
else
|
||||
{
|
||||
} else {
|
||||
mask >>= (unsigned)d;
|
||||
if (mask != 0 && (mask > 4 || mask == 3 || Test86MSByte(p[(size_t)(mask >> 1) + 1])))
|
||||
{
|
||||
if ((mask != 0) && ((mask > 4) || (mask == 3) || Test86MSByte (p[(size_t)(mask >> 1) + 1]))) {
|
||||
mask = (mask >> 1) | 4;
|
||||
pos++;
|
||||
continue;
|
||||
@@ -46,35 +55,35 @@ SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding
|
||||
}
|
||||
}
|
||||
|
||||
if (Test86MSByte(p[4]))
|
||||
{
|
||||
UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
|
||||
UInt32 cur = ip + (UInt32)pos;
|
||||
if (Test86MSByte (p[4])) {
|
||||
UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
|
||||
UInt32 cur = ip + (UInt32)pos;
|
||||
pos += 5;
|
||||
if (encoding)
|
||||
if (encoding) {
|
||||
v += cur;
|
||||
else
|
||||
} else {
|
||||
v -= cur;
|
||||
if (mask != 0)
|
||||
{
|
||||
unsigned sh = (mask & 6) << 2;
|
||||
if (Test86MSByte((Byte)(v >> sh)))
|
||||
{
|
||||
}
|
||||
|
||||
if (mask != 0) {
|
||||
unsigned sh = (mask & 6) << 2;
|
||||
if (Test86MSByte ((Byte)(v >> sh))) {
|
||||
v ^= (((UInt32)0x100 << sh) - 1);
|
||||
if (encoding)
|
||||
if (encoding) {
|
||||
v += cur;
|
||||
else
|
||||
} else {
|
||||
v -= cur;
|
||||
}
|
||||
}
|
||||
|
||||
mask = 0;
|
||||
}
|
||||
|
||||
p[1] = (Byte)v;
|
||||
p[2] = (Byte)(v >> 8);
|
||||
p[3] = (Byte)(v >> 16);
|
||||
p[4] = (Byte)(0 - ((v >> 24) & 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
mask = (mask >> 1) | 4;
|
||||
pos++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user