diff --git a/src/Sourcefile b/src/Sourcefile index 8453c55e6..67d8dfff1 100644 --- a/src/Sourcefile +++ b/src/Sourcefile @@ -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 diff --git a/src/acs/call-funcs.cpp b/src/acs/call-funcs.cpp index eb1193155..24eab6be5 100644 --- a/src/acs/call-funcs.cpp +++ b/src/acs/call-funcs.cpp @@ -2739,7 +2739,7 @@ bool CallFunc_SetObjectSpecial(ACSVM::Thread *thread, const ACSVM::Word *argV, A } mobj->script_stringargs[i] = static_cast(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(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(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(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(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; \ diff --git a/src/acs/environment.cpp b/src/acs/environment.cpp index 6c359424b..317fc6018 100644 --- a/src/acs/environment.cpp +++ b/src/acs/environment.cpp @@ -425,7 +425,7 @@ ACSVM::Word Environment::callSpecImpl ACSVM::String *strPtr = map->getString(argV[i]); stringargs[i] = static_cast(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++) diff --git a/src/command.c b/src/command.c index cdf0e0075..a7f2d1dac 100644 --- a/src/command.c +++ b/src/command.c @@ -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 } // ========================================================================= diff --git a/src/console.c b/src/console.c index 9c30ee78c..3f5b6bcf1 100644 --- a/src/console.c +++ b/src/console.c @@ -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--; diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 099cd7269..ea3cd0eb1 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -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; diff --git a/src/d_net.c b/src/d_net.c index 79c34fa72..5dd350a8f 100644 --- a/src/d_net.c +++ b/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]; diff --git a/src/d_netfil.c b/src/d_netfil.c index 57914296d..99f6601c8 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -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 diff --git a/src/deh_soc.c b/src/deh_soc.c index 26bdfb77f..dff0fe6de 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -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; } diff --git a/src/doomdef.h b/src/doomdef.h index b707eb214..d4a5bf465 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -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); diff --git a/src/f_wipe.c b/src/f_wipe.c index 71b268281..6ec04aebd 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -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; } } diff --git a/src/g_demo.c b/src/g_demo.c index 561e8469e..0e359bbd2 100644 --- a/src/g_demo.c +++ b/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) diff --git a/src/g_game.c b/src/g_game.c index 16eaefceb..1bdb719a6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -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) diff --git a/src/hardware/hw3sound.c b/src/hardware/hw3sound.c index 9f5eb14be..52f691b9e 100644 --- a/src/hardware/hw3sound.c +++ b/src/hardware/hw3sound.c @@ -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); diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 721266806..ddfb262d1 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -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?"); diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 2a7409227..880288087 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -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), diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 3734e2bb6..1def2ef49 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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 "); diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 6b42c4361..b187ed8b3 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -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); diff --git a/src/hardware/hw_model.c b/src/hardware/hw_model.c index b0d377976..c8211aab7 100644 --- a/src/hardware/hw_model.c +++ b/src/hardware/hw_model.c @@ -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); } diff --git a/src/i_tcp.c b/src/i_tcp.c index 3cfd7fee0..a0ed1525e 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -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) { diff --git a/src/k_kart.c b/src/k_kart.c index e3e4d11aa..39487ac75 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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]; diff --git a/src/k_mapuser.c b/src/k_mapuser.c index bb81ea51f..314471297 100644 --- a/src/k_mapuser.c +++ b/src/k_mapuser.c @@ -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; } diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9762c280e..7e11a3bee 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -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 */ } diff --git a/src/lzf.c b/src/lzf.c index 2ea3db6c1..c2451ce76 100644 --- a/src/lzf.c +++ b/src/lzf.c @@ -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 diff --git a/src/m_fixed.c b/src/m_fixed.c index 517d28902..72d5c451a 100644 --- a/src/m_fixed.c +++ b/src/m_fixed.c @@ -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, ...) { diff --git a/src/m_memcpy.c b/src/m_memcpy.c deleted file mode 100644 index ac8b508cc..000000000 --- a/src/m_memcpy.c +++ /dev/null @@ -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; -} diff --git a/src/m_misc.cpp b/src/m_misc.cpp index ee345c41f..cebdd891e 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -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'; diff --git a/src/p_enemy.c b/src/p_enemy.c index 06cc1a351..b38026108 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -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]; diff --git a/src/p_mobj.c b/src/p_mobj.c index e3847f74b..9fda585e0 100644 --- a/src/p_mobj.c +++ b/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, " "); diff --git a/src/p_saveg.c b/src/p_saveg.c index 744cdc30b..33c80fc2f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -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'; } } diff --git a/src/p_setup.c b/src/p_setup.c index 8de8390bd..043395cf2 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -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 diff --git a/src/r_data.c b/src/r_data.c index 58c140214..59ecb0717 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -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; diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 0a09ebd82..23afe9af4 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -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); } // ========================================================================== diff --git a/src/r_patch.c b/src/r_patch.c index 581939a2e..b95794f9b 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -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; diff --git a/src/r_patchrotation.c b/src/r_patchrotation.c index f2ccfe6ec..274a686fd 100644 --- a/src/r_patchrotation.c +++ b/src/r_patchrotation.c @@ -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; } diff --git a/src/r_picformats.c b/src/r_picformats.c index aa89f39a8..cda0615a5 100644 --- a/src/r_picformats.c +++ b/src/r_picformats.c @@ -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 } diff --git a/src/r_segs.cpp b/src/r_segs.cpp index a34fb7dad..0c3ac43ef 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -244,7 +244,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3 dc->lightlist = static_cast(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(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; } diff --git a/src/r_skins.c b/src/r_skins.c index a0e1b0bff..f6fc09cdb 100644 --- a/src/r_skins.c +++ b/src/r_skins.c @@ -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; diff --git a/src/r_textures.c b/src/r_textures.c index a62e055cd..a56f19ece 100644 --- a/src/r_textures.c +++ b/src/r_textures.c @@ -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 diff --git a/src/r_things.cpp b/src/r_things.cpp index 431be8cd1..b94349561 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -279,7 +279,7 @@ void R_AddKartFaces(skin_t *skin) } sd->numframes = NUMFACES; sd->spriteframes = static_cast(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(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(M_Memcpy(R_NewVisSprite(), sprite, sizeof (vissprite_t))); + newsprite = static_cast(memcpy(R_NewVisSprite(), sprite, sizeof (vissprite_t))); newsprite->cut = static_cast(newsprite->cut | (sprite->cut & SC_FLAGMASK)); diff --git a/src/s_sound.c b/src/s_sound.c index 7582ec07d..998bb05ae 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -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 diff --git a/src/sdl/i_net.c b/src/sdl/i_net.c index 9dd87e48d..f79bdb7ab 100644 --- a/src/sdl/i_net.c +++ b/src/sdl/i_net.c @@ -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; diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index cac11c1f4..0e2c22946 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -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. diff --git a/src/v_video.c b/src/v_video.c index 3d719b570..f1a037268 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -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; diff --git a/src/w_wad.c b/src/w_wad.c index 3fa299fb9..fa0fd329f 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -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 diff --git a/src/z_zone.c b/src/z_zone.c index f11e57d01..bf538910e 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -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 @@ -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);