Skip to content

Commit 15883dd

Browse files
committed
remove unneeded use of std::endl
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
1 parent fdfeae3 commit 15883dd

3 files changed

Lines changed: 20 additions & 15 deletions

File tree

src/libutils/oglapphelpers/vulkanapp.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
#include <iostream>
77
#include <sstream>
8+
#include <string>
89
#include <stdexcept>
910
#include <cstring>
10-
#include <fstream>
11+
#include <vector>
12+
#include <memory>
13+
14+
#include <OpenColorIO/OpenColorIO.h>
1115

1216
#include <glslang/Public/ShaderLang.h>
1317
#include <glslang/Public/ResourceLimits.h>
@@ -119,8 +123,8 @@ void VulkanApp::initVulkan()
119123
// Print GPU information for diagnostics
120124
VkPhysicalDeviceProperties deviceProperties;
121125
vkGetPhysicalDeviceProperties(m_physicalDevice, &deviceProperties);
122-
std::cout << "Vulkan GPU: " << deviceProperties.deviceName << std::endl;
123-
std::cout << " Device Type: ";
126+
std::cout << "Vulkan GPU: " << deviceProperties.deviceName << "\n"
127+
" Device Type: ";
124128
switch (deviceProperties.deviceType)
125129
{
126130
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: std::cout << "Discrete GPU"; break;
@@ -131,10 +135,9 @@ void VulkanApp::initVulkan()
131135
case VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM:
132136
default: std::cout << "Other"; break;
133137
}
134-
std::cout << std::endl;
135-
std::cout << " API Version: " << VK_VERSION_MAJOR(deviceProperties.apiVersion) << "."
138+
std::cout << "\n API Version: " << VK_VERSION_MAJOR(deviceProperties.apiVersion) << "."
136139
<< VK_VERSION_MINOR(deviceProperties.apiVersion) << "."
137-
<< VK_VERSION_PATCH(deviceProperties.apiVersion) << std::endl;
140+
<< VK_VERSION_PATCH(deviceProperties.apiVersion) << "\n";
138141

139142
// Create logical device
140143
float queuePriority = 1.0f;
@@ -401,7 +404,7 @@ void VulkanApp::setShader(GpuShaderDescRcPtr & shaderDesc)
401404

402405
if (m_printShader)
403406
{
404-
std::cout << "Vulkan Compute Shader:\n" << m_vulkanBuilder->getShaderSource() << std::endl;
407+
std::cout << "Vulkan Compute Shader:\n" << m_vulkanBuilder->getShaderSource() << "\n";
405408
}
406409

407410
createComputePipeline();
@@ -577,19 +580,19 @@ void VulkanApp::printVulkanInfo() const noexcept
577580
{
578581
if (m_physicalDevice == VK_NULL_HANDLE)
579582
{
580-
std::cout << "Vulkan not initialized" << std::endl;
583+
std::cout << "Vulkan not initialized\n";
581584
return;
582585
}
583586

584587
VkPhysicalDeviceProperties properties;
585588
vkGetPhysicalDeviceProperties(m_physicalDevice, &properties);
586589

587-
std::cout << "Vulkan Device: " << properties.deviceName << std::endl;
590+
std::cout << "Vulkan Device: " << properties.deviceName << "\n";
588591
std::cout << "Vulkan API Version: "
589592
<< VK_VERSION_MAJOR(properties.apiVersion) << "."
590593
<< VK_VERSION_MINOR(properties.apiVersion) << "."
591-
<< VK_VERSION_PATCH(properties.apiVersion) << std::endl;
592-
std::cout << "Driver Version: " << properties.driverVersion << std::endl;
594+
<< VK_VERSION_PATCH(properties.apiVersion) << "\n";
595+
std::cout << "Driver Version: " << properties.driverVersion << "\n";
593596
}
594597

595598
VulkanAppRcPtr VulkanApp::CreateVulkanApp(int bufWidth, int bufHeight)
@@ -940,7 +943,7 @@ void VulkanBuilder::createUniformBuffer(GpuShaderDescRcPtr & shaderDesc)
940943
}
941944
else
942945
{
943-
std::cerr << "Warning: Unknown uniform type for '" << name << "'" << std::endl;
946+
std::cerr << "Warning: Unknown uniform type for '" << name << "'\n";
944947
continue;
945948
}
946949

src/libutils/oglapphelpers/vulkanapp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <vector>
1111
#include <string>
1212
#include <memory>
13+
#include <cstdint>
14+
#include <cstddef>
1315

1416
#include <vulkan/vulkan.h>
1517

tests/gpu/GPUUnitTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ int main(int argc, const char ** argv)
710710
vulkanApp = OCIO::VulkanApp::CreateVulkanApp(g_winWidth, g_winHeight);
711711
vulkanApp->printVulkanInfo();
712712
#else
713-
std::cerr << std::endl << "'GPU tests - Vulkan' is not supported (OCIO_VULKAN_ENABLED not defined)" << std::endl;
713+
std::cerr << "\n'GPU tests - Vulkan' is not supported (OCIO_VULKAN_ENABLED not defined)\n";
714714
return 1;
715715
#endif
716716
}
@@ -726,7 +726,7 @@ int main(int argc, const char ** argv)
726726
}
727727
catch (const std::exception & e)
728728
{
729-
std::cerr << std::endl << e.what() << std::endl;
729+
std::cerr << "\n" << e.what() << "\n";
730730
return 1;
731731
}
732732

@@ -894,7 +894,7 @@ int main(int argc, const char ** argv)
894894
catch(const std::exception & ex)
895895
{
896896
++failures;
897-
std::cerr << "FAILED - std::exception: " << ex.what() << std::endl;
897+
std::cerr << "FAILED - std::exception: " << ex.what() << "\n";
898898
}
899899
catch(...)
900900
{

0 commit comments

Comments
 (0)