]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PerformancePkg/Dp_App/DpTrace.c
PerformancePkg/Dp_App: rebase to ARRAY_SIZE()
[mirror_edk2.git] / PerformancePkg / Dp_App / DpTrace.c
index 256f7462838c8b7dbae26b13890372089961a3d1..6a62bba7efe0236bd0037ac34bb81f61bc12df70 100644 (file)
@@ -220,8 +220,8 @@ DumpAllTrace(
       ++Count;    // Count the number of records printed\r
 \r
       // If Handle is non-zero, see if we can determine a name for the driver\r
-      AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0])); // Use Module by default\r
-      AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
+      AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString)); // Use Module by default\r
+      AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));\r
       if (Measurement.Handle != NULL) {\r
         // See if the Handle is in the HandleBuffer\r
         for (TIndex = 0; TIndex < HandleCount; TIndex++) {\r
@@ -594,7 +594,7 @@ ProcessHandles(
         continue;\r
       }\r
       mGaugeString[0] = 0;    // Empty driver name by default\r
-      AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
+      AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));\r
       // See if the Handle is in the HandleBuffer\r
       for (Index = 0; Index < HandleCount; Index++) {\r
         if (Measurement.Handle == HandleBuffer[Index]) {\r
@@ -777,8 +777,8 @@ ProcessGlobal(
                           &Measurement.EndTimeStamp,\r
                           &Measurement.Identifier)) != 0)\r
   {\r
-    AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, sizeof (mGaugeString) / sizeof (mGaugeString[0]));\r
-    AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, sizeof (mUnicodeToken) / sizeof (mUnicodeToken[0]));\r
+    AsciiStrToUnicodeStrS (Measurement.Module, mGaugeString, ARRAY_SIZE (mGaugeString));\r
+    AsciiStrToUnicodeStrS (Measurement.Token, mUnicodeToken, ARRAY_SIZE (mUnicodeToken));\r
     mGaugeString[25] = 0;\r
     mUnicodeToken[31] = 0;\r
     if ( ! ( IsPhase( &Measurement)  ||\r