From 4be18ce16b7a59eaed9706546128bf81c8844c51 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 11 Sep 2024 17:11:49 +0200 Subject: [PATCH] server: Remove some dead initializations (Clang). --- server/change.c | 2 +- server/process.c | 2 +- server/queue.c | 3 +-- server/registry.c | 10 +++++----- server/token.c | 1 - server/trace.c | 3 +-- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/server/change.c b/server/change.c index f773ccf8831..f42ce066340 100644 --- a/server/change.c +++ b/server/change.c @@ -1071,7 +1071,7 @@ static void dir_add_to_existing_notify( struct dir *dir ) /* check if it's in the list of inodes we want to watch */ if (fstat( unix_fd, &st_new )) return; - if ((inode = find_inode( st_new.st_dev, st_new.st_ino ))) return; + if (find_inode( st_new.st_dev, st_new.st_ino )) return; /* lookup the parent */ if (!(link = get_path_from_fd( unix_fd, 3 ))) return; diff --git a/server/process.c b/server/process.c index 155dc050d95..49f5c75005f 100644 --- a/server/process.c +++ b/server/process.c @@ -838,7 +838,7 @@ static struct security_descriptor *process_get_sd( struct object *obj ) process_default_sd->dacl_len = dacl_len; sid = (struct sid *)(process_default_sd + 1); sid = copy_sid( sid, &builtin_admins_sid ); - sid = copy_sid( sid, &domain_users_sid ); + copy_sid( sid, &domain_users_sid ); dacl = (struct acl *)((char *)(process_default_sd + 1) + admins_sid_len + users_sid_len); dacl->revision = ACL_REVISION; diff --git a/server/queue.c b/server/queue.c index b1f69df5ec1..c99c8d8661b 100644 --- a/server/queue.c +++ b/server/queue.c @@ -360,10 +360,9 @@ static void sync_input_keystate( struct thread_input *input ) { const input_shm_t *input_shm = input->shared; const desktop_shm_t *desktop_shm; - struct desktop *desktop; int i; - if (!(desktop = input->desktop) || input_shm->keystate_lock) return; + if (!input->desktop || input_shm->keystate_lock) return; desktop_shm = input->desktop->shared; SHARED_WRITE_BEGIN( input_shm, input_shm_t ) diff --git a/server/registry.c b/server/registry.c index 5ec57b216d1..cc9a33fff1d 100644 --- a/server/registry.c +++ b/server/registry.c @@ -446,7 +446,7 @@ static struct security_descriptor *key_get_sd( struct object *obj ) key_default_sd->dacl_len = dacl_len; sid = (struct sid *)(key_default_sd + 1); sid = copy_sid( sid, &builtin_admins_sid ); - sid = copy_sid( sid, &builtin_admins_sid ); + copy_sid( sid, &builtin_admins_sid ); dacl = (struct acl *)((char *)(key_default_sd + 1) + 2 * admins_sid_len); dacl->revision = ACL_REVISION; @@ -1001,7 +1001,7 @@ static void enum_key( struct key *key, int index, int info_class, struct enum_ke static void rename_key( struct key *key, const struct unicode_str *new_name ) { struct object_name *new_name_ptr; - struct key *subkey, *parent = get_parent( key ); + struct key *parent = get_parent( key ); data_size_t len; int i, index, cur_index; @@ -1014,7 +1014,7 @@ static void rename_key( struct key *key, const struct unicode_str *new_name ) } /* check for existing subkey with the same name */ - if (!parent || (subkey = find_subkey( parent, new_name, &index ))) + if (!parent || find_subkey( parent, new_name, &index )) { set_error( STATUS_CANNOT_DELETE ); return; @@ -1635,7 +1635,7 @@ static int load_value( struct key *key, const char *buffer, struct file_load_inf case REG_SZ: if (!get_file_tmp_space( info, strlen(buffer) * sizeof(WCHAR) )) return 0; len = info->tmplen; - if ((res = parse_strW( info->tmp, &len, buffer, '\"' )) == -1) goto error; + if (parse_strW( info->tmp, &len, buffer, '\"' ) == -1) goto error; ptr = info->tmp; break; case REG_DWORD: @@ -1696,7 +1696,7 @@ static int get_prefix_len( struct key *key, const char *name, struct file_load_i if (!get_file_tmp_space( info, strlen(name) * sizeof(WCHAR) )) return 0; len = info->tmplen; - if ((res = parse_strW( info->tmp, &len, name, ']' )) == -1) + if (parse_strW( info->tmp, &len, name, ']' ) == -1) { file_read_error( "Malformed key", info ); return 0; diff --git a/server/token.c b/server/token.c index 9cc4f93adf4..c4c03516187 100644 --- a/server/token.c +++ b/server/token.c @@ -285,7 +285,6 @@ int sd_is_valid( const struct security_descriptor *sd, data_size_t size ) dacl = sd_get_dacl( sd, &dummy ); if (dacl && !acl_is_valid( dacl, sd->dacl_len )) return FALSE; - offset += sd->dacl_len; return TRUE; } diff --git a/server/trace.c b/server/trace.c index 449a2ff9ec2..e2fe90cf64f 100644 --- a/server/trace.c +++ b/server/trace.c @@ -982,7 +982,7 @@ static void dump_varargs_startup_info( const char *prefix, data_size_t size ) pos = dump_inline_unicode_string( "\",title=L\"", pos, info.title_len, size ); pos = dump_inline_unicode_string( "\",desktop=L\"", pos, info.desktop_len, size ); pos = dump_inline_unicode_string( "\",shellinfo=L\"", pos, info.shellinfo_len, size ); - pos = dump_inline_unicode_string( "\",runtime=L\"", pos, info.runtime_len, size ); + dump_inline_unicode_string( "\",runtime=L\"", pos, info.runtime_len, size ); fprintf( stderr, "\"}" ); remove_data( size ); } @@ -1185,7 +1185,6 @@ static void dump_inline_security_descriptor( const char *prefix, const struct se if ((sd->dacl_len >= MAX_ACL_LEN) || (offset + sd->dacl_len > size)) return; dump_inline_acl( ",dacl=", (const struct acl *)((const char *)sd + offset), sd->dacl_len ); - offset += sd->dacl_len; } fputc( '}', stderr ); }