linux-user: Remove type casts to union type
Casting to a union type is a gcc (and clang) extension. Other compilers might not support it. This is not a problem today, but the type casts can be removed easily. Smatch now no longer complains like before: linux-user/syscall.c:3190:18: warning: cast to non-scalar linux-user/syscall.c:7348:44: warning: cast to non-scalar Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
		
							parent
							
								
									c78d65e8a7
								
							
						
					
					
						commit
						d1c002b6ae
					
				| 
						 | 
				
			
			@ -2728,8 +2728,9 @@ static inline abi_long host_to_target_semarray(int semid, abi_ulong target_addr,
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static inline abi_long do_semctl(int semid, int semnum, int cmd,
 | 
			
		||||
                                 union target_semun target_su)
 | 
			
		||||
                                 abi_ulong target_arg)
 | 
			
		||||
{
 | 
			
		||||
    union target_semun target_su = { .buf = target_arg };
 | 
			
		||||
    union semun arg;
 | 
			
		||||
    struct semid_ds dsarg;
 | 
			
		||||
    unsigned short *array = NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -3251,8 +3252,7 @@ static abi_long do_ipc(unsigned int call, abi_long first,
 | 
			
		|||
         * ptr argument. */
 | 
			
		||||
        abi_ulong atptr;
 | 
			
		||||
        get_user_ual(atptr, ptr);
 | 
			
		||||
        ret = do_semctl(first, second, third,
 | 
			
		||||
                (union target_semun) atptr);
 | 
			
		||||
        ret = do_semctl(first, second, third, atptr);
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -7550,7 +7550,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 | 
			
		|||
#endif
 | 
			
		||||
#ifdef TARGET_NR_semctl
 | 
			
		||||
    case TARGET_NR_semctl:
 | 
			
		||||
        ret = do_semctl(arg1, arg2, arg3, (union target_semun)(abi_ulong)arg4);
 | 
			
		||||
        ret = do_semctl(arg1, arg2, arg3, arg4);
 | 
			
		||||
        break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef TARGET_NR_msgctl
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue