make it even simpler

This commit is contained in:
Alug committed 2024-03-04 05:24:41 +01:00
1 parent cdd2b6560e
commit 2f899fdfcc
4 files changed
+2 -29

No files matched your search

+1 -1
View File
@@ -468,7 +468,7 @@ void M_StartupLocale(void);
// M_GetText function that just returns the string.
#define M_GetText(x) (x)
#endif
extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL;
void *M_Memcpy(void* dest, const void* src, size_t n);
char *va(const char *format, ...) FUNCPRINTF;
char *M_GetToken(const char *inputString);
char *sizeu1(size_t num);
+1 -24
View File
@@ -1938,34 +1938,11 @@ char *sizeu5(size_t num)
return sizeu5_buf;
}
// Alam: why? memcpy may be __cdecl/_System and our code may be not the same type
static void *cpu_cpy(void *dest, const void *src, size_t n)
void *M_Memcpy(void *dest, const void *src, size_t n)
{
if (src == NULL)
{
CONS_Debug(DBG_MEMORY, "Memcpy from 0x0?!: %p %p %s\n", dest, src, sizeu1(n));
return dest;
}
if(dest == NULL)
{
CONS_Debug(DBG_MEMORY, "Memcpy to 0x0?!: %p %p %s\n", dest, src, sizeu1(n));
return dest;
}
return memcpy(dest, src, n);
}
void *(*M_Memcpy)(void* dest, const void* src, size_t n) = cpu_cpy;
/** Memcpy that uses MMX, 3DNow, MMXExt or even SSE
* Do not use on overlapped memory, use memmove for that
*/
void M_SetupMemcpy(void)
{
M_Memcpy = cpu_cpy;
}
/** Return the appropriate message for a file error or end of file.
*/
const char *M_FileError(FILE *fp)
-2
View File
@@ -94,8 +94,6 @@ TMatrix *RotateZMatrix(angle_t rad);
// s1 = s2+s3+s1 (1024 lenghtmax)
void strcatbf(char *s1, const char *s2, const char *s3);
void M_SetupMemcpy(void);
const char *M_FileError(FILE *handle);
// counting bits, for weapon ammo code, usually
-2
View File
@@ -139,8 +139,6 @@ void SCR_SetMode(void)
//
void SCR_Startup(void)
{
M_SetupMemcpy();
if (dedicated)
{
V_Init();