# HG changeset patch # User jlarmour # Date 1042863506 0 # Node ID b43ec5f18a9798953bc8725a0b929e9df7217ec5 # Parent 7b8fa5a6b0b3e44b287c7c3c792513f999a5d162 * include/cyg_ass.h (CYG_CHECK_FUNC_PTRC): Define with const pointer arguments. (CYG_CHECK_DATA_PTRC): Ditto. (CYG_CHECK_FUNC_PTR): Ditto. (CYG_CHECK_DATA_PTR): Ditto. * src/null.cxx: Define cyg_check_data/func_ptr() with const args. * src/buffer.cxx: Ditto. * src/fancy.cxx: Ditto. * src/simple.cxx: Ditto. diff --git a/packages/infra/current/ChangeLog b/packages/infra/current/ChangeLog --- a/packages/infra/current/ChangeLog +++ b/packages/infra/current/ChangeLog @@ -1,3 +1,15 @@ +2003-01-18 Jonathan Larmour + + * include/cyg_ass.h (CYG_CHECK_FUNC_PTRC): Define with const pointer + arguments. + (CYG_CHECK_DATA_PTRC): Ditto. + (CYG_CHECK_FUNC_PTR): Ditto. + (CYG_CHECK_DATA_PTR): Ditto. + * src/null.cxx: Define cyg_check_data/func_ptr() with const args. + * src/buffer.cxx: Ditto. + * src/fancy.cxx: Ditto. + * src/simple.cxx: Ditto. + 2002-07-18 Gary Thomas * include/diag.h: diff --git a/packages/infra/current/include/cyg_ass.h b/packages/infra/current/include/cyg_ass.h --- a/packages/infra/current/include/cyg_ass.h +++ b/packages/infra/current/include/cyg_ass.h @@ -156,32 +156,32 @@ cyg_assert_msg( const char *psz_func, co // with different formats, and so we can check them against different memory // regions. -externC cyg_bool cyg_check_data_ptr(void *ptr); -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)); +externC cyg_bool cyg_check_data_ptr(const void *ptr); +externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void)); #ifdef CYGDBG_USE_ASSERTS # define CYG_CHECK_DATA_PTR( _ptr_, _msg_ ) \ CYG_MACRO_START \ - if( !cyg_check_data_ptr((void *)(_ptr_))) \ + if( !cyg_check_data_ptr((const void *)(_ptr_))) \ CYG_ASSERT_DOCALL( _msg_ ); \ CYG_MACRO_END # define CYG_CHECK_FUNC_PTR( _ptr_, _msg_ ) \ CYG_MACRO_START \ - if( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \ + if( !cyg_check_func_ptr((const void (*)(void))(_ptr_))) \ CYG_ASSERT_DOCALL( _msg_ ); \ CYG_MACRO_END # define CYG_CHECK_DATA_PTRC( _ptr_ ) \ CYG_MACRO_START \ - if ( !cyg_check_data_ptr((void *)(_ptr_))) \ + if ( !cyg_check_data_ptr((const void *)(_ptr_))) \ CYG_ASSERT_DOCALL("data pointer (" #_ptr_ ") is valid");\ CYG_MACRO_END # define CYG_CHECK_FUNC_PTRC( _ptr_ ) \ CYG_MACRO_START \ - if ( !cyg_check_func_ptr((void (*)(void))(_ptr_))) \ + if ( !cyg_check_func_ptr((const void (*)(void))(_ptr_))) \ CYG_ASSERT_DOCALL("function pointer (" #_ptr_ ") is valid"); \ CYG_MACRO_END diff --git a/packages/infra/current/src/buffer.cxx b/packages/infra/current/src/buffer.cxx --- a/packages/infra/current/src/buffer.cxx +++ b/packages/infra/current/src/buffer.cxx @@ -761,7 +761,7 @@ unsigned long stext_addr = (unsigned lon unsigned long etext_addr = (unsigned long)&_etext; }; -externC cyg_bool cyg_check_data_ptr(void *ptr) +externC cyg_bool cyg_check_data_ptr(const void *ptr) { unsigned long p = (unsigned long)ptr; @@ -772,7 +772,7 @@ externC cyg_bool cyg_check_data_ptr(void return true; } -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void)) { unsigned long p = (unsigned long)ptr; diff --git a/packages/infra/current/src/fancy.cxx b/packages/infra/current/src/fancy.cxx --- a/packages/infra/current/src/fancy.cxx +++ b/packages/infra/current/src/fancy.cxx @@ -632,7 +632,7 @@ unsigned long stext_addr = (unsigned lon unsigned long etext_addr = (unsigned long)&_etext; }; -externC cyg_bool cyg_check_data_ptr(void *ptr) +externC cyg_bool cyg_check_data_ptr(const void *ptr) { unsigned long p = (unsigned long)ptr; @@ -643,7 +643,7 @@ externC cyg_bool cyg_check_data_ptr(void return true; } -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void)) { unsigned long p = (unsigned long)ptr; diff --git a/packages/infra/current/src/null.cxx b/packages/infra/current/src/null.cxx --- a/packages/infra/current/src/null.cxx +++ b/packages/infra/current/src/null.cxx @@ -155,7 +155,7 @@ unsigned long stext_addr = (unsigned lon unsigned long etext_addr = (unsigned long)&_etext; }; -externC cyg_bool cyg_check_data_ptr(void *ptr) +externC cyg_bool cyg_check_data_ptr(const void *ptr) { unsigned long p = (unsigned long)ptr; @@ -166,7 +166,7 @@ externC cyg_bool cyg_check_data_ptr(void return true; } -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void)) { unsigned long p = (unsigned long)ptr; diff --git a/packages/infra/current/src/simple.cxx b/packages/infra/current/src/simple.cxx --- a/packages/infra/current/src/simple.cxx +++ b/packages/infra/current/src/simple.cxx @@ -533,7 +533,7 @@ unsigned long stext_addr = (unsigned lon unsigned long etext_addr = (unsigned long)&_etext; }; -externC cyg_bool cyg_check_data_ptr(void *ptr) +externC cyg_bool cyg_check_data_ptr(const void *ptr) { unsigned long p = (unsigned long)ptr; @@ -544,7 +544,7 @@ externC cyg_bool cyg_check_data_ptr(void return true; } -externC cyg_bool cyg_check_func_ptr(void (*ptr)(void)) +externC cyg_bool cyg_check_func_ptr(const void (*ptr)(void)) { unsigned long p = (unsigned long)ptr;