From 1295e37d4bb4c07f41cfa6ce298344aaf1563c72 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Thu, 6 Apr 2023 13:51:51 -0600 Subject: UnitTestFrameworkPkg: Update to be more C11 compliant by using __func__ __FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout UnitTestFrameworkPkg. Signed-off-by: Rebecca Cran Reviewed-by: Michael D Kinney Reviewed-by: Ard Biesheuvel --- .../UnitTestPersistenceLibSimpleFileSystem.c | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c') diff --git a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c index d7a62145da..b59991683f 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c +++ b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c @@ -61,7 +61,7 @@ GetCacheFileDevicePath ( (VOID **)&LoadedImage ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_WARN, "%a - Failed to locate DevicePath for loaded image. %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_WARN, "%a - Failed to locate DevicePath for loaded image. %r\n", __func__, Status)); return NULL; } @@ -91,7 +91,7 @@ GetCacheFileDevicePath ( // Make sure we didn't get any weird data. // if (DirectorySlashOffset == 0) { - DEBUG ((DEBUG_ERROR, "%a - Weird 0-length string when processing app path.\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - Weird 0-length string when processing app path.\n", __func__)); goto Exit; } @@ -112,7 +112,7 @@ GetCacheFileDevicePath ( // Let's check and make sure that's right. // if (AppPath[DirectorySlashOffset] != L'\\') { - DEBUG ((DEBUG_ERROR, "%a - Could not find a single directory separator in app path.\n", __FUNCTION__)); + DEBUG ((DEBUG_ERROR, "%a - Could not find a single directory separator in app path.\n", __func__)); goto Exit; } @@ -202,7 +202,7 @@ DoesCacheExist ( FreePool (FileDevicePath); } - DEBUG ((DEBUG_VERBOSE, "%a - Returning %d\n", __FUNCTION__, !EFI_ERROR (Status))); + DEBUG ((DEBUG_VERBOSE, "%a - Returning %d\n", __func__, !EFI_ERROR (Status))); return (!EFI_ERROR (Status)); } @@ -263,7 +263,7 @@ SaveUnitTestCache ( // Status = ShellDeleteFile (&FileHandle); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a failed to delete file %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a failed to delete file %r\n", __func__, Status)); } } @@ -277,7 +277,7 @@ SaveUnitTestCache ( 0 ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __func__, Status)); goto Exit; } @@ -285,7 +285,7 @@ SaveUnitTestCache ( // Write the data to the file. // WriteCount = SaveStateSize; - DEBUG ((DEBUG_INFO, "%a - Writing %d bytes to file...\n", __FUNCTION__, WriteCount)); + DEBUG ((DEBUG_INFO, "%a - Writing %d bytes to file...\n", __func__, WriteCount)); Status = ShellWriteFile ( FileHandle, &WriteCount, @@ -293,9 +293,9 @@ SaveUnitTestCache ( ); if (EFI_ERROR (Status) || (WriteCount != SaveStateSize)) { - DEBUG ((DEBUG_ERROR, "%a - Writing to file failed! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Writing to file failed! %r\n", __func__, Status)); } else { - DEBUG ((DEBUG_INFO, "%a - SUCCESS!\n", __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a - SUCCESS!\n", __func__)); } // @@ -368,7 +368,7 @@ LoadUnitTestCache ( 0 ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Opening file for writing failed! %r\n", __func__, Status)); goto Exit; } else { IsFileOpened = TRUE; @@ -379,7 +379,7 @@ LoadUnitTestCache ( // Status = ShellGetFileSize (FileHandle, &LargeFileSize); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Failed to determine file size! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to determine file size! %r\n", __func__, Status)); goto Exit; } @@ -390,7 +390,7 @@ LoadUnitTestCache ( *SaveStateSize = FileSize; Buffer = AllocatePool (FileSize); if (Buffer == NULL) { - DEBUG ((DEBUG_ERROR, "%a - Failed to allocate a pool to hold the file contents! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to allocate a pool to hold the file contents! %r\n", __func__, Status)); Status = EFI_OUT_OF_RESOURCES; goto Exit; } @@ -400,7 +400,7 @@ LoadUnitTestCache ( // Status = ShellReadFile (FileHandle, &FileSize, Buffer); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a - Failed to read the file contents! %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a - Failed to read the file contents! %r\n", __func__, Status)); } Exit: -- cgit v1.2.3