<div dir="ltr">ack<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 25, 2014 at 2:23 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">This is a more explicit name.<br>
---<br>
<br>
This goes after PATCH 2/7 and renames all 'obj' variables.<br>
<br>
server/reds_stream.c | 60 ++++++++++++++++++++++++++--------------------------<br>
1 file changed, 30 insertions(+), 30 deletions(-)<br>
<br>
diff --git a/server/reds_stream.c b/server/reds_stream.c<br>
index 50660e8..ad10889 100644<br>
--- a/server/reds_stream.c<br>
+++ b/server/reds_stream.c<br>
@@ -391,54 +391,54 @@ void reds_stream_set_async_error_handler(RedsStream *stream,<br>
stream->priv->async_read.error = error_handler;<br>
}<br>
<br>
-static inline void async_read_clear_handlers(AsyncRead *obj)<br>
+static inline void async_read_clear_handlers(AsyncRead *async)<br>
{<br>
- if (obj->stream->watch) {<br>
- reds_stream_remove_watch(obj->stream);<br>
+ if (async->stream->watch) {<br>
+ reds_stream_remove_watch(async->stream);<br>
}<br>
- obj->stream = NULL;<br>
+ async->stream = NULL;<br>
}<br>
<br>
void async_read_handler(int fd, int event, void *data)<br>
{<br>
- AsyncRead *obj = (AsyncRead *)data;<br>
+ AsyncRead *async = (AsyncRead *)data;<br>
<br>
for (;;) {<br>
- int n = obj->end - obj->now;<br>
+ int n = async->end - async->now;<br>
<br>
spice_assert(n > 0);<br>
- n = reds_stream_read(obj->stream, obj->now, n);<br>
+ n = reds_stream_read(async->stream, async->now, n);<br>
if (n <= 0) {<br>
if (n < 0) {<br>
switch (errno) {<br>
case EAGAIN:<br>
- if (!obj->stream->watch) {<br>
- obj->stream->watch = core->watch_add(obj->stream->socket,<br>
- SPICE_WATCH_EVENT_READ,<br>
- async_read_handler, obj);<br>
+ if (!async->stream->watch) {<br>
+ async->stream->watch = core->watch_add(async->stream->socket,<br>
+ SPICE_WATCH_EVENT_READ,<br>
+ async_read_handler, async);<br>
}<br>
return;<br>
case EINTR:<br>
break;<br>
default:<br>
- async_read_clear_handlers(obj);<br>
- if (obj->error) {<br>
- obj->error(obj->opaque, errno);<br>
+ async_read_clear_handlers(async);<br>
+ if (async->error) {<br>
+ async->error(async->opaque, errno);<br>
}<br>
return;<br>
}<br>
} else {<br>
- async_read_clear_handlers(obj);<br>
- if (obj->error) {<br>
- obj->error(obj->opaque, 0);<br>
+ async_read_clear_handlers(async);<br>
+ if (async->error) {<br>
+ async->error(async->opaque, 0);<br>
}<br>
return;<br>
}<br>
} else {<br>
- obj->now += n;<br>
- if (obj->now == obj->end) {<br>
- async_read_clear_handlers(obj);<br>
- obj->done(obj->opaque);<br>
+ async->now += n;<br>
+ if (async->now == async->end) {<br>
+ async_read_clear_handlers(async);<br>
+ async->done(async->opaque);<br>
return;<br>
}<br>
}<br>
@@ -450,15 +450,15 @@ void reds_stream_async_read(RedsStream *stream,<br>
AsyncReadDone read_done_cb,<br>
void *opaque)<br>
{<br>
- AsyncRead *obj = &stream->priv->async_read;<br>
-<br>
- g_return_if_fail(!obj->stream);<br>
- obj->stream = stream;<br>
- obj->now = data;<br>
- obj->end = obj->now + size;<br>
- obj->done = read_done_cb;<br>
- obj->opaque = opaque;<br>
- async_read_handler(0, 0, obj);<br>
+ AsyncRead *async = &stream->priv->async_read;<br>
+<br>
+ g_return_if_fail(!async->stream);<br>
+ async->stream = stream;<br>
+ async->now = data;<br>
+ async->end = async->now + size;<br>
+ async->done = read_done_cb;<br>
+ async->opaque = opaque;<br>
+ async_read_handler(0, 0, async);<br>
<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.5.3<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>