ref: 7611418ea0a40796a9b1c221430beb09be17127f
parent: db9b193ab08b9e033e80887e31ac7cca8203d906
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Oct 13 23:19:06 EDT 2024
memcpy → memmove
--- a/cl_parse.c
+++ b/cl_parse.c
@@ -133,7 +133,7 @@
// read messages from server, should just be nops
old = net_message;
- memcpy (olddata, net_message.data, net_message.cursize);
+ memmove (olddata, net_message.data, net_message.cursize);
do
{
@@ -155,7 +155,7 @@
} while (ret);
net_message = old;
- memcpy (net_message.data, olddata, net_message.cursize);
+ memmove (net_message.data, olddata, net_message.cursize);
// check time
time = dtime ();
@@ -538,7 +538,7 @@
fatal ("CL_NewTranslation: slot > cl.maxclients");
dest = cl.scores[slot].translations;
source = vid.colormap;
- memcpy(dest, vid.colormap, sizeof cl.scores[slot].translations);
+ memmove(dest, vid.colormap, sizeof cl.scores[slot].translations);
top = cl.scores[slot].colors & 0xf0;
bottom = (cl.scores[slot].colors &15)<<4;
@@ -545,13 +545,13 @@
for (i=0 ; i<VID_GRADES ; i++, dest += 256, source+=256)
{
if (top < 128) // the artists made some backwards ranges. sigh.
- memcpy (dest + TOP_RANGE, source + top, 16);
+ memmove (dest + TOP_RANGE, source + top, 16);
else
for (j=0 ; j<16 ; j++)
dest[TOP_RANGE+j] = source[top+15-j];
if (bottom < 128)
- memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
+ memmove (dest + BOTTOM_RANGE, source + bottom, 16);
else
for (j=0 ; j<16 ; j++)
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
--- a/cmd.c
+++ b/cmd.c
@@ -94,7 +94,7 @@
if (templen)
{
temp = Z_Malloc (templen);
- memcpy(temp, cmd_text.data, templen);
+ memmove(temp, cmd_text.data, templen);
SZ_Clear (&cmd_text);
}
@@ -138,7 +138,7 @@
}
- memcpy (line, text, i);
+ memmove (line, text, i);
line[i] = 0;
// delete the text from the command buffer and move remaining commands down
@@ -151,7 +151,7 @@
{
i++;
cmd_text.cursize -= i;
- memcpy(text, text+i, cmd_text.cursize);
+ memmove(text, text+i, cmd_text.cursize);
}
// execute the command line
--- a/common.c
+++ b/common.c
@@ -363,7 +363,7 @@
void
SZ_Write(sizebuf_t *buf, void *data, int length)
{
- memcpy(SZ_GetSpace(buf, length), data, length);
+ memmove(SZ_GetSpace(buf, length), data, length);
}
void
@@ -374,9 +374,9 @@
len = strlen(data)+1;
if(buf->data[buf->cursize-1])
- memcpy(SZ_GetSpace(buf, len), data, len); // no trailing 0
+ memmove(SZ_GetSpace(buf, len), data, len); // no trailing 0
else
- memcpy((uchar *)SZ_GetSpace(buf, len-1)-1, data, len); // write over trailing 0
+ memmove((uchar *)SZ_GetSpace(buf, len-1)-1, data, len); // write over trailing 0
}
/*
--- a/console.c
+++ b/console.c
@@ -143,7 +143,7 @@
if (con_linewidth < numchars)
numchars = con_linewidth;
- memcpy(tbuf, con_text, CON_TEXTSIZE);
+ memmove(tbuf, con_text, CON_TEXTSIZE);
memset(con_text, ' ', CON_TEXTSIZE);
for (i=0 ; i<numlines ; i++)
--- a/draw.c
+++ b/draw.c
@@ -342,7 +342,7 @@
v = (vid.conheight - lines + y) * 200 / vid.conheight;
src = conback->data + v * 320;
if(vid.conwidth == 320)
- memcpy(dest, src, vid.conwidth);
+ memmove(dest, src, vid.conwidth);
else{
f = 0;
fstep = 320 * 0x10000 / vid.conwidth;
@@ -398,7 +398,7 @@
{
for (i=0 ; i<prect->height ; i++)
{
- memcpy (pdest, psrc, prect->width);
+ memmove (pdest, psrc, prect->width);
psrc += rowbytes;
pdest += vid.rowbytes;
}
--- a/fs.c
+++ b/fs.c
@@ -681,7 +681,7 @@
}
r = 0;
loadedicts(bf, sv.pr);
- memcpy(svs.clients->spawn_parms, sp, sizeof sp);
+ memmove(svs.clients->spawn_parms, sp, sizeof sp);
exit:
return r;
}
--- a/menu.c
+++ b/menu.c
@@ -113,16 +113,16 @@
identityTable[j] = j;
dest = translationTable;
source = identityTable;
- memcpy (dest, source, 256);
+ memmove (dest, source, 256);
if (top < 128) // the artists made some backwards ranges. sigh.
- memcpy (dest + TOP_RANGE, source + top, 16);
+ memmove (dest + TOP_RANGE, source + top, 16);
else
for (j=0 ; j<16 ; j++)
dest[TOP_RANGE+j] = source[top+15-j];
if (bottom < 128)
- memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
+ memmove (dest + BOTTOM_RANGE, source + bottom, 16);
else
for (j=0 ; j<16 ; j++)
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
--- a/model_alias.c
+++ b/model_alias.c
@@ -110,7 +110,7 @@
*pskinindex = Hunk_From(pheader);
pskin = Hunk_Alloc(skinsize);
pinskin = (uchar *)pin;
- memcpy(pskin, pinskin, skinsize);
+ memmove(pskin, pinskin, skinsize);
pinskin += skinsize;
return (void *)pinskin;
}
--- a/model_bsp.c
+++ b/model_bsp.c
@@ -110,7 +110,7 @@
tx->width = w;
tx->height = h;
// the pixels immediately follow the structures
- memcpy(tx+1, p, pixels);
+ memmove(tx+1, p, pixels);
if(strncmp(tx->name, "sky", 3) == 0)
R_InitSky(tx);
}
@@ -210,7 +210,7 @@
if(sz == 0)
mod->lightdata = nil;
else
- memcpy(mod->lightdata = Hunk_Alloc(sz), in, sz);
+ memmove(mod->lightdata = Hunk_Alloc(sz), in, sz);
return 0;
}
@@ -220,7 +220,7 @@
if(sz == 0)
mod->visdata = nil;
else
- memcpy(mod->visdata = Hunk_Alloc(sz), in, sz);
+ memmove(mod->visdata = Hunk_Alloc(sz), in, sz);
return 0;
}
@@ -230,7 +230,7 @@
if(sz == 0)
mod->entities = nil;
else
- memcpy(mod->entities = Hunk_Alloc(sz), in, sz);
+ memmove(mod->entities = Hunk_Alloc(sz), in, sz);
return 0;
}
--- a/net_dgrm.c
+++ b/net_dgrm.c
@@ -32,7 +32,7 @@
hnputl(netbuf, NET_HEADERSIZE + n | f);
hnputl(netbuf+4, seq);
if(buf != nil)
- memcpy(netbuf+8, buf, n);
+ memmove(netbuf+8, buf, n);
return udpwrite(netbuf, NET_HEADERSIZE + n, a);
}
@@ -52,7 +52,7 @@
fatal("SendMessage: called with canSend == false\n");
#endif
- memcpy(s->sendMessage, data->data, data->cursize);
+ memmove(s->sendMessage, data->data, data->cursize);
s->sendMessageLength = data->cursize;
if(data->cursize <= MAX_DATAGRAM){
n = data->cursize;
@@ -231,7 +231,7 @@
sock->sendMessageLength -= MAX_DATAGRAM;
if (sock->sendMessageLength > 0)
{
- memcpy(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
+ memmove(sock->sendMessage, sock->sendMessage+MAX_DATAGRAM, sock->sendMessageLength);
sock->sendNext = true;
}
else
@@ -265,7 +265,7 @@
break;
}
- memcpy(sock->receiveMessage + sock->receiveMessageLength, netbuf+8, n);
+ memmove(sock->receiveMessage + sock->receiveMessageLength, netbuf+8, n);
sock->receiveMessageLength += n;
continue;
}
@@ -558,7 +558,7 @@
// everything is allocated, just fill in the details
sock->socket = newsock;
sock->landriver = net_landriverlevel;
- memcpy(&sock->addr, &clientaddr, sizeof clientaddr);
+ memmove(&sock->addr, &clientaddr, sizeof clientaddr);
strcpy(sock->address, UDP_AddrToString(&clientaddr));
// send him back the info about the server connection he has been allocated
@@ -616,7 +616,7 @@
// connect to the host
if (dfunc.Connect(&sendaddr) == -1)
goto ErrorReturn;
- memcpy(&readaddr, &sendaddr, sizeof readaddr);
+ memmove(&readaddr, &sendaddr, sizeof readaddr);
// send the connection request
Con_Printf("trying...\n"); SCR_UpdateScreen (false);
@@ -682,7 +682,7 @@
do{
if(getnewcon(&sendaddr) > 0){
close(readaddr.fd);
- memcpy(&readaddr, &sendaddr, sizeof readaddr);
+ memmove(&readaddr, &sendaddr, sizeof readaddr);
break;
}
sleep(1);
@@ -716,7 +716,7 @@
if (ret == CPACCEPT)
{
- memcpy(&sock->addr, &readaddr, sizeof readaddr);
+ memmove(&sock->addr, &readaddr, sizeof readaddr);
dfunc.SetSocketPort (&sock->addr, MSG_ReadLong());
}
else
--- a/net_loop.c
+++ b/net_loop.c
@@ -97,7 +97,7 @@
sock->receiveMessageLength -= length;
if (sock->receiveMessageLength)
- memcpy(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
+ memmove(sock->receiveMessage, &sock->receiveMessage[length], sock->receiveMessageLength);
if (sock->driverdata && ret == 1)
((qsocket_t *)sock->driverdata)->canSend = true;
@@ -132,7 +132,7 @@
buffer++;
// message
- memcpy(buffer, data->data, data->cursize);
+ memmove(buffer, data->data, data->cursize);
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
sock->canSend = false;
@@ -166,7 +166,7 @@
buffer++;
// message
- memcpy(buffer, data->data, data->cursize);
+ memmove(buffer, data->data, data->cursize);
*bufferLength = IntAlign(*bufferLength + data->cursize + 4);
return 1;
}
--- a/pr_cmds.c
+++ b/pr_cmds.c
@@ -701,7 +701,7 @@
checkpvs = realloc(checkpvs, size);
checkpvs_size = size;
}
- memcpy (checkpvs, pvs, size);
+ memmove (checkpvs, pvs, size);
return i;
}
--- a/qw/cl_parse.c
+++ b/qw/cl_parse.c
@@ -447,7 +447,7 @@
r = upload_size - upload_pos;
if (r > 768)
r = 768;
- memcpy(buffer, upload_data + upload_pos, r);
+ memmove(buffer, upload_data + upload_pos, r);
MSG_WriteByte (&cls.netchan.message, clc_upload);
MSG_WriteShort (&cls.netchan.message, r);
@@ -483,7 +483,7 @@
Con_DPrintf("Upload starting of %d...\n", size);
upload_data = malloc(size);
- memcpy(upload_data, data, size);
+ memmove(upload_data, data, size);
upload_size = size;
upload_pos = 0;
@@ -888,7 +888,7 @@
dest = player->translations;
source = vid.colormap;
- memcpy (dest, vid.colormap, sizeof(player->translations));
+ memmove (dest, vid.colormap, sizeof(player->translations));
top = player->topcolor;
if (top > 13 || top < 0)
top = 13;
@@ -901,13 +901,13 @@
for (i=0 ; i<VID_GRADES ; i++, dest += 256, source+=256)
{
if (top < 128) // the artists made some backwards ranges. sigh.
- memcpy (dest + TOP_RANGE, source + top, 16);
+ memmove (dest + TOP_RANGE, source + top, 16);
else
for (j=0 ; j<16 ; j++)
dest[TOP_RANGE+j] = source[top+15-j];
if (bottom < 128)
- memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
+ memmove (dest + BOTTOM_RANGE, source + bottom, 16);
else
for (j=0 ; j<16 ; j++)
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
--- a/qw/cmd.c
+++ b/qw/cmd.c
@@ -101,7 +101,7 @@
if (templen)
{
temp = Z_Malloc (templen);
- memcpy (temp, cmd_text.data, templen);
+ memmove (temp, cmd_text.data, templen);
SZ_Clear (&cmd_text);
}
else
@@ -147,7 +147,7 @@
}
- memcpy (line, text, i);
+ memmove (line, text, i);
line[i] = 0;
// delete the text from the command buffer and move remaining commands down
@@ -160,7 +160,7 @@
{
i++;
cmd_text.cursize -= i;
- memcpy (text, text+i, cmd_text.cursize);
+ memmove (text, text+i, cmd_text.cursize);
}
// execute the command line
--- a/qw/common.c
+++ b/qw/common.c
@@ -633,7 +633,7 @@
{
int bits;
- memcpy (move, from, sizeof(*move));
+ memmove (move, from, sizeof(*move));
bits = MSG_ReadByte ();
@@ -698,7 +698,7 @@
void SZ_Write (sizebuf_t *buf, void *data, int length)
{
- memcpy (SZ_GetSpace(buf,length),data,length);
+ memmove (SZ_GetSpace(buf,length),data,length);
}
void SZ_Print (sizebuf_t *buf, char *data)
@@ -708,9 +708,9 @@
len = strlen(data)+1;
if (!buf->cursize || buf->data[buf->cursize-1])
- memcpy ((byte *)SZ_GetSpace(buf, len),data,len); // no trailing 0
+ memmove ((byte *)SZ_GetSpace(buf, len),data,len); // no trailing 0
else
- memcpy ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
+ memmove ((byte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
}
@@ -2014,7 +2014,7 @@
if (length > 60)
length = 60;
- memcpy (chkbuf + 16, base, length);
+ memmove (chkbuf + 16, base, length);
length += 16;
@@ -2050,7 +2050,7 @@
if (length > 60)
length = 60;
- memcpy (chkb, base, length);
+ memmove (chkb, base, length);
chkb[length] = (sequence & 0xff) ^ p[0];
chkb[length+1] = p[1];
--- a/qw/console.c
+++ b/qw/console.c
@@ -169,7 +169,7 @@
if (con_linewidth < numchars)
numchars = con_linewidth;
- memcpy (tbuf, con->text, CON_TEXTSIZE);
+ memmove (tbuf, con->text, CON_TEXTSIZE);
memset (con->text, ' ', CON_TEXTSIZE);
for (i=0 ; i<numlines ; i++)
--- a/qw/draw.c
+++ b/qw/draw.c
@@ -283,7 +283,7 @@
source = pic->data;
dest = vid.buffer + y * vid.rowbytes + x;
for(v=0; v<pic->height; v++){
- memcpy(dest, source, pic->width);
+ memmove(dest, source, pic->width);
dest += vid.rowbytes;
source += pic->width;
}
@@ -311,7 +311,7 @@
source = pic->data + srcy * pic->width + srcx;
dest = vid.buffer + y * vid.rowbytes + x;
for(v=0; v<height; v++){
- memcpy(dest, source, width);
+ memmove(dest, source, width);
dest += vid.rowbytes;
source += pic->width;
}
@@ -478,7 +478,7 @@
dest = conback->data + 320 - (strlen(ver)*8 + 11) + 320*186;
}
- memcpy(saveback, conback->data + 320*186, 320*8);
+ memmove(saveback, conback->data + 320*186, 320*8);
for (x=0 ; x<strlen(ver) ; x++)
Draw_CharToConback (ver[x], dest+(x<<3));
@@ -488,7 +488,7 @@
v = (vid.conheight - lines + y) * 200 / vid.conheight;
src = conback->data + v * 320;
if(vid.conwidth == 320)
- memcpy(dest, src, vid.conwidth);
+ memmove(dest, src, vid.conwidth);
else{
f = 0;
fstep = 320 * 0x10000 / vid.conwidth;
@@ -501,7 +501,7 @@
}
}
// put it back
- memcpy(conback->data + 320*186, saveback, 320*8);
+ memmove(conback->data + 320*186, saveback, 320*8);
}
@@ -546,7 +546,7 @@
{
for (i=0 ; i<prect->height ; i++)
{
- memcpy (pdest, psrc, prect->width);
+ memmove (pdest, psrc, prect->width);
psrc += rowbytes;
pdest += vid.rowbytes;
}
--- a/qw/md4.c
+++ b/qw/md4.c
@@ -121,7 +121,7 @@
/* Transform as many times as possible.*/
if (inputLen >= partLen)
{
- memcpy((POINTER)&context->buffer[index], (POINTER)input, partLen);
+ memmove((POINTER)&context->buffer[index], (POINTER)input, partLen);
MD4Transform (context->state, context->buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
@@ -133,7 +133,7 @@
i = 0;
/* Buffer remaining input */
- memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
+ memmove ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i);
}
--- a/qw/menu.c
+++ b/qw/menu.c
@@ -136,16 +136,16 @@
identityTable[j] = j;
dest = translationTable;
source = identityTable;
- memcpy (dest, source, 256);
+ memmove (dest, source, 256);
if (top < 128) // the artists made some backwards ranges. sigh.
- memcpy (dest + TOP_RANGE, source + top, 16);
+ memmove (dest + TOP_RANGE, source + top, 16);
else
for (j=0 ; j<16 ; j++)
dest[TOP_RANGE+j] = source[top+15-j];
if (bottom < 128)
- memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
+ memmove (dest + BOTTOM_RANGE, source + bottom, 16);
else
for (j=0 ; j<16 ; j++)
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
--- a/qw/model.c
+++ b/qw/model.c
@@ -99,7 +99,7 @@
out = decompressed;
/*
- memcpy (out, in, row);
+ memmove (out, in, row);
*/
if (!in)
{ // no vis info, so make all visible
@@ -352,13 +352,13 @@
tx = Hunk_AllocName (sizeof(texture_t) +pixels, loadname );
loadmodel->textures[i] = tx;
- memcpy (tx->name, mt->name, sizeof(tx->name));
+ memmove (tx->name, mt->name, sizeof(tx->name));
tx->width = mt->width;
tx->height = mt->height;
for (j=0 ; j<MIPLEVELS ; j++)
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
// the pixels immediately follow the structures
- memcpy ( tx+1, mt+1, pixels);
+ memmove ( tx+1, mt+1, pixels);
if (!strncmp(mt->name,"sky",3))
R_InitSky (tx);
@@ -471,7 +471,7 @@
return;
}
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
}
@@ -488,7 +488,7 @@
return;
}
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
}
@@ -505,7 +505,7 @@
return;
}
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->entities, mod_base + l->fileofs, l->filelen);
}
@@ -1330,7 +1330,7 @@
pskin = Hunk_AllocName (skinsize * r_pixbytes, loadname);
pinskin = (byte *)pin;
*pskinindex = (byte *)pskin - (byte *)pheader;
- memcpy (pskin, pinskin, skinsize);
+ memmove (pskin, pinskin, skinsize);
pinskin += skinsize;
return ((void *)pinskin);
}
@@ -1637,7 +1637,7 @@
Cache_Alloc (&mod->cache, total, loadname);
if (!mod->cache.data)
return;
- memcpy (mod->cache.data, pheader, total);
+ memmove (mod->cache.data, pheader, total);
Hunk_FreeToLowMark (start);
}
@@ -1676,7 +1676,7 @@
pspriteframe->down = origin[1] - height;
pspriteframe->left = origin[0];
pspriteframe->right = width + origin[0];
- memcpy (&pspriteframe->pixels[0], (byte *)(pinframe + 1), size);
+ memmove (&pspriteframe->pixels[0], (byte *)(pinframe + 1), size);
return (void *)((byte *)pinframe + sizeof (dspriteframe_t) + size);
}
--- a/qw/net_chan.c
+++ b/qw/net_chan.c
@@ -137,7 +137,7 @@
memset (chan, 0, sizeof(*chan));
if(adr != nil)
- memcpy(&chan->remote_address, adr, sizeof *adr);
+ memmove(&chan->remote_address, adr, sizeof *adr);
chan->last_received = realtime;
chan->message.data = chan->message_buf;
@@ -217,7 +217,7 @@
// if the reliable transmit buffer is empty, copy the current message out
if (!chan->reliable_length && chan->message.cursize)
{
- memcpy (chan->reliable_buf, chan->message_buf, chan->message.cursize);
+ memmove (chan->reliable_buf, chan->message_buf, chan->message.cursize);
chan->reliable_length = chan->message.cursize;
chan->message.cursize = 0;
chan->reliable_sequence ^= 1;
--- a/qw/net_udp.c
+++ b/qw/net_udp.c
@@ -121,7 +121,7 @@
if(a == cons + nelem(cons))
return;
else if(a->fd < 0){
- memcpy(a, to, sizeof *a);
+ memmove(a, to, sizeof *a);
if((a->fd = dial(netmkaddr(a->addr, "udp", a->srv), nil, nil, nil)) < 0){
fprint(2, "dial: %r\n");
return;
--- a/qw/pr_cmds.c
+++ b/qw/pr_cmds.c
@@ -588,7 +588,7 @@
VectorAdd (ent->v.origin, ent->v.view_ofs, org);
leaf = Mod_PointInLeaf (org, sv.worldmodel);
pvs = Mod_LeafPVS (leaf, sv.worldmodel);
- memcpy (checkpvs, pvs, (sv.worldmodel->numleafs+7)>>3 );
+ memmove (checkpvs, pvs, (sv.worldmodel->numleafs+7)>>3 );
return i;
}
--- a/qw/r_sprite.c
+++ b/qw/r_sprite.c
@@ -68,7 +68,7 @@
// handle wraparound case
dists[nump] = dists[0];
- memcpy (instep, in, sizeof (vec5_t));
+ memmove (instep, in, sizeof (vec5_t));
// clip the winding
@@ -79,7 +79,7 @@
{
if (dists[i] >= 0)
{
- memcpy (outstep, instep, sizeof (vec5_t));
+ memmove (outstep, instep, sizeof (vec5_t));
outstep += sizeof (vec5_t) / sizeof (float);
outcount++;
}
--- a/qw/sv_ccmds.c
+++ b/qw/sv_ccmds.c
@@ -790,7 +790,7 @@
}
strcpy(cl->uploadfn, checkname);
- memcpy(&cl->snap_from, &net_from, sizeof(net_from));
+ memmove(&cl->snap_from, &net_from, sizeof(net_from));
if (sv_redirected != RD_NONE)
cl->remote_snap = true;
else
--- a/qw/sv_init.c
+++ b/qw/sv_init.c
@@ -184,7 +184,7 @@
vcount = 0;
for (i=0 ; i<num ; i++, scan+=rowbytes)
{
- memcpy (scan, Mod_LeafPVS(sv.worldmodel->leafs+i, sv.worldmodel),
+ memmove (scan, Mod_LeafPVS(sv.worldmodel->leafs+i, sv.worldmodel),
rowbytes);
if (i == 0)
continue;
@@ -204,7 +204,7 @@
dest = (unsigned *)sv.phs;
for (i=0 ; i<num ; i++, dest += rowwords, scan += rowbytes)
{
- memcpy (dest, scan, rowbytes);
+ memmove (dest, scan, rowbytes);
for (j=0 ; j<rowbytes ; j++)
{
bitbyte = scan[j];
--- a/qw/sv_send.c
+++ b/qw/sv_send.c
@@ -41,7 +41,7 @@
send[2] = 0xff;
send[3] = 0xff;
send[4] = A2C_PRINT;
- memcpy (send+5, outputbuf, strlen(outputbuf)+1);
+ memmove (send+5, outputbuf, strlen(outputbuf)+1);
NET_SendPacket (strlen(send)+1, send, net_from);
}
@@ -709,7 +709,7 @@
//move along, move along
for (j = 1; j < c->num_backbuf; j++) {
- memcpy(c->backbuf_data[j - 1], c->backbuf_data[j],
+ memmove(c->backbuf_data[j - 1], c->backbuf_data[j],
c->backbuf_size[j]);
c->backbuf_size[j - 1] = c->backbuf_size[j];
}
--- a/qw/svmodel.c
+++ b/qw/svmodel.c
@@ -81,7 +81,7 @@
out = decompressed;
/*
- memcpy (out, in, row);
+ memmove (out, in, row);
*/
if (!in)
{ // no vis info, so make all visible
@@ -296,13 +296,13 @@
tx = Hunk_AllocName (sizeof(texture_t) +pixels, loadname );
loadmodel->textures[i] = tx;
- memcpy (tx->name, mt->name, sizeof(tx->name));
+ memmove (tx->name, mt->name, sizeof(tx->name));
tx->width = mt->width;
tx->height = mt->height;
for (j=0 ; j<MIPLEVELS ; j++)
tx->offsets[j] = mt->offsets[j] + sizeof(texture_t) - sizeof(miptex_t);
// the pixels immediately follow the structures
- memcpy ( tx+1, mt+1, pixels);
+ memmove ( tx+1, mt+1, pixels);
}
//
@@ -412,7 +412,7 @@
return;
}
loadmodel->lightdata = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->lightdata, mod_base + l->fileofs, l->filelen);
}
@@ -429,7 +429,7 @@
return;
}
loadmodel->visdata = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->visdata, mod_base + l->fileofs, l->filelen);
}
@@ -446,7 +446,7 @@
return;
}
loadmodel->entities = Hunk_AllocName ( l->filelen, loadname);
- memcpy (loadmodel->entities, mod_base + l->fileofs, l->filelen);
+ memmove (loadmodel->entities, mod_base + l->fileofs, l->filelen);
}
--- a/qw/zone.c
+++ b/qw/zone.c
@@ -343,7 +343,7 @@
//
// print the single block
//
- memcpy (name, h->name, 8);
+ memmove (name, h->name, 8);
if (all)
Con_Printf ("%8p :%8d %8s\n",h, h->size, name);
@@ -558,9 +558,9 @@
{
// Con_Printf ("cache_move ok\n");
- memcpy(new+1, c+1, c->size - sizeof(cache_system_t));
+ memmove(new+1, c+1, c->size - sizeof(cache_system_t));
new->user = c->user;
- memcpy(new->name, c->name, sizeof(new->name));
+ memmove(new->name, c->name, sizeof(new->name));
Cache_Free (c->user);
new->user->data = (void *)(new+1);
}
--- a/r_sprite.c
+++ b/r_sprite.c
@@ -65,7 +65,7 @@
// handle wraparound case
dists[nump] = dists[0];
- memcpy(instep, in, sizeof(vec5_t));
+ memmove(instep, in, sizeof(vec5_t));
// clip the winding
@@ -76,7 +76,7 @@
{
if (dists[i] >= 0)
{
- memcpy(outstep, instep, sizeof(vec5_t));
+ memmove(outstep, instep, sizeof(vec5_t));
outstep += sizeof (vec5_t) / sizeof (float);
outcount++;
}
--- a/sv_main.c
+++ b/sv_main.c
@@ -312,7 +312,7 @@
netconnection = client->netconnection;
if(sv.loadgame)
- memcpy(spawn_parms, client->spawn_parms, sizeof spawn_parms);
+ memmove(spawn_parms, client->spawn_parms, sizeof spawn_parms);
memset(client, 0, sizeof *client);
client->netconnection = netconnection;
@@ -325,7 +325,7 @@
client->message.allowoverflow = true; // we can catch it
if(sv.loadgame)
- memcpy(client->spawn_parms, spawn_parms, sizeof spawn_parms);
+ memmove(client->spawn_parms, spawn_parms, sizeof spawn_parms);
else{
// call the progs to get default spawn parms for the new client
PR_ExecuteProgram(sv.pr, sv.pr->global_struct->SetNewParms);