Skip to content

Commit 040eed5

Browse files
committed
More std::endl removal
Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com>
1 parent 0362a9d commit 040eed5

File tree

3 files changed

+33
-37
lines changed

3 files changed

+33
-37
lines changed

src/apps/ociolutimage/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ int main(int argc, const char* argv[])
166166

167167
if (ap.parse(argc, argv) < 0)
168168
{
169-
std::cout << ap.geterror() << std::endl;
169+
std::cout << ap.geterror() << "\n";
170170
ap.usage();
171171
std::cout << "\n";
172172
return 1;
@@ -192,7 +192,7 @@ int main(int argc, const char* argv[])
192192
}
193193
catch (const std::exception & e)
194194
{
195-
std::cerr << "Error generating image: " << e.what() << std::endl;
195+
std::cerr << "Error generating image: " << e.what() << "\n";
196196
exit(1);
197197
}
198198
catch (...)
@@ -212,7 +212,7 @@ int main(int argc, const char* argv[])
212212
}
213213
catch (const std::exception & e)
214214
{
215-
std::cerr << "Error extracting LUT: " << e.what() << std::endl;
215+
std::cerr << "Error extracting LUT: " << e.what() << "\n";
216216
exit(1);
217217
}
218218
catch (...)

src/apps/ociomakeclf/main.cpp

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ void CreateOutputLutFile(const std::string & outLutFilepath, OCIO::ConstGroupTra
7575
std::ostringstream oss;
7676
oss << "Could not open the file '"
7777
<< outLutFilepath
78-
<< "'."
79-
<< std::endl;
78+
<< "'.\n";
8079
throw OCIO::Exception(oss.str().c_str());
8180
}
8281
}
@@ -104,7 +103,7 @@ int main(int argc, const char ** argv)
104103

105104
if (ap.parse(argc, argv) < 0)
106105
{
107-
std::cerr << std::endl << ap.geterror() << std::endl << std::endl;
106+
std::cerr << "\n" << ap.geterror() << "\n\n";
108107
ap.usage();
109108
return 1;
110109
}
@@ -130,17 +129,17 @@ int main(int argc, const char ** argv)
130129
if (StringUtils::EndsWith(cscName, BuiltinSuffix))
131130
{
132131
cscName.resize(cscName.size() - strlen(BuiltinSuffix));
133-
std::cout << std::endl << "\t" << cscName;
132+
std::cout << "\n\t" << cscName;
134133
}
135134
}
136-
std::cout << std::endl << std::endl;
135+
std::cout << "\n\n";
137136

138137
return 0;
139138
}
140139

141140
if (args.size() != 2)
142141
{
143-
std::cerr << "ERROR: Expecting 2 arguments, found " << args.size() << "." << std::endl;
142+
std::cerr << "ERROR: Expecting 2 arguments, found " << args.size() << ".\n";
144143
ap.usage();
145144
return 1;
146145
}
@@ -172,15 +171,14 @@ int main(int argc, const char ** argv)
172171
{
173172
std::cerr << "ERROR: The LUT color space name '"
174173
<< originalCSC
175-
<< "' is not supported."
176-
<< std::endl;
174+
<< "' is not supported.\n";
177175
return 1;
178176
}
179177
}
180178

181179
if (outLutFilepath.empty())
182180
{
183-
std::cerr << "ERROR: The output file path is missing." << std::endl;
181+
std::cerr << "ERROR: The output file path is missing.\n";
184182
return 1;
185183
}
186184
else
@@ -190,22 +188,21 @@ int main(int argc, const char ** argv)
190188
{
191189
std::cerr << "ERROR: The output LUT file path '"
192190
<< outLutFilepath
193-
<< "' must have a .clf extension."
194-
<< std::endl;
191+
<< "' must have a .clf extension.\n";
195192
return 1;
196193
}
197194
}
198195

199196
if (verbose)
200197
{
201-
std::cout << "OCIO Version: " << OCIO::GetVersion() << std::endl;
198+
std::cout << "OCIO Version: " << OCIO::GetVersion() << "\n";
202199
}
203200

