Remove M_Memcpy
Was quite literally a wrapper that did nothing.
This commit is contained in:
parent
278c1ee941
commit
d7ed03fab9
46 changed files with 176 additions and 200 deletions
|
|
@ -36,7 +36,6 @@ m_easing.c
|
|||
m_fixed.c
|
||||
m_menu.c
|
||||
m_textinput.c
|
||||
m_memcpy.c
|
||||
m_misc.cpp
|
||||
m_emotes.cpp
|
||||
m_perfstats.c
|
||||
|
|
|
|||
|
|
@ -2739,7 +2739,7 @@ bool CallFunc_SetObjectSpecial(ACSVM::Thread *thread, const ACSVM::Word *argV, A
|
|||
}
|
||||
|
||||
mobj->script_stringargs[i] = static_cast<char *>(Z_Realloc(mobj->script_stringargs[i], len + 1, PU_STATIC, nullptr));
|
||||
M_Memcpy(mobj->script_stringargs[i], strPtr->str, len + 1);
|
||||
memcpy(mobj->script_stringargs[i], strPtr->str, len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3639,7 +3639,7 @@ bool CallFunc_SetLineProperty(ACSVM::Thread *thread, const ACSVM::Word *argV, AC
|
|||
else \
|
||||
{ \
|
||||
line->y = static_cast<char *>(Z_Realloc(line->y, str->len + 1, PU_LEVEL, NULL)); \
|
||||
M_Memcpy(line->y, str->str, str->len + 1); \
|
||||
memcpy(line->y, str->str, str->len + 1); \
|
||||
line->y[str->len] = '\0'; \
|
||||
} \
|
||||
break; \
|
||||
|
|
@ -3907,7 +3907,7 @@ bool CallFunc_SetSideProperty(ACSVM::Thread *thread, const ACSVM::Word *argV, AC
|
|||
else \
|
||||
{ \
|
||||
side->y = static_cast<char *>(Z_Realloc(side->y, str->len + 1, PU_LEVEL, NULL)); \
|
||||
M_Memcpy(side->y, str->str, str->len + 1); \
|
||||
memcpy(side->y, str->str, str->len + 1); \
|
||||
side->y[str->len] = '\0'; \
|
||||
} \
|
||||
break; \
|
||||
|
|
@ -4214,7 +4214,7 @@ bool CallFunc_SetSectorProperty(ACSVM::Thread *thread, const ACSVM::Word *argV,
|
|||
else \
|
||||
{ \
|
||||
sector->y = static_cast<char *>(Z_Realloc(sector->y, str->len + 1, PU_LEVEL, NULL)); \
|
||||
M_Memcpy(sector->y, str->str, str->len + 1); \
|
||||
memcpy(sector->y, str->str, str->len + 1); \
|
||||
sector->y[str->len] = '\0'; \
|
||||
} \
|
||||
break; \
|
||||
|
|
@ -4603,7 +4603,7 @@ bool CallFunc_SetThingProperty(ACSVM::Thread *thread, const ACSVM::Word *argV, A
|
|||
else \
|
||||
{ \
|
||||
mobj->y = static_cast<char *>(Z_Realloc(mobj->y, str->len + 1, PU_LEVEL, NULL)); \
|
||||
M_Memcpy(mobj->y, str->str, str->len + 1); \
|
||||
memcpy(mobj->y, str->str, str->len + 1); \
|
||||
mobj->y[str->len] = '\0'; \
|
||||
} \
|
||||
break; \
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ ACSVM::Word Environment::callSpecImpl
|
|||
ACSVM::String *strPtr = map->getString(argV[i]);
|
||||
|
||||
stringargs[i] = static_cast<char *>(Z_Malloc(strPtr->len + 1, PU_STATIC, nullptr));
|
||||
M_Memcpy(stringargs[i], strPtr->str, strPtr->len + 1);
|
||||
memcpy(stringargs[i], strPtr->str, strPtr->len + 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < std::min((signed)(argC), NUM_SCRIPT_ARGS); i++)
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ void COM_BufInsertTextEx(const char *ptext, int flags)
|
|||
templen = com_text.cursize;
|
||||
if (templen)
|
||||
{
|
||||
temp = M_Memcpy(ZZ_Alloc(templen), com_text.data, templen);
|
||||
temp = memcpy(ZZ_Alloc(templen), com_text.data, templen);
|
||||
VS_Clear(&com_text);
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ void COM_BufExecute(void)
|
|||
break;
|
||||
}
|
||||
|
||||
M_Memcpy(line, ptext, i);
|
||||
memcpy(line, ptext, i);
|
||||
line[i] = 0;
|
||||
|
||||
// flush the command text from the command buffer, _BEFORE_
|
||||
|
|
@ -1393,7 +1393,7 @@ void *VS_GetSpace(vsbuf_t *buf, size_t length)
|
|||
*/
|
||||
void VS_Write(vsbuf_t *buf, const void *data, size_t length)
|
||||
{
|
||||
M_Memcpy(VS_GetSpace(buf, length), data, length);
|
||||
memcpy(VS_GetSpace(buf, length), data, length);
|
||||
}
|
||||
|
||||
void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags)
|
||||
|
|
@ -1402,7 +1402,7 @@ void VS_WriteEx(vsbuf_t *buf, const void *data, size_t length, int flags)
|
|||
p = VS_GetSpace(buf, 2 + length);
|
||||
p[0] = '\033';
|
||||
p[1] = flags;
|
||||
M_Memcpy(&p[2], data, length);
|
||||
memcpy(&p[2], data, length);
|
||||
}
|
||||
|
||||
/** Prints text in a variable buffer. Like VS_Write() plus a
|
||||
|
|
@ -1419,9 +1419,9 @@ void VS_Print(vsbuf_t *buf, const char *data)
|
|||
len = strlen(data) + 1;
|
||||
|
||||
if (buf->data[buf->cursize-1])
|
||||
M_Memcpy((UINT8 *)VS_GetSpace(buf, len), data, len); // no trailing 0
|
||||
memcpy((UINT8 *)VS_GetSpace(buf, len), data, len); // no trailing 0
|
||||
else
|
||||
M_Memcpy((UINT8 *)VS_GetSpace(buf, len-1) - 1, data, len); // write over trailing 0
|
||||
memcpy((UINT8 *)VS_GetSpace(buf, len-1) - 1, data, len); // write over trailing 0
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ static void CON_RecalcSize(void)
|
|||
oldcon_width = con_width;
|
||||
oldnumlines = con_totallines;
|
||||
oldcon_cy = con_cy;
|
||||
M_Memcpy(tmp_buffer, con_buffer, CON_BUFFERSIZE);
|
||||
memcpy(tmp_buffer, con_buffer, CON_BUFFERSIZE);
|
||||
|
||||
if (conw < 1)
|
||||
con_width = (BASEVIDWIDTH>>3) - 2;
|
||||
|
|
@ -592,7 +592,7 @@ static void CON_RecalcSize(void)
|
|||
{
|
||||
if (tmp_buffer[(i%oldnumlines)*oldcon_width])
|
||||
{
|
||||
M_Memcpy(string, &tmp_buffer[(i%oldnumlines)*oldcon_width], oldcon_width);
|
||||
memcpy(string, &tmp_buffer[(i%oldnumlines)*oldcon_width], oldcon_width);
|
||||
conw = oldcon_width - 1;
|
||||
while (string[conw] == ' ' && conw)
|
||||
conw--;
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ static inline void *G_DcpyTiccmd(void* dest, const ticcmd_t* src, const size_t n
|
|||
UINT8 *ret = dest;
|
||||
|
||||
if (r)
|
||||
M_Memcpy(dest, src, n);
|
||||
memcpy(dest, src, n);
|
||||
else if (d)
|
||||
G_MoveTiccmd(dest, src, d);
|
||||
return ret+n;
|
||||
|
|
@ -234,7 +234,7 @@ static inline void *G_ScpyTiccmd(ticcmd_t* dest, void* src, const size_t n)
|
|||
UINT8 *ret = src;
|
||||
|
||||
if (r)
|
||||
M_Memcpy(dest, src, n);
|
||||
memcpy(dest, src, n);
|
||||
else if (d)
|
||||
G_MoveTiccmd(dest, src, d);
|
||||
return ret+n;
|
||||
|
|
@ -299,7 +299,7 @@ void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_
|
|||
|
||||
if (param && nparam)
|
||||
{
|
||||
M_Memcpy(&localtextcmd[playerid][((UINT16*)localtextcmd[playerid])[0] + 2], param, nparam);
|
||||
memcpy(&localtextcmd[playerid][((UINT16*)localtextcmd[playerid])[0] + 2], param, nparam);
|
||||
((UINT16*)localtextcmd[playerid])[0] = ((UINT16*)localtextcmd[playerid])[0] + (UINT8)nparam;
|
||||
}
|
||||
}
|
||||
|
|
@ -535,7 +535,7 @@ void SendKick(UINT8 playernum, UINT8 msg)
|
|||
if (!textcmd)
|
||||
return false;
|
||||
|
||||
M_Memcpy(*demo_point, textcmd, textcmd[0]+1);
|
||||
memcpy(*demo_point, textcmd, textcmd[0]+1);
|
||||
*demo_point += textcmd[0]+1;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -550,7 +550,7 @@ void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum)
|
|||
|
||||
textcmd = D_GetTextcmd(gametic, playernum);
|
||||
nextra = **demo_pointer;
|
||||
M_Memcpy(textcmd, *demo_pointer, nextra + 1);
|
||||
memcpy(textcmd, *demo_pointer, nextra + 1);
|
||||
// increment demo pointer
|
||||
*demo_pointer += nextra + 1;
|
||||
}*/
|
||||
|
|
@ -5069,7 +5069,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||
DEBFILE(va("textcmd put in tic %u at position %d (player %d) ftts %u mk %u\n",
|
||||
tic, ((UINT16*)textcmd)[0]+2, netconsole, firstticstosend, maketic));
|
||||
|
||||
M_Memcpy(&textcmd[((UINT16*)textcmd)[0]+2], netbuffer->u.textcmd+2, incoming_size);
|
||||
memcpy(&textcmd[((UINT16*)textcmd)[0]+2], netbuffer->u.textcmd+2, incoming_size);
|
||||
((UINT16*)textcmd)[0] += incoming_size;
|
||||
}
|
||||
break;
|
||||
|
|
@ -5186,7 +5186,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
|||
const size_t txtsize = ((UINT16*)txtpak)[0]+2;
|
||||
|
||||
if (i >= gametic) // Don't copy old net commands
|
||||
M_Memcpy(D_GetTextcmd(i, k), txtpak, txtsize);
|
||||
memcpy(D_GetTextcmd(i, k), txtpak, txtsize);
|
||||
txtpak += txtsize;
|
||||
}
|
||||
}
|
||||
|
|
@ -5592,7 +5592,7 @@ static void CL_SendClientCmd(void)
|
|||
break;
|
||||
}
|
||||
|
||||
M_Memcpy(netbuffer->u.textcmd, localtextcmd[i], ((UINT16*)localtextcmd[i])[0]+2);
|
||||
memcpy(netbuffer->u.textcmd, localtextcmd[i], ((UINT16*)localtextcmd[i])[0]+2);
|
||||
// All extra data have been sent
|
||||
if (HSendPacket(servernode, true, 0, ((UINT16*)localtextcmd[i])[0]+2)) // Send can fail...
|
||||
((UINT16*)localtextcmd[i])[0] = 0;
|
||||
|
|
|
|||
10
src/d_net.c
10
src/d_net.c
|
|
@ -256,7 +256,7 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer)
|
|||
ackpak[i].senttime = I_GetTime();
|
||||
ackpak[i].resentnum = 0;
|
||||
}
|
||||
M_Memcpy(ackpak[i].pak.raw, netbuffer, ackpak[i].length);
|
||||
memcpy(ackpak[i].pak.raw, netbuffer, ackpak[i].length);
|
||||
|
||||
*freeack = ackpak[i].acknum;
|
||||
|
||||
|
|
@ -446,7 +446,7 @@ void Net_SendAcks(INT32 node)
|
|||
{
|
||||
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
|
||||
netbuffer->packettype = PT_NOTHING;
|
||||
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
||||
memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
|
||||
HSendPacket(node, false, 0, MAXACKTOSEND);
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ void Net_AckTicker(void)
|
|||
}
|
||||
DEBFILE(va("Resend ack %d, %u<%d at %u\n", ackpak[i].acknum, ackpak[i].senttime,
|
||||
NODETIMEOUT, I_GetTime()));
|
||||
M_Memcpy(netbuffer, ackpak[i].pak.raw, ackpak[i].length);
|
||||
memcpy(netbuffer, ackpak[i].pak.raw, ackpak[i].length);
|
||||
ackpak[i].senttime = I_GetTime();
|
||||
ackpak[i].resentnum++;
|
||||
ackpak[i].nextacknum = node->nextacknum;
|
||||
|
|
@ -1027,7 +1027,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
|
|||
return false;
|
||||
}
|
||||
netbuffer->ack = netbuffer->ackreturn = 0; // don't hold over values from last packet sent/received
|
||||
M_Memcpy(&reboundstore[rebound_head], netbuffer,
|
||||
memcpy(&reboundstore[rebound_head], netbuffer,
|
||||
doomcom->datalength);
|
||||
reboundsize[rebound_head] = doomcom->datalength;
|
||||
rebound_head = (rebound_head+1) % MAXREBOUND;
|
||||
|
|
@ -1119,7 +1119,7 @@ boolean HGetPacket(void)
|
|||
// Get a packet from self
|
||||
if (rebound_tail != rebound_head)
|
||||
{
|
||||
M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]);
|
||||
memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]);
|
||||
doomcom->datalength = reboundsize[rebound_tail];
|
||||
if (netbuffer->packettype == PT_NODETIMEOUT)
|
||||
doomcom->remotenode = netbuffer->u.textcmd[0];
|
||||
|
|
|
|||
|
|
@ -1227,7 +1227,7 @@ void FileSendTicker(void)
|
|||
if (f->size-transfer[i].position < fragmentsize)
|
||||
fragmentsize = f->size-transfer[i].position;
|
||||
if (ram)
|
||||
M_Memcpy(p->data, &f->id.ram[transfer[i].position], fragmentsize);
|
||||
memcpy(p->data, &f->id.ram[transfer[i].position], fragmentsize);
|
||||
else
|
||||
{
|
||||
fseek(transfer[i].currentfile, transfer[i].position, SEEK_SET);
|
||||
|
|
@ -1343,7 +1343,7 @@ static void SendAckPacket(fileack_pak *packet, UINT8 fileid)
|
|||
|
||||
// Send the packet
|
||||
netbuffer->packettype = PT_FILEACK;
|
||||
M_Memcpy(&netbuffer->u.fileack, packet, packetsize);
|
||||
memcpy(&netbuffer->u.fileack, packet, packetsize);
|
||||
HSendPacket(servernode, false, 0, packetsize);
|
||||
|
||||
// Clear the packet
|
||||
|
|
@ -1686,7 +1686,7 @@ void nameonly(char *s)
|
|||
ns = &(s[j+1]);
|
||||
len = strlen(ns);
|
||||
#if 0
|
||||
M_Memcpy(s, ns, len+1);
|
||||
memcpy(s, ns, len+1);
|
||||
#else
|
||||
memmove(s, ns, len+1);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -944,7 +944,7 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
{
|
||||
size_t newsize = sizeof(mobjtype_t) * mapheaderinfo[num]->numFlickies;
|
||||
mapheaderinfo[num]->flickies = Z_Realloc(mapheaderinfo[num]->flickies, newsize, PU_STATIC, NULL);
|
||||
M_Memcpy(mapheaderinfo[num]->flickies, tmpflickies, newsize);
|
||||
memcpy(mapheaderinfo[num]->flickies, tmpflickies, newsize);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -991,7 +991,7 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
size_t newsize = sizeof(mobjtype_t) * mapheaderinfo[num]->numFlickies;
|
||||
mapheaderinfo[num]->flickies = Z_Realloc(mapheaderinfo[num]->flickies, newsize, PU_STATIC, NULL);
|
||||
// now we add them to the list!
|
||||
M_Memcpy(mapheaderinfo[num]->flickies, tmpflickies, newsize);
|
||||
memcpy(mapheaderinfo[num]->flickies, tmpflickies, newsize);
|
||||
}
|
||||
else
|
||||
deh_warning("Level header %d: no valid flicky types found\n", num);
|
||||
|
|
@ -4239,7 +4239,7 @@ struct {
|
|||
{
|
||||
size_t len = (p-line);
|
||||
char *word = malloc(len+1);
|
||||
M_Memcpy(word,line,len);
|
||||
memcpy(word,line,len);
|
||||
word[len] = '\0';
|
||||
return word;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -315,7 +315,6 @@ extern char liveeventbackup[256];
|
|||
#define M_GetText(x) (x)
|
||||
#endif
|
||||
void M_StartupLocale(void);
|
||||
void *M_Memcpy(void* dest, const void* src, size_t n);
|
||||
char *va(const char *format, ...) FUNCPRINTF;
|
||||
|
||||
char *M_GetToken(const char *inputString);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ void F_DoWipe(fademask_t *fademask)
|
|||
// shortcut - memcpy source to work
|
||||
while (draw_linestogo--)
|
||||
{
|
||||
M_Memcpy(w_base+relativepos, s_base+relativepos, draw_rowend-draw_rowstart);
|
||||
memcpy(w_base+relativepos, s_base+relativepos, draw_rowend-draw_rowstart);
|
||||
relativepos += vid.width;
|
||||
}
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ void F_DoWipe(fademask_t *fademask)
|
|||
// shortcut - memcpy target to work
|
||||
while (draw_linestogo--)
|
||||
{
|
||||
M_Memcpy(w_base+relativepos, e_base+relativepos, draw_rowend-draw_rowstart);
|
||||
memcpy(w_base+relativepos, e_base+relativepos, draw_rowend-draw_rowstart);
|
||||
relativepos += vid.width;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/g_demo.c
12
src/g_demo.c
|
|
@ -2802,7 +2802,7 @@ void G_BeginRecording(void)
|
|||
demoflags |= DF_LUAVARS;
|
||||
|
||||
// Setup header.
|
||||
M_Memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
||||
memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
||||
WRITEUINT8(demobuf.p,VERSION);
|
||||
WRITEUINT8(demobuf.p,SUBVERSION);
|
||||
WRITEUINT16(demobuf.p,DEMOVERSION);
|
||||
|
|
@ -2827,7 +2827,7 @@ void G_BeginRecording(void)
|
|||
demobuf.p += sizeof(UINT64);
|
||||
|
||||
// game data
|
||||
M_Memcpy(demobuf.p, "PLAY", 4); demobuf.p += 4;
|
||||
memcpy(demobuf.p, "PLAY", 4); demobuf.p += 4;
|
||||
WRITESTRINGN(demobuf.p, mapheaderinfo[gamemap-1]->lumpname, MAXMAPLUMPNAME);
|
||||
WRITEUINT64(demobuf.p, maphash);
|
||||
|
||||
|
|
@ -3005,7 +3005,7 @@ void G_BeginMetal(void)
|
|||
demobuf.p = demobuf.buffer;
|
||||
|
||||
// Write header.
|
||||
M_Memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
||||
memcpy(demobuf.p, DEMOHEADER, 12); demobuf.p += 12;
|
||||
WRITEUINT8(demobuf.p,VERSION);
|
||||
WRITEUINT8(demobuf.p,SUBVERSION);
|
||||
WRITEUINT16(demobuf.p,DEMOVERSION);
|
||||
|
|
@ -3013,7 +3013,7 @@ void G_BeginMetal(void)
|
|||
// demo checksum
|
||||
demobuf.p += sizeof(UINT64);
|
||||
|
||||
M_Memcpy(demobuf.p, "METL", 4); demobuf.p += 4;
|
||||
memcpy(demobuf.p, "METL", 4); demobuf.p += 4;
|
||||
|
||||
memset(&ghostext,0,sizeof(ghostext));
|
||||
ghostext[0].lastscale = ghostext[0].scale = FRACUNIT;
|
||||
|
|
@ -3326,7 +3326,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
|
|||
return;
|
||||
}
|
||||
|
||||
M_Memcpy(pdemo->title, header.demotitle, 64);
|
||||
memcpy(pdemo->title, header.demotitle, 64);
|
||||
|
||||
if (header.version != VERSION || header.subversion != SUBVERSION)
|
||||
pdemo->type = MD_OUTDATED;
|
||||
|
|
@ -4389,7 +4389,7 @@ void G_SaveDemo(void)
|
|||
}
|
||||
WRITEUINT8(demobuf.p, DW_END); // Mark end of demo extra data.
|
||||
|
||||
M_Memcpy(p, demo.titlename, 64); // Write demo title here
|
||||
memcpy(p, demo.titlename, 64); // Write demo title here
|
||||
p += 64;
|
||||
|
||||
if (multiplayer)
|
||||
|
|
|
|||
|
|
@ -1634,7 +1634,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
ticcmd_t *G_CopyTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
{
|
||||
return M_Memcpy(dest, src, n*sizeof(*src));
|
||||
return memcpy(dest, src, n*sizeof(*src));
|
||||
}
|
||||
|
||||
ticcmd_t *G_MoveTiccmd(ticcmd_t* dest, const ticcmd_t* src, const size_t n)
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ static void make_outphase_sfx(void *dest, void *src, INT32 size)
|
|||
{
|
||||
SINT8 *s = (SINT8 *)src + HEADER_SIZE, *d = (SINT8 *)dest + HEADER_SIZE;
|
||||
|
||||
M_Memcpy(dest, src, HEADER_SIZE);
|
||||
memcpy(dest, src, HEADER_SIZE);
|
||||
size -= HEADER_SIZE;
|
||||
|
||||
while (size--)
|
||||
|
|
@ -660,7 +660,7 @@ INT32 HW3S_Init(I_Error_t FatalErrorFunction, snddev_t *snd_dev)
|
|||
|
||||
p_attack_source.sfxinfo = NULL;
|
||||
|
||||
M_Memcpy(&p_attack_source2, &p_attack_source, sizeof (source_t));
|
||||
memcpy(&p_attack_source2, &p_attack_source, sizeof (source_t));
|
||||
|
||||
p_attack_source.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
p_attack_source2.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
|
|
@ -671,7 +671,7 @@ INT32 HW3S_Init(I_Error_t FatalErrorFunction, snddev_t *snd_dev)
|
|||
|
||||
p_scream_source.sfxinfo = NULL;
|
||||
|
||||
M_Memcpy(&p_scream_source2, &p_scream_source, sizeof (source_t));
|
||||
memcpy(&p_scream_source2, &p_scream_source, sizeof (source_t));
|
||||
|
||||
p_scream_source.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
p_scream_source2.handle = HW3DS.pfnAddSource(&source_data, sfx_None);
|
||||
|
|
@ -689,7 +689,7 @@ INT32 HW3S_Init(I_Error_t FatalErrorFunction, snddev_t *snd_dev)
|
|||
|
||||
ambient_sdata.left.permanent = 1;
|
||||
|
||||
M_Memcpy(&ambient_sdata.right, &ambient_sdata.left, sizeof (source3D_data_t));
|
||||
memcpy(&ambient_sdata.right, &ambient_sdata.left, sizeof (source3D_data_t));
|
||||
|
||||
ambient_sdata.right.pos.x = -ambient_sdata.left.pos.x;
|
||||
ambient_source.left.handle = HW3DS.pfnAddSource(&ambient_sdata.left, sfx_None);
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
|
|||
WalkBSPNode(bsp->children[0], frontpoly, &bsp->children[0],bsp->bbox[0]);
|
||||
|
||||
// copy child bbox
|
||||
M_Memcpy(bbox, bsp->bbox[0], 4*sizeof (fixed_t));
|
||||
memcpy(bbox, bsp->bbox[0], 4*sizeof (fixed_t));
|
||||
}
|
||||
else
|
||||
I_Error("WalkBSPNode: no front poly?");
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ static void HWR_GenerateTexture(GLMapTexture_t *grtex, INT32 texnum, boolean noe
|
|||
|
||||
grtex->mipmap.colormap = Z_Calloc(sizeof(*grtex->mipmap.colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
grtex->mipmap.colormap->source = colormap;
|
||||
M_Memcpy(grtex->mipmap.colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(grtex->mipmap.colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
|
||||
blockwidth = texture->width;
|
||||
blockheight = texture->height;
|
||||
|
|
@ -1155,7 +1155,7 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
|||
|
||||
grmip->colormap = Z_Calloc(sizeof(*grmip->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
grmip->colormap->source = colormap;
|
||||
M_Memcpy(grmip->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(grmip->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
}
|
||||
|
||||
if (!grmip->downloaded && !grmip->data)
|
||||
|
|
@ -1213,7 +1213,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap)
|
|||
|
||||
grtex->mipmap.colormap = Z_Calloc(sizeof(*grtex->mipmap.colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
grtex->mipmap.colormap->source = colormap;
|
||||
M_Memcpy(grtex->mipmap.colormap->data, colormap, 256);
|
||||
memcpy(grtex->mipmap.colormap->data, colormap, 256);
|
||||
|
||||
for (size_t steppy = 0; steppy < size; steppy++)
|
||||
if (flat[steppy] != HWR_PATCHES_CHROMAKEY_COLORINDEX)
|
||||
|
|
@ -1332,7 +1332,7 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
|||
{
|
||||
if (memcmp(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8)))
|
||||
{
|
||||
M_Memcpy(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
HWR_UpdatePatchMipmap(patch, grMipmap);
|
||||
}
|
||||
else
|
||||
|
|
@ -1354,7 +1354,7 @@ void HWR_GetMappedPatch(patch_t *patch, const UINT8 *colormap)
|
|||
|
||||
newMipmap->colormap = Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
newMipmap->colormap->source = colormap;
|
||||
M_Memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
|
||||
HWR_LoadPatchMipmap(patch, newMipmap);
|
||||
}
|
||||
|
|
@ -1479,7 +1479,7 @@ patch_t *HWR_GetPic(lumpnum_t lumpnum)
|
|||
format2bpp(grPatch->mipmap->format) == format2bpp(picmode2GR[pic->mode]))
|
||||
{
|
||||
// no conversion needed
|
||||
M_Memcpy(grPatch->mipmap->data, pic->data,len);
|
||||
memcpy(grPatch->mipmap->data, pic->data,len);
|
||||
}
|
||||
else
|
||||
HWR_DrawPicInCache(block, SHORT(pic->width), SHORT(pic->height),
|
||||
|
|
|
|||
|
|
@ -2338,7 +2338,7 @@ static inline void HWR_AddPolyObjectSegs(void)
|
|||
for (j = 0; j < po_ptrs[i]->segCount; ++j)
|
||||
{
|
||||
// Copy the info of a polyobject's seg, then convert it to OpenGL floating point
|
||||
M_Memcpy(&gl_fakeline, po_ptrs[i]->segs[j], sizeof(seg_t));
|
||||
memcpy(&gl_fakeline, po_ptrs[i]->segs[j], sizeof(seg_t));
|
||||
|
||||
// Now convert the line to float and add it to be rendered
|
||||
pv1.x = FIXED_TO_FLOAT(gl_fakeline.v1->x);
|
||||
|
|
@ -6356,8 +6356,8 @@ static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, I
|
|||
Z_Realloc(wallinfo, allocedwalls * sizeof (*wallinfo), PU_LEVEL, &wallinfo);
|
||||
}
|
||||
|
||||
M_Memcpy(wallinfo[numwalls].wallVerts, wallVerts, sizeof (wallinfo[numwalls].wallVerts));
|
||||
M_Memcpy(&wallinfo[numwalls].Surf, pSurf, sizeof (FSurfaceInfo));
|
||||
memcpy(wallinfo[numwalls].wallVerts, wallVerts, sizeof (wallinfo[numwalls].wallVerts));
|
||||
memcpy(&wallinfo[numwalls].Surf, pSurf, sizeof (FSurfaceInfo));
|
||||
wallinfo[numwalls].texnum = texnum;
|
||||
wallinfo[numwalls].blend = blend;
|
||||
wallinfo[numwalls].noencore = noencore;
|
||||
|
|
@ -6633,7 +6633,7 @@ void HWR_LoadCustomShadersFromFile(UINT16 wadnum, boolean PK3)
|
|||
size = W_LumpLengthPwad(wadnum, lump);
|
||||
|
||||
line = Z_Malloc(size+1, PU_STATIC, NULL);
|
||||
M_Memcpy(line, shaderdef, size);
|
||||
memcpy(line, shaderdef, size);
|
||||
line[size] = '\0';
|
||||
|
||||
stoken = strtok(line, "\r\n ");
|
||||
|
|
|
|||
|
|
@ -1169,7 +1169,7 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendpatch, INT32 ski
|
|||
{
|
||||
if (memcmp(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8)))
|
||||
{
|
||||
M_Memcpy(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(grMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
HWR_CreateBlendedTexture(patch, blendpatch, grMipmap, skinnum, color);
|
||||
HWD.pfnUpdateTexture(grMipmap);
|
||||
}
|
||||
|
|
@ -1196,7 +1196,7 @@ static void HWR_GetBlendedTexture(patch_t *patch, patch_t *blendpatch, INT32 ski
|
|||
|
||||
newMipmap->colormap = Z_Calloc(sizeof(*newMipmap->colormap), PU_HWRPATCHCOLMIPMAP, NULL);
|
||||
newMipmap->colormap->source = colormap;
|
||||
M_Memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
memcpy(newMipmap->colormap->data, colormap, 256 * sizeof(UINT8));
|
||||
|
||||
HWR_CreateBlendedTexture(patch, blendpatch, newMipmap, skinnum, color);
|
||||
|
||||
|
|
|
|||
|
|
@ -395,13 +395,13 @@ void GenerateVertexNormals(model_t *model)
|
|||
float *vertPtr = frame->vertices;
|
||||
float *oldNormals;
|
||||
|
||||
M_Memcpy(newNormals, frame->normals, sizeof(float)*3*mesh->numTriangles*3);
|
||||
memcpy(newNormals, frame->normals, sizeof(float)*3*mesh->numTriangles*3);
|
||||
|
||||
/* if (!systemSucks)
|
||||
{
|
||||
memTag = Z_GetTag(frame->tangents);
|
||||
float *newTangents = (float*)Z_Malloc(sizeof(float)*3*mesh->numTriangles*3, memTag);
|
||||
M_Memcpy(newTangents, frame->tangents, sizeof(float)*3*mesh->numTriangles*3);
|
||||
memcpy(newTangents, frame->tangents, sizeof(float)*3*mesh->numTriangles*3);
|
||||
}*/
|
||||
|
||||
for (k = 0; k < mesh->numVertices; k++)
|
||||
|
|
@ -583,13 +583,13 @@ void Optimize(model_t *model)
|
|||
char *destByte;
|
||||
char *srcByte;
|
||||
|
||||
M_Memcpy(&newMesh->uvs[uvCount],
|
||||
memcpy(&newMesh->uvs[uvCount],
|
||||
curMesh->uvs,
|
||||
sizeof(float)*2*curMesh->numTriangles*3);
|
||||
|
||||
/* if (node->material->lightmap)
|
||||
{
|
||||
M_Memcpy(&newMesh->lightuvs[uvCount],
|
||||
memcpy(&newMesh->lightuvs[uvCount],
|
||||
curMesh->lightuvs,
|
||||
sizeof(float)*2*curMesh->numTriangles*3);
|
||||
}*/
|
||||
|
|
@ -597,13 +597,13 @@ void Optimize(model_t *model)
|
|||
|
||||
dest = (float*)newMesh->frames[0].vertices;
|
||||
src = (float*)curMesh->frames[0].vertices;
|
||||
M_Memcpy(&dest[vertCount],
|
||||
memcpy(&dest[vertCount],
|
||||
src,
|
||||
sizeof(float)*3*curMesh->numTriangles*3);
|
||||
|
||||
dest = (float*)newMesh->frames[0].normals;
|
||||
src = (float*)curMesh->frames[0].normals;
|
||||
M_Memcpy(&dest[vertCount],
|
||||
memcpy(&dest[vertCount],
|
||||
src,
|
||||
sizeof(float)*3*curMesh->numTriangles*3);
|
||||
|
||||
|
|
@ -611,7 +611,7 @@ void Optimize(model_t *model)
|
|||
{
|
||||
dest = (float*)newMesh->frames[0].tangents;
|
||||
src = (float*)curMesh->frames[0].tangents;
|
||||
M_Memcpy(&dest[vertCount],
|
||||
memcpy(&dest[vertCount],
|
||||
src,
|
||||
sizeof(float)*3*curMesh->numTriangles*3);
|
||||
}*/
|
||||
|
|
@ -623,7 +623,7 @@ void Optimize(model_t *model)
|
|||
|
||||
if (srcByte)
|
||||
{
|
||||
M_Memcpy(&destByte[colorCount],
|
||||
memcpy(&destByte[colorCount],
|
||||
srcByte,
|
||||
sizeof(char)*4*curMesh->numTriangles*3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ static boolean SOCK_Get(void)
|
|||
{
|
||||
const time_t curTime = time(NULL);
|
||||
|
||||
M_Memcpy(&clientaddress[j], &fromaddress, fromlen);
|
||||
memcpy(&clientaddress[j], &fromaddress, fromlen);
|
||||
nodesocket[j] = mysockets[n];
|
||||
DEBFILE(va("New node detected: node:%d address:%s\n", j,
|
||||
SOCK_GetNodeAddress(j)));
|
||||
|
|
@ -1525,7 +1525,7 @@ static boolean SOCK_Ban(INT32 node)
|
|||
ban = numbans;
|
||||
AddBannedIndex();
|
||||
|
||||
M_Memcpy(&banned[ban].address, &clientaddress[node], sizeof (mysockaddr_t));
|
||||
memcpy(&banned[ban].address, &clientaddress[node], sizeof (mysockaddr_t));
|
||||
|
||||
if (banned[ban].address.any.sa_family == AF_INET)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3603,9 +3603,9 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateXMatrix(rotangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(closestangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
|
||||
finalx = x + v[0];
|
||||
finaly = y + v[1];
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ void K_UserPropertyPush(mapUserProperties_t *user, const char *key, mapUserPrope
|
|||
prop = &user->properties[ user->length ];
|
||||
|
||||
prop->key = Z_Malloc(keyLength + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(prop->key, key, keyLength + 1);
|
||||
memcpy(prop->key, key, keyLength + 1);
|
||||
prop->key[keyLength] = '\0';
|
||||
|
||||
prop->hash = quickncasehash(prop->key, keyLength);
|
||||
|
|
@ -84,7 +84,7 @@ void K_UserPropertyPush(mapUserProperties_t *user, const char *key, mapUserPrope
|
|||
const size_t stringLength = strlen(string);
|
||||
|
||||
prop->valueStr = Z_Malloc(stringLength + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(prop->valueStr, string, stringLength + 1);
|
||||
memcpy(prop->valueStr, string, stringLength + 1);
|
||||
prop->valueStr[stringLength] = '\0';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ static int lib_concat(lua_State *L)
|
|||
return luaL_error(L, LUA_QL("tostring") " must return a string to "
|
||||
LUA_QL("__add"));
|
||||
r = Z_Realloc(r, rl+sl, PU_STATIC, NULL);
|
||||
M_Memcpy(r+rl, s, sl);
|
||||
memcpy(r+rl, s, sl);
|
||||
rl += sl;
|
||||
lua_pop(L, 1); /* pop result */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ lzf_decompress (const void *const in_data, size_t in_len,
|
|||
#endif
|
||||
|
||||
#if USE_MEMCPY
|
||||
M_Memcpy (op, ip, ctrl);
|
||||
memcpy (op, ip, ctrl);
|
||||
op += ctrl;
|
||||
ip += ctrl;
|
||||
#else
|
||||
|
|
@ -435,7 +435,7 @@ lzf_compress (const void *const in_data,size_t in_len,
|
|||
|
||||
*op++ = MAX_LIT - 1;
|
||||
#if USE_MEMCPY
|
||||
M_Memcpy (op, ip - MAX_LIT, MAX_LIT);
|
||||
memcpy (op, ip - MAX_LIT, MAX_LIT);
|
||||
op += MAX_LIT;
|
||||
lit = 0;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ vector2_t *FV2_UnLoad(vector2_t *vec, fixed_t *x, fixed_t *y)
|
|||
|
||||
vector2_t *FV2_Copy(vector2_t *a_o, const vector2_t *a_i)
|
||||
{
|
||||
return M_Memcpy(a_o, a_i, sizeof(vector2_t));
|
||||
return memcpy(a_o, a_i, sizeof(vector2_t));
|
||||
}
|
||||
|
||||
vector2_t *FV2_AddEx(const vector2_t *a_i, const vector2_t *a_c, vector2_t *a_o)
|
||||
|
|
@ -344,12 +344,12 @@ vector4_t *FV4_UnLoad(vector4_t *vec, fixed_t *x, fixed_t *y, fixed_t *z, fixed_
|
|||
|
||||
vector3_t *FV3_Copy(vector3_t *a_o, const vector3_t *a_i)
|
||||
{
|
||||
return M_Memcpy(a_o, a_i, sizeof(vector3_t));
|
||||
return memcpy(a_o, a_i, sizeof(vector3_t));
|
||||
}
|
||||
|
||||
vector4_t *FV4_Copy(vector4_t *a_o, const vector4_t *a_i)
|
||||
{
|
||||
return M_Memcpy(a_o, a_i, sizeof(vector4_t));
|
||||
return memcpy(a_o, a_i, sizeof(vector4_t));
|
||||
}
|
||||
|
||||
vector3_t *FV3_AddEx(const vector3_t *a_i, const vector3_t *a_c, vector3_t *a_o)
|
||||
|
|
@ -1280,7 +1280,7 @@ static void *cpu_cpy(void *dest, const void *src, size_t n)
|
|||
return memcpy(dest, src, n);
|
||||
}
|
||||
|
||||
void *(*M_Memcpy)(void* dest, const void* src, size_t n) = cpu_cpy;
|
||||
void *(*memcpy)(void* dest, const void* src, size_t n) = cpu_cpy;
|
||||
|
||||
void I_Error(const char *error, ...)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
// BLANKART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
||||
// Copyright (C) 1999-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file m_memcpy.c
|
||||
/// \brief (formerly) X86 optimized implementations of M_Memcpy
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "m_misc.h"
|
||||
|
||||
void *M_Memcpy(void* dest, const void* src, size_t n)
|
||||
{
|
||||
memcpy(dest, src, n);
|
||||
return dest;
|
||||
}
|
||||
|
|
@ -2017,7 +2017,7 @@ char *M_GetToken(const char *inputString)
|
|||
// Assign the memory. Don't forget an extra byte for the end of the string!
|
||||
texturesToken = (char *)Z_Malloc((texturesTokenLength+1)*sizeof(char),PU_STATIC,NULL);
|
||||
// Copy the string.
|
||||
M_Memcpy(texturesToken, stringToUse+startPos, (size_t)texturesTokenLength);
|
||||
memcpy(texturesToken, stringToUse+startPos, (size_t)texturesTokenLength);
|
||||
// Make the final character NUL.
|
||||
texturesToken[texturesTokenLength] = '\0';
|
||||
|
||||
|
|
@ -2061,7 +2061,7 @@ char *M_GetToken(const char *inputString)
|
|||
// Assign the memory. Don't forget an extra byte for the end of the string!
|
||||
texturesToken = (char *)Z_Malloc((texturesTokenLength+1)*sizeof(char),PU_STATIC,NULL);
|
||||
// Copy the string.
|
||||
M_Memcpy(texturesToken, stringToUse+startPos, (size_t)texturesTokenLength);
|
||||
memcpy(texturesToken, stringToUse+startPos, (size_t)texturesTokenLength);
|
||||
// Make the final character NUL.
|
||||
texturesToken[texturesTokenLength] = '\0';
|
||||
return texturesToken;
|
||||
|
|
@ -2150,7 +2150,7 @@ static void M_ReadTokenString(UINT32 i)
|
|||
}
|
||||
|
||||
// Copy the string.
|
||||
M_Memcpy(tokenizerToken[i], tokenizerInput + tokenizerStartPos, (size_t)tokenLength);
|
||||
memcpy(tokenizerToken[i], tokenizerInput + tokenizerStartPos, (size_t)tokenLength);
|
||||
|
||||
// Make the final character NUL.
|
||||
tokenizerToken[i][tokenLength] = '\0';
|
||||
|
|
|
|||
|
|
@ -1005,9 +1005,9 @@ void A_PointyThink(void *thing)
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->lastlook+i)));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(actor->angle+ANGLE_180));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
|
||||
P_UnsetThingPosition(ball);
|
||||
ball->x = actor->x + v[0];
|
||||
|
|
|
|||
36
src/p_mobj.c
36
src/p_mobj.c
|
|
@ -6017,9 +6017,9 @@ static void P_MoveHoop(mobj_t *mobj)
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(mobj->target->movedir*FRACUNIT)));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(FixedAngle(mobj->target->movecount*FRACUNIT)));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
|
||||
finalx = x + v[0];
|
||||
finaly = y + v[1];
|
||||
|
|
@ -6085,9 +6085,9 @@ void P_SpawnHoopOfSomething(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateXMatrix(rotangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(closestangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
|
||||
finalx = x + v[0];
|
||||
finaly = y + v[1];
|
||||
|
|
@ -6124,9 +6124,9 @@ void P_SpawnParaloop(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 numb
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateXMatrix(rotangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(closestangle));
|
||||
M_Memcpy(&v, res, sizeof (v));
|
||||
memcpy(&v, res, sizeof (v));
|
||||
|
||||
finalx = x + v[0];
|
||||
finaly = y + v[1];
|
||||
|
|
@ -6360,9 +6360,9 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
|
|||
|
||||
// Calculate the angle matrixes for the link.
|
||||
res = VectorMatrixMultiply(unit_lengthways, *RotateXMatrix(center->threshold << ANGLETOFINESHIFT));
|
||||
M_Memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
|
||||
memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
|
||||
res = VectorMatrixMultiply(unit_lengthways, *RotateZMatrix(center->angle));
|
||||
M_Memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
|
||||
memcpy(&unit_lengthways, res, sizeof(unit_lengthways));
|
||||
|
||||
lastthreshold = mobj->threshold;
|
||||
lastfriction = mobj->friction;
|
||||
|
|
@ -6383,9 +6383,9 @@ void P_MaceRotate(mobj_t *center, INT32 baserot, INT32 baseprevrot)
|
|||
unit_sideways[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(unit_sideways, *RotateXMatrix(center->threshold << ANGLETOFINESHIFT));
|
||||
M_Memcpy(&unit_sideways, res, sizeof(unit_sideways));
|
||||
memcpy(&unit_sideways, res, sizeof(unit_sideways));
|
||||
res = VectorMatrixMultiply(unit_sideways, *RotateZMatrix(center->angle));
|
||||
M_Memcpy(&unit_sideways, res, sizeof(unit_sideways));
|
||||
memcpy(&unit_sideways, res, sizeof(unit_sideways));
|
||||
}
|
||||
|
||||
if (pos_sideways[3] > mobj->movefactor)
|
||||
|
|
@ -13902,7 +13902,7 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
|
|||
}
|
||||
|
||||
mobj->stringargs[arg] = Z_Realloc(mobj->stringargs[arg], len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mobj->stringargs[arg], mthing->stringargs[arg], len + 1);
|
||||
memcpy(mobj->stringargs[arg], mthing->stringargs[arg], len + 1);
|
||||
}
|
||||
|
||||
for (arg = 0; arg < NUM_SCRIPT_ARGS; arg++)
|
||||
|
|
@ -13927,7 +13927,7 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
|
|||
}
|
||||
|
||||
mobj->script_stringargs[arg] = Z_Realloc(mobj->script_stringargs[arg], len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mobj->script_stringargs[arg], mthing->script_stringargs[arg], len + 1);
|
||||
memcpy(mobj->script_stringargs[arg], mthing->script_stringargs[arg], len + 1);
|
||||
}
|
||||
|
||||
if (!P_SetupSpawnedMapThing(mthing, mobj, &doangle))
|
||||
|
|
@ -14041,9 +14041,9 @@ void P_SpawnHoop(mapthing_t *mthing)
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *pitchmatrix);
|
||||
M_Memcpy(&v, res, sizeof(v));
|
||||
memcpy(&v, res, sizeof(v));
|
||||
res = VectorMatrixMultiply(v, *yawmatrix);
|
||||
M_Memcpy(&v, res, sizeof(v));
|
||||
memcpy(&v, res, sizeof(v));
|
||||
|
||||
mobj = P_SpawnMobj(x + v[0], y + v[1], z + v[2], MT_HOOP);
|
||||
mobj->z -= mobj->height/2;
|
||||
|
|
@ -14084,9 +14084,9 @@ void P_SpawnHoop(mapthing_t *mthing)
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *pitchmatrix);
|
||||
M_Memcpy(&v, res, sizeof(v));
|
||||
memcpy(&v, res, sizeof(v));
|
||||
res = VectorMatrixMultiply(v, *yawmatrix);
|
||||
M_Memcpy(&v, res, sizeof(v));
|
||||
memcpy(&v, res, sizeof(v));
|
||||
|
||||
mobj = P_SpawnMobj(x + v[0], y + v[1], z + v[2], MT_HOOPCOLLIDE);
|
||||
mobj->z -= mobj->height/2;
|
||||
|
|
@ -14239,7 +14239,7 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
|
|||
v[3] = FRACUNIT;
|
||||
|
||||
res = VectorMatrixMultiply(v, *RotateZMatrix(angle));
|
||||
M_Memcpy(&v, res, sizeof(v));
|
||||
memcpy(&v, res, sizeof(v));
|
||||
|
||||
mobj = P_SpawnMobjFromMapThing(&dummything, x + v[0], y + v[1], z + v[2], itemtype);
|
||||
|
||||
|
|
@ -14260,7 +14260,7 @@ static void P_ParseItemTypes(char *itemstring, mobjtype_t *itemtypes, UINT8 *num
|
|||
if (itemstring)
|
||||
{
|
||||
char *stringcopy = Z_Malloc(strlen(itemstring) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(stringcopy, itemstring, strlen(itemstring));
|
||||
memcpy(stringcopy, itemstring, strlen(itemstring));
|
||||
stringcopy[strlen(itemstring)] = '\0';
|
||||
|
||||
tok = strtok(stringcopy, " ");
|
||||
|
|
|
|||
|
|
@ -3975,7 +3975,7 @@ static boolean P_NetSyncMisc(savebuffer_t *save, boolean resending)
|
|||
else
|
||||
{
|
||||
ss->stringargs[j] = Z_Realloc(ss->stringargs[j], len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(ss->stringargs[j], spawnss->stringargs[j], len);
|
||||
memcpy(ss->stringargs[j], spawnss->stringargs[j], len);
|
||||
ss->stringargs[j][len] = '\0';
|
||||
}
|
||||
}
|
||||
|
|
@ -4049,7 +4049,7 @@ static boolean P_NetSyncMisc(savebuffer_t *save, boolean resending)
|
|||
else
|
||||
{
|
||||
li->stringargs[j] = Z_Realloc(li->stringargs[j], len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(li->stringargs[j], spawnli->stringargs[j], len);
|
||||
memcpy(li->stringargs[j], spawnli->stringargs[j], len);
|
||||
li->stringargs[j][len] = '\0';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1131,7 +1131,7 @@ static void P_WriteConstant(INT32 constant, char **target, const char *desc, UIN
|
|||
sprintf(buffer, "%d", constant);
|
||||
len = strlen(buffer) + 1;
|
||||
*target = Z_Malloc(len, PU_LEVEL, NULL);
|
||||
M_Memcpy(*target, buffer, len);
|
||||
memcpy(*target, buffer, len);
|
||||
}
|
||||
|
||||
static void P_WriteDuplicateText(const char *text, char **target)
|
||||
|
|
@ -1141,7 +1141,7 @@ static void P_WriteDuplicateText(const char *text, char **target)
|
|||
|
||||
size_t len = strlen(text) + 1;
|
||||
*target = Z_Malloc(len, PU_LEVEL, NULL);
|
||||
M_Memcpy(*target, text, len);
|
||||
memcpy(*target, text, len);
|
||||
}
|
||||
|
||||
static void P_WriteSkincolor(INT32 constant, char **target)
|
||||
|
|
@ -1228,14 +1228,14 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
|
||||
if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')
|
||||
{
|
||||
M_Memcpy(process,msd->bottomtexture,8);
|
||||
memcpy(process,msd->bottomtexture,8);
|
||||
process[8] = '\0';
|
||||
sd->bottomtexture = get_number(process);
|
||||
}
|
||||
|
||||
if (!(msd->midtexture[0] == '-' && msd->midtexture[1] == '\0') || msd->midtexture[1] != '\0')
|
||||
{
|
||||
M_Memcpy(process,msd->midtexture,8);
|
||||
memcpy(process,msd->midtexture,8);
|
||||
process[8] = '\0';
|
||||
sd->midtexture = get_number(process);
|
||||
}
|
||||
|
|
@ -1243,15 +1243,15 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
sd->text = Z_Malloc(7, PU_LEVEL, NULL);
|
||||
if (isfrontside && !(msd->toptexture[0] == '-' && msd->toptexture[1] == '\0'))
|
||||
{
|
||||
M_Memcpy(process,msd->toptexture,8);
|
||||
memcpy(process,msd->toptexture,8);
|
||||
process[8] = '\0';
|
||||
|
||||
// If they type in O_ or D_ and their music name, just shrug,
|
||||
// then copy the rest instead.
|
||||
if ((process[0] == 'O' || process[0] == 'D') && process[7])
|
||||
M_Memcpy(sd->text, process+2, 6);
|
||||
memcpy(sd->text, process+2, 6);
|
||||
else // Assume it's a proper music name.
|
||||
M_Memcpy(sd->text, process, 6);
|
||||
memcpy(sd->text, process, 6);
|
||||
sd->text[6] = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -1266,7 +1266,7 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
if (msd->toptexture[0] != '-' || msd->toptexture[1] != '\0')
|
||||
{
|
||||
char process[8 + 1];
|
||||
M_Memcpy(process, msd->toptexture, 8);
|
||||
memcpy(process, msd->toptexture, 8);
|
||||
process[8] = '\0';
|
||||
|
||||
P_WriteDuplicateText(process, &sd->text);
|
||||
|
|
@ -1309,11 +1309,11 @@ static void P_LoadSidedefs(UINT8 *data)
|
|||
if (msd->toptexture[0] == '-' && msd->toptexture[1] == '\0')
|
||||
break;
|
||||
else
|
||||
M_Memcpy(process,msd->toptexture,8);
|
||||
memcpy(process,msd->toptexture,8);
|
||||
if (msd->midtexture[0] != '-' || msd->midtexture[1] != '\0')
|
||||
M_Memcpy(process+strlen(process), msd->midtexture, 8);
|
||||
memcpy(process+strlen(process), msd->midtexture, 8);
|
||||
if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')
|
||||
M_Memcpy(process+strlen(process), msd->bottomtexture, 8);
|
||||
memcpy(process+strlen(process), msd->bottomtexture, 8);
|
||||
|
||||
P_WriteDuplicateText(process, &sd->text);
|
||||
break;
|
||||
|
|
@ -1949,7 +1949,7 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
|
|||
if (argnum >= NUM_SCRIPT_STRINGARGS)
|
||||
return;
|
||||
sectors[i].stringargs[argnum] = Z_Malloc(strlen(val) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(sectors[i].stringargs[argnum], val, strlen(val) + 1);
|
||||
memcpy(sectors[i].stringargs[argnum], val, strlen(val) + 1);
|
||||
}
|
||||
else if (fastncmp(param, "arg", 3) && strlen(param) > 3)
|
||||
{
|
||||
|
|
@ -2042,7 +2042,7 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char
|
|||
if (argnum >= NUM_SCRIPT_STRINGARGS)
|
||||
return;
|
||||
lines[i].stringargs[argnum] = Z_Malloc(strlen(val) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(lines[i].stringargs[argnum], val, strlen(val) + 1);
|
||||
memcpy(lines[i].stringargs[argnum], val, strlen(val) + 1);
|
||||
}
|
||||
else if (fastncmp(param, "arg", 3) && strlen(param) > 3)
|
||||
{
|
||||
|
|
@ -2173,7 +2173,7 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
|
|||
return;
|
||||
size_t len = strlen(val);
|
||||
mapthings[i].script_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].script_stringargs[argnum], val, len);
|
||||
memcpy(mapthings[i].script_stringargs[argnum], val, len);
|
||||
mapthings[i].script_stringargs[argnum][len] = '\0';
|
||||
}
|
||||
else
|
||||
|
|
@ -2183,7 +2183,7 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
|
|||
return;
|
||||
size_t len = strlen(val);
|
||||
mapthings[i].stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].stringargs[argnum], val, len);
|
||||
memcpy(mapthings[i].stringargs[argnum], val, len);
|
||||
mapthings[i].stringargs[argnum][len] = '\0';
|
||||
}
|
||||
}
|
||||
|
|
@ -2218,7 +2218,7 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
|
|||
return;
|
||||
size_t len = strlen(val);
|
||||
mapthings[i].stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].stringargs[argnum], val, len);
|
||||
memcpy(mapthings[i].stringargs[argnum], val, len);
|
||||
mapthings[i].stringargs[argnum][len] = '\0';
|
||||
}
|
||||
else if (fastncmp(param, "scriptstringarg", 15) && strlen(param) > 15)
|
||||
|
|
@ -2228,7 +2228,7 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
|
|||
return;
|
||||
size_t len = strlen(val);
|
||||
mapthings[i].script_stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].script_stringargs[argnum], val, len);
|
||||
memcpy(mapthings[i].script_stringargs[argnum], val, len);
|
||||
mapthings[i].script_stringargs[argnum][len] = '\0';
|
||||
}
|
||||
else if (fastncmp(param, "scriptarg", 9) && strlen(param) > 9)
|
||||
|
|
@ -3608,9 +3608,9 @@ static void P_ProcessLinedefsAfterSidedefs(void)
|
|||
len[1] = strlen(sides[ld->sidenum[1]].text);
|
||||
|
||||
ld->text = Z_Malloc(len[0] + len[1], PU_LEVEL, NULL);
|
||||
M_Memcpy(ld->text, sides[ld->sidenum[0]].text, len[0]);
|
||||
memcpy(ld->text, sides[ld->sidenum[0]].text, len[0]);
|
||||
if (len[1])
|
||||
M_Memcpy(ld->text + len[0], sides[ld->sidenum[1]].text, len[1] + 1);
|
||||
memcpy(ld->text + len[0], sides[ld->sidenum[1]].text, len[1] + 1);
|
||||
}
|
||||
break;
|
||||
case 447: // Change colormap
|
||||
|
|
@ -4086,7 +4086,7 @@ static nodetype_t P_GetNodetype(const virtres_t *virt, UINT8 **nodedata, char si
|
|||
I_Error("Level has no nodes (does your map have at least 2 sectors?)");
|
||||
}
|
||||
|
||||
M_Memcpy(signature, *nodedata, 4);
|
||||
memcpy(signature, *nodedata, 4);
|
||||
(*nodedata) += 4;
|
||||
|
||||
// Identify node format from its starting signature.
|
||||
|
|
@ -4693,7 +4693,7 @@ static void P_LoadReject(UINT8 *data, size_t count)
|
|||
else
|
||||
{
|
||||
rejectmatrix = Z_Malloc(count, PU_LEVEL, NULL); // allocate memory for the reject matrix
|
||||
M_Memcpy(rejectmatrix, data, count); // copy the data into it
|
||||
memcpy(rejectmatrix, data, count); // copy the data into it
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -6222,13 +6222,13 @@ static void P_ConvertBinaryLinedefTypes(void)
|
|||
if (sides[lines[i].sidenum[0]].text)
|
||||
{
|
||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
||||
memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
||||
}
|
||||
|
||||
if (lines[i].sidenum[1] != 0xffff && lines[i].flags & ML_BLOCKMONSTERS) // read power from back sidedef
|
||||
{
|
||||
lines[i].stringargs[1] = Z_Malloc(strlen(sides[lines[i].sidenum[1]].text) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(lines[i].stringargs[1], sides[lines[i].sidenum[1]].text, strlen(sides[lines[i].sidenum[1]].text) + 1);
|
||||
memcpy(lines[i].stringargs[1], sides[lines[i].sidenum[1]].text, strlen(sides[lines[i].sidenum[1]].text) + 1);
|
||||
}
|
||||
else
|
||||
P_WriteConstant((lines[i].flags & ML_NOCLIMB) ? -1 : (sides[lines[i].sidenum[0]].textureoffset >> FRACBITS), &lines[i].stringargs[1], "Powers", i);
|
||||
|
|
@ -6475,7 +6475,7 @@ static void P_ConvertBinaryLinedefTypes(void)
|
|||
if (sides[lines[i].sidenum[0]].text)
|
||||
{
|
||||
lines[i].stringargs[0] = Z_Malloc(strlen(sides[lines[i].sidenum[0]].text) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
||||
memcpy(lines[i].stringargs[0], sides[lines[i].sidenum[0]].text, strlen(sides[lines[i].sidenum[0]].text) + 1);
|
||||
}
|
||||
break;
|
||||
case 480: //Polyobject - door slide
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ void R_ReInitColormaps(UINT16 num, void *newencoremap, size_t encoremapsize, boo
|
|||
size_t p, i;
|
||||
|
||||
encoremap = Z_MallocAlign(256 + 10, PU_LEVEL, NULL, 8);
|
||||
M_Memcpy(encoremap, newencoremap, encoremapsize);
|
||||
memcpy(encoremap, newencoremap, encoremapsize);
|
||||
colormap_p = colormap_p2 = colormaps;
|
||||
colormap_p += COLORMAP_REMAPOFFSET;
|
||||
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ void R_VideoErase(size_t ofs, INT32 count)
|
|||
// is not optimal, e.g. byte by byte on
|
||||
// a 32bit CPU, as GNU GCC/Linux libc did
|
||||
// at one point.
|
||||
M_Memcpy(vid.screens[0] + ofs, vid.screens[1] + ofs, count);
|
||||
memcpy(vid.screens[0] + ofs, vid.screens[1] + ofs, count);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ patch_t *Patch_Create(softwarepatch_t *source, size_t srcsize, void *dest)
|
|||
I_Error("Patch_Create: no column data!");
|
||||
|
||||
patch->columns = Z_Calloc(colsize, PU_PATCH_DATA, NULL);
|
||||
M_Memcpy(patch->columns, ((UINT8 *)source + LONG(source->columnofs[0])), colsize);
|
||||
memcpy(patch->columns, ((UINT8 *)source + LONG(source->columnofs[0])), colsize);
|
||||
}
|
||||
|
||||
return patch;
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||
|
||||
while (dy--)
|
||||
{
|
||||
M_Memcpy(dest, src, width * sizeof(UINT16));
|
||||
memcpy(dest, src, width * sizeof(UINT16));
|
||||
dest += width;
|
||||
src += newwidth;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1431,7 +1431,7 @@ static void R_ParseSpriteInfoSkin(struct ParseSpriteInfoState *parser)
|
|||
// copy skin name yada yada
|
||||
sprinfoTokenLength = strlen(sprinfoToken);
|
||||
skinName = (char *)Z_Malloc((sprinfoTokenLength+1)*sizeof(char),PU_STATIC,NULL);
|
||||
M_Memcpy(skinName,sprinfoToken,sprinfoTokenLength*sizeof(char));
|
||||
memcpy(skinName,sprinfoToken,sprinfoTokenLength*sizeof(char));
|
||||
skinName[sprinfoTokenLength] = '\0';
|
||||
strlwr(skinName);
|
||||
|
||||
|
|
@ -1457,12 +1457,12 @@ static void copy_to_skin (struct ParseSpriteInfoState *parser, INT32 skinnum)
|
|||
|
||||
for (spr2num = 0; spr2num < NUMPLAYERSPRITES; ++spr2num)
|
||||
{
|
||||
M_Memcpy(&sprinfo[spr2num], parser->info, sizeof(spriteinfo_t));
|
||||
memcpy(&sprinfo[spr2num], parser->info, sizeof(spriteinfo_t));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
M_Memcpy(&sprinfo[parser->spr2num], parser->info, sizeof(spriteinfo_t));
|
||||
memcpy(&sprinfo[parser->spr2num], parser->info, sizeof(spriteinfo_t));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1616,12 +1616,12 @@ static boolean R_ParseSpriteInfoFrame(struct ParseSpriteInfoState *parser, boole
|
|||
|
||||
for (sprnum = 0; sprnum < NUMSPRITES; ++sprnum)
|
||||
{
|
||||
M_Memcpy(&spriteinfo[sprnum], parser->info, sizeof(spriteinfo_t));
|
||||
memcpy(&spriteinfo[sprnum], parser->info, sizeof(spriteinfo_t));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
M_Memcpy(&spriteinfo[parser->sprnum], parser->info, sizeof(spriteinfo_t));
|
||||
memcpy(&spriteinfo[parser->sprnum], parser->info, sizeof(spriteinfo_t));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1673,7 +1673,7 @@ static boolean R_ParseSpriteInfo(boolean spr2)
|
|||
else
|
||||
{
|
||||
memset(&newSpriteName, 0, 5);
|
||||
M_Memcpy(newSpriteName, sprinfoToken, sprinfoTokenLength);
|
||||
memcpy(newSpriteName, sprinfoToken, sprinfoTokenLength);
|
||||
// ^^ we've confirmed that the token is == 4 characters so it will never overflow a 5 byte char buffer
|
||||
strupr(newSpriteName); // Just do this now so we don't have to worry about it
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
|
|||
dc->lightlist = static_cast<r_lightlist_t*>(Z_Frame_Alloc(sizeof (*dc->lightlist) * dc->maxlights));
|
||||
if (old_lightlist != nullptr)
|
||||
{
|
||||
M_Memcpy(dc->lightlist, old_lightlist, sizeof (*dc->lightlist) * old_maxlights);
|
||||
memcpy(dc->lightlist, old_lightlist, sizeof (*dc->lightlist) * old_maxlights);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -843,7 +843,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
dc->lightlist = static_cast<r_lightlist_t*>(Z_Frame_Alloc(sizeof (*dc->lightlist) * dc->maxlights));
|
||||
if (old_lightlist != nullptr)
|
||||
{
|
||||
M_Memcpy(dc->lightlist, old_lightlist, sizeof (*dc->lightlist) * old_maxlights);
|
||||
memcpy(dc->lightlist, old_lightlist, sizeof (*dc->lightlist) * old_maxlights);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3094,14 +3094,14 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
if (((ds_p->silhouette & SIL_TOP) || maskedtexture) && !ds_p->sprtopclip)
|
||||
{
|
||||
M_Memcpy(lastopening, ceilingclip + start, 2*(rw_stopx - start));
|
||||
memcpy(lastopening, ceilingclip + start, 2*(rw_stopx - start));
|
||||
ds_p->sprtopclip = lastopening - start;
|
||||
lastopening += rw_stopx - start;
|
||||
}
|
||||
|
||||
if (((ds_p->silhouette & SIL_BOTTOM) || maskedtexture) && !ds_p->sprbottomclip)
|
||||
{
|
||||
M_Memcpy(lastopening, floorclip + start, 2*(rw_stopx - start));
|
||||
memcpy(lastopening, floorclip + start, 2*(rw_stopx - start));
|
||||
ds_p->sprbottomclip = lastopening - start;
|
||||
lastopening += rw_stopx - start;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -986,7 +986,7 @@ void R_AddSkins(UINT16 wadnum)
|
|||
buf2 = malloc(size+1);
|
||||
if (!buf2)
|
||||
I_Error("R_AddSkins: No more free memory\n");
|
||||
M_Memcpy(buf2,buf,size);
|
||||
memcpy(buf2,buf,size);
|
||||
buf2[size] = '\0';
|
||||
|
||||
// set defaults
|
||||
|
|
@ -1120,7 +1120,7 @@ void R_PatchSkins(UINT16 wadnum)
|
|||
buf2 = malloc(size+1);
|
||||
if (!buf2)
|
||||
I_Error("R_PatchSkins: No more free memory\n");
|
||||
M_Memcpy(buf2,buf,size);
|
||||
memcpy(buf2,buf,size);
|
||||
buf2[size] = '\0';
|
||||
|
||||
skin = NULL;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static inline void R_DrawColumnInCache(column_t *patch, UINT8 *cache, texpatch_t
|
|||
count = cacheheight - position;
|
||||
|
||||
if (count > 0)
|
||||
M_Memcpy(cache + position, source, count);
|
||||
memcpy(cache + position, source, count);
|
||||
|
||||
patch = (column_t *)((UINT8 *)patch + patch->length + 4);
|
||||
}
|
||||
|
|
@ -431,7 +431,7 @@ UINT8 *R_GenerateTexture(size_t texnum)
|
|||
blocksize = lumplength;
|
||||
block = Z_Calloc(blocksize, PU_LEVEL, // will change tag at end of this function
|
||||
&texturecache[texnum]);
|
||||
M_Memcpy(block, realpatch, blocksize);
|
||||
memcpy(block, realpatch, blocksize);
|
||||
texturememory += blocksize;
|
||||
|
||||
// use the patch's column lookup
|
||||
|
|
@ -1162,7 +1162,7 @@ Rloadflats (INT32 i, INT32 w)
|
|||
texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
|
||||
|
||||
// Set texture properties.
|
||||
M_Memcpy(texture->name, W_CheckNameForNumPwad(wadnum, lumpnum), sizeof(texture->name));
|
||||
memcpy(texture->name, W_CheckNameForNumPwad(wadnum, lumpnum), sizeof(texture->name));
|
||||
texture->hash = quickncasehash(texture->name, 8);
|
||||
|
||||
#ifndef NO_PNG_LUMPS
|
||||
|
|
@ -1263,7 +1263,7 @@ Rloadtextures (INT32 i, INT32 w)
|
|||
texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
|
||||
|
||||
// Set texture properties.
|
||||
M_Memcpy(texture->name, W_CheckNameForNumPwad(wadnum, lumpnum), sizeof(texture->name));
|
||||
memcpy(texture->name, W_CheckNameForNumPwad(wadnum, lumpnum), sizeof(texture->name));
|
||||
texture->hash = quickncasehash(texture->name, 8);
|
||||
|
||||
#ifndef NO_PNG_LUMPS
|
||||
|
|
@ -1529,7 +1529,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
|
|||
Z_Free(patchName);
|
||||
}
|
||||
patchName = (char *)Z_Malloc((texturesTokenLength+1)*sizeof(char),PU_STATIC,NULL);
|
||||
M_Memcpy(patchName,texturesToken,texturesTokenLength*sizeof(char));
|
||||
memcpy(patchName,texturesToken,texturesTokenLength*sizeof(char));
|
||||
patchName[texturesTokenLength] = '\0';
|
||||
}
|
||||
|
||||
|
|
@ -1716,7 +1716,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
|
|||
else
|
||||
{
|
||||
memset(&newTextureName, 0, 9);
|
||||
M_Memcpy(newTextureName, texturesToken, texturesTokenLength);
|
||||
memcpy(newTextureName, texturesToken, texturesTokenLength);
|
||||
// ^^ we've confirmed that the token is <= 8 characters so it will never overflow a 9 byte char buffer
|
||||
strupr(newTextureName); // Just do this now so we don't have to worry about it
|
||||
}
|
||||
|
|
@ -1802,7 +1802,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
|
|||
{
|
||||
// Allocate memory for a zero-patch texture. Obviously, we'll be adding patches momentarily.
|
||||
resultTexture = (texture_t *)Z_Calloc(sizeof(texture_t),PU_STATIC,NULL);
|
||||
M_Memcpy(resultTexture->name, newTextureName, 8);
|
||||
memcpy(resultTexture->name, newTextureName, 8);
|
||||
resultTexture->hash = quickncasehash(newTextureName, 8);
|
||||
resultTexture->width = newTextureWidth;
|
||||
resultTexture->height = newTextureHeight;
|
||||
|
|
@ -1827,7 +1827,7 @@ static texture_t *R_ParseTexture(boolean actuallyLoadTexture)
|
|||
// Make room for the new patch
|
||||
resultTexture = Z_Realloc(resultTexture, sizeof(texture_t) + (resultTexture->patchcount+1)*sizeof(texpatch_t), PU_STATIC, NULL);
|
||||
// Populate the uninitialized values in the new patch entry of our array
|
||||
M_Memcpy(&resultTexture->patches[resultTexture->patchcount], newPatch, sizeof(texpatch_t));
|
||||
memcpy(&resultTexture->patches[resultTexture->patchcount], newPatch, sizeof(texpatch_t));
|
||||
// Account for the new number of patches in the texture
|
||||
resultTexture->patchcount++;
|
||||
// Then free up the memory assigned to R_ParsePatch, as it's unneeded now
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ void R_AddKartFaces(skin_t *skin)
|
|||
}
|
||||
sd->numframes = NUMFACES;
|
||||
sd->spriteframes = static_cast<spriteframe_t*>(Z_Realloc(sd->spriteframes, sizeof(spriteframe_t)*NUMFACES, PU_STATIC, NULL));
|
||||
M_Memcpy(sd->spriteframes, sprtemp, sizeof(spriteframe_t)*NUMFACES);
|
||||
memcpy(sd->spriteframes, sprtemp, sizeof(spriteframe_t)*NUMFACES);
|
||||
}
|
||||
#undef NUMFACES
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
|||
if (spritedef->numframes) // (then spriteframes is not null)
|
||||
{
|
||||
// copy the already defined sprite frames
|
||||
M_Memcpy(sprtemp, spritedef->spriteframes,
|
||||
memcpy(sprtemp, spritedef->spriteframes,
|
||||
spritedef->numframes * sizeof (spriteframe_t));
|
||||
maxframe = spritedef->numframes - 1;
|
||||
}
|
||||
|
|
@ -488,7 +488,7 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16
|
|||
static_cast<spriteframe_t*>(Z_Malloc(maxframe * sizeof (*spritedef->spriteframes), PU_STATIC, NULL));
|
||||
|
||||
spritedef->numframes = maxframe;
|
||||
M_Memcpy(spritedef->spriteframes, sprtemp, maxframe*sizeof (spriteframe_t));
|
||||
memcpy(spritedef->spriteframes, sprtemp, maxframe*sizeof (spriteframe_t));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1251,7 +1251,7 @@ static void R_SplitSprite(vissprite_t *sprite)
|
|||
|
||||
// Found a split! Make a new sprite, copy the old sprite to it, and
|
||||
// adjust the heights.
|
||||
newsprite = static_cast<vissprite_t*>(M_Memcpy(R_NewVisSprite(), sprite, sizeof (vissprite_t)));
|
||||
newsprite = static_cast<vissprite_t*>(memcpy(R_NewVisSprite(), sprite, sizeof (vissprite_t)));
|
||||
|
||||
newsprite->cut = static_cast<spritecut_e>(newsprite->cut | (sprite->cut & SC_FLAGMASK));
|
||||
|
||||
|
|
|
|||
|
|
@ -1583,7 +1583,7 @@ static void S_LoadMusicDefLump(lumpnum_t lumpnum)
|
|||
musdeftext = malloc(size+1);
|
||||
if (!musdeftext)
|
||||
I_Error("S_LoadMusicDefs: No more free memory for the parser\n");
|
||||
M_Memcpy(musdeftext, lump, size);
|
||||
memcpy(musdeftext, lump, size);
|
||||
musdeftext[size] = '\0';
|
||||
|
||||
// Find music def
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ static void NET_Get(void)
|
|||
{
|
||||
size_t i;
|
||||
newnode++;
|
||||
M_Memcpy(&clientaddress[newnode], &mypacket.address, sizeof (IPaddress));
|
||||
memcpy(&clientaddress[newnode], &mypacket.address, sizeof (IPaddress));
|
||||
DEBFILE(va("New node detected: node:%d address:%s\n", newnode,
|
||||
NET_GetNodeAddress(newnode)));
|
||||
doomcom->remotenode = newnode; // good packet from a game player
|
||||
|
|
@ -257,7 +257,7 @@ static SINT8 NET_NetMakeNodewPort(const char *hostname, const char *port)
|
|||
return newnode;
|
||||
}
|
||||
newnode++;
|
||||
M_Memcpy(&clientaddress[newnode],&hostnameIP,sizeof (IPaddress));
|
||||
memcpy(&clientaddress[newnode],&hostnameIP,sizeof (IPaddress));
|
||||
return (SINT8)newnode;
|
||||
}
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ static boolean NET_Ban(INT32 node)
|
|||
if (numbans == MAXBANS)
|
||||
return false;
|
||||
|
||||
M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress));
|
||||
memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress));
|
||||
banned[numbans].port = 0;
|
||||
numbans++;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ static void *getsfx(lumpnum_t sfxlump, size_t *len)
|
|||
|
||||
sfxcvt.len = (INT32)size-8; //Alam: Chop off the header
|
||||
sfxcvt.buf = malloc(sfxcvt.len * sfxcvt.len_mult); //Alam: make room
|
||||
if (sfxcvt.buf) M_Memcpy(sfxcvt.buf, &(sfx->data), sfxcvt.len); //Alam: copy the sfx sample
|
||||
if (sfxcvt.buf) memcpy(sfxcvt.buf, &(sfx->data), sfxcvt.len); //Alam: copy the sfx sample
|
||||
|
||||
if (sfxcvt.buf && SDL_ConvertAudio(&sfxcvt) == 0) //Alam: let convert it!
|
||||
{
|
||||
|
|
@ -269,9 +269,9 @@ static void *getsfx(lumpnum_t sfxlump, size_t *len)
|
|||
paddedsfx = (dssfx_t *) Z_Malloc(size, PU_SOUND, NULL);
|
||||
|
||||
// Now copy and pad.
|
||||
M_Memcpy(paddedsfx->data, sfxcvt.buf, sfxcvt.len_cvt);
|
||||
memcpy(paddedsfx->data, sfxcvt.buf, sfxcvt.len_cvt);
|
||||
free(sfxcvt.buf);
|
||||
M_Memcpy(paddedsfx,sfx,8);
|
||||
memcpy(paddedsfx,sfx,8);
|
||||
paddedsfx->samplerate = SHORT(csr); // new freq
|
||||
}
|
||||
else //Alam: the convert failed, not needed or I couldn't malloc the buf
|
||||
|
|
@ -280,7 +280,7 @@ static void *getsfx(lumpnum_t sfxlump, size_t *len)
|
|||
*len = size - 8;
|
||||
|
||||
// Allocate from zone memory then copy and pad
|
||||
paddedsfx = (dssfx_t *)M_Memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size);
|
||||
paddedsfx = (dssfx_t *)memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -290,7 +290,7 @@ static void *getsfx(lumpnum_t sfxlump, size_t *len)
|
|||
*len = size - 8;
|
||||
|
||||
// Allocate from zone memory then copy and pad
|
||||
paddedsfx = (dssfx_t *)M_Memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size);
|
||||
paddedsfx = (dssfx_t *)memcpy(Z_Malloc(size, PU_SOUND, NULL), sfx, size);
|
||||
}
|
||||
|
||||
// Remove the cached lump.
|
||||
|
|
|
|||
|
|
@ -520,13 +520,13 @@ void VID_BlitLinearScreen(const UINT8 *restrict srcptr, UINT8 *restrict destptr,
|
|||
i -= 16;
|
||||
}
|
||||
#endif
|
||||
M_Memcpy(destptr, srcptr, i);
|
||||
memcpy(destptr, srcptr, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (height--)
|
||||
{
|
||||
M_Memcpy(destptr, srcptr, width);
|
||||
memcpy(destptr, srcptr, width);
|
||||
|
||||
destptr += destrowbytes;
|
||||
srcptr += srcrowbytes;
|
||||
|
|
@ -1316,7 +1316,7 @@ void V_DrawBlock(INT32 x, INT32 y, INT32 scrn, INT32 width, INT32 height, const
|
|||
|
||||
while (height--)
|
||||
{
|
||||
M_Memcpy(dest, src, width);
|
||||
memcpy(dest, src, width);
|
||||
|
||||
src += width;
|
||||
dest += vid.width;
|
||||
|
|
@ -3693,7 +3693,7 @@ void V_DoPostProcessor(INT32 view, INT32 param)
|
|||
|
||||
if (sine < 0)
|
||||
{
|
||||
M_Memcpy(&tmpscr[(y*vid.width)+xoffset+newpix], &srcscr[(y*vid.width)+xoffset], viewwidth-newpix);
|
||||
memcpy(&tmpscr[(y*vid.width)+xoffset+newpix], &srcscr[(y*vid.width)+xoffset], viewwidth-newpix);
|
||||
|
||||
// Cleanup edge
|
||||
while (newpix)
|
||||
|
|
@ -3704,7 +3704,7 @@ void V_DoPostProcessor(INT32 view, INT32 param)
|
|||
}
|
||||
else
|
||||
{
|
||||
M_Memcpy(&tmpscr[(y*vid.width)+xoffset+0], &srcscr[(y*vid.width)+xoffset+sine], viewwidth-newpix);
|
||||
memcpy(&tmpscr[(y*vid.width)+xoffset+0], &srcscr[(y*vid.width)+xoffset+sine], viewwidth-newpix);
|
||||
|
||||
// Cleanup edge
|
||||
while (newpix)
|
||||
|
|
@ -3763,10 +3763,10 @@ void V_DoPostProcessor(INT32 view, INT32 param)
|
|||
{
|
||||
// Shift this row of pixels to the right by 2
|
||||
tmpscr[(y*vid.width)+xoffset] = srcscr[(y*vid.width)+xoffset];
|
||||
M_Memcpy(&tmpscr[(y*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset+vid.dupx], viewwidth-vid.dupx);
|
||||
memcpy(&tmpscr[(y*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset+vid.dupx], viewwidth-vid.dupx);
|
||||
}
|
||||
else
|
||||
M_Memcpy(&tmpscr[(y*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset], viewwidth);
|
||||
memcpy(&tmpscr[(y*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset], viewwidth);
|
||||
|
||||
heatindex[view] %= viewheight;
|
||||
}
|
||||
|
|
@ -3801,7 +3801,7 @@ void V_DoPostProcessor(INT32 view, INT32 param)
|
|||
INT32 y, y2;
|
||||
|
||||
for (y = yoffset, y2 = yoffset+viewheight - 1; y < yoffset+viewheight; y++, y2--)
|
||||
M_Memcpy(&tmpscr[(y2*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset], viewwidth);
|
||||
memcpy(&tmpscr[(y2*vid.width)+xoffset], &srcscr[(y*vid.width)+xoffset], viewwidth);
|
||||
|
||||
UINT8 *tmp = tmpscr;
|
||||
tmpscr = srcscr;
|
||||
|
|
|
|||
|
|
@ -1807,7 +1807,7 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
|||
|
||||
if (!decData) // Did we get no data at all?
|
||||
return 0;
|
||||
M_Memcpy(dest, decData + offset, size);
|
||||
memcpy(dest, decData + offset, size);
|
||||
Z_Free(rawData);
|
||||
Z_Free(decData);
|
||||
#ifdef NO_PNG_LUMPS
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
#include "i_system.h" // I_GetFreeMem
|
||||
#include "i_video.h" // rendermode
|
||||
#include "z_zone.h"
|
||||
#include "m_misc.h" // M_Memcpy
|
||||
#include "lua_script.h"
|
||||
|
||||
#include <tracy/tracy/TracyC.h>
|
||||
|
|
@ -325,7 +324,7 @@ void *Z_Realloc2(void *ptr, size_t size, INT32 tag, void *user, INT32 alignbits,
|
|||
else
|
||||
copysize = block->realsize;
|
||||
|
||||
M_Memcpy(rez, ptr, copysize);
|
||||
memcpy(rez, ptr, copysize);
|
||||
|
||||
Z_Free2(ptr, file, line);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue