History

updated CK_STDCERR, STK exception printing, casting

gewang committed 4 years ago

Commit 8a9decf1 parent ab23bb417 files · +4867 −2480Browse files

Showing the changes to src/core/chuck_errmsg.cpp (1 of 17 files). Show all

Unified · Split

src/core/chuck_errmsg.cpp+15−11
@@ -43,9 +43,9 @@ · 42 unmodified lines
4343 #endif
4444
4545 // global
46−int EM_tokPos = 0;
47−int EM_lineNum = 1;
48−int EM_extLineNum = 1;
46+t_CKINT EM_tokPos = 0;
47+t_CKINT EM_lineNum = 1;
48+t_CKINT EM_extLineNum = 1;
4949 t_CKBOOL anyErrors= FALSE;
5050
5151 // local global
@@ -222,10 +222,7 @@ ChuckOutStream::~ChuckOutStream() · 170 unmodified lines
222222 ChuckOutStream& ChuckOutStream::operator<<( const std::string val )
223223 {
224224 m_stream << val;
225− if( val == CK_STDENDL )
226− {
227− this->flush();
228− }
225+ if( m_isErr || (val == CK_STDENDL) ) { this->flush(); }
229226 return *this;
230227 }
231228
@@ -233,13 +230,15 @@ ChuckOutStream& ChuckOutStream::operator<<( const std::string val ) · 1 unmodified line
233230 ChuckOutStream& ChuckOutStream::operator<<( const char * val )
234231 {
235232 m_stream << val;
233+ if( m_isErr || std::string(val) == CK_STDENDL ) { this->flush(); }
236234 return *this;
237235 }
238236
239237
240−ChuckOutStream& ChuckOutStream::operator<<( const double val )
238+ChuckOutStream& ChuckOutStream::operator<<(const double val)
241239 {
242240 m_stream << val;
241+ if( m_isErr ) { this->flush(); }
243242 return *this;
244243 }
245244
@@ -247,6 +246,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const double val ) · 1 unmodified line
247246 ChuckOutStream& ChuckOutStream::operator<<( const float val )
248247 {
249248 m_stream << val;
249+ if (m_isErr) { this->flush(); }
250250 return *this;
251251 }
252252
@@ -254,6 +254,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const float val ) · 1 unmodified line
254254 ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val )
255255 {
256256 m_stream << val;
257+ if (m_isErr) { this->flush(); }
257258 return *this;
258259 }
259260
@@ -261,6 +262,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val ) · 1 unmodified line
261262 ChuckOutStream& ChuckOutStream::operator<<( const long long val )
262263 {
263264 m_stream << val;
265+ if (m_isErr) { this->flush(); }
264266 return *this;
265267 }
266268
@@ -268,6 +270,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long long val ) · 1 unmodified line
268270 ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val )
269271 {
270272 m_stream << val;
273+ if (m_isErr) { this->flush(); }
271274 return *this;
272275 }
273276
@@ -275,6 +278,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val ) · 1 unmodified line
275278 ChuckOutStream& ChuckOutStream::operator<<( const long val )
276279 {
277280 m_stream << val;
281+ if (m_isErr) { this->flush(); }
278282 return *this;
279283 }
280284
@@ -282,6 +286,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long val ) · 1 unmodified line
282286 ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val )
283287 {
284288 m_stream << val;
289+ if (m_isErr) { this->flush(); }
285290 return *this;
286291 }
287292
@@ -289,6 +294,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val ) · 1 unmodified line
289294 ChuckOutStream& ChuckOutStream::operator<<( const int val )
290295 {
291296 m_stream << val;
297+ if (m_isErr) { this->flush(); }
292298 return *this;
293299 }
294300
@@ -296,13 +302,11 @@ ChuckOutStream& ChuckOutStream::operator<<( const int val ) · 1 unmodified line
296302 ChuckOutStream& ChuckOutStream::operator<<( const bool val )
297303 {
298304 m_stream << val;
305+ if (m_isErr) { this->flush(); }
299306 return *this;
300307 }
301308
302309
303−
304−
305−
306310 void ChuckOutStream::set_callback( void (*callback)( const char * ) )
307311 {
308312 m_callback = callback;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t