diff options
Diffstat (limited to 'MdePkg/Library/BaseMemoryLib')
-rw-r--r-- | MdePkg/Library/BaseMemoryLib/MemLibGeneric.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c b/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c index b058be8f71..cf40ace1fa 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGeneric.c @@ -37,9 +37,9 @@ InternalMemSetMem16 ( IN UINT16 Value
)
{
- do {
- ((UINT16*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT16*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}
@@ -61,9 +61,9 @@ InternalMemSetMem32 ( IN UINT32 Value
)
{
- do {
- ((UINT32*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT32*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}
@@ -85,9 +85,9 @@ InternalMemSetMem64 ( IN UINT64 Value
)
{
- do {
- ((UINT64*)Buffer)[--Length] = Value;
- } while (Length != 0);
+ for (; Length != 0; Length--) {
+ ((UINT64*)Buffer)[Length - 1] = Value;
+ }
return Buffer;
}
|