Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!)

This commit is contained in:
Sam Lantinga
2023-03-09 15:10:00 -08:00
parent ad95c93bf4
commit c6443d86c9
57 changed files with 176 additions and 179 deletions

View File

@@ -287,7 +287,7 @@ void SDL_EVDEV_Poll(void)
mouse = SDL_GetMouse();
for (item = _this->first; item != NULL; item = item->next) {
while ((len = read(item->fd, events, (sizeof events))) > 0) {
while ((len = read(item->fd, events, sizeof(events))) > 0) {
len /= sizeof(events[0]);
for (i = 0; i < len; ++i) {
struct input_event *event = &events[i];

View File

@@ -62,9 +62,9 @@ static char *GetAppName(void)
int linksize;
#if defined(__LINUX__)
(void)SDL_snprintf(procfile, sizeof procfile, "/proc/%d/exe", getpid());
(void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/exe", getpid());
#elif defined(__FREEBSD__)
(void)SDL_snprintf(procfile, sizeof procfile, "/proc/%d/file", getpid());
(void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/file", getpid());
#endif
linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
if (linksize > 0) {

View File

@@ -405,13 +405,13 @@ static char *IBus_GetDBusAddressFilename(void)
SDL_free(display);
return NULL;
}
(void)SDL_snprintf(config_dir, sizeof config_dir, "%s/.config", home_env);
(void)SDL_snprintf(config_dir, sizeof(config_dir), "%s/.config", home_env);
}
key = dbus->get_local_machine_id();
SDL_memset(file_path, 0, sizeof(file_path));
(void)SDL_snprintf(file_path, sizeof file_path, "%s/ibus/bus/%s-%s-%s",
(void)SDL_snprintf(file_path, sizeof(file_path), "%s/ibus/bus/%s-%s-%s",
config_dir, key, host, disp_num);
dbus->free(key);
SDL_free(display);
@@ -489,7 +489,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr)
if (result) {
char matchstr[128];
(void)SDL_snprintf(matchstr, sizeof matchstr, "type='signal',interface='%s'", ibus_input_interface);
(void)SDL_snprintf(matchstr, sizeof(matchstr), "type='signal',interface='%s'", ibus_input_interface);
SDL_free(input_ctx_path);
input_ctx_path = SDL_strdup(path);
SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL);

View File

@@ -266,7 +266,7 @@ WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
}
ptr = (const unsigned char *)guid;
(void)SDL_snprintf(keystr, sizeof keystr,
(void)SDL_snprintf(keystr, sizeof(keystr),
"System\\CurrentControlSet\\Control\\MediaCategories\\{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
ptr[3], ptr[2], ptr[1], ptr[0], ptr[5], ptr[4], ptr[7], ptr[6],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]);