From 5135d37813fe23a3a1ea19c6e116933052faf1b3 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Thu, 6 Jan 2005 07:45:17 +0000 Subject: solved classic "char*" vs "char[]" conflict. we were mimicking a pointer variable at desired location and then we took its address. using array is more intuitive, as they give us the starting address instantly. --- src/mesa/tnl/t_vtx_x86.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mesa/tnl/t_vtx_x86.c b/src/mesa/tnl/t_vtx_x86.c index 37530f4940a..38cdad451c7 100644 --- a/src/mesa/tnl/t_vtx_x86.c +++ b/src/mesa/tnl/t_vtx_x86.c @@ -48,8 +48,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #if defined(USE_X86_ASM) && !defined(HAVE_NONSTANDARD_GLAPIENTRY) #define EXTERN( FUNC ) \ -extern const char *FUNC; \ -extern const char *FUNC##_end +extern const char FUNC[]; \ +extern const char FUNC##_end[] EXTERN( _tnl_x86_Attribute1fv ); EXTERN( _tnl_x86_Attribute2fv ); @@ -84,8 +84,8 @@ EXTERN( _tnl_x86_choose_fv ); #define DFN( FUNC, CACHE, KEY ) \ struct _tnl_dynfn *dfn = MALLOC_STRUCT( _tnl_dynfn );\ - char *start = (char *)&FUNC; \ - char *end = (char *)&FUNC##_end; \ + const char *start = FUNC; \ + const char *end = FUNC##_end; \ int offset = 0; \ insert_at_head( &CACHE, dfn ); \ dfn->key = KEY; \ @@ -273,8 +273,8 @@ void _tnl_InitX86Codegen( struct _tnl_dynfn_generators *gen ) #define MKDISP(FUNC, SIZE, ATTR, WARP) \ do { \ char *code; \ - char *start = (char *)&WARP; \ - char *end = (char *)&WARP##_end; \ + const char *start = WARP; \ + const char *end = WARP##_end; \ int offset = 0; \ code = ALIGN_MALLOC( end - start, 16 ); \ memcpy (code, start, end - start); \ @@ -347,8 +347,8 @@ void _tnl_x86choosers( tnl_attrfv_func (*choose)[4], for (attr = 0; attr < _TNL_MAX_ATTR_CODEGEN; attr++) { for (size = 0; size < 4; size++) { char *code; - char *start = (char *)&_tnl_x86_choose_fv; - char *end = (char *)&_tnl_x86_choose_fv_end; + const char *start = _tnl_x86_choose_fv; + const char *end = _tnl_x86_choose_fv_end; int offset = 0; code = ALIGN_MALLOC( end - start, 16 ); memcpy (code, start, end - start); -- cgit v1.2.3