Clang-Tidy fixes (#6725)

This commit is contained in:
Pierre Wendling 2022-12-01 16:07:03 -05:00 committed by GitHub
parent c2ce44bead
commit 3c501b963d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 1312 additions and 1154 deletions

View file

@ -100,12 +100,13 @@ void HIDAPI_DumpPacket(const char *prefix, const Uint8 *data, int size)
int start = 0, amount = size;
buffer = (char *)SDL_malloc(length);
SDL_snprintf(buffer, length, prefix, size);
(void)SDL_snprintf(buffer, length, prefix, size);
for (i = start; i < start + amount; ++i) {
size_t current_len = SDL_strlen(buffer);
if ((i % 8) == 0) {
SDL_snprintf(&buffer[SDL_strlen(buffer)], length - SDL_strlen(buffer), "\n%.2d: ", i);
(void)SDL_snprintf(&buffer[current_len], length - current_len, "\n%.2d: ", i);
}
SDL_snprintf(&buffer[SDL_strlen(buffer)], length - SDL_strlen(buffer), " 0x%.2x", data[i]);
(void)SDL_snprintf(&buffer[current_len], length - current_len, " 0x%.2x", data[i]);
}
SDL_strlcat(buffer, "\n", length);
SDL_Log("%s", buffer);
@ -379,7 +380,6 @@ static void HIDAPI_SetupDeviceDriver(SDL_HIDAPI_Device *device, SDL_bool *remove
/* Make sure the device didn't get removed while opening the HID path */
for (curr = SDL_HIDAPI_devices; curr && curr != device; curr = curr->next) {
continue;
}
if (curr == NULL) {
*removed = SDL_TRUE;
@ -713,7 +713,6 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
SDL_bool removed;
for (curr = SDL_HIDAPI_devices, last = NULL; curr; last = curr, curr = curr->next) {
continue;
}
device = (SDL_HIDAPI_Device *)SDL_calloc(1, sizeof(*device));
@ -980,7 +979,6 @@ check_removed:
/* See if we can create any combined Joy-Con controllers */
while (HIDAPI_CreateCombinedJoyCons()) {
continue;
}
SDL_UnlockJoysticks();