<div dir="ltr">Looks Good<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 9 August 2014 00:22, Jasper St. Pierre <span dir="ltr"><<a href="mailto:jstpierre@mecheye.net" target="_blank">jstpierre@mecheye.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
 src/scanner.c | 17 +++++++++++------<br>
 1 file changed, 11 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/scanner.c b/src/scanner.c<br>
index b6c8a8d..51ecb55 100644<br>
--- a/src/scanner.c<br>
+++ b/src/scanner.c<br>
@@ -30,6 +30,11 @@<br>
<br>
 #include "wayland-util.h"<br>
<br>
+enum side {<br>
+       CLIENT,<br>
+       SERVER,<br>
+};<br>
+<br>
 static int<br>
 usage(int ret)<br>
 {<br>
@@ -974,10 +979,10 @@ format_copyright(const char *copyright)<br>
 }<br>
<br>
 static void<br>
-emit_header(struct protocol *protocol, int server)<br>
+emit_header(struct protocol *protocol, enum side side)<br>
 {<br>
        struct interface *i;<br>
-       const char *s = server ? "SERVER" : "CLIENT";<br>
+       const char *s = (side == SERVER) ? "SERVER" : "CLIENT";<br>
<br>
        if (protocol->copyright)<br>
                format_copyright(protocol->copyright);<br>
@@ -996,7 +1001,7 @@ emit_header(struct protocol *protocol, int server)<br>
               "struct wl_resource;\n\n",<br>
               protocol->uppercase_name, s,<br>
               protocol->uppercase_name, s,<br>
-              server ? "wayland-util.h" : "wayland-client.h");<br>
+              (side == SERVER) ? "wayland-util.h" : "wayland-client.h");<br>
<br>
        wl_list_for_each(i, &protocol->interface_list, link)<br>
                printf("struct %s;\n", i->name);<br>
@@ -1013,7 +1018,7 @@ emit_header(struct protocol *protocol, int server)<br>
<br>
                emit_enumerations(i);<br>
<br>
-               if (server) {<br>
+               if (side == SERVER) {<br>
                        emit_structs(&i->request_list, i);<br>
                        emit_opcodes(&i->event_list, i);<br>
                        emit_opcode_versions(&i->event_list, i);<br>
@@ -1300,10 +1305,10 @@ int main(int argc, char *argv[])<br>
<br>
        switch (mode) {<br>
                case CLIENT_HEADER:<br>
-                       emit_header(&protocol, 0);<br>
+                       emit_header(&protocol, CLIENT);<br>
                        break;<br>
                case SERVER_HEADER:<br>
-                       emit_header(&protocol, 1);<br>
+                       emit_header(&protocol, SERVER);<br>
                        break;<br>
                case CODE:<br>
                        emit_code(&protocol);<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.0.4<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div>