]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/CheckSum.c
Synchronize function comment in MdePkg\Library\BaseLib.h with the instance of this...
[mirror_edk2.git] / MdePkg / Library / BaseLib / CheckSum.c
index a89b7b17753ea65faac97edb35584a78dbd35254..7fad548aa98a2895065ef6cfd46728437bbb20d3 100644 (file)
 #include "BaseLibInternals.h"\r
 \r
 /**\r
-  Calculate the sum of all elements in a buffer in unit of UINT8. \r
+  Returns the sum of all elements in a buffer in unit of UINT8.\r
   During calculation, the carry bits are dropped.\r
 \r
-  This function calculates the sum of all elements in a buffer \r
-  in unit of UINT8. The carry bits in result of addition are dropped. \r
-  The result is returned as UINT8. If Length is Zero, then Zero is \r
+  This function calculates the sum of all elements in a buffer\r
+  in unit of UINT8. The carry bits in result of addition are dropped.\r
+  The result is returned as UINT8. If Length is Zero, then Zero is\r
   returned.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
-  @param  Length      The size, in bytes, of Buffer .\r
+  @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The sum of Buffer with carry bits dropped during additions.\r
+  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
 \r
 **/\r
 UINT8\r
@@ -55,21 +55,21 @@ CalculateSum8 (
 \r
 \r
 /**\r
-  Returns the two's complement checksum of all elements in a buffer \r
+  Returns the two's complement checksum of all elements in a buffer\r
   of 8-bit values.\r
 \r
-  This function first calculates the sum of the 8-bit values in the \r
-  buffer specified by Buffer and Length.  The carry bits in the result \r
-  of addition are dropped. Then, the two's complement of the sum is \r
+  This function first calculates the sum of the 8-bit values in the\r
+  buffer specified by Buffer and Length.  The carry bits in the result\r
+  of addition are dropped. Then, the two's complement of the sum is\r
   returned.  If Length is 0, then 0 is returned.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The 2's complement checksum of Buffer.\r
+  @return Checksum    The 2's complement checksum of Buffer.\r
 \r
 **/\r
 UINT8\r
@@ -90,13 +90,13 @@ CalculateCheckSum8 (
 }\r
 \r
 /**\r
-  Returns the sum of all elements in a buffer of 16-bit values.  During \r
+  Returns the sum of all elements in a buffer of 16-bit values.  During\r
   calculation, the carry bits are dropped.\r
 \r
-  This function calculates the sum of the 16-bit values in the buffer \r
-  specified by Buffer and Length. The carry bits in result of addition are dropped. \r
-  The 16-bit result is returned.  If Length is 0, then 0 is returned.  \r
-  \r
+  This function calculates the sum of the 16-bit values in the buffer\r
+  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
+  The 16-bit result is returned.  If Length is 0, then 0 is returned.\r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is not aligned on a 16-bit boundary, then ASSERT().\r
@@ -105,7 +105,7 @@ CalculateCheckSum8 (
   @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The sum of Buffer with carry bits dropped during additions.\r
+  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
 \r
 **/\r
 UINT16\r
@@ -134,23 +134,23 @@ CalculateSum16 (
 \r
 \r
 /**\r
-  Returns the two's complement checksum of all elements in a buffer of \r
+  Returns the two's complement checksum of all elements in a buffer of\r
   16-bit values.\r
 \r
-  This function first calculates the sum of the 16-bit values in the buffer \r
-  specified by Buffer and Length.  The carry bits in the result of addition \r
-  are dropped. Then, the two's complement of the sum is returned.  If Length \r
+  This function first calculates the sum of the 16-bit values in the buffer\r
+  specified by Buffer and Length.  The carry bits in the result of addition\r
+  are dropped. Then, the two's complement of the sum is returned.  If Length\r
   is 0, then 0 is returned.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is not aligned on a 16-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The 2's complement checksum of Buffer.\r
+  @return Checksum    The 2's complement checksum of Buffer.\r
 \r
 **/\r
 UINT16\r
@@ -172,13 +172,13 @@ CalculateCheckSum16 (
 \r
 \r
 /**\r
-  Returns the sum of all elements in a buffer of 32-bit values.  During \r
+  Returns the sum of all elements in a buffer of 32-bit values. During\r
   calculation, the carry bits are dropped.\r
 \r
-  This function calculates the sum of the 32-bit values in the buffer \r
-  specified by Buffer and Length. The carry bits in result of addition are dropped. \r
-  The 32-bit result is returned.  If Length is 0, then 0 is returned.  \r
-  \r
+  This function calculates the sum of the 32-bit values in the buffer\r
+  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
+  The 32-bit result is returned. If Length is 0, then 0 is returned.\r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is not aligned on a 32-bit boundary, then ASSERT().\r
@@ -187,7 +187,7 @@ CalculateCheckSum16 (
   @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The sum of Buffer with carry bits dropped during additions.\r
+  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
 \r
 **/\r
 UINT32\r
@@ -216,23 +216,23 @@ CalculateSum32 (
 \r
 \r
 /**\r
-  Returns the two's complement checksum of all elements in a buffer of \r
+  Returns the two's complement checksum of all elements in a buffer of\r
   32-bit values.\r
 \r
-  This function first calculates the sum of the 32-bit values in the buffer \r
-  specified by Buffer and Length.  The carry bits in the result of addition \r
-  are dropped. Then, the two's complement of the sum is returned.  If Length \r
+  This function first calculates the sum of the 32-bit values in the buffer\r
+  specified by Buffer and Length.  The carry bits in the result of addition\r
+  are dropped. Then, the two's complement of the sum is returned.  If Length\r
   is 0, then 0 is returned.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is not aligned on a 32-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The 2's complement checksum of Buffer.\r
+  @return Checksum    The 2's complement checksum of Buffer.\r
 \r
 **/\r
 UINT32\r
@@ -254,13 +254,13 @@ CalculateCheckSum32 (
 \r
 \r
 /**\r
-  Returns the sum of all elements in a buffer of 64-bit values.  During \r
+  Returns the sum of all elements in a buffer of 64-bit values.  During\r
   calculation, the carry bits are dropped.\r
 \r
-  This function calculates the sum of the 64-bit values in the buffer \r
-  specified by Buffer and Length. The carry bits in result of addition are dropped. \r
-  The 64-bit result is returned.  If Length is 0, then 0 is returned.  \r
-  \r
+  This function calculates the sum of the 64-bit values in the buffer\r
+  specified by Buffer and Length. The carry bits in result of addition are dropped.\r
+  The 64-bit result is returned.  If Length is 0, then 0 is returned.\r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is not aligned on a 64-bit boundary, then ASSERT().\r
@@ -269,7 +269,7 @@ CalculateCheckSum32 (
   @param  Buffer      Pointer to the buffer to carry out the sum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The sum of Buffer with carry bits dropped during additions.\r
+  @return Sum         The sum of Buffer with carry bits dropped during additions.\r
 \r
 **/\r
 UINT64\r
@@ -298,23 +298,23 @@ CalculateSum64 (
 \r
 \r
 /**\r
-  Returns the two's complement checksum of all elements in a buffer of \r
+  Returns the two's complement checksum of all elements in a buffer of\r
   64-bit values.\r
 \r
-  This function first calculates the sum of the 64-bit values in the buffer \r
-  specified by Buffer and Length.  The carry bits in the result of addition \r
-  are dropped. Then, the two's complement of the sum is returned.  If Length \r
+  This function first calculates the sum of the 64-bit values in the buffer\r
+  specified by Buffer and Length.  The carry bits in the result of addition\r
+  are dropped. Then, the two's complement of the sum is returned.  If Length\r
   is 0, then 0 is returned.\r
-  \r
+\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is not aligned on a 64-bit boundary, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param  Buffer      Pointer to the buffer to carry out the checksum operation.\r
   @param  Length      The size, in bytes, of Buffer.\r
 \r
-  @return The 2's complement checksum of Buffer.\r
+  @return Checksum    The 2's complement checksum of Buffer.\r
 \r
 **/\r
 UINT64\r