scanner: remove list_length in favor of wl_list_length
authorRan Benita <ran234@gmail.com>
Mon, 25 Feb 2013 15:12:51 +0000 (17:12 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 8 Mar 2013 00:19:14 +0000 (19:19 -0500)
src/scanner.c

index 6d2eddd..fef85ab 100644 (file)
@@ -127,18 +127,6 @@ struct parse_context {
        unsigned int character_data_length;
 };
 
-static int
-list_length(struct wl_list *list)
-{
-       struct wl_list *l;
-       int i;
-
-       for (i = 0, l = list->next; l != list; i++, l = l->next)
-               ;
-
-       return i;
-}
-
 static char *
 uppercase_dup(const char *src)
 {
@@ -1123,13 +1111,13 @@ emit_code(struct protocol *protocol)
 
                if (!wl_list_empty(&i->request_list))
                        printf("\t%d, %s_requests,\n",
-                              list_length(&i->request_list), i->name);
+                              wl_list_length(&i->request_list), i->name);
                else
                        printf("\t0, NULL,\n");
 
                if (!wl_list_empty(&i->event_list))
                        printf("\t%d, %s_events,\n",
-                              list_length(&i->event_list), i->name);
+                              wl_list_length(&i->event_list), i->name);
                else
                        printf("\t0, NULL,\n");