204201
try
205202
{
206203
if (verbose)
207204
{
208-
std::cout << "Building the transformation." << std::endl;
205+
std::cout << "Building the transformation.\n";
209206
}
210207

211208
OCIO::GroupTransformRcPtr grp = OCIO::GroupTransform::Create();
@@ -261,7 +258,7 @@ int main(int argc, const char ** argv)
261258

262259
if (verbose && !measure)
263260
{
264-
std::cout << Msg << "." << std::endl;
261+
std::cout << Msg << ".\n";
265262
}
266263

267264
if (measure)
@@ -280,17 +277,17 @@ int main(int argc, const char ** argv)
280277
}
281278
catch (OCIO::Exception & ex)
282279
{
283-
std::cerr << "OCIO ERROR: " << ex.what() << std::endl;
280+
std::cerr << "OCIO ERROR: " << ex.what() << "\n";
284281
return 1;
285282
}
286283
catch (std::exception & ex)
287284
{
288-
std::cerr << "ERROR: " << ex.what() << std::endl;
285+
std::cerr << "ERROR: " << ex.what() << "\n";
289286
return 1;
290287
}
291288
catch (...)
292289
{
293-
std::cerr << "ERROR: Unknown error encountered." << std::endl;
290+
std::cerr << "ERROR: Unknown error encountered.\n";
294291
return 1;
295292
}
296293

src/apps/ociomergeconfigs/main.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ int main(int argc, const char **argv)
107107

108108
if (ap.parse(argc, argv) < 0)
109109
{
110-
std::cerr << ap.geterror() << std::endl;
110+
std::cerr << ap.geterror() << "\n";
111111
ap.usage();
112112
exit(1);
113113
}
114114
else if (args.size() != 1)
115115
{
116-
std::cerr << "ERROR: Expecting 1 arguments, found " << args.size() << "." << std::endl;
116+
std::cerr << "ERROR: Expecting 1 arguments, found " << args.size() << ".\n";
117117
ap.usage();
118118
exit(1);
119119
}
@@ -134,7 +134,7 @@ int main(int argc, const char **argv)
134134
}
135135
catch (OCIO::Exception & e)
136136
{
137-
std::cout << e.what() << std::endl;
137+
std::cout << e.what() << "\n";
138138
exit(1);
139139
}
140140

@@ -150,44 +150,43 @@ int main(int argc, const char **argv)
150150
}
151151
catch (OCIO::Exception & exception)
152152
{
153-
std::cout << exception.what() << std::endl;
153+
std::cout << exception.what() << "\n";
154154
exit(1);
155155
}
156156
}
157157

158158
if (displayParams)
159159
{
160-
std::cout << "********************" << std::endl;
161-
std::cout << "Merger options" << std::endl;
162-
std::cout << "********************" << std::endl;
160+
std::cout << "********************\n"
161+
"Merger options\n"
162+
"********************\n";
163163
std::ostringstream os;
164164
newMerger->serialize(os);
165-
std::cout << os.str() << std::endl;
166-
std::cout << std::endl;
165+
std::cout << os.str() << "\n\n";
167166
}
168167

169168
// "Show-all" option take priority over the "show" option.
170169
if (displayAllConfig)
171170
{
172171
for (int i = 0; i < merger->getNumConfigMergingParameters(); i++)
173172
{
174-
std::cout << "*********************" << std::endl;
175-
std::cout << "Merged Config " << i << std::endl;
176-
std::cout << "*********************" << std::endl;
173+
std::cout << "*********************\n"
174+
"Merged Config " << i << "\n"
175+
"*********************\n";
177176
std::ostringstream os;
178177
newMerger->getMergedConfig(i)->serialize(os);
179-
std::cout << os.str() << std::endl;
178+
std::cout << os.str() << "\n";
180179
}
181180
}
182181

183182
if (displayConfig && !displayAllConfig)
184183
{
185-
std::cout << "********************" << std::endl;
186-
std::cout << "Last Merged Config" << std::endl;
187-
std::cout << "********************" << std::endl;
184+
std::cout << "********************\n"
185+
"Last Merged Config\n"
186+
"********************\n";
188187
std::ostringstream os;
189188
newMerger->getMergedConfig()->serialize(os);
190-
std::cout << os.str() << std::endl;
189+
std::cout << os.str() << "\n";
191190
}
192191

193192
if (!outputFile.empty())

0 commit comments

Comments
 (0)