Showing the changes to src/core/chuck_errmsg.cpp (1 of 17 files). Show all
Unified · Split
| @@ -43,9 +43,9 @@ · 42 unmodified lines | ||
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | 45 | // 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; | |
| 49 | 49 | t_CKBOOL anyErrors= FALSE; |
| 50 | 50 | |
| 51 | 51 | // local global |
| @@ -222,10 +222,7 @@ ChuckOutStream::~ChuckOutStream() · 170 unmodified lines | ||
| 222 | 222 | ChuckOutStream& ChuckOutStream::operator<<( const std::string val ) |
| 223 | 223 | { |
| 224 | 224 | m_stream << val; |
| 225 | − if( val == CK_STDENDL ) | |
| 226 | − { | |
| 227 | − this->flush(); | |
| 228 | − } | |
| 225 | + if( m_isErr || (val == CK_STDENDL) ) { this->flush(); } | |
| 229 | 226 | return *this; |
| 230 | 227 | } |
| 231 | 228 | |
| @@ -233,13 +230,15 @@ ChuckOutStream& ChuckOutStream::operator<<( const std::string val ) · 1 unmodified line | ||
| 233 | 230 | ChuckOutStream& ChuckOutStream::operator<<( const char * val ) |
| 234 | 231 | { |
| 235 | 232 | m_stream << val; |
| 233 | + if( m_isErr || std::string(val) == CK_STDENDL ) { this->flush(); } | |
| 236 | 234 | return *this; |
| 237 | 235 | } |
| 238 | 236 | |
| 239 | 237 | |
| 240 | −ChuckOutStream& ChuckOutStream::operator<<( const double val ) | |
| 238 | +ChuckOutStream& ChuckOutStream::operator<<(const double val) | |
| 241 | 239 | { |
| 242 | 240 | m_stream << val; |
| 241 | + if( m_isErr ) { this->flush(); } | |
| 243 | 242 | return *this; |
| 244 | 243 | } |
| 245 | 244 | |
| @@ -247,6 +246,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const double val ) · 1 unmodified line | ||
| 247 | 246 | ChuckOutStream& ChuckOutStream::operator<<( const float val ) |
| 248 | 247 | { |
| 249 | 248 | m_stream << val; |
| 249 | + if (m_isErr) { this->flush(); } | |
| 250 | 250 | return *this; |
| 251 | 251 | } |
| 252 | 252 | |
| @@ -254,6 +254,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const float val ) · 1 unmodified line | ||
| 254 | 254 | ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val ) |
| 255 | 255 | { |
| 256 | 256 | m_stream << val; |
| 257 | + if (m_isErr) { this->flush(); } | |
| 257 | 258 | return *this; |
| 258 | 259 | } |
| 259 | 260 | |
| @@ -261,6 +262,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long long val ) · 1 unmodified line | ||
| 261 | 262 | ChuckOutStream& ChuckOutStream::operator<<( const long long val ) |
| 262 | 263 | { |
| 263 | 264 | m_stream << val; |
| 265 | + if (m_isErr) { this->flush(); } | |
| 264 | 266 | return *this; |
| 265 | 267 | } |
| 266 | 268 | |
| @@ -268,6 +270,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long long val ) · 1 unmodified line | ||
| 268 | 270 | ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val ) |
| 269 | 271 | { |
| 270 | 272 | m_stream << val; |
| 273 | + if (m_isErr) { this->flush(); } | |
| 271 | 274 | return *this; |
| 272 | 275 | } |
| 273 | 276 | |
| @@ -275,6 +278,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned long val ) · 1 unmodified line | ||
| 275 | 278 | ChuckOutStream& ChuckOutStream::operator<<( const long val ) |
| 276 | 279 | { |
| 277 | 280 | m_stream << val; |
| 281 | + if (m_isErr) { this->flush(); } | |
| 278 | 282 | return *this; |
| 279 | 283 | } |
| 280 | 284 | |
| @@ -282,6 +286,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const long val ) · 1 unmodified line | ||
| 282 | 286 | ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val ) |
| 283 | 287 | { |
| 284 | 288 | m_stream << val; |
| 289 | + if (m_isErr) { this->flush(); } | |
| 285 | 290 | return *this; |
| 286 | 291 | } |
| 287 | 292 | |
| @@ -289,6 +294,7 @@ ChuckOutStream& ChuckOutStream::operator<<( const unsigned int val ) · 1 unmodified line | ||
| 289 | 294 | ChuckOutStream& ChuckOutStream::operator<<( const int val ) |
| 290 | 295 | { |
| 291 | 296 | m_stream << val; |
| 297 | + if (m_isErr) { this->flush(); } | |
| 292 | 298 | return *this; |
| 293 | 299 | } |
| 294 | 300 | |
| @@ -296,13 +302,11 @@ ChuckOutStream& ChuckOutStream::operator<<( const int val ) · 1 unmodified line | ||
| 296 | 302 | ChuckOutStream& ChuckOutStream::operator<<( const bool val ) |
| 297 | 303 | { |
| 298 | 304 | m_stream << val; |
| 305 | + if (m_isErr) { this->flush(); } | |
| 299 | 306 | return *this; |
| 300 | 307 | } |
| 301 | 308 | |
| 302 | 309 | |
| 303 | − | |
| 304 | − | |
| 305 | − | |
| 306 | 310 | void ChuckOutStream::set_callback( void (*callback)( const char * ) ) |
| 307 | 311 | { |
| 308 | 312 | m_callback = callback; |