From e197de56cdb86835f1437688a9161cd909792d80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:09:01 -0700 Subject: mesa: replace old MEMCPY macro with memcpy --- src/gallium/state_trackers/glx/xlib/xm_api.c | 2 +- src/mesa/drivers/dri/mga/mgapixel.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 6 +-- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 4 +- src/mesa/drivers/glide/fxdd.c | 6 +-- src/mesa/drivers/glide/fxddtex.c | 4 +- src/mesa/drivers/x11/xm_api.c | 12 +++--- src/mesa/main/attrib.c | 60 ++++++++++++++-------------- src/mesa/main/context.c | 2 +- src/mesa/main/dlist.c | 14 +++---- src/mesa/main/imports.h | 2 - src/mesa/main/mipmap.c | 40 +++++++++---------- src/mesa/main/pixel.c | 4 +- src/mesa/main/texstore.c | 4 +- src/mesa/math/m_matrix.c | 28 ++++++------- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvprogram.c | 2 +- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_statevars.c | 2 +- src/mesa/swrast/s_zoom.c | 8 ++-- src/mesa/tnl/t_pipeline.c | 2 +- src/mesa/tnl/t_vb_program.c | 2 +- 22 files changed, 104 insertions(+), 106 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index fb314f3b528..2e678c8f1e0 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -678,7 +678,7 @@ XMesaVisual XMesaCreateVisual( Display *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); v->ximage_flag = ximage_flag; diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 69415f8a839..664f7c77c2b 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -600,7 +600,7 @@ mgaTryDrawPixels( GLcontext *ctx, } } #else - MEMCPY( address, pixels, rows*bufferpitch ); + memcpy( address, pixels, rows*bufferpitch ); #endif do_draw_pix( ctx, x, y, width, rows, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 44496274188..5a7184056dc 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -519,7 +519,7 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -578,7 +578,7 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -672,7 +672,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, (format == GL_BGRA && type == GL_UNSIGNED_BYTE)) { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst -= dstStride; src += srcStride; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index e31ae97b023..1c51452c104 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1660,7 +1660,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, compressedSize); + memcpy(texImage->Data, data, compressedSize); } RevalidateTexture(ctx, texObj); @@ -1707,7 +1707,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* [dBorca] hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride); } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 2bc60399ea2..d94bf08a882 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -840,7 +840,7 @@ fxDDReadPixels565 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -953,7 +953,7 @@ fxDDReadPixels555 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -1572,7 +1572,7 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, for (row = 0; row < height; row++) { GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, pixels, width, height, format, type, row, 0); - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; } } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 9dd4f1e9c37..a87a28ac3e0 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1688,7 +1688,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, texImage->CompressedSize); + memcpy(texImage->Data, data, texImage->CompressedSize); } ti->info.format = mml->glideFormat; @@ -1739,7 +1739,7 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride); } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 1a5456e1be2..98ce6c5831a 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -511,12 +511,12 @@ xmesa_free_buffer(XMesaBuffer buffer) static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) { - MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table)); - MEMCPY(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); - MEMCPY(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); - MEMCPY(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); + memcpy(dst->color_table, src->color_table, sizeof(src->color_table)); + memcpy(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); + memcpy(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); + memcpy(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); dst->num_alloced = src->num_alloced; - MEMCPY(dst->alloced_colors, src->alloced_colors, + memcpy(dst->alloced_colors, src->alloced_colors, sizeof(src->alloced_colors)); } @@ -1376,7 +1376,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); #endif /* check for MESA_GAMMA environment variable */ diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 881644cdaf2..44dc3b871ec 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -222,7 +222,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_ACCUM_BUFFER_BIT) { struct gl_accum_attrib *attr; attr = MALLOC_STRUCT( gl_accum_attrib ); - MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); + memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr); } @@ -230,7 +230,7 @@ _mesa_PushAttrib(GLbitfield mask) GLuint i; struct gl_colorbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_colorbuffer_attrib ); - MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); + memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; @@ -241,14 +241,14 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_current_attrib *attr; FLUSH_CURRENT( ctx, 0 ); attr = MALLOC_STRUCT( gl_current_attrib ); - MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); + memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); save_attrib_data(&head, GL_CURRENT_BIT, attr); } if (mask & GL_DEPTH_BUFFER_BIT) { struct gl_depthbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_depthbuffer_attrib ); - MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); + memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr); } @@ -292,7 +292,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4; attr->Map1Vertex3 = ctx->Eval.Map1Vertex3; attr->Map1Vertex4 = ctx->Eval.Map1Vertex4; - MEMCPY(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); + memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); attr->Map2Color4 = ctx->Eval.Map2Color4; attr->Map2Index = ctx->Eval.Map2Index; attr->Map2Normal = ctx->Eval.Map2Normal; @@ -302,7 +302,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4; attr->Map2Vertex3 = ctx->Eval.Map2Vertex3; attr->Map2Vertex4 = ctx->Eval.Map2Vertex4; - MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); + memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); attr->Normalize = ctx->Transform.Normalize; attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped; attr->PointSmooth = ctx->Point.SmoothFlag; @@ -336,21 +336,21 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_EVAL_BIT) { struct gl_eval_attrib *attr; attr = MALLOC_STRUCT( gl_eval_attrib ); - MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); + memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); save_attrib_data(&head, GL_EVAL_BIT, attr); } if (mask & GL_FOG_BIT) { struct gl_fog_attrib *attr; attr = MALLOC_STRUCT( gl_fog_attrib ); - MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); + memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); save_attrib_data(&head, GL_FOG_BIT, attr); } if (mask & GL_HINT_BIT) { struct gl_hint_attrib *attr; attr = MALLOC_STRUCT( gl_hint_attrib ); - MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); + memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); save_attrib_data(&head, GL_HINT_BIT, attr); } @@ -358,28 +358,28 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_light_attrib *attr; FLUSH_CURRENT(ctx, 0); /* flush material changes */ attr = MALLOC_STRUCT( gl_light_attrib ); - MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); + memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); save_attrib_data(&head, GL_LIGHTING_BIT, attr); } if (mask & GL_LINE_BIT) { struct gl_line_attrib *attr; attr = MALLOC_STRUCT( gl_line_attrib ); - MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); + memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); save_attrib_data(&head, GL_LINE_BIT, attr); } if (mask & GL_LIST_BIT) { struct gl_list_attrib *attr; attr = MALLOC_STRUCT( gl_list_attrib ); - MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) ); + memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) ); save_attrib_data(&head, GL_LIST_BIT, attr); } if (mask & GL_PIXEL_MODE_BIT) { struct gl_pixel_attrib *attr; attr = MALLOC_STRUCT( gl_pixel_attrib ); - MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); + memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr); @@ -388,35 +388,35 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_POINT_BIT) { struct gl_point_attrib *attr; attr = MALLOC_STRUCT( gl_point_attrib ); - MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); + memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); save_attrib_data(&head, GL_POINT_BIT, attr); } if (mask & GL_POLYGON_BIT) { struct gl_polygon_attrib *attr; attr = MALLOC_STRUCT( gl_polygon_attrib ); - MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); + memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); save_attrib_data(&head, GL_POLYGON_BIT, attr); } if (mask & GL_POLYGON_STIPPLE_BIT) { GLuint *stipple; stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) ); - MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); + memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple); } if (mask & GL_SCISSOR_BIT) { struct gl_scissor_attrib *attr; attr = MALLOC_STRUCT( gl_scissor_attrib ); - MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); + memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); save_attrib_data(&head, GL_SCISSOR_BIT, attr); } if (mask & GL_STENCIL_BUFFER_BIT) { struct gl_stencil_attrib *attr; attr = MALLOC_STRUCT( gl_stencil_attrib ); - MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); + memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr); } @@ -460,14 +460,14 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_TRANSFORM_BIT) { struct gl_transform_attrib *attr; attr = MALLOC_STRUCT( gl_transform_attrib ); - MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); + memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); save_attrib_data(&head, GL_TRANSFORM_BIT, attr); } if (mask & GL_VIEWPORT_BIT) { struct gl_viewport_attrib *attr; attr = MALLOC_STRUCT( gl_viewport_attrib ); - MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); + memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); save_attrib_data(&head, GL_VIEWPORT_BIT, attr); } @@ -475,7 +475,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_MULTISAMPLE_BIT_ARB) { struct gl_multisample_attrib *attr; attr = MALLOC_STRUCT( gl_multisample_attrib ); - MEMCPY( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); + memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr); } @@ -1010,7 +1010,7 @@ _mesa_PopAttrib(void) break; case GL_CURRENT_BIT: FLUSH_CURRENT( ctx, 0 ); - MEMCPY( &ctx->Current, attr->data, + memcpy( &ctx->Current, attr->data, sizeof(struct gl_current_attrib) ); break; case GL_DEPTH_BUFFER_BIT: @@ -1032,7 +1032,7 @@ _mesa_PopAttrib(void) } break; case GL_EVAL_BIT: - MEMCPY( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); + memcpy( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); ctx->NewState |= _NEW_EVAL; break; case GL_FOG_BIT: @@ -1126,7 +1126,7 @@ _mesa_PopAttrib(void) _mesa_set_enable(ctx, GL_COLOR_MATERIAL, light->ColorMaterialEnabled); /* materials */ - MEMCPY(&ctx->Light.Material, &light->Material, + memcpy(&ctx->Light.Material, &light->Material, sizeof(struct gl_material)); } break; @@ -1141,10 +1141,10 @@ _mesa_PopAttrib(void) } break; case GL_LIST_BIT: - MEMCPY( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); + memcpy( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); break; case GL_PIXEL_MODE_BIT: - MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); + memcpy( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); /* XXX what other pixel state needs to be set by function calls? */ _mesa_ReadBuffer(ctx->Pixel.ReadBuffer); ctx->NewState |= _NEW_PIXEL; @@ -1203,7 +1203,7 @@ _mesa_PopAttrib(void) } break; case GL_POLYGON_STIPPLE_BIT: - MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); + memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); ctx->NewState |= _NEW_POLYGONSTIPPLE; if (ctx->Driver.PolygonStipple) ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data ); @@ -1417,8 +1417,8 @@ _mesa_PushClientAttrib(GLbitfield mask) ctx->Array.ElementArrayBufferObj->RefCount++; #endif - MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); - MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); + memcpy( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); + memcpy( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); attr->ArrayObj = obj; @@ -1492,7 +1492,7 @@ _mesa_PopClientAttrib(void) data->ElementArrayBufferObj->Name); #endif - MEMCPY( ctx->Array.ArrayObj, data->ArrayObj, + memcpy( ctx->Array.ArrayObj, data->ArrayObj, sizeof( struct gl_array_object ) ); FREE( data->ArrayObj ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c292d1fea5e..f315f0b212b 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1108,7 +1108,7 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) dst->Polygon = src->Polygon; } if (mask & GL_POLYGON_STIPPLE_BIT) { - /* Use loop instead of MEMCPY due to problem with Portland Group's + /* Use loop instead of memcpy due to problem with Portland Group's * C compiler. Reported by John Stone. */ GLuint i; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ea0d13b8906..9c472d85e32 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -2913,7 +2913,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) n[1].e = map; n[2].i = mapsize; n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); - MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); + memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); } if (ctx->ExecuteFlag) { CALL_PixelMapfv(ctx->Exec, (map, mapsize, values)); @@ -4365,7 +4365,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4411,7 +4411,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; @@ -4458,7 +4458,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; @@ -4501,7 +4501,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4541,7 +4541,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; @@ -4583,7 +4583,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d5ab7cdc206..c4e28df0513 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -71,8 +71,6 @@ extern "C" { /** Free aligned memory */ #define ALIGN_FREE(PTR) _mesa_align_free(PTR) -/** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ #define MEMSET( DST, VAL, N ) memset(DST, VAL, N) diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 77cd1d41595..1da576337f9 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,9 +979,9 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1025,15 +1025,15 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1050,9 +1050,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } @@ -1174,28 +1174,28 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, /* do border along [img][row=0][col=0] */ src = srcPtr + (img + 1) * bytesPerSrcImage; dst = dstPtr + (img + 1) * bytesPerDstImage; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=0] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcHeight - 1) * bytesPerSrcRow; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstHeight - 1) * bytesPerDstRow; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=0][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcWidth - 1) * bpt; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstWidth - 1) * bpt; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (bytesPerSrcImage - bpt); dst = dstPtr + (img + 1) * bytesPerDstImage + (bytesPerDstImage - bpt); - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); } } else { @@ -1265,9 +1265,9 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1319,15 +1319,15 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1344,9 +1344,9 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index ca6ecd7bfb6..f6c316a5803 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -362,7 +362,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } } else { - MEMCPY(values, pm->Map, mapsize * sizeof(GLfloat)); + memcpy(values, pm->Map, mapsize * sizeof(GLfloat)); } _mesa_unmap_pbo_dest(ctx, &ctx->Pack); @@ -401,7 +401,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) if (map == GL_PIXEL_MAP_S_TO_S) { /* special case */ - MEMCPY(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); + memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); } else { for (i = 0; i < mapsize; i++) { diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c1418e0967a..ab572a13edf 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3716,7 +3716,7 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; /* copy the data */ - MEMCPY(texImage->Data, data, imageSize); + memcpy(texImage->Data, data, imageSize); _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } @@ -3823,7 +3823,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, /* copy rows of blocks */ for (i = 0; i < rows; i++) { - MEMCPY(dest, src, bytesPerRow); + memcpy(dest, src, bytesPerRow); dest += destRowStride; src += srcRowStride; } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index da6956efed5..e810d6deb82 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -599,7 +599,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) } else { /* pure translation */ - MEMCPY( out, Identity, sizeof(Identity) ); + memcpy( out, Identity, sizeof(Identity) ); MAT(out,0,3) = - MAT(in,0,3); MAT(out,1,3) = - MAT(in,1,3); MAT(out,2,3) = - MAT(in,2,3); @@ -637,7 +637,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) */ static GLboolean invert_matrix_identity( GLmatrix *mat ) { - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_TRUE; } @@ -659,7 +659,7 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); MAT(out,2,2) = 1.0F / MAT(in,2,2); @@ -692,7 +692,7 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -714,7 +714,7 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat ) if (MAT(in,2,3) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -776,7 +776,7 @@ static GLboolean matrix_invert( GLmatrix *mat ) return GL_TRUE; } else { mat->flags |= MAT_FLAG_SINGULAR; - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_FALSE; } } @@ -807,7 +807,7 @@ _math_matrix_rotate( GLmatrix *mat, s = (GLfloat) _mesa_sin( angle * DEG2RAD ); c = (GLfloat) _mesa_cos( angle * DEG2RAD ); - MEMCPY(m, Identity, sizeof(GLfloat)*16); + memcpy(m, Identity, sizeof(GLfloat)*16); optimized = GL_FALSE; #define M(row,col) m[col*4+row] @@ -1141,10 +1141,10 @@ _math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, void _math_matrix_set_identity( GLmatrix *mat ) { - MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->m, Identity, 16*sizeof(GLfloat) ); if (mat->inv) - MEMCPY( mat->inv, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->inv, Identity, 16*sizeof(GLfloat) ); mat->type = MATRIX_IDENTITY; mat->flags &= ~(MAT_DIRTY_FLAGS| @@ -1444,7 +1444,7 @@ _math_matrix_is_dirty( const GLmatrix *m ) void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) { - MEMCPY( to->m, from->m, sizeof(Identity) ); + memcpy( to->m, from->m, sizeof(Identity) ); to->flags = from->flags; to->type = from->type; @@ -1453,7 +1453,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) matrix_invert( to ); } else { - MEMCPY(to->inv, from->inv, sizeof(GLfloat)*16); + memcpy(to->inv, from->inv, sizeof(GLfloat)*16); } } } @@ -1470,7 +1470,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) { - MEMCPY( mat->m, m, 16*sizeof(GLfloat) ); + memcpy( mat->m, m, 16*sizeof(GLfloat) ); mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY); } @@ -1486,7 +1486,7 @@ _math_matrix_ctr( GLmatrix *m ) { m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->m) - MEMCPY( m->m, Identity, sizeof(Identity) ); + memcpy( m->m, Identity, sizeof(Identity) ); m->inv = NULL; m->type = MATRIX_IDENTITY; m->flags = 0; @@ -1525,7 +1525,7 @@ _math_matrix_alloc_inv( GLmatrix *m ) if (!m->inv) { m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->inv) - MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) ); + memcpy( m->inv, Identity, 16 * sizeof(GLfloat) ); } } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index e226973c53f..35f18aa2fb7 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1479,7 +1479,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 394b6a42d71..19020be42c7 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -297,7 +297,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) } if (prog->String) { - MEMCPY(program, prog->String, strlen((char *) prog->String)); + memcpy(program, prog->String, strlen((char *) prog->String)); } else { program[0] = 0; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 1a840a3a928..3656438d42c 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1296,7 +1296,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index a0be1acfcab..f5264fa9189 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -1117,7 +1117,7 @@ static void load_transpose_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16]) { - MEMCPY(registers[pos], mat, 16 * sizeof(GLfloat)); + memcpy(registers[pos], mat, 16 * sizeof(GLfloat)); } diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index a48eae19259..bec16208e3d 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -324,14 +324,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) : 4 * sizeof(GLfloat)); if (y1 - y0 > 1) { - MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); + memcpy(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_rgba_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); + memcpy(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); } } } @@ -340,14 +340,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; const GLint end = zoomed.end; /* save */ if (y1 - y0 > 1) { - MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); + memcpy(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_index_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); + memcpy(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); } } } diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 946b29e250f..36fcd074cd9 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -47,7 +47,7 @@ void _tnl_install_pipeline( GLcontext *ctx, */ for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) { struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - MEMCPY(s, stages[i], sizeof(*s)); + memcpy(s, stages[i], sizeof(*s)); if (s->create) s->create(ctx, s); } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 44b64b17d15..5351b5fe41f 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -221,7 +221,7 @@ static void init_machine(GLcontext *ctx, struct gl_program_machine *machine) { /* Input registers get initialized from the current vertex attribs */ - MEMCPY(machine->VertAttribs, ctx->Current.Attrib, + memcpy(machine->VertAttribs, ctx->Current.Attrib, MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram._Current->IsNVProgram) { -- cgit v1.2.3