mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Fixed some accidental uses of external C runtime functions
This commit is contained in:
@@ -621,7 +621,7 @@ static SDL_bool BReadDeviceInfo(SDL_DriverSwitch_Context *ctx)
|
||||
ctx->m_eControllerType = (ESwitchDeviceInfoControllerType)reply->deviceInfo.ucDeviceType;
|
||||
|
||||
// Bytes 4-9: MAC address (big-endian)
|
||||
memcpy(ctx->m_rgucMACAddress, reply->deviceInfo.rgucMACAddress, sizeof(ctx->m_rgucMACAddress));
|
||||
SDL_memcpy(ctx->m_rgucMACAddress, reply->deviceInfo.rgucMACAddress, sizeof(ctx->m_rgucMACAddress));
|
||||
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ HIDAPI_UpdateDiscovery()
|
||||
if (buf.event.len > 0 &&
|
||||
!SDL_HIDAPI_discovery.m_bHaveDevicesChanged) {
|
||||
if (StrHasPrefix(buf.event.name, "hidraw") &&
|
||||
StrIsInteger(buf.event.name + strlen ("hidraw"))) {
|
||||
StrIsInteger(buf.event.name + SDL_strlen ("hidraw"))) {
|
||||
SDL_HIDAPI_discovery.m_bHaveDevicesChanged = SDL_TRUE;
|
||||
/* We found an hidraw change. We still continue to
|
||||
* drain the inotify fd to avoid leaving old
|
||||
@@ -494,7 +494,7 @@ HIDAPI_UpdateDiscovery()
|
||||
remain -= len;
|
||||
|
||||
if (remain != 0) {
|
||||
memmove(&buf.storage[0], &buf.storage[len], remain);
|
||||
SDL_memmove(&buf.storage[0], &buf.storage[len], remain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ LINUX_InotifyJoystickDetect(void)
|
||||
while (remain > 0) {
|
||||
if (buf.event.len > 0) {
|
||||
if (StrHasPrefix(buf.event.name, "event") &&
|
||||
StrIsInteger(buf.event.name + strlen ("event"))) {
|
||||
StrIsInteger(buf.event.name + SDL_strlen ("event"))) {
|
||||
char path[PATH_MAX];
|
||||
|
||||
SDL_snprintf(path, SDL_arraysize(path), "/dev/input/%s", buf.event.name);
|
||||
@@ -547,7 +547,7 @@ LINUX_InotifyJoystickDetect(void)
|
||||
remain -= len;
|
||||
|
||||
if (remain != 0) {
|
||||
memmove (&buf.storage[0], &buf.storage[len], remain);
|
||||
SDL_memmove (&buf.storage[0], &buf.storage[len], remain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user