used the following commands: find . -type f -name "*.h" | xargs sed -i 's/\s*$//g' find . -type f -name "*.cpp" | xargs sed -i 's/\s*$//g'
Showing the changes to src/core/chuck_errmsg.cpp (1 of 90 files). Show all
Unified · Split
| @@ -79,10 +79,10 @@ void ck_fprintf_stdout( const char * format, ... ) · 78 unmodified lines | ||
| 79 | 79 | va_start( args, format ); |
| 80 | 80 | vsnprintf( g_buffer2, g_buffer2_size, format, args ); |
| 81 | 81 | va_end( args ); |
| 82 | − | |
| 82 | + | |
| 83 | 83 | // send the formatted string to the buffer |
| 84 | 84 | g_stdout_stream << g_buffer2; |
| 85 | − | |
| 85 | + | |
| 86 | 86 | // try flushing |
| 87 | 87 | ck_fflush_stdout(); |
| 88 | 88 | } |
| @@ -95,10 +95,10 @@ void ck_fprintf_stderr( const char * format, ... ) · 6 unmodified lines | ||
| 95 | 95 | va_start( args, format ); |
| 96 | 96 | vsnprintf( g_buffer2, g_buffer2_size, format, args ); |
| 97 | 97 | va_end( args ); |
| 98 | − | |
| 98 | + | |
| 99 | 99 | // send the formatted string to the buffer |
| 100 | 100 | g_stderr_stream << g_buffer2; |
| 101 | − | |
| 101 | + | |
| 102 | 102 | // try flushing |
| 103 | 103 | ck_fflush_stderr(); |
| 104 | 104 | } |
| @@ -112,7 +112,7 @@ void ck_fflush_stdout() · 7 unmodified lines | ||
| 112 | 112 | // send to stdout |
| 113 | 113 | fprintf( stdout, "%s", g_stdout_stream.str().c_str() ); |
| 114 | 114 | fflush( stdout ); |
| 115 | − | |
| 115 | + | |
| 116 | 116 | // and clear buffer |
| 117 | 117 | g_stdout_stream.str( std::string() ); |
| 118 | 118 | } |
| @@ -124,7 +124,7 @@ void ck_fflush_stdout() · 5 unmodified lines | ||
| 124 | 124 | { |
| 125 | 125 | // if so, emit to callback |
| 126 | 126 | g_stdout_callback( g_stdout_stream.str().c_str() ); |
| 127 | − | |
| 127 | + | |
| 128 | 128 | // and clear buffer |
| 129 | 129 | g_stdout_stream.str( std::string() ); |
| 130 | 130 | } |
| @@ -140,7 +140,7 @@ void ck_fflush_stderr() · 9 unmodified lines | ||
| 140 | 140 | // send to stderr |
| 141 | 141 | fprintf( stderr, "%s", g_stderr_stream.str().c_str() ); |
| 142 | 142 | fflush( stderr ); |
| 143 | − | |
| 143 | + | |
| 144 | 144 | // and clear buffer |
| 145 | 145 | g_stderr_stream.str( std::string() ); |
| 146 | 146 | } |
| @@ -152,7 +152,7 @@ void ck_fflush_stderr() · 5 unmodified lines | ||
| 152 | 152 | { |
| 153 | 153 | // if so, emit to callback |
| 154 | 154 | g_stderr_callback( g_stderr_stream.str().c_str() ); |
| 155 | − | |
| 155 | + | |
| 156 | 156 | // and clear buffer |
| 157 | 157 | g_stderr_stream.str( std::string() ); |
| 158 | 158 | } |
| @@ -164,10 +164,10 @@ void ck_vfprintf_stdout( const char * format, va_list args ) · 5 unmodified lines | ||
| 164 | 164 | { |
| 165 | 165 | // evaluate the format string |
| 166 | 166 | vsnprintf( g_buffer2, g_buffer2_size, format, args ); |
| 167 | − | |
| 167 | + | |
| 168 | 168 | // send the formatted string to the buffer |
| 169 | 169 | g_stdout_stream << g_buffer2; |
| 170 | − | |
| 170 | + | |
| 171 | 171 | // try flushing |
| 172 | 172 | ck_fflush_stdout(); |
| 173 | 173 | } |
| @@ -177,10 +177,10 @@ void ck_vfprintf_stderr( const char * format, va_list args ) · 3 unmodified lines | ||
| 177 | 177 | { |
| 178 | 178 | // evaluate the format string |
| 179 | 179 | vsnprintf( g_buffer2, g_buffer2_size, format, args ); |
| 180 | − | |
| 180 | + | |
| 181 | 181 | // send the formatted string to the buffer |
| 182 | 182 | g_stderr_stream << g_buffer2; |
| 183 | − | |
| 183 | + | |
| 184 | 184 | // try flushing |
| 185 | 185 | ck_fflush_stderr(); |
| 186 | 186 | } |
| @@ -374,14 +374,14 @@ static IntList linePos=NULL; · 187 unmodified lines | ||
| 374 | 374 | static int lastErrorCat(const char * str) |
| 375 | 375 | { |
| 376 | 376 | assert(g_lasterrorIndex <= LASTERROR_SIZE-1); |
| 377 | − | |
| 377 | + | |
| 378 | 378 | size_t len = strlen(str); |
| 379 | − | |
| 379 | + | |
| 380 | 380 | strncat(g_lasterror, str, LASTERROR_SIZE-g_lasterrorIndex-1); |
| 381 | − | |
| 381 | + | |
| 382 | 382 | size_t appendCount = ck_min(LASTERROR_SIZE-g_lasterrorIndex-1, len); |
| 383 | 383 | g_lasterrorIndex += appendCount; |
| 384 | − | |
| 384 | + | |
| 385 | 385 | return appendCount > 0; |
| 386 | 386 | } |
| 387 | 387 | |
| @@ -430,7 +430,7 @@ void EM_reset_msg() · 42 unmodified lines | ||
| 430 | 430 | g_lasterrorIndex = 0; |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | −// [%s]:line(%d).char(%d): | |
| 433 | +// [%s]:line(%d).char(%d): | |
| 434 | 434 | void EM_error( int pos, const char * message, ... ) |
| 435 | 435 | { |
| 436 | 436 | va_list ap; |
| @@ -438,15 +438,15 @@ void EM_error( int pos, const char * message, ... ) · 1 unmodified line | ||
| 438 | 438 | int num = lineNum; |
| 439 | 439 | |
| 440 | 440 | anyErrors = TRUE; |
| 441 | − while( lines && lines->i >= pos ) | |
| 441 | + while( lines && lines->i >= pos ) | |
| 442 | 442 | { |
| 443 | 443 | lines = lines->rest; |
| 444 | 444 | num--; |
| 445 | 445 | } |
| 446 | − | |
| 446 | + | |
| 447 | 447 | // separate errmsgs with newlines |
| 448 | 448 | if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" ); |
| 449 | − | |
| 449 | + | |
| 450 | 450 | CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 451 | 451 | sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 452 | 452 | lastErrorCat( g_buffer ); |
| @@ -458,7 +458,7 @@ void EM_error( int pos, const char * message, ... ) · 5 unmodified lines | ||
| 458 | 458 | } |
| 459 | 459 | CK_FPRINTF_STDERR( " " ); |
| 460 | 460 | lastErrorCat( " " ); |
| 461 | − | |
| 461 | + | |
| 462 | 462 | va_start(ap, message); |
| 463 | 463 | CK_VFPRINTF_STDERR( message, ap); |
| 464 | 464 | va_end(ap); |
| @@ -466,7 +466,7 @@ void EM_error( int pos, const char * message, ... ) · 1 unmodified line | ||
| 466 | 466 | va_start(ap, message); |
| 467 | 467 | vsprintf( g_buffer, message, ap ); |
| 468 | 468 | va_end(ap); |
| 469 | − | |
| 469 | + | |
| 470 | 470 | CK_FPRINTF_STDERR( "\n"); |
| 471 | 471 | CK_FFLUSH_STDERR(); |
| 472 | 472 | lastErrorCat( g_buffer ); |
| @@ -482,7 +482,7 @@ void EM_error2( int line, const char * message, ... ) · 9 unmodified lines | ||
| 482 | 482 | |
| 483 | 483 | // separate errmsgs with newlines |
| 484 | 484 | if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" ); |
| 485 | − | |
| 485 | + | |
| 486 | 486 | CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 487 | 487 | sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 488 | 488 | lastErrorCat( g_buffer ); |
| @@ -513,12 +513,12 @@ void EM_error2( int line, const char * message, ... ) · 24 unmodified lines | ||
| 513 | 513 | void EM_error2b( int line, const char * message, ... ) |
| 514 | 514 | { |
| 515 | 515 | va_list ap; |
| 516 | − | |
| 516 | + | |
| 517 | 517 | EM_extLineNum = line; |
| 518 | 518 | |
| 519 | 519 | // separate errmsgs with newlines |
| 520 | 520 | if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" ); |
| 521 | − | |
| 521 | + | |
| 522 | 522 | CK_FPRINTF_STDERR( "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 523 | 523 | sprintf( g_buffer, "[%s]:", *fileName ? mini(fileName) : "chuck" ); |
| 524 | 524 | lastErrorCat( g_buffer ); |
| @@ -545,14 +545,14 @@ void EM_error2b( int line, const char * message, ... ) · 20 unmodified lines | ||
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | |
| 548 | −// | |
| 548 | +// | |
| 549 | 549 | void EM_error3( const char * message, ... ) |
| 550 | 550 | { |
| 551 | 551 | va_list ap; |
| 552 | − | |
| 552 | + | |
| 553 | 553 | // separate errmsgs with newlines |
| 554 | 554 | if( g_lasterror[0] != '\0' ) lastErrorCat( "\n" ); |
| 555 | − | |
| 555 | + | |
| 556 | 556 | // g_lasterror[0] = '\0'; |
| 557 | 557 | g_buffer[0] = '\0'; |
| 558 | 558 | |