Mercurial > flash_v2
diff packages/infra/current/src/buffer.cxx @ 2:443894e2e912 ecos-v1_2_1-release
Block commit of eCos version 1.2.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 12:24:34 +0000 |
| parents | 3111d98ba7b3 |
| children | c38311975d4f |
line wrap: on
line diff
--- a/packages/infra/current/src/buffer.cxx +++ b/packages/infra/current/src/buffer.cxx @@ -1,6 +1,6 @@ //========================================================================== // -// buffer.cxx +// buffer.cxx // // Memory buffered trace and assert functions // @@ -22,18 +22,18 @@ // September 30, 1998. // // The Initial Developer of the Original Code is Cygnus. Portions created -// by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. +// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. // ------------------------------------------- // //####COPYRIGHTEND#### //========================================================================== //#####DESCRIPTIONBEGIN#### // -// Author(s): nickg -// Contributors: nickg -// Date: 1998-10-16 -// Purpose: Buffered Trace and assert functions -// Description: The functions in this file are a buffered implementation +// Author(s): nickg +// Contributors: nickg +// Date: 1998-10-16 +// Purpose: Buffered Trace and assert functions +// Description: The functions in this file are a buffered implementation // of the standard trace and assert functions. These store // trace messages in a memory buffer and emit them when an // assert is hit, or when requested to. @@ -67,15 +67,15 @@ // Local Configuration: hack me! // these are generally: -// if 0, feature is disabled -// if 1, feature is enabled, printing is default width -// if >1, field is padded up to that width if necessary -// (not truncated ever) +// if 0, feature is disabled +// if 1, feature is enabled, printing is default width +// if >1, field is padded up to that width if necessary +// (not truncated ever) -#define CYG_FILENAME 20 -#define CYG_THREADID 1 -#define CYG_LINENUM 4 -#define CYG_FUNCNAME 100 +#define CYG_FILENAME 20 +#define CYG_THREADID 1 +#define CYG_LINENUM 4 +#define CYG_FUNCNAME 100 #define CYG_DIAG_PRINTF 1 #define CYG_FUNC_INDENT 2 @@ -174,20 +174,21 @@ write_whattracepost( cyg_uint32 what ) // ------------------------------------------------------------------------- -static char *trim_file(char *file) +static const char *trim_file(const char *file) { #if CYG_FILENAME if ( NULL == file ) file = "<nofile>"; #if 1 == CYG_FILENAME - char *f = file; + const char *f = file; while( *f ) f++; while( *f != '/' && f != file ) f--; return f==file?f:(f+1); #else static char fbuf2[100]; - char *f = file, *g = fbuf2; + const char *f = file; + char *g = fbuf2; while( *f ) f++; while( *f != '/' && f != file ) f--; if ( f > file ) f++; @@ -201,7 +202,7 @@ static char *trim_file(char *file) #endif } -static char *trim_func(char *func) +static const char *trim_func(const char *func) { #if CYG_FUNCNAME static char fbuf[CYG_FBUF_SIZE]; @@ -216,8 +217,7 @@ static char *trim_func(char *func) fbuf[i++] = '('; fbuf[i++] = ')'; fbuf[i ] = 0; - while( i > 0 && fbuf[i] != ' ' ) i--; - if( i > 0 ) i++; + i=0; #if 1 == CYG_FUNCNAME return &fbuf[i]; #else @@ -265,6 +265,7 @@ static cyg_uint32 get_tid(void) # define get_tid() (0xFFFF) #endif +#ifdef CYGDBG_USE_ASSERTS static void write_thread_id() { #if CYG_THREADID @@ -275,6 +276,7 @@ static void write_thread_id() diag_write_char('>'); #endif } +#endif // ------------------------------------------------------------------------- // Trace functions: @@ -699,8 +701,8 @@ cyg_trace_dump(void) #ifdef CYGDBG_USE_ASSERTS externC void -cyg_assert_fail( char *psz_func, char *psz_file, cyg_uint32 linenum, - char *psz_msg ) +cyg_assert_fail( const char *psz_func, const char *psz_file, + cyg_uint32 linenum, const char *psz_msg ) { cyg_uint32 old_ints;
