server: Replace inline static with static inline.
This commit is contained in:
parent
a33f71a32d
commit
b1788c8462
|
@ -1026,7 +1026,7 @@ static int set_unix_lock( struct fd *fd, file_pos_t start, file_pos_t end, int t
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if interval [start;end) overlaps the lock */
|
/* check if interval [start;end) overlaps the lock */
|
||||||
inline static int lock_overlaps( struct file_lock *lock, file_pos_t start, file_pos_t end )
|
static inline int lock_overlaps( struct file_lock *lock, file_pos_t start, file_pos_t end )
|
||||||
{
|
{
|
||||||
if (lock->end && start >= lock->end) return 0;
|
if (lock->end && start >= lock->end) return 0;
|
||||||
if (end && lock->start >= end) return 0;
|
if (end && lock->start >= end) return 0;
|
||||||
|
|
|
@ -79,7 +79,7 @@ extern void no_cancel_async( struct fd *fd );
|
||||||
extern void main_loop(void);
|
extern void main_loop(void);
|
||||||
extern void remove_process_locks( struct process *process );
|
extern void remove_process_locks( struct process *process );
|
||||||
|
|
||||||
inline static struct fd *get_obj_fd( struct object *obj ) { return obj->ops->get_fd( obj ); }
|
static inline struct fd *get_obj_fd( struct object *obj ) { return obj->ops->get_fd( obj ); }
|
||||||
|
|
||||||
/* timeout functions */
|
/* timeout functions */
|
||||||
|
|
||||||
|
|
|
@ -69,11 +69,11 @@ static struct handle_table *global_table;
|
||||||
/* handle to table index conversion */
|
/* handle to table index conversion */
|
||||||
|
|
||||||
/* handles are a multiple of 4 under NT; handle 0 is not used */
|
/* handles are a multiple of 4 under NT; handle 0 is not used */
|
||||||
inline static obj_handle_t index_to_handle( int index )
|
static inline obj_handle_t index_to_handle( int index )
|
||||||
{
|
{
|
||||||
return (obj_handle_t)((unsigned long)(index + 1) << 2);
|
return (obj_handle_t)((unsigned long)(index + 1) << 2);
|
||||||
}
|
}
|
||||||
inline static int handle_to_index( obj_handle_t handle )
|
static inline int handle_to_index( obj_handle_t handle )
|
||||||
{
|
{
|
||||||
return ((unsigned long)handle >> 2) - 1;
|
return ((unsigned long)handle >> 2) - 1;
|
||||||
}
|
}
|
||||||
|
@ -82,16 +82,16 @@ inline static int handle_to_index( obj_handle_t handle )
|
||||||
|
|
||||||
#define HANDLE_OBFUSCATOR 0x544a4def
|
#define HANDLE_OBFUSCATOR 0x544a4def
|
||||||
|
|
||||||
inline static int handle_is_global( obj_handle_t handle)
|
static inline int handle_is_global( obj_handle_t handle)
|
||||||
{
|
{
|
||||||
return ((unsigned long)handle ^ HANDLE_OBFUSCATOR) < 0x10000;
|
return ((unsigned long)handle ^ HANDLE_OBFUSCATOR) < 0x10000;
|
||||||
}
|
}
|
||||||
inline static obj_handle_t handle_local_to_global( obj_handle_t handle )
|
static inline obj_handle_t handle_local_to_global( obj_handle_t handle )
|
||||||
{
|
{
|
||||||
if (!handle) return 0;
|
if (!handle) return 0;
|
||||||
return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR);
|
return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR);
|
||||||
}
|
}
|
||||||
inline static obj_handle_t handle_global_to_local( obj_handle_t handle )
|
static inline obj_handle_t handle_global_to_local( obj_handle_t handle )
|
||||||
{
|
{
|
||||||
return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR);
|
return (obj_handle_t)((unsigned long)handle ^ HANDLE_OBFUSCATOR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,14 +180,14 @@ static struct hook *find_hook( struct thread *thread, int index, void *proc )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the first hook in the chain */
|
/* get the first hook in the chain */
|
||||||
inline static struct hook *get_first_hook( struct hook_table *table, int index )
|
static inline struct hook *get_first_hook( struct hook_table *table, int index )
|
||||||
{
|
{
|
||||||
struct list *elem = list_head( &table->hooks[index] );
|
struct list *elem = list_head( &table->hooks[index] );
|
||||||
return elem ? HOOK_ENTRY( elem ) : NULL;
|
return elem ? HOOK_ENTRY( elem ) : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if a given hook should run in the current thread */
|
/* check if a given hook should run in the current thread */
|
||||||
inline static int run_hook_in_current_thread( struct hook *hook )
|
static inline int run_hook_in_current_thread( struct hook *hook )
|
||||||
{
|
{
|
||||||
if ((!hook->process || hook->process == current->process) &&
|
if ((!hook->process || hook->process == current->process) &&
|
||||||
(!(hook->flags & WINEVENT_SKIPOWNPROCESS) || hook->process != current->process))
|
(!(hook->flags & WINEVENT_SKIPOWNPROCESS) || hook->process != current->process))
|
||||||
|
@ -200,7 +200,7 @@ inline static int run_hook_in_current_thread( struct hook *hook )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if a given hook should run in the owner thread instead of the current thread */
|
/* check if a given hook should run in the owner thread instead of the current thread */
|
||||||
inline static int run_hook_in_owner_thread( struct hook *hook )
|
static inline int run_hook_in_owner_thread( struct hook *hook )
|
||||||
{
|
{
|
||||||
if ((hook->index == WH_MOUSE_LL - WH_MINHOOK ||
|
if ((hook->index == WH_MOUSE_LL - WH_MINHOOK ||
|
||||||
hook->index == WH_KEYBOARD_LL - WH_MINHOOK))
|
hook->index == WH_KEYBOARD_LL - WH_MINHOOK))
|
||||||
|
@ -209,7 +209,7 @@ inline static int run_hook_in_owner_thread( struct hook *hook )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the first non-deleted hook in the chain */
|
/* find the first non-deleted hook in the chain */
|
||||||
inline static struct hook *get_first_valid_hook( struct hook_table *table, int index,
|
static inline struct hook *get_first_valid_hook( struct hook_table *table, int index,
|
||||||
int event, user_handle_t win,
|
int event, user_handle_t win,
|
||||||
int object_id, int child_id )
|
int object_id, int child_id )
|
||||||
{
|
{
|
||||||
|
|
|
@ -266,7 +266,7 @@ static int get_image_params( struct mapping *mapping )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the size of the unix file associated with the mapping */
|
/* get the size of the unix file associated with the mapping */
|
||||||
inline static int get_file_size( struct file *file, file_pos_t *size )
|
static inline int get_file_size( struct file *file, file_pos_t *size )
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int unix_fd = get_file_unix_fd( file );
|
int unix_fd = get_file_unix_fd( file );
|
||||||
|
|
|
@ -145,14 +145,14 @@ extern void finish_process_tracing( struct process *process );
|
||||||
extern int read_process_memory( struct process *process, const void *ptr, data_size_t size, char *dest );
|
extern int read_process_memory( struct process *process, const void *ptr, data_size_t size, char *dest );
|
||||||
extern int write_process_memory( struct process *process, void *ptr, data_size_t size, const char *src );
|
extern int write_process_memory( struct process *process, void *ptr, data_size_t size, const char *src );
|
||||||
|
|
||||||
inline static process_id_t get_process_id( struct process *process ) { return process->id; }
|
static inline process_id_t get_process_id( struct process *process ) { return process->id; }
|
||||||
|
|
||||||
inline static int is_process_init_done( struct process *process )
|
static inline int is_process_init_done( struct process *process )
|
||||||
{
|
{
|
||||||
return process->startup_state == STARTUP_DONE;
|
return process->startup_state == STARTUP_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static struct process_dll *get_process_exe_module( struct process *process )
|
static inline struct process_dll *get_process_exe_module( struct process *process )
|
||||||
{
|
{
|
||||||
struct list *ptr = list_head( &process->dlls );
|
struct list *ptr = list_head( &process->dlls );
|
||||||
return ptr ? LIST_ENTRY( ptr, struct process_dll, entry ) : NULL;
|
return ptr ? LIST_ENTRY( ptr, struct process_dll, entry ) : NULL;
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
#define PT_READ_D 3
|
#define PT_READ_D 3
|
||||||
#define PT_WRITE_D 4
|
#define PT_WRITE_D 4
|
||||||
#define PT_STEP 5
|
#define PT_STEP 5
|
||||||
inline static int ptrace(int req, ...) { errno = EPERM; return -1; /*FAIL*/ }
|
static inline int ptrace(int req, ...) { errno = EPERM; return -1; /*FAIL*/ }
|
||||||
#endif /* HAVE_SYS_PTRACE_H */
|
#endif /* HAVE_SYS_PTRACE_H */
|
||||||
|
|
||||||
/* handle a status returned by wait4 */
|
/* handle a status returned by wait4 */
|
||||||
|
|
|
@ -306,13 +306,13 @@ void set_queue_hooks( struct thread *thread, struct hook_table *hooks )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check the queue status */
|
/* check the queue status */
|
||||||
inline static int is_signaled( struct msg_queue *queue )
|
static inline int is_signaled( struct msg_queue *queue )
|
||||||
{
|
{
|
||||||
return ((queue->wake_bits & queue->wake_mask) || (queue->changed_bits & queue->changed_mask));
|
return ((queue->wake_bits & queue->wake_mask) || (queue->changed_bits & queue->changed_mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set some queue bits */
|
/* set some queue bits */
|
||||||
inline static void set_queue_bits( struct msg_queue *queue, unsigned int bits )
|
static inline void set_queue_bits( struct msg_queue *queue, unsigned int bits )
|
||||||
{
|
{
|
||||||
queue->wake_bits |= bits;
|
queue->wake_bits |= bits;
|
||||||
queue->changed_bits |= bits;
|
queue->changed_bits |= bits;
|
||||||
|
@ -320,26 +320,26 @@ inline static void set_queue_bits( struct msg_queue *queue, unsigned int bits )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear some queue bits */
|
/* clear some queue bits */
|
||||||
inline static void clear_queue_bits( struct msg_queue *queue, unsigned int bits )
|
static inline void clear_queue_bits( struct msg_queue *queue, unsigned int bits )
|
||||||
{
|
{
|
||||||
queue->wake_bits &= ~bits;
|
queue->wake_bits &= ~bits;
|
||||||
queue->changed_bits &= ~bits;
|
queue->changed_bits &= ~bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check whether msg is a keyboard message */
|
/* check whether msg is a keyboard message */
|
||||||
inline static int is_keyboard_msg( struct message *msg )
|
static inline int is_keyboard_msg( struct message *msg )
|
||||||
{
|
{
|
||||||
return (msg->msg >= WM_KEYFIRST && msg->msg <= WM_KEYLAST);
|
return (msg->msg >= WM_KEYFIRST && msg->msg <= WM_KEYLAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if message is matched by the filter */
|
/* check if message is matched by the filter */
|
||||||
inline static int check_msg_filter( unsigned int msg, unsigned int first, unsigned int last )
|
static inline int check_msg_filter( unsigned int msg, unsigned int first, unsigned int last )
|
||||||
{
|
{
|
||||||
return (msg >= first && msg <= last);
|
return (msg >= first && msg <= last);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check whether a message filter contains at least one potential hardware message */
|
/* check whether a message filter contains at least one potential hardware message */
|
||||||
inline static int filter_contains_hw_range( unsigned int first, unsigned int last )
|
static inline int filter_contains_hw_range( unsigned int first, unsigned int last )
|
||||||
{
|
{
|
||||||
/* hardware message ranges are (in numerical order):
|
/* hardware message ranges are (in numerical order):
|
||||||
* WM_NCMOUSEFIRST .. WM_NCMOUSELAST
|
* WM_NCMOUSEFIRST .. WM_NCMOUSELAST
|
||||||
|
@ -354,7 +354,7 @@ inline static int filter_contains_hw_range( unsigned int first, unsigned int las
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the QS_* bit corresponding to a given hardware message */
|
/* get the QS_* bit corresponding to a given hardware message */
|
||||||
inline static int get_hardware_msg_bit( struct message *msg )
|
static inline int get_hardware_msg_bit( struct message *msg )
|
||||||
{
|
{
|
||||||
if (msg->msg == WM_MOUSEMOVE || msg->msg == WM_NCMOUSEMOVE) return QS_MOUSEMOVE;
|
if (msg->msg == WM_MOUSEMOVE || msg->msg == WM_NCMOUSEMOVE) return QS_MOUSEMOVE;
|
||||||
if (is_keyboard_msg( msg )) return QS_KEY;
|
if (is_keyboard_msg( msg )) return QS_KEY;
|
||||||
|
@ -362,7 +362,7 @@ inline static int get_hardware_msg_bit( struct message *msg )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the current thread queue, creating it if needed */
|
/* get the current thread queue, creating it if needed */
|
||||||
inline static struct msg_queue *get_current_queue(void)
|
static inline struct msg_queue *get_current_queue(void)
|
||||||
{
|
{
|
||||||
struct msg_queue *queue = current->queue;
|
struct msg_queue *queue = current->queue;
|
||||||
if (!queue) queue = create_msg_queue( current, NULL );
|
if (!queue) queue = create_msg_queue( current, NULL );
|
||||||
|
@ -370,7 +370,7 @@ inline static struct msg_queue *get_current_queue(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get a (pseudo-)unique id to tag hardware messages */
|
/* get a (pseudo-)unique id to tag hardware messages */
|
||||||
inline static unsigned int get_unique_id(void)
|
static inline unsigned int get_unique_id(void)
|
||||||
{
|
{
|
||||||
static unsigned int id;
|
static unsigned int id;
|
||||||
if (!++id) id = 1; /* avoid an id of 0 */
|
if (!++id) id = 1; /* avoid an id of 0 */
|
||||||
|
@ -860,7 +860,7 @@ static void thread_input_destroy( struct object *obj )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fix the thread input data when a window is destroyed */
|
/* fix the thread input data when a window is destroyed */
|
||||||
inline static void thread_input_cleanup_window( struct msg_queue *queue, user_handle_t window )
|
static inline void thread_input_cleanup_window( struct msg_queue *queue, user_handle_t window )
|
||||||
{
|
{
|
||||||
struct thread_input *input = queue->input;
|
struct thread_input *input = queue->input;
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ static void key_destroy( struct object *obj )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the request vararg as registry path */
|
/* get the request vararg as registry path */
|
||||||
inline static void get_req_path( struct unicode_str *str, int skip_root )
|
static inline void get_req_path( struct unicode_str *str, int skip_root )
|
||||||
{
|
{
|
||||||
static const WCHAR root_name[] = { '\\','R','e','g','i','s','t','r','y','\\' };
|
static const WCHAR root_name[] = { '\\','R','e','g','i','s','t','r','y','\\' };
|
||||||
|
|
||||||
|
|
|
@ -66,32 +66,32 @@ extern void trace_request(void);
|
||||||
extern void trace_reply( enum request req, const union generic_reply *reply );
|
extern void trace_reply( enum request req, const union generic_reply *reply );
|
||||||
|
|
||||||
/* get the request vararg data */
|
/* get the request vararg data */
|
||||||
inline static const void *get_req_data(void)
|
static inline const void *get_req_data(void)
|
||||||
{
|
{
|
||||||
return current->req_data;
|
return current->req_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the request vararg size */
|
/* get the request vararg size */
|
||||||
inline static data_size_t get_req_data_size(void)
|
static inline data_size_t get_req_data_size(void)
|
||||||
{
|
{
|
||||||
return current->req.request_header.request_size;
|
return current->req.request_header.request_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the request vararg as unicode string */
|
/* get the request vararg as unicode string */
|
||||||
inline static void get_req_unicode_str( struct unicode_str *str )
|
static inline void get_req_unicode_str( struct unicode_str *str )
|
||||||
{
|
{
|
||||||
str->str = get_req_data();
|
str->str = get_req_data();
|
||||||
str->len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR);
|
str->len = (get_req_data_size() / sizeof(WCHAR)) * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the reply maximum vararg size */
|
/* get the reply maximum vararg size */
|
||||||
inline static data_size_t get_reply_max_size(void)
|
static inline data_size_t get_reply_max_size(void)
|
||||||
{
|
{
|
||||||
return current->req.request_header.reply_size;
|
return current->req.request_header.reply_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* allocate and fill the reply data */
|
/* allocate and fill the reply data */
|
||||||
inline static void *set_reply_data( const void *data, data_size_t size )
|
static inline void *set_reply_data( const void *data, data_size_t size )
|
||||||
{
|
{
|
||||||
void *ret = set_reply_data_size( size );
|
void *ret = set_reply_data_size( size );
|
||||||
if (ret) memcpy( ret, data, size );
|
if (ret) memcpy( ret, data, size );
|
||||||
|
@ -99,7 +99,7 @@ inline static void *set_reply_data( const void *data, data_size_t size )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the reply data pointer directly (will be freed by request code) */
|
/* set the reply data pointer directly (will be freed by request code) */
|
||||||
inline static void set_reply_data_ptr( void *data, data_size_t size )
|
static inline void set_reply_data_ptr( void *data, data_size_t size )
|
||||||
{
|
{
|
||||||
assert( size <= get_reply_max_size() );
|
assert( size <= get_reply_max_size() );
|
||||||
current->reply_size = size;
|
current->reply_size = size;
|
||||||
|
|
|
@ -284,7 +284,7 @@ static void sock_wake_up( struct sock *sock, int pollev )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static int sock_error( struct fd *fd )
|
static inline int sock_error( struct fd *fd )
|
||||||
{
|
{
|
||||||
unsigned int optval = 0, optlen;
|
unsigned int optval = 0, optlen;
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ static const struct fd_ops thread_fd_ops =
|
||||||
static struct list thread_list = LIST_INIT(thread_list);
|
static struct list thread_list = LIST_INIT(thread_list);
|
||||||
|
|
||||||
/* initialize the structure for a newly allocated thread */
|
/* initialize the structure for a newly allocated thread */
|
||||||
inline static void init_thread_structure( struct thread *thread )
|
static inline void init_thread_structure( struct thread *thread )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ static const char *get_status_name( unsigned int status );
|
||||||
|
|
||||||
/* utility functions */
|
/* utility functions */
|
||||||
|
|
||||||
inline static void remove_data( data_size_t size )
|
static inline void remove_data( data_size_t size )
|
||||||
{
|
{
|
||||||
cur_data = (const char *)cur_data + size;
|
cur_data = (const char *)cur_data + size;
|
||||||
cur_size -= size;
|
cur_size -= size;
|
||||||
|
|
|
@ -45,13 +45,13 @@ static struct user_handle *handle_to_entry( user_handle_t handle )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static user_handle_t entry_to_handle( struct user_handle *ptr )
|
static inline user_handle_t entry_to_handle( struct user_handle *ptr )
|
||||||
{
|
{
|
||||||
int index = ptr - handles;
|
int index = ptr - handles;
|
||||||
return (user_handle_t)((((unsigned long)index << 1) + FIRST_USER_HANDLE) + (ptr->generation << 16));
|
return (user_handle_t)((((unsigned long)index << 1) + FIRST_USER_HANDLE) + (ptr->generation << 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static struct user_handle *alloc_user_entry(void)
|
static inline struct user_handle *alloc_user_entry(void)
|
||||||
{
|
{
|
||||||
struct user_handle *handle;
|
struct user_handle *handle;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ inline static struct user_handle *alloc_user_entry(void)
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void *free_user_entry( struct user_handle *ptr )
|
static inline void *free_user_entry( struct user_handle *ptr )
|
||||||
{
|
{
|
||||||
void *ret;
|
void *ret;
|
||||||
ret = ptr->ptr;
|
ret = ptr->ptr;
|
||||||
|
|
|
@ -107,7 +107,7 @@ static struct window *progman_window;
|
||||||
static struct window *taskman_window;
|
static struct window *taskman_window;
|
||||||
|
|
||||||
/* retrieve a pointer to a window from its handle */
|
/* retrieve a pointer to a window from its handle */
|
||||||
inline static struct window *get_window( user_handle_t handle )
|
static inline struct window *get_window( user_handle_t handle )
|
||||||
{
|
{
|
||||||
struct window *ret = get_user_object( handle, USER_WINDOW );
|
struct window *ret = get_user_object( handle, USER_WINDOW );
|
||||||
if (!ret) set_win32_error( ERROR_INVALID_WINDOW_HANDLE );
|
if (!ret) set_win32_error( ERROR_INVALID_WINDOW_HANDLE );
|
||||||
|
@ -285,7 +285,7 @@ static obj_handle_t get_property( struct window *win, atom_t atom )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* destroy all properties of a window */
|
/* destroy all properties of a window */
|
||||||
inline static void destroy_properties( struct window *win )
|
static inline void destroy_properties( struct window *win )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ static WCHAR *build_desktop_name( const struct unicode_str *name,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* retrieve a pointer to a desktop object */
|
/* retrieve a pointer to a desktop object */
|
||||||
inline static struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle,
|
static inline struct desktop *get_desktop_obj( struct process *process, obj_handle_t handle,
|
||||||
unsigned int access )
|
unsigned int access )
|
||||||
{
|
{
|
||||||
return (struct desktop *)get_handle_obj( process, handle, access, &desktop_ops );
|
return (struct desktop *)get_handle_obj( process, handle, access, &desktop_ops );
|
||||||
|
|
Loading…
Reference in New Issue