<div dir="ltr">I would rather not do that massive tab cleanup, because it is a pain in reading history with git blame.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 30, 2014 at 1:56 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Some source files inconsistently use space VS tabs. Most of the codebase<br>
uses 8 spaces for indentation, this commit changes the remaining tabs to<br>
spaces.<br>
---<br>
gtk/channel-display.h | 2 +-<br>
gtk/channel-main.c | 14 +-<br>
gtk/channel-record.h | 2 +-<br>
gtk/continuation.c | 66 ++++-----<br>
gtk/continuation.h | 18 +--<br>
gtk/controller/namedpipe.c | 14 +-<br>
gtk/controller/namedpipeconnection.c | 6 +-<br>
gtk/coroutine.h | 24 ++--<br>
gtk/coroutine_gthread.c | 166 +++++++++++------------<br>
gtk/coroutine_ucontext.c | 106 +++++++--------<br>
gtk/coroutine_winfibers.c | 98 +++++++-------<br>
gtk/gio-coroutine.c | 10 +-<br>
gtk/glib-compat.c | 2 +-<br>
gtk/glib-compat.h | 6 +-<br>
gtk/spice-audio.h | 6 +-<br>
gtk/spice-channel.c | 2 +-<br>
gtk/spice-grabsequence.c | 94 ++++++-------<br>
gtk/spice-grabsequence.h | 6 +-<br>
gtk/spice-gtk-session.c | 6 +-<br>
gtk/spice-session.c | 36 ++---<br>
gtk/spice-util.c | 2 +-<br>
gtk/spice-widget.h | 8 +-<br>
gtk/spicy-screenshot.c | 4 +-<br>
gtk/spicy.c | 12 +-<br>
gtk/vncdisplaykeymap.c | 250 +++++++++++++++++------------------<br>
25 files changed, 480 insertions(+), 480 deletions(-)<br>
<br>
diff --git a/gtk/channel-display.h b/gtk/channel-display.h<br>
index 88e60d9..10c2813 100644<br>
--- a/gtk/channel-display.h<br>
+++ b/gtk/channel-display.h<br>
@@ -93,7 +93,7 @@ struct _SpiceDisplayChannelClass {<br>
/*< private >*/<br>
};<br>
<br>
-GType spice_display_channel_get_type(void);<br>
+GType spice_display_channel_get_type(void);<br>
gboolean spice_display_get_primary(SpiceChannel *channel, guint32 surface_id,<br>
SpiceDisplayPrimary *primary);<br>
<br>
diff --git a/gtk/channel-main.c b/gtk/channel-main.c<br>
index 1ad090f..14899b9 100644<br>
--- a/gtk/channel-main.c<br>
+++ b/gtk/channel-main.c<br>
@@ -256,13 +256,13 @@ static void spice_main_get_property(GObject *object,<br>
switch (prop_id) {<br>
case PROP_MOUSE_MODE:<br>
g_value_set_int(value, c->mouse_mode);<br>
- break;<br>
+ break;<br>
case PROP_AGENT_CONNECTED:<br>
g_value_set_boolean(value, c->agent_connected);<br>
- break;<br>
+ break;<br>
case PROP_AGENT_CAPS_0:<br>
g_value_set_int(value, c->agent_caps[0]);<br>
- break;<br>
+ break;<br>
case PROP_DISPLAY_DISABLE_WALLPAPER:<br>
g_value_set_boolean(value, c->display_disable_wallpaper);<br>
break;<br>
@@ -285,8 +285,8 @@ static void spice_main_get_property(GObject *object,<br>
g_value_set_int(value, spice_main_get_max_clipboard(self));<br>
break;<br>
default:<br>
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);<br>
- break;<br>
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);<br>
+ break;<br>
}<br>
}<br>
<br>
@@ -322,8 +322,8 @@ static void spice_main_set_property(GObject *gobject, guint prop_id,<br>
spice_main_set_max_clipboard(self, g_value_get_int(value));<br>
break;<br>
default:<br>
- G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
- break;<br>
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
+ break;<br>
}<br>
}<br>
<br>
diff --git a/gtk/channel-record.h b/gtk/channel-record.h<br>
index 20a9ad3..31c0f7b 100644<br>
--- a/gtk/channel-record.h<br>
+++ b/gtk/channel-record.h<br>
@@ -68,7 +68,7 @@ struct _SpiceRecordChannelClass {<br>
/* Do not add fields to this struct */<br>
};<br>
<br>
-GType spice_record_channel_get_type(void);<br>
+GType spice_record_channel_get_type(void);<br>
void spice_record_send_data(SpiceRecordChannel *channel, gpointer data,<br>
gsize bytes, guint32 time);<br>
<br>
diff --git a/gtk/continuation.c b/gtk/continuation.c<br>
index adce858..3c348a9 100644<br>
--- a/gtk/continuation.c<br>
+++ b/gtk/continuation.c<br>
@@ -35,63 +35,63 @@<br>
* union is a quick hack to let us do that<br>
*/<br>
union cc_arg {<br>
- void *p;<br>
- int i[2];<br>
+ void *p;<br>
+ int i[2];<br>
};<br>
<br>
static void continuation_trampoline(int i0, int i1)<br>
{<br>
- union cc_arg arg;<br>
- struct continuation *cc;<br>
- arg.i[0] = i0;<br>
- arg.i[1] = i1;<br>
- cc = arg.p;<br>
+ union cc_arg arg;<br>
+ struct continuation *cc;<br>
+ arg.i[0] = i0;<br>
+ arg.i[1] = i1;<br>
+ cc = arg.p;<br>
<br>
- if (_setjmp(cc->jmp) == 0) {<br>
- ucontext_t tmp;<br>
- swapcontext(&tmp, &cc->last);<br>
- }<br>
+ if (_setjmp(cc->jmp) == 0) {<br>
+ ucontext_t tmp;<br>
+ swapcontext(&tmp, &cc->last);<br>
+ }<br>
<br>
- cc->entry(cc);<br>
+ cc->entry(cc);<br>
}<br>
<br>
void cc_init(struct continuation *cc)<br>
{<br>
- volatile union cc_arg arg;<br>
- arg.p = cc;<br>
- if (getcontext(&cc->uc) == -1)<br>
- g_error("getcontext() failed: %s", g_strerror(errno));<br>
- cc->uc.uc_link = &cc->last;<br>
- cc->uc.uc_stack.ss_sp = cc->stack;<br>
- cc->uc.uc_stack.ss_size = cc->stack_size;<br>
- cc->uc.uc_stack.ss_flags = 0;<br>
+ volatile union cc_arg arg;<br>
+ arg.p = cc;<br>
+ if (getcontext(&cc->uc) == -1)<br>
+ g_error("getcontext() failed: %s", g_strerror(errno));<br>
+ cc->uc.uc_link = &cc->last;<br>
+ cc->uc.uc_stack.ss_sp = cc->stack;<br>
+ cc->uc.uc_stack.ss_size = cc->stack_size;<br>
+ cc->uc.uc_stack.ss_flags = 0;<br>
<br>
- makecontext(&cc->uc, (void *)continuation_trampoline, 2, arg.i[0], arg.i[1]);<br>
- swapcontext(&cc->last, &cc->uc);<br>
+ makecontext(&cc->uc, (void *)continuation_trampoline, 2, arg.i[0], arg.i[1]);<br>
+ swapcontext(&cc->last, &cc->uc);<br>
}<br>
<br>
int cc_release(struct continuation *cc)<br>
{<br>
- if (cc->release)<br>
- return cc->release(cc);<br>
+ if (cc->release)<br>
+ return cc->release(cc);<br>
<br>
- return 0;<br>
+ return 0;<br>
}<br>
<br>
int cc_swap(struct continuation *from, struct continuation *to)<br>
{<br>
- to->exited = 0;<br>
- if (getcontext(&to->last) == -1)<br>
- return -1;<br>
- else if (to->exited == 0)<br>
- to->exited = 1; // so when coroutine finishes<br>
+ to->exited = 0;<br>
+ if (getcontext(&to->last) == -1)<br>
+ return -1;<br>
+ else if (to->exited == 0)<br>
+ to->exited = 1; // so when coroutine finishes<br>
else if (to->exited == 1)<br>
return 1; // it ends up here<br>
<br>
- if (_setjmp(from->jmp) == 0)<br>
- _longjmp(to->jmp, 1);<br>
+ if (_setjmp(from->jmp) == 0)<br>
+ _longjmp(to->jmp, 1);<br>
<br>
- return 0;<br>
+ return 0;<br>
}<br>
/*<br>
* Local variables:<br>
diff --git a/gtk/continuation.h b/gtk/continuation.h<br>
index 675a257..31d5bff 100644<br>
--- a/gtk/continuation.h<br>
+++ b/gtk/continuation.h<br>
@@ -27,16 +27,16 @@<br>
<br>
struct continuation<br>
{<br>
- char *stack;<br>
- size_t stack_size;<br>
- void (*entry)(struct continuation *cc);<br>
- int (*release)(struct continuation *cc);<br>
+ char *stack;<br>
+ size_t stack_size;<br>
+ void (*entry)(struct continuation *cc);<br>
+ int (*release)(struct continuation *cc);<br>
<br>
- /* private */<br>
- ucontext_t uc;<br>
- ucontext_t last;<br>
- int exited;<br>
- jmp_buf jmp;<br>
+ /* private */<br>
+ ucontext_t uc;<br>
+ ucontext_t last;<br>
+ int exited;<br>
+ jmp_buf jmp;<br>
};<br>
<br>
void cc_init(struct continuation *cc);<br>
diff --git a/gtk/controller/namedpipe.c b/gtk/controller/namedpipe.c<br>
index 5312218..8bdc6da 100644<br>
--- a/gtk/controller/namedpipe.c<br>
+++ b/gtk/controller/namedpipe.c<br>
@@ -28,8 +28,8 @@ static gboolean spice_named_pipe_initable_init (GInitable *initable,<br>
GError **error);<br>
<br>
G_DEFINE_TYPE_WITH_CODE (SpiceNamedPipe, spice_named_pipe, G_TYPE_OBJECT,<br>
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,<br>
- spice_named_pipe_initable_iface_init));<br>
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,<br>
+ spice_named_pipe_initable_iface_init));<br>
<br>
enum<br>
{<br>
@@ -164,7 +164,7 @@ spice_named_pipe_class_init (SpiceNamedPipeClass *klass)<br>
gobject_class->constructed = spice_named_pipe_constructed;<br>
<br>
g_object_class_install_property (gobject_class, PROP_NAME,<br>
- g_param_spec_string ("name",<br>
+ g_param_spec_string ("name",<br>
"Pipe Name",<br>
"The NamedPipe name",<br>
NULL,<br>
@@ -212,7 +212,7 @@ spice_named_pipe_initable_init (GInitable *initable,<br>
if (np->priv->construct_error)<br>
{<br>
if (error)<br>
- *error = g_error_copy (np->priv->construct_error);<br>
+ *error = g_error_copy (np->priv->construct_error);<br>
return FALSE;<br>
}<br>
<br>
@@ -259,9 +259,9 @@ spice_named_pipe_close (SpiceNamedPipe *np,<br>
gchar *emsg = g_win32_error_message (errsv);<br>
<br>
g_set_error (error, G_IO_ERROR,<br>
- g_io_error_from_win32_error (errsv),<br>
- "Error closing handle: %s",<br>
- emsg);<br>
+ g_io_error_from_win32_error (errsv),<br>
+ "Error closing handle: %s",<br>
+ emsg);<br>
g_free (emsg);<br>
return FALSE;<br>
}<br>
diff --git a/gtk/controller/namedpipeconnection.c b/gtk/controller/namedpipeconnection.c<br>
index 3173b61..385038f 100644<br>
--- a/gtk/controller/namedpipeconnection.c<br>
+++ b/gtk/controller/namedpipeconnection.c<br>
@@ -200,9 +200,9 @@ spice_named_pipe_connection_close_async (GIOStream *stream,<br>
}<br>
<br>
res = g_simple_async_result_new (G_OBJECT (stream),<br>
- callback,<br>
- user_data,<br>
- spice_named_pipe_connection_close_async);<br>
+ callback,<br>
+ user_data,<br>
+ spice_named_pipe_connection_close_async);<br>
g_simple_async_result_complete_in_idle (res);<br>
g_object_unref (res);<br>
}<br>
diff --git a/gtk/coroutine.h b/gtk/coroutine.h<br>
index 78dc467..29be733 100644<br>
--- a/gtk/coroutine.h<br>
+++ b/gtk/coroutine.h<br>
@@ -33,25 +33,25 @@<br>
<br>
struct coroutine<br>
{<br>
- size_t stack_size;<br>
- void *(*entry)(void *);<br>
- int (*release)(struct coroutine *);<br>
+ size_t stack_size;<br>
+ void *(*entry)(void *);<br>
+ int (*release)(struct coroutine *);<br>
<br>
- /* read-only */<br>
- int exited;<br>
+ /* read-only */<br>
+ int exited;<br>
<br>
- /* private */<br>
- struct coroutine *caller;<br>
- void *data;<br>
+ /* private */<br>
+ struct coroutine *caller;<br>
+ void *data;<br>
<br>
#if WITH_UCONTEXT<br>
- struct continuation cc;<br>
+ struct continuation cc;<br>
#elif WITH_WINFIBER<br>
LPVOID fiber;<br>
int ret;<br>
#else<br>
- GThread *thread;<br>
- gboolean runnable;<br>
+ GThread *thread;<br>
+ gboolean runnable;<br>
#endif<br>
};<br>
<br>
@@ -70,7 +70,7 @@ void *coroutine_yield(void *arg);<br>
gboolean coroutine_is_main(struct coroutine *co);<br>
<br>
static inline gboolean coroutine_self_is_main(void) {<br>
- return coroutine_self() == NULL || coroutine_is_main(coroutine_self());<br>
+ return coroutine_self() == NULL || coroutine_is_main(coroutine_self());<br>
}<br>
<br>
#endif<br>
diff --git a/gtk/coroutine_gthread.c b/gtk/coroutine_gthread.c<br>
index b0098fa..3585d42 100644<br>
--- a/gtk/coroutine_gthread.c<br>
+++ b/gtk/coroutine_gthread.c<br>
@@ -37,131 +37,131 @@ static struct coroutine leader;<br>
<br>
static void coroutine_system_init(void)<br>
{<br>
- if (!g_thread_supported()) {<br>
- CO_DEBUG("INIT");<br>
- g_thread_init(NULL);<br>
- }<br>
+ if (!g_thread_supported()) {<br>
+ CO_DEBUG("INIT");<br>
+ g_thread_init(NULL);<br>
+ }<br>
<br>
<br>
- run_cond = g_cond_new();<br>
- run_lock = g_mutex_new();<br>
- CO_DEBUG("LOCK");<br>
- g_mutex_lock(run_lock);<br>
+ run_cond = g_cond_new();<br>
+ run_lock = g_mutex_new();<br>
+ CO_DEBUG("LOCK");<br>
+ g_mutex_lock(run_lock);<br>
<br>
- /* The thread that creates the first coroutine is the system coroutine<br>
- * so let's fill out a structure for it */<br>
- leader.entry = NULL;<br>
- leader.release = NULL;<br>
- leader.stack_size = 0;<br>
- leader.exited = 0;<br>
- leader.thread = g_thread_self();<br>
- leader.runnable = TRUE; /* we're the one running right now */<br>
- leader.caller = NULL;<br>
- leader.data = NULL;<br>
+ /* The thread that creates the first coroutine is the system coroutine<br>
+ * so let's fill out a structure for it */<br>
+ leader.entry = NULL;<br>
+ leader.release = NULL;<br>
+ leader.stack_size = 0;<br>
+ leader.exited = 0;<br>
+ leader.thread = g_thread_self();<br>
+ leader.runnable = TRUE; /* we're the one running right now */<br>
+ leader.caller = NULL;<br>
+ leader.data = NULL;<br>
<br>
- current = &leader;<br>
+ current = &leader;<br>
}<br>
<br>
static gpointer coroutine_thread(gpointer opaque)<br>
{<br>
- struct coroutine *co = opaque;<br>
- CO_DEBUG("LOCK");<br>
- g_mutex_lock(run_lock);<br>
- while (!co->runnable) {<br>
- CO_DEBUG("WAIT");<br>
- g_cond_wait(run_cond, run_lock);<br>
- }<br>
+ struct coroutine *co = opaque;<br>
+ CO_DEBUG("LOCK");<br>
+ g_mutex_lock(run_lock);<br>
+ while (!co->runnable) {<br>
+ CO_DEBUG("WAIT");<br>
+ g_cond_wait(run_cond, run_lock);<br>
+ }<br>
<br>
- CO_DEBUG("RUNNABLE");<br>
- current = co;<br>
- co->caller->data = co->entry(co->data);<br>
- co->exited = 1;<br>
+ CO_DEBUG("RUNNABLE");<br>
+ current = co;<br>
+ co->caller->data = co->entry(co->data);<br>
+ co->exited = 1;<br>
<br>
- co->caller->runnable = TRUE;<br>
- CO_DEBUG("BROADCAST");<br>
- g_cond_broadcast(run_cond);<br>
- CO_DEBUG("UNLOCK");<br>
- g_mutex_unlock(run_lock);<br>
+ co->caller->runnable = TRUE;<br>
+ CO_DEBUG("BROADCAST");<br>
+ g_cond_broadcast(run_cond);<br>
+ CO_DEBUG("UNLOCK");<br>
+ g_mutex_unlock(run_lock);<br>
<br>
- return NULL;<br>
+ return NULL;<br>
}<br>
<br>
void coroutine_init(struct coroutine *co)<br>
{<br>
- GError *err = NULL;<br>
+ GError *err = NULL;<br>
<br>
- if (run_cond == NULL)<br>
- coroutine_system_init();<br>
+ if (run_cond == NULL)<br>
+ coroutine_system_init();<br>
<br>
- CO_DEBUG("NEW");<br>
- co->thread = g_thread_create_full(coroutine_thread, co, co->stack_size,<br>
- FALSE, TRUE,<br>
- G_THREAD_PRIORITY_NORMAL,<br>
- &err);<br>
- if (err != NULL)<br>
- g_error("g_thread_create_full() failed: %s", err->message);<br>
+ CO_DEBUG("NEW");<br>
+ co->thread = g_thread_create_full(coroutine_thread, co, co->stack_size,<br>
+ FALSE, TRUE,<br>
+ G_THREAD_PRIORITY_NORMAL,<br>
+ &err);<br>
+ if (err != NULL)<br>
+ g_error("g_thread_create_full() failed: %s", err->message);<br>
<br>
- co->exited = 0;<br>
- co->runnable = FALSE;<br>
- co->caller = NULL;<br>
+ co->exited = 0;<br>
+ co->runnable = FALSE;<br>
+ co->caller = NULL;<br>
}<br>
<br>
int coroutine_release(struct coroutine *co G_GNUC_UNUSED)<br>
{<br>
- return 0;<br>
+ return 0;<br>
}<br>
<br>
void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)<br>
{<br>
- from->runnable = FALSE;<br>
- to->runnable = TRUE;<br>
- to->data = arg;<br>
- to->caller = from;<br>
- CO_DEBUG("BROADCAST");<br>
- g_cond_broadcast(run_cond);<br>
- CO_DEBUG("UNLOCK");<br>
- g_mutex_unlock(run_lock);<br>
- CO_DEBUG("LOCK");<br>
- g_mutex_lock(run_lock);<br>
- while (!from->runnable) {<br>
- CO_DEBUG("WAIT");<br>
- g_cond_wait(run_cond, run_lock);<br>
- }<br>
- current = from;<br>
- to->caller = NULL;<br>
+ from->runnable = FALSE;<br>
+ to->runnable = TRUE;<br>
+ to->data = arg;<br>
+ to->caller = from;<br>
+ CO_DEBUG("BROADCAST");<br>
+ g_cond_broadcast(run_cond);<br>
+ CO_DEBUG("UNLOCK");<br>
+ g_mutex_unlock(run_lock);<br>
+ CO_DEBUG("LOCK");<br>
+ g_mutex_lock(run_lock);<br>
+ while (!from->runnable) {<br>
+ CO_DEBUG("WAIT");<br>
+ g_cond_wait(run_cond, run_lock);<br>
+ }<br>
+ current = from;<br>
+ to->caller = NULL;<br>
<br>
- CO_DEBUG("SWAPPED");<br>
- return from->data;<br>
+ CO_DEBUG("SWAPPED");<br>
+ return from->data;<br>
}<br>
<br>
struct coroutine *coroutine_self(void)<br>
{<br>
- if (run_cond == NULL)<br>
- coroutine_system_init();<br>
+ if (run_cond == NULL)<br>
+ coroutine_system_init();<br>
<br>
- return current;<br>
+ return current;<br>
}<br>
<br>
void *coroutine_yieldto(struct coroutine *to, void *arg)<br>
{<br>
- g_return_val_if_fail(!to->caller, NULL);<br>
- g_return_val_if_fail(!to->exited, NULL);<br>
+ g_return_val_if_fail(!to->caller, NULL);<br>
+ g_return_val_if_fail(!to->exited, NULL);<br>
<br>
- CO_DEBUG("SWAP");<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ CO_DEBUG("SWAP");<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
void *coroutine_yield(void *arg)<br>
{<br>
- struct coroutine *to = coroutine_self()->caller;<br>
- if (!to) {<br>
- fprintf(stderr, "Co-routine is yielding to no one\n");<br>
- abort();<br>
- }<br>
+ struct coroutine *to = coroutine_self()->caller;<br>
+ if (!to) {<br>
+ fprintf(stderr, "Co-routine is yielding to no one\n");<br>
+ abort();<br>
+ }<br>
<br>
- CO_DEBUG("SWAP");<br>
- coroutine_self()->caller = NULL;<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ CO_DEBUG("SWAP");<br>
+ coroutine_self()->caller = NULL;<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
gboolean coroutine_is_main(struct coroutine *co)<br>
diff --git a/gtk/coroutine_ucontext.c b/gtk/coroutine_ucontext.c<br>
index d709a33..4ddb717 100644<br>
--- a/gtk/coroutine_ucontext.c<br>
+++ b/gtk/coroutine_ucontext.c<br>
@@ -37,51 +37,51 @@<br>
<br>
int coroutine_release(struct coroutine *co)<br>
{<br>
- return cc_release(&co->cc);<br>
+ return cc_release(&co->cc);<br>
}<br>
<br>
static int _coroutine_release(struct continuation *cc)<br>
{<br>
- struct coroutine *co = container_of(cc, struct coroutine, cc);<br>
+ struct coroutine *co = container_of(cc, struct coroutine, cc);<br>
<br>
- if (co->release) {<br>
- int ret = co->release(co);<br>
- if (ret < 0)<br>
- return ret;<br>
- }<br>
+ if (co->release) {<br>
+ int ret = co->release(co);<br>
+ if (ret < 0)<br>
+ return ret;<br>
+ }<br>
<br>
- munmap(co->cc.stack, co->cc.stack_size);<br>
+ munmap(co->cc.stack, co->cc.stack_size);<br>
<br>
- co->caller = NULL;<br>
+ co->caller = NULL;<br>
<br>
- return 0;<br>
+ return 0;<br>
}<br>
<br>
static void coroutine_trampoline(struct continuation *cc)<br>
{<br>
- struct coroutine *co = container_of(cc, struct coroutine, cc);<br>
- co->data = co->entry(co->data);<br>
+ struct coroutine *co = container_of(cc, struct coroutine, cc);<br>
+ co->data = co->entry(co->data);<br>
}<br>
<br>
void coroutine_init(struct coroutine *co)<br>
{<br>
- if (co->stack_size == 0)<br>
- co->stack_size = 16 << 20;<br>
+ if (co->stack_size == 0)<br>
+ co->stack_size = 16 << 20;<br>
<br>
- co->cc.stack_size = co->stack_size;<br>
- co->cc.stack = mmap(0, co->stack_size,<br>
- PROT_READ | PROT_WRITE,<br>
- MAP_PRIVATE | MAP_ANONYMOUS,<br>
- -1, 0);<br>
- if (co->cc.stack == MAP_FAILED)<br>
- g_error("mmap(%" G_GSIZE_FORMAT ") failed: %s",<br>
- co->stack_size, g_strerror(errno));<br>
+ co->cc.stack_size = co->stack_size;<br>
+ co->cc.stack = mmap(0, co->stack_size,<br>
+ PROT_READ | PROT_WRITE,<br>
+ MAP_PRIVATE | MAP_ANONYMOUS,<br>
+ -1, 0);<br>
+ if (co->cc.stack == MAP_FAILED)<br>
+ g_error("mmap(%" G_GSIZE_FORMAT ") failed: %s",<br>
+ co->stack_size, g_strerror(errno));<br>
<br>
- co->cc.entry = coroutine_trampoline;<br>
- co->cc.release = _coroutine_release;<br>
- co->exited = 0;<br>
+ co->cc.entry = coroutine_trampoline;<br>
+ co->cc.release = _coroutine_release;<br>
+ co->exited = 0;<br>
<br>
- cc_init(&co->cc);<br>
+ cc_init(&co->cc);<br>
}<br>
<br>
#if 0<br>
@@ -94,47 +94,47 @@ static struct coroutine *current;<br>
<br>
struct coroutine *coroutine_self(void)<br>
{<br>
- if (current == NULL)<br>
- current = &leader;<br>
- return current;<br>
+ if (current == NULL)<br>
+ current = &leader;<br>
+ return current;<br>
}<br>
<br>
void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)<br>
{<br>
- int ret;<br>
- to->data = arg;<br>
- current = to;<br>
- ret = cc_swap(&from->cc, &to->cc);<br>
- if (ret == 0)<br>
- return from->data;<br>
- else if (ret == 1) {<br>
- coroutine_release(to);<br>
- current = from;<br>
- to->exited = 1;<br>
- return to->data;<br>
- }<br>
+ int ret;<br>
+ to->data = arg;<br>
+ current = to;<br>
+ ret = cc_swap(&from->cc, &to->cc);<br>
+ if (ret == 0)<br>
+ return from->data;<br>
+ else if (ret == 1) {<br>
+ coroutine_release(to);<br>
+ current = from;<br>
+ to->exited = 1;<br>
+ return to->data;<br>
+ }<br>
<br>
- return NULL;<br>
+ return NULL;<br>
}<br>
<br>
void *coroutine_yieldto(struct coroutine *to, void *arg)<br>
{<br>
- g_return_val_if_fail(!to->caller, NULL);<br>
- g_return_val_if_fail(!to->exited, NULL);<br>
+ g_return_val_if_fail(!to->caller, NULL);<br>
+ g_return_val_if_fail(!to->exited, NULL);<br>
<br>
- to->caller = coroutine_self();<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ to->caller = coroutine_self();<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
void *coroutine_yield(void *arg)<br>
{<br>
- struct coroutine *to = coroutine_self()->caller;<br>
- if (!to) {<br>
- fprintf(stderr, "Co-routine is yielding to no one\n");<br>
- abort();<br>
- }<br>
- coroutine_self()->caller = NULL;<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ struct coroutine *to = coroutine_self()->caller;<br>
+ if (!to) {<br>
+ fprintf(stderr, "Co-routine is yielding to no one\n");<br>
+ abort();<br>
+ }<br>
+ coroutine_self()->caller = NULL;<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
gboolean coroutine_is_main(struct coroutine *co)<br>
diff --git a/gtk/coroutine_winfibers.c b/gtk/coroutine_winfibers.c<br>
index a56d33d..a448f45 100644<br>
--- a/gtk/coroutine_winfibers.c<br>
+++ b/gtk/coroutine_winfibers.c<br>
@@ -30,87 +30,87 @@ static struct coroutine *caller = NULL;<br>
<br>
int coroutine_release(struct coroutine *co)<br>
{<br>
- DeleteFiber(co->fiber);<br>
- return 0;<br>
+ DeleteFiber(co->fiber);<br>
+ return 0;<br>
}<br>
<br>
static void WINAPI coroutine_trampoline(LPVOID lpParameter)<br>
{<br>
- struct coroutine *co = (struct coroutine *)lpParameter;<br>
+ struct coroutine *co = (struct coroutine *)lpParameter;<br>
<br>
- co->data = co->entry(co->data);<br>
+ co->data = co->entry(co->data);<br>
<br>
- if (co->release)<br>
- co->ret = co->release(co);<br>
- else<br>
- co->ret = 0;<br>
+ if (co->release)<br>
+ co->ret = co->release(co);<br>
+ else<br>
+ co->ret = 0;<br>
<br>
- co->caller = NULL;<br>
+ co->caller = NULL;<br>
<br>
- // and switch back to caller<br>
- co->ret = 1;<br>
- SwitchToFiber(caller->fiber);<br>
+ // and switch back to caller<br>
+ co->ret = 1;<br>
+ SwitchToFiber(caller->fiber);<br>
}<br>
<br>
void coroutine_init(struct coroutine *co)<br>
{<br>
- if (leader.fiber == NULL) {<br>
- leader.fiber = ConvertThreadToFiber(&leader);<br>
- if (leader.fiber == NULL)<br>
- g_error("ConvertThreadToFiber() failed");<br>
- }<br>
+ if (leader.fiber == NULL) {<br>
+ leader.fiber = ConvertThreadToFiber(&leader);<br>
+ if (leader.fiber == NULL)<br>
+ g_error("ConvertThreadToFiber() failed");<br>
+ }<br>
<br>
- co->exited = 0;<br>
- co->fiber = CreateFiber(0, &coroutine_trampoline, co);<br>
- if (co->fiber == NULL)<br>
- g_error("CreateFiber() failed");<br>
+ co->exited = 0;<br>
+ co->fiber = CreateFiber(0, &coroutine_trampoline, co);<br>
+ if (co->fiber == NULL)<br>
+ g_error("CreateFiber() failed");<br>
<br>
- co->ret = 0;<br>
+ co->ret = 0;<br>
}<br>
<br>
struct coroutine *coroutine_self(void)<br>
{<br>
- if (current == NULL)<br>
- current = &leader;<br>
- return current;<br>
+ if (current == NULL)<br>
+ current = &leader;<br>
+ return current;<br>
}<br>
<br>
void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)<br>
{<br>
- to->data = arg;<br>
- current = to;<br>
- caller = from;<br>
- SwitchToFiber(to->fiber);<br>
- if (to->ret == 0)<br>
- return from->data;<br>
- else if (to->ret == 1) {<br>
- coroutine_release(to);<br>
- current = &leader;<br>
- to->exited = 1;<br>
- return to->data;<br>
- }<br>
+ to->data = arg;<br>
+ current = to;<br>
+ caller = from;<br>
+ SwitchToFiber(to->fiber);<br>
+ if (to->ret == 0)<br>
+ return from->data;<br>
+ else if (to->ret == 1) {<br>
+ coroutine_release(to);<br>
+ current = &leader;<br>
+ to->exited = 1;<br>
+ return to->data;<br>
+ }<br>
<br>
- return NULL;<br>
+ return NULL;<br>
}<br>
<br>
void *coroutine_yieldto(struct coroutine *to, void *arg)<br>
{<br>
- g_return_val_if_fail(!to->caller, NULL);<br>
- g_return_val_if_fail(!to->exited, NULL);<br>
+ g_return_val_if_fail(!to->caller, NULL);<br>
+ g_return_val_if_fail(!to->exited, NULL);<br>
<br>
- to->caller = coroutine_self();<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ to->caller = coroutine_self();<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
void *coroutine_yield(void *arg)<br>
{<br>
- struct coroutine *to = coroutine_self()->caller;<br>
- if (!to) {<br>
- fprintf(stderr, "Co-routine is yielding to no one\n");<br>
- abort();<br>
- }<br>
- coroutine_self()->caller = NULL;<br>
- return coroutine_swap(coroutine_self(), to, arg);<br>
+ struct coroutine *to = coroutine_self()->caller;<br>
+ if (!to) {<br>
+ fprintf(stderr, "Co-routine is yielding to no one\n");<br>
+ abort();<br>
+ }<br>
+ coroutine_self()->caller = NULL;<br>
+ return coroutine_swap(coroutine_self(), to, arg);<br>
}<br>
<br>
gboolean coroutine_is_main(struct coroutine *co)<br>
diff --git a/gtk/gio-coroutine.c b/gtk/gio-coroutine.c<br>
index c903bd2..e5812df 100644<br>
--- a/gtk/gio-coroutine.c<br>
+++ b/gtk/gio-coroutine.c<br>
@@ -37,8 +37,8 @@ GCoroutine* g_coroutine_self(void)<br>
<br>
/* Main loop helper functions */<br>
static gboolean g_io_wait_helper(GSocket *sock G_GNUC_UNUSED,<br>
- GIOCondition cond,<br>
- gpointer data)<br>
+ GIOCondition cond,<br>
+ gpointer data)<br>
{<br>
struct coroutine *to = data;<br>
coroutine_yieldto(to, &cond);<br>
@@ -96,7 +96,7 @@ void g_coroutine_wakeup(GCoroutine *coroutine)<br>
* true if the condition we're checking is ready for dispatch<br>
*/<br>
static gboolean g_condition_wait_prepare(GSource *src,<br>
- int *timeout) {<br>
+ int *timeout) {<br>
GConditionWaitSource *vsrc = (GConditionWaitSource *)src;<br>
*timeout = -1;<br>
return vsrc->func(vsrc->data);<br>
@@ -113,8 +113,8 @@ static gboolean g_condition_wait_check(GSource *src)<br>
}<br>
<br>
static gboolean g_condition_wait_dispatch(GSource *src G_GNUC_UNUSED,<br>
- GSourceFunc cb,<br>
- gpointer data) {<br>
+ GSourceFunc cb,<br>
+ gpointer data) {<br>
return cb(data);<br>
}<br>
<br>
diff --git a/gtk/glib-compat.c b/gtk/glib-compat.c<br>
index 9d1165e..32da168 100644<br>
--- a/gtk/glib-compat.c<br>
+++ b/gtk/glib-compat.c<br>
@@ -88,7 +88,7 @@ g_simple_async_result_take_error (GSimpleAsyncResult *simple,<br>
**/<br>
G_GNUC_INTERNAL void<br>
g_slist_free_full (GSList *list,<br>
- GDestroyNotify free_func)<br>
+ GDestroyNotify free_func)<br>
{<br>
g_slist_foreach (list, (GFunc) free_func, NULL);<br>
g_slist_free (list);<br>
diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h<br>
index 45d961e..17cabaf 100644<br>
--- a/gtk/glib-compat.h<br>
+++ b/gtk/glib-compat.h<br>
@@ -75,9 +75,9 @@ GType spice_error_get_type (void) G_GNUC_CONST;<br>
#define G_PARAM_DEPRECATED (1 << 31)<br>
<br>
void g_key_file_set_uint64 (GKeyFile *key_file,<br>
- const gchar *group_name,<br>
- const gchar *key,<br>
- guint64 value);<br>
+ const gchar *group_name,<br>
+ const gchar *key,<br>
+ guint64 value);<br>
#endif /* glib 2.26 */<br>
<br>
#if !GLIB_CHECK_VERSION(2,28,0)<br>
diff --git a/gtk/spice-audio.h b/gtk/spice-audio.h<br>
index ebc4946..af2bca5 100644<br>
--- a/gtk/spice-audio.h<br>
+++ b/gtk/spice-audio.h<br>
@@ -26,10 +26,10 @@ G_BEGIN_DECLS<br>
<br>
#define SPICE_TYPE_AUDIO spice_audio_get_type()<br>
<br>
-#define SPICE_AUDIO(obj) \<br>
+#define SPICE_AUDIO(obj) \<br>
(G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_AUDIO, SpiceAudio))<br>
<br>
-#define SPICE_AUDIO_CLASS(klass) \<br>
+#define SPICE_AUDIO_CLASS(klass) \<br>
(G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_AUDIO, SpiceAudioClass))<br>
<br>
#define SPICE_IS_AUDIO(obj) \<br>
@@ -38,7 +38,7 @@ G_BEGIN_DECLS<br>
#define SPICE_IS_AUDIO_CLASS(klass) \<br>
(G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_AUDIO))<br>
<br>
-#define SPICE_AUDIO_GET_CLASS(obj) \<br>
+#define SPICE_AUDIO_GET_CLASS(obj) \<br>
(G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_AUDIO, SpiceAudioClass))<br>
<br>
typedef struct _SpiceAudio SpiceAudio;<br>
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c<br>
index cd031e4..ae281c4 100644<br>
--- a/gtk/spice-channel.c<br>
+++ b/gtk/spice-channel.c<br>
@@ -1241,7 +1241,7 @@ static gchar *addr_to_string(GSocketAddress *addr)<br>
<br>
static gboolean<br>
spice_channel_gather_sasl_credentials(SpiceChannel *channel,<br>
- sasl_interact_t *interact)<br>
+ sasl_interact_t *interact)<br>
{<br>
SpiceChannelPrivate *c;<br>
int ninteract;<br>
diff --git a/gtk/spice-grabsequence.c b/gtk/spice-grabsequence.c<br>
index 39adfb0..2ebc064 100644<br>
--- a/gtk/spice-grabsequence.c<br>
+++ b/gtk/spice-grabsequence.c<br>
@@ -27,19 +27,19 @@<br>
<br>
GType spice_grab_sequence_get_type(void)<br>
{<br>
- static GType grab_sequence_type = 0;<br>
- static volatile gsize grab_sequence_type_volatile;<br>
+ static GType grab_sequence_type = 0;<br>
+ static volatile gsize grab_sequence_type_volatile;<br>
<br>
- if (g_once_init_enter(&grab_sequence_type_volatile)) {<br>
- grab_sequence_type = g_boxed_type_register_static<br>
- ("SpiceGrabSequence",<br>
- (GBoxedCopyFunc)spice_grab_sequence_copy,<br>
- (GBoxedFreeFunc)spice_grab_sequence_free);<br>
- g_once_init_leave(&grab_sequence_type_volatile,<br>
- grab_sequence_type);<br>
- }<br>
+ if (g_once_init_enter(&grab_sequence_type_volatile)) {<br>
+ grab_sequence_type = g_boxed_type_register_static<br>
+ ("SpiceGrabSequence",<br>
+ (GBoxedCopyFunc)spice_grab_sequence_copy,<br>
+ (GBoxedFreeFunc)spice_grab_sequence_free);<br>
+ g_once_init_leave(&grab_sequence_type_volatile,<br>
+ grab_sequence_type);<br>
+ }<br>
<br>
- return grab_sequence_type;<br>
+ return grab_sequence_type;<br>
}<br>
<br>
<br>
@@ -54,14 +54,14 @@ GType spice_grab_sequence_get_type(void)<br>
*/<br>
SpiceGrabSequence *spice_grab_sequence_new(guint nkeysyms, guint *keysyms)<br>
{<br>
- SpiceGrabSequence *sequence;<br>
+ SpiceGrabSequence *sequence;<br>
<br>
- sequence = g_slice_new0(SpiceGrabSequence);<br>
- sequence->nkeysyms = nkeysyms;<br>
- sequence->keysyms = g_new0(guint, nkeysyms);<br>
- memcpy(sequence->keysyms, keysyms, sizeof(guint)*nkeysyms);<br>
+ sequence = g_slice_new0(SpiceGrabSequence);<br>
+ sequence->nkeysyms = nkeysyms;<br>
+ sequence->keysyms = g_new0(guint, nkeysyms);<br>
+ memcpy(sequence->keysyms, keysyms, sizeof(guint)*nkeysyms);<br>
<br>
- return sequence;<br>
+ return sequence;<br>
}<br>
<br>
<br>
@@ -73,29 +73,29 @@ SpiceGrabSequence *spice_grab_sequence_new(guint nkeysyms, guint *keysyms)<br>
**/<br>
SpiceGrabSequence *spice_grab_sequence_new_from_string(const gchar *str)<br>
{<br>
- gchar **keysymstr;<br>
- int i;<br>
- SpiceGrabSequence *sequence;<br>
+ gchar **keysymstr;<br>
+ int i;<br>
+ SpiceGrabSequence *sequence;<br>
<br>
- sequence = g_slice_new0(SpiceGrabSequence);<br>
+ sequence = g_slice_new0(SpiceGrabSequence);<br>
<br>
- keysymstr = g_strsplit(str, "+", 5);<br>
+ keysymstr = g_strsplit(str, "+", 5);<br>
<br>
- sequence->nkeysyms = 0;<br>
- while (keysymstr[sequence->nkeysyms])<br>
- sequence->nkeysyms++;<br>
+ sequence->nkeysyms = 0;<br>
+ while (keysymstr[sequence->nkeysyms])<br>
+ sequence->nkeysyms++;<br>
<br>
- sequence->keysyms = g_new0(guint, sequence->nkeysyms);<br>
- for (i = 0 ; i < sequence->nkeysyms ; i++) {<br>
- sequence->keysyms[i] =<br>
- (guint)gdk_keyval_from_name(keysymstr[i]);<br>
+ sequence->keysyms = g_new0(guint, sequence->nkeysyms);<br>
+ for (i = 0 ; i < sequence->nkeysyms ; i++) {<br>
+ sequence->keysyms[i] =<br>
+ (guint)gdk_keyval_from_name(keysymstr[i]);<br>
if (sequence->keysyms[i] == 0) {<br>
g_critical("Invalid key: %s", keysymstr[i]);<br>
}<br>
}<br>
- g_strfreev(keysymstr);<br>
+ g_strfreev(keysymstr);<br>
<br>
- return sequence;<br>
+ return sequence;<br>
<br>
}<br>
<br>
@@ -108,14 +108,14 @@ SpiceGrabSequence *spice_grab_sequence_new_from_string(const gchar *str)<br>
**/<br>
SpiceGrabSequence *spice_grab_sequence_copy(SpiceGrabSequence *srcSequence)<br>
{<br>
- SpiceGrabSequence *sequence;<br>
+ SpiceGrabSequence *sequence;<br>
<br>
- sequence = g_slice_dup(SpiceGrabSequence, srcSequence);<br>
- sequence->keysyms = g_new0(guint, srcSequence->nkeysyms);<br>
- memcpy(sequence->keysyms, srcSequence->keysyms,<br>
- sizeof(guint) * sequence->nkeysyms);<br>
+ sequence = g_slice_dup(SpiceGrabSequence, srcSequence);<br>
+ sequence->keysyms = g_new0(guint, srcSequence->nkeysyms);<br>
+ memcpy(sequence->keysyms, srcSequence->keysyms,<br>
+ sizeof(guint) * sequence->nkeysyms);<br>
<br>
- return sequence;<br>
+ return sequence;<br>
}<br>
<br>
<br>
@@ -127,8 +127,8 @@ SpiceGrabSequence *spice_grab_sequence_copy(SpiceGrabSequence *srcSequence)<br>
**/<br>
void spice_grab_sequence_free(SpiceGrabSequence *sequence)<br>
{<br>
- g_free(sequence->keysyms);<br>
- g_slice_free(SpiceGrabSequence, sequence);<br>
+ g_free(sequence->keysyms);<br>
+ g_slice_free(SpiceGrabSequence, sequence);<br>
}<br>
<br>
<br>
@@ -140,16 +140,16 @@ void spice_grab_sequence_free(SpiceGrabSequence *sequence)<br>
**/<br>
gchar *spice_grab_sequence_as_string(SpiceGrabSequence *sequence)<br>
{<br>
- GString *str = g_string_new("");<br>
- int i;<br>
+ GString *str = g_string_new("");<br>
+ int i;<br>
<br>
- for (i = 0 ; i < sequence->nkeysyms ; i++) {<br>
- if (i > 0)<br>
- g_string_append_c(str, '+');<br>
- g_string_append(str, gdk_keyval_name(sequence->keysyms[i]));<br>
- }<br>
+ for (i = 0 ; i < sequence->nkeysyms ; i++) {<br>
+ if (i > 0)<br>
+ g_string_append_c(str, '+');<br>
+ g_string_append(str, gdk_keyval_name(sequence->keysyms[i]));<br>
+ }<br>
<br>
- return g_string_free(str, FALSE);<br>
+ return g_string_free(str, FALSE);<br>
<br>
}<br>
<br>
diff --git a/gtk/spice-grabsequence.h b/gtk/spice-grabsequence.h<br>
index fe58fc1..4910856 100644<br>
--- a/gtk/spice-grabsequence.h<br>
+++ b/gtk/spice-grabsequence.h<br>
@@ -33,10 +33,10 @@ typedef struct _SpiceGrabSequence SpiceGrabSequence;<br>
<br>
struct _SpiceGrabSequence {<br>
/*< private >*/<br>
- guint nkeysyms;<br>
- guint *keysyms;<br>
+ guint nkeysyms;<br>
+ guint *keysyms;<br>
<br>
- /* Do not add fields to this struct */<br>
+ /* Do not add fields to this struct */<br>
};<br>
<br>
GType spice_grab_sequence_get_type(void);<br>
diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c<br>
index 10bd762..3ef382c 100644<br>
--- a/gtk/spice-gtk-session.c<br>
+++ b/gtk/spice-gtk-session.c<br>
@@ -304,7 +304,7 @@ static void spice_gtk_session_get_property(GObject *gobject,<br>
switch (prop_id) {<br>
case PROP_SESSION:<br>
g_value_set_object(value, s->session);<br>
- break;<br>
+ break;<br>
case PROP_AUTO_CLIPBOARD:<br>
g_value_set_boolean(value, s->auto_clipboard_enable);<br>
break;<br>
@@ -312,8 +312,8 @@ static void spice_gtk_session_get_property(GObject *gobject,<br>
g_value_set_boolean(value, s->auto_usbredir_enable);<br>
break;<br>
default:<br>
- G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
- break;<br>
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
+ break;<br>
}<br>
}<br>
<br>
diff --git a/gtk/spice-session.c b/gtk/spice-session.c<br>
index 0663380..ed08e1a 100644<br>
--- a/gtk/spice-session.c<br>
+++ b/gtk/spice-session.c<br>
@@ -420,44 +420,44 @@ static void spice_session_get_property(GObject *gobject,<br>
switch (prop_id) {<br>
case PROP_HOST:<br>
g_value_set_string(value, s->host);<br>
- break;<br>
+ break;<br>
case PROP_PORT:<br>
g_value_set_string(value, s->port);<br>
- break;<br>
+ break;<br>
case PROP_TLS_PORT:<br>
g_value_set_string(value, s->tls_port);<br>
- break;<br>
+ break;<br>
case PROP_USERNAME:<br>
g_value_set_string(value, s->username);<br>
- break;<br>
+ break;<br>
case PROP_PASSWORD:<br>
g_value_set_string(value, s->password);<br>
- break;<br>
+ break;<br>
case PROP_CA_FILE:<br>
g_value_set_string(value, s->ca_file);<br>
- break;<br>
+ break;<br>
case PROP_CIPHERS:<br>
g_value_set_string(value, s->ciphers);<br>
- break;<br>
+ break;<br>
case PROP_PROTOCOL:<br>
g_value_set_int(value, s->protocol);<br>
- break;<br>
+ break;<br>
case PROP_URI:<br>
len = spice_uri_create(session, buf, sizeof(buf));<br>
g_value_set_string(value, len ? buf : NULL);<br>
break;<br>
case PROP_CLIENT_SOCKETS:<br>
g_value_set_boolean(value, s->client_provided_sockets);<br>
- break;<br>
+ break;<br>
case PROP_PUBKEY:<br>
g_value_set_boxed(value, s->pubkey);<br>
- break;<br>
+ break;<br>
case PROP_CA:<br>
g_value_set_boxed(value, s->ca);<br>
- break;<br>
+ break;<br>
case PROP_CERT_SUBJECT:<br>
g_value_set_string(value, s->cert_subject);<br>
- break;<br>
+ break;<br>
case PROP_VERIFY:<br>
g_value_set_flags(value, s->verify);<br>
break;<br>
@@ -502,19 +502,19 @@ static void spice_session_get_property(GObject *gobject,<br>
break;<br>
case PROP_NAME:<br>
g_value_set_string(value, s->name);<br>
- break;<br>
+ break;<br>
case PROP_UUID:<br>
g_value_set_pointer(value, s->uuid);<br>
- break;<br>
+ break;<br>
case PROP_PROXY:<br>
g_value_take_string(value, spice_uri_to_string(s->proxy));<br>
- break;<br>
+ break;<br>
case PROP_SHARED_DIR:<br>
g_value_set_string(value, spice_session_get_shared_dir(session));<br>
break;<br>
default:<br>
- G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
- break;<br>
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);<br>
+ break;<br>
}<br>
}<br>
<br>
@@ -575,7 +575,7 @@ static void spice_session_set_property(GObject *gobject,<br>
s->verify |= SPICE_SESSION_VERIFY_PUBKEY;<br>
else<br>
s->verify &= ~SPICE_SESSION_VERIFY_PUBKEY;<br>
- break;<br>
+ break;<br>
case PROP_CERT_SUBJECT:<br>
g_free(s->cert_subject);<br>
s->cert_subject = g_value_dup_string(value);<br>
diff --git a/gtk/spice-util.c b/gtk/spice-util.c<br>
index bec237b..ab29d32 100644<br>
--- a/gtk/spice-util.c<br>
+++ b/gtk/spice-util.c<br>
@@ -47,7 +47,7 @@ static void spice_util_enable_debug_messages(void)<br>
if (!doms) {<br>
g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, 1);<br>
} else if (g_str_equal(doms, "all")) {<br>
- return;<br>
+ return;<br>
} else if (!strstr(doms, G_LOG_DOMAIN)) {<br>
gchar *newdoms = g_strdup_printf("%s %s", doms, G_LOG_DOMAIN);<br>
g_setenv("G_MESSAGES_DEBUG", newdoms, 1);<br>
diff --git a/gtk/spice-widget.h b/gtk/spice-widget.h<br>
index d239ed2..ac85dac 100644<br>
--- a/gtk/spice-widget.h<br>
+++ b/gtk/spice-widget.h<br>
@@ -63,12 +63,12 @@ struct _SpiceDisplayClass {<br>
<br>
typedef enum<br>
{<br>
- SPICE_DISPLAY_KEY_EVENT_PRESS = 1,<br>
- SPICE_DISPLAY_KEY_EVENT_RELEASE = 2,<br>
- SPICE_DISPLAY_KEY_EVENT_CLICK = 3,<br>
+ SPICE_DISPLAY_KEY_EVENT_PRESS = 1,<br>
+ SPICE_DISPLAY_KEY_EVENT_RELEASE = 2,<br>
+ SPICE_DISPLAY_KEY_EVENT_CLICK = 3,<br>
} SpiceDisplayKeyEvent;<br>
<br>
-GType spice_display_get_type(void);<br>
+GType spice_display_get_type(void);<br>
<br>
SpiceDisplay* spice_display_new(SpiceSession *session, int channel_id);<br>
SpiceDisplay* spice_display_new_with_monitor(SpiceSession *session, gint channel_id, gint monitor_id);<br>
diff --git a/gtk/spicy-screenshot.c b/gtk/spicy-screenshot.c<br>
index e7835bf..1383f0d 100644<br>
--- a/gtk/spicy-screenshot.c<br>
+++ b/gtk/spicy-screenshot.c<br>
@@ -56,8 +56,8 @@ static int write_ppm_32(void)<br>
<br>
fp = fopen(outf,"w");<br>
if (NULL == fp) {<br>
- fprintf(stderr, _("%s: can't open %s: %s\n"), g_get_prgname(), outf, strerror(errno));<br>
- return -1;<br>
+ fprintf(stderr, _("%s: can't open %s: %s\n"), g_get_prgname(), outf, strerror(errno));<br>
+ return -1;<br>
}<br>
fprintf(fp, "P6\n%d %d\n255\n",<br>
d_width, d_height);<br>
diff --git a/gtk/spicy.c b/gtk/spicy.c<br>
index 2fcd529..4924411 100644<br>
--- a/gtk/spicy.c<br>
+++ b/gtk/spicy.c<br>
@@ -788,14 +788,14 @@ static const GtkActionEntry entries[] = {<br>
.accelerator = "<shift>F11",<br>
},{<br>
#ifdef USE_SMARTCARD<br>
- .name = "InsertSmartcard",<br>
- .label = N_("_Insert Smartcard"),<br>
- .callback = G_CALLBACK(menu_cb_insert_smartcard),<br>
+ .name = "InsertSmartcard",<br>
+ .label = N_("_Insert Smartcard"),<br>
+ .callback = G_CALLBACK(menu_cb_insert_smartcard),<br>
.accelerator = "<shift>F8",<br>
},{<br>
- .name = "RemoveSmartcard",<br>
- .label = N_("_Remove Smartcard"),<br>
- .callback = G_CALLBACK(menu_cb_remove_smartcard),<br>
+ .name = "RemoveSmartcard",<br>
+ .label = N_("_Remove Smartcard"),<br>
+ .callback = G_CALLBACK(menu_cb_remove_smartcard),<br>
.accelerator = "<shift>F9",<br>
},{<br>
#endif<br>
diff --git a/gtk/vncdisplaykeymap.c b/gtk/vncdisplaykeymap.c<br>
index 340a86f..450ea58 100644<br>
--- a/gtk/vncdisplaykeymap.c<br>
+++ b/gtk/vncdisplaykeymap.c<br>
@@ -55,9 +55,9 @@<br>
* to vncserver<br>
*/<br>
static struct {<br>
- GdkKeymapKey *keys;<br>
- gint n_keys;<br>
- guint keyval;<br>
+ GdkKeymapKey *keys;<br>
+ gint n_keys;<br>
+ guint keyval;<br>
} untranslated_keys[] = {{NULL, 0, GDK_Tab}};<br>
<br>
static unsigned int ref_count_for_untranslated_keys = 0;<br>
@@ -131,30 +131,30 @@ static unsigned int ref_count_for_untranslated_keys = 0;<br>
<br>
static gboolean check_for_xwin(GdkDisplay *dpy)<br>
{<br>
- char *vendor = ServerVendor(gdk_x11_display_get_xdisplay(dpy));<br>
+ char *vendor = ServerVendor(gdk_x11_display_get_xdisplay(dpy));<br>
<br>
- if (strstr(vendor, "Cygwin/X"))<br>
- return TRUE;<br>
+ if (strstr(vendor, "Cygwin/X"))<br>
+ return TRUE;<br>
<br>
- return FALSE;<br>
+ return FALSE;<br>
}<br>
<br>
static gboolean check_for_xquartz(GdkDisplay *dpy)<br>
{<br>
- int nextensions;<br>
- int i;<br>
- gboolean match = FALSE;<br>
- char **extensions = XListExtensions(gdk_x11_display_get_xdisplay(dpy),<br>
- &nextensions);<br>
- for (i = 0 ; extensions != NULL && i < nextensions ; i++) {<br>
- if (strcmp(extensions[i], "Apple-WM") == 0 ||<br>
- strcmp(extensions[i], "Apple-DRI") == 0)<br>
- match = TRUE;<br>
- }<br>
- if (extensions)<br>
- XFreeExtensionList(extensions);<br>
+ int nextensions;<br>
+ int i;<br>
+ gboolean match = FALSE;<br>
+ char **extensions = XListExtensions(gdk_x11_display_get_xdisplay(dpy),<br>
+ &nextensions);<br>
+ for (i = 0 ; extensions != NULL && i < nextensions ; i++) {<br>
+ if (strcmp(extensions[i], "Apple-WM") == 0 ||<br>
+ strcmp(extensions[i], "Apple-DRI") == 0)<br>
+ match = TRUE;<br>
+ }<br>
+ if (extensions)<br>
+ XFreeExtensionList(extensions);<br>
<br>
- return match;<br>
+ return match;<br>
}<br>
#endif<br>
<br>
@@ -162,156 +162,156 @@ const guint16 *vnc_display_keymap_gdk2xtkbd_table(GdkWindow *window,<br>
size_t *maplen)<br>
{<br>
#ifdef GDK_WINDOWING_X11<br>
- if (GDK_IS_X11_WINDOW(window)) {<br>
- XkbDescPtr desc;<br>
- const gchar *keycodes = NULL;<br>
+ if (GDK_IS_X11_WINDOW(window)) {<br>
+ XkbDescPtr desc;<br>
+ const gchar *keycodes = NULL;<br>
GdkDisplay *dpy = gdk_window_get_display(window);<br>
<br>
- /* There is no easy way to determine what X11 server<br>
- * and platform & keyboard driver is in use. Thus we<br>
- * do best guess heuristics.<br>
- *<br>
- * This will need more work for people with other<br>
- * X servers..... patches welcomed.<br>
- */<br>
+ /* There is no easy way to determine what X11 server<br>
+ * and platform & keyboard driver is in use. Thus we<br>
+ * do best guess heuristics.<br>
+ *<br>
+ * This will need more work for people with other<br>
+ * X servers..... patches welcomed.<br>
+ */<br>
<br>
- desc = XkbGetKeyboard(gdk_x11_display_get_xdisplay(dpy),<br>
- XkbGBN_AllComponentsMask,<br>
- XkbUseCoreKbd);<br>
- if (desc) {<br>
- if (desc->names) {<br>
- keycodes = gdk_x11_get_xatom_name(desc->names->keycodes);<br>
- if (!keycodes)<br>
- g_warning("could not lookup keycode name");<br>
- }<br>
- XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);<br>
- }<br>
+ desc = XkbGetKeyboard(gdk_x11_display_get_xdisplay(dpy),<br>
+ XkbGBN_AllComponentsMask,<br>
+ XkbUseCoreKbd);<br>
+ if (desc) {<br>
+ if (desc->names) {<br>
+ keycodes = gdk_x11_get_xatom_name(desc->names->keycodes);<br>
+ if (!keycodes)<br>
+ g_warning("could not lookup keycode name");<br>
+ }<br>
+ XkbFreeKeyboard(desc, XkbGBN_AllComponentsMask, True);<br>
+ }<br>
<br>
- if (check_for_xwin(dpy)) {<br>
- VNC_DEBUG("Using xwin keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_xorgxwin2xtkbd);<br>
- return keymap_xorgxwin2xtkbd;<br>
- } else if (check_for_xquartz(dpy)) {<br>
- VNC_DEBUG("Using xquartz keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_xorgxquartz2xtkbd);<br>
- return keymap_xorgxquartz2xtkbd;<br>
- } else if (keycodes && STRPREFIX(keycodes, "evdev_")) {<br>
- VNC_DEBUG("Using evdev keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd);<br>
- return keymap_xorgevdev2xtkbd;<br>
- } else if (keycodes && STRPREFIX(keycodes, "xfree86_")) {<br>
- VNC_DEBUG("Using xfree86 keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_xorgkbd2xtkbd);<br>
- return keymap_xorgkbd2xtkbd;<br>
- } else {<br>
- g_warning("Unknown keycode mapping '%s'.\n"<br>
- "Please report to <a href="mailto:gtk-vnc-list@gnome.org">gtk-vnc-list@gnome.org</a>\n"<br>
- "including the following information:\n"<br>
- "\n"<br>
- " - Operating system\n"<br>
- " - GDK build\n"<br>
- " - X11 Server\n"<br>
- " - xprop -root\n"<br>
- " - xdpyinfo\n",<br>
- keycodes);<br>
- return NULL;<br>
- }<br>
- }<br>
+ if (check_for_xwin(dpy)) {<br>
+ VNC_DEBUG("Using xwin keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_xorgxwin2xtkbd);<br>
+ return keymap_xorgxwin2xtkbd;<br>
+ } else if (check_for_xquartz(dpy)) {<br>
+ VNC_DEBUG("Using xquartz keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_xorgxquartz2xtkbd);<br>
+ return keymap_xorgxquartz2xtkbd;<br>
+ } else if (keycodes && STRPREFIX(keycodes, "evdev_")) {<br>
+ VNC_DEBUG("Using evdev keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd);<br>
+ return keymap_xorgevdev2xtkbd;<br>
+ } else if (keycodes && STRPREFIX(keycodes, "xfree86_")) {<br>
+ VNC_DEBUG("Using xfree86 keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_xorgkbd2xtkbd);<br>
+ return keymap_xorgkbd2xtkbd;<br>
+ } else {<br>
+ g_warning("Unknown keycode mapping '%s'.\n"<br>
+ "Please report to <a href="mailto:gtk-vnc-list@gnome.org">gtk-vnc-list@gnome.org</a>\n"<br>
+ "including the following information:\n"<br>
+ "\n"<br>
+ " - Operating system\n"<br>
+ " - GDK build\n"<br>
+ " - X11 Server\n"<br>
+ " - xprop -root\n"<br>
+ " - xdpyinfo\n",<br>
+ keycodes);<br>
+ return NULL;<br>
+ }<br>
+ }<br>
#endif<br>
<br>
#ifdef GDK_WINDOWING_WIN32<br>
- if (GDK_IS_WIN32_WINDOW(window)) {<br>
- VNC_DEBUG("Using Win32 virtual keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_win322xtkbd);<br>
- return keymap_win322xtkbd;<br>
- }<br>
+ if (GDK_IS_WIN32_WINDOW(window)) {<br>
+ VNC_DEBUG("Using Win32 virtual keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_win322xtkbd);<br>
+ return keymap_win322xtkbd;<br>
+ }<br>
#endif<br>
<br>
#ifdef GDK_WINDOWING_QUARTZ<br>
- if (GDK_IS_QUARTZ_WINDOW(window)) {<br>
- VNC_DEBUG("Using OS-X virtual keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_osx2xtkbd);<br>
- return keymap_osx2xtkbd;<br>
- }<br>
+ if (GDK_IS_QUARTZ_WINDOW(window)) {<br>
+ VNC_DEBUG("Using OS-X virtual keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_osx2xtkbd);<br>
+ return keymap_osx2xtkbd;<br>
+ }<br>
#endif<br>
<br>
#ifdef GDK_WINDOWING_WAYLAND<br>
- if (GDK_IS_WAYLAND_WINDOW(window)) {<br>
- VNC_DEBUG("Using Wayland Xorg/evdev virtual keycode mapping");<br>
- *maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd);<br>
- return keymap_xorgevdev2xtkbd;<br>
+ if (GDK_IS_WAYLAND_WINDOW(window)) {<br>
+ VNC_DEBUG("Using Wayland Xorg/evdev virtual keycode mapping");<br>
+ *maplen = G_N_ELEMENTS(keymap_xorgevdev2xtkbd);<br>
+ return keymap_xorgevdev2xtkbd;<br>
}<br>
#endif<br>
<br>
#ifdef GDK_WINDOWING_BROADWAY<br>
- if (GDK_IS_BROADWAY_WINDOW(window)) {<br>
+ if (GDK_IS_BROADWAY_WINDOW(window)) {<br>
g_warning("experimental: using broadway, x11 virtual keysym mapping - with very limited support. See also <a href="https://bugzilla.gnome.org/show_bug.cgi?id=700105" target="_blank">https://bugzilla.gnome.org/show_bug.cgi?id=700105</a>");<br>
<br>
- *maplen = G_N_ELEMENTS(keymap_x112xtkbd);<br>
- return keymap_x112xtkbd;<br>
+ *maplen = G_N_ELEMENTS(keymap_x112xtkbd);<br>
+ return keymap_x112xtkbd;<br>
}<br>
#endif<br>
<br>
- g_warning("Unsupported GDK Windowing platform.\n"<br>
- "Disabling extended keycode tables.\n"<br>
- "Please report to <a href="mailto:gtk-vnc-list@gnome.org">gtk-vnc-list@gnome.org</a>\n"<br>
- "including the following information:\n"<br>
- "\n"<br>
- " - Operating system\n"<br>
- " - GDK Windowing system build\n");<br>
- return NULL;<br>
+ g_warning("Unsupported GDK Windowing platform.\n"<br>
+ "Disabling extended keycode tables.\n"<br>
+ "Please report to <a href="mailto:gtk-vnc-list@gnome.org">gtk-vnc-list@gnome.org</a>\n"<br>
+ "including the following information:\n"<br>
+ "\n"<br>
+ " - Operating system\n"<br>
+ " - GDK Windowing system build\n");<br>
+ return NULL;<br>
}<br>
<br>
guint16 vnc_display_keymap_gdk2xtkbd(const guint16 *keycode_map,<br>
- size_t keycode_maplen,<br>
- guint16 keycode)<br>
+ size_t keycode_maplen,<br>
+ guint16 keycode)<br>
{<br>
- if (!keycode_map)<br>
- return 0;<br>
- if (keycode >= keycode_maplen)<br>
- return 0;<br>
- return keycode_map[keycode];<br>
+ if (!keycode_map)<br>
+ return 0;<br>
+ if (keycode >= keycode_maplen)<br>
+ return 0;<br>
+ return keycode_map[keycode];<br>
}<br>
<br>
/* Set the keymap entries */<br>
void vnc_display_keyval_set_entries(void)<br>
{<br>
- size_t i;<br>
- if (ref_count_for_untranslated_keys == 0)<br>
- for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)<br>
- gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),<br>
- untranslated_keys[i].keyval,<br>
- &untranslated_keys[i].keys,<br>
- &untranslated_keys[i].n_keys);<br>
- ref_count_for_untranslated_keys++;<br>
+ size_t i;<br>
+ if (ref_count_for_untranslated_keys == 0)<br>
+ for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)<br>
+ gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),<br>
+ untranslated_keys[i].keyval,<br>
+ &untranslated_keys[i].keys,<br>
+ &untranslated_keys[i].n_keys);<br>
+ ref_count_for_untranslated_keys++;<br>
}<br>
<br>
/* Free the keymap entries */<br>
void vnc_display_keyval_free_entries(void)<br>
{<br>
- size_t i;<br>
+ size_t i;<br>
<br>
- if (ref_count_for_untranslated_keys == 0)<br>
- return;<br>
+ if (ref_count_for_untranslated_keys == 0)<br>
+ return;<br>
<br>
- ref_count_for_untranslated_keys--;<br>
- if (ref_count_for_untranslated_keys == 0)<br>
- for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)<br>
- g_free(untranslated_keys[i].keys);<br>
+ ref_count_for_untranslated_keys--;<br>
+ if (ref_count_for_untranslated_keys == 0)<br>
+ for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)<br>
+ g_free(untranslated_keys[i].keys);<br>
<br>
}<br>
<br>
/* Get the keyval from the keycode without the level. */<br>
guint vnc_display_keyval_from_keycode(guint keycode, guint keyval)<br>
{<br>
- size_t i;<br>
- for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++) {<br>
- if (keycode == untranslated_keys[i].keys[0].keycode) {<br>
- return untranslated_keys[i].keyval;<br>
- }<br>
- }<br>
+ size_t i;<br>
+ for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++) {<br>
+ if (keycode == untranslated_keys[i].keys[0].keycode) {<br>
+ return untranslated_keys[i].keyval;<br>
+ }<br>
+ }<br>
<br>
- return keyval;<br>
+ return keyval;<br>
}<br>
/*<br>
* Local variables:<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div>