From e249f1727246c6ff8f9e6579a564afe5c723716f Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Sat, 9 May 2020 08:03:25 -0700 Subject: [PATCH] Misc Clean Up (#373) --- src/bin/winkernel/driver.c | 2 +- src/platform/cert_capi.c | 16 ++++++++-------- src/platform/toeplitz.c | 8 ++++---- src/test/bin/quic_gtest.h | 18 +++++++++--------- src/test/bin/winkernel/control.cpp | 20 ++++++++++---------- src/test/bin/winkernel/driver.cpp | 6 +++--- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/bin/winkernel/driver.c b/src/bin/winkernel/driver.c index 964cd36e6..3bef67c1b 100644 --- a/src/bin/winkernel/driver.c +++ b/src/bin/winkernel/driver.c @@ -60,7 +60,7 @@ Parameters Description: Return Value: A success status as determined by NT_SUCCESS macro, if successful. - + --*/ { NTSTATUS Status; diff --git a/src/platform/cert_capi.c b/src/platform/cert_capi.c index 8cd002d78..cd0d99985 100644 --- a/src/platform/cert_capi.c +++ b/src/platform/cert_capi.c @@ -882,10 +882,10 @@ QuicCertValidateChain( int ServerNameLength = MultiByteToWideChar(CP_UTF8, 0, Host, -1, NULL, 0); if (ServerNameLength == 0) { QuicTraceEvent( - LibraryErrorStatus, - "[ lib] ERROR, %u, %s.", - GetLastError(), - "MultiByteToWideChar(1) failed"); + LibraryErrorStatus, + "[ lib] ERROR, %u, %s.", + GetLastError(), + "MultiByteToWideChar(1) failed"); goto Exit; } @@ -902,10 +902,10 @@ QuicCertValidateChain( ServerNameLength = MultiByteToWideChar(CP_UTF8, 0, Host, -1, ServerName, ServerNameLength); if (ServerNameLength == 0) { QuicTraceEvent( - LibraryErrorStatus, - "[ lib] ERROR, %u, %s.", - GetLastError(), - "MultiByteToWideChar(2) failed"); + LibraryErrorStatus, + "[ lib] ERROR, %u, %s.", + GetLastError(), + "MultiByteToWideChar(2) failed"); goto Exit; } } diff --git a/src/platform/toeplitz.c b/src/platform/toeplitz.c index f8bb4639f..9fd26b8a5 100644 --- a/src/platform/toeplitz.c +++ b/src/platform/toeplitz.c @@ -36,8 +36,8 @@ Notes: We have speeded the implementation by processing the hash input four bits at a time. This requires us to maintain a lookup table of 16 32-bit entries - for each nibble of the hash input. - + for each nibble of the hash input. + This implementation assumes that the output of the hash is always 32-bit. It also assumes that the caller will pass in a array of bytes to hash, and the number of bits in the hash input will always be a multiple of 8 -- that @@ -67,7 +67,7 @@ QuicToeplitzHashInitialize( // directly be looked up to find out what value needs to be XORed // into the result based on the value of the nibble. Therefore, a // 4 byte hash input will have 8 nibbles, and each of the nibbles - // has a separate lookup table. This lookup table is looked up + // has a separate lookup table. This lookup table is looked up // based on the nibble value, the contents are XORed into the result // and we then move to the next nibble of the input, and the next // table. @@ -77,7 +77,7 @@ QuicToeplitzHashInitialize( // Initialize the Toeplitz->LookupTables. // for (uint32_t i = 0; i < QUIC_TOEPLITZ_LOOKUP_TABLE_COUNT; i++) { - // + // // First construct the 32-bit word that is obtained after // shifting the key left by i*4 bits. That goes into Word1 // diff --git a/src/test/bin/quic_gtest.h b/src/test/bin/quic_gtest.h index 9ff472e90..9468f9430 100644 --- a/src/test/bin/quic_gtest.h +++ b/src/test/bin/quic_gtest.h @@ -530,7 +530,7 @@ public: Error = GetLastError(); QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "GetFullPathName failed"); return false; @@ -544,7 +544,7 @@ public: if (ServiceHandle == nullptr) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", GetLastError(), "OpenService failed"); char DriverFilePath[MAX_PATH]; @@ -558,7 +558,7 @@ public: Error = GetLastError(); QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "GetFullPathName failed"); return false; @@ -585,7 +585,7 @@ public: } QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "CreateService failed"); return false; @@ -607,7 +607,7 @@ public: if (Error != ERROR_SERVICE_ALREADY_RUNNING) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "StartService failed"); return false; @@ -651,7 +651,7 @@ public: Error = GetLastError(); QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "CreateFile failed"); return false; @@ -686,7 +686,7 @@ public: Error = GetLastError(); QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "CreateEvent failed"); return false; @@ -708,7 +708,7 @@ public: CloseHandle(Overlapped.hEvent); QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "DeviceIoControl failed"); return false; @@ -728,7 +728,7 @@ public: } QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Error, "GetOverlappedResultEx failed"); } else { diff --git a/src/test/bin/winkernel/control.cpp b/src/test/bin/winkernel/control.cpp index 3cfd75f32..ca4515f7f 100644 --- a/src/test/bin/winkernel/control.cpp +++ b/src/test/bin/winkernel/control.cpp @@ -77,7 +77,7 @@ QuicTestCtlInitialize( if (QUIC_FAILED(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "MsQuicOpen"); goto Error; @@ -103,7 +103,7 @@ QuicTestCtlInitialize( if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfDeviceInitAssignName failed"); goto Error; @@ -131,7 +131,7 @@ QuicTestCtlInitialize( if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfDeviceCreate failed"); goto Error; @@ -146,7 +146,7 @@ QuicTestCtlInitialize( if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfDeviceCreateSymbolicLink failed"); goto Error; @@ -168,7 +168,7 @@ QuicTestCtlInitialize( if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfIoQueueCreate failed"); goto Error; @@ -264,7 +264,7 @@ QuicTestCtlEvtFileCreate( if (QUIC_FAILED(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "RegistrationOpen"); break; @@ -418,7 +418,7 @@ QuicTestCtlSetSecurityConfig( if (QUIC_FAILED(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "SecConfigCreate"); goto Error; @@ -625,7 +625,7 @@ QuicTestCtlEvtIoDeviceControl( Status = STATUS_NOT_IMPLEMENTED; QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", FunctionCode, "Invalid FunctionCode"); goto Error; @@ -635,7 +635,7 @@ QuicTestCtlEvtIoDeviceControl( Status = STATUS_INSUFFICIENT_RESOURCES; QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", FunctionCode, "Invalid buffer size for FunctionCode"); goto Error; @@ -652,7 +652,7 @@ QuicTestCtlEvtIoDeviceControl( if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfRequestRetrieveInputBuffer failed"); goto Error; diff --git a/src/test/bin/winkernel/driver.cpp b/src/test/bin/winkernel/driver.cpp index 8daf5339c..896969a69 100644 --- a/src/test/bin/winkernel/driver.cpp +++ b/src/test/bin/winkernel/driver.cpp @@ -104,7 +104,7 @@ Return Value: if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "QuicPlatformInitialize failed"); goto Error; @@ -129,7 +129,7 @@ Return Value: if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "WdfDriverCreate failed"); goto Error; @@ -142,7 +142,7 @@ Return Value: if (!NT_SUCCESS(Status)) { QuicTraceEvent( LibraryErrorStatus, - "[ lib] ERROR, %d, %s.", + "[ lib] ERROR, %u, %s.", Status, "QuicTestCtlInitialize failed"); goto Error;