Code indentation
authorjunghoon13.son <junghoon13.son@samsung.com>
Fri, 6 Mar 2015 04:45:02 +0000 (13:45 +0900)
committerTaekyun Kim <tkq.kim@samsung.com>
Fri, 19 Jun 2015 09:06:39 +0000 (18:06 +0900)
    - expand tab to space

Change-Id: I7807df9910a2e1d3bce7b344ee61740aa1c08fd9

src/common.c
src/compositor.c
src/output.c
src/pepper.h
src/pepper_internal.h
src/server/server.c
src/shell.c
src/surface.c

index 1332330..07a2a43 100644 (file)
@@ -15,7 +15,7 @@ pepper_string_copy(const char *str)
     char *ret = pepper_string_alloc(len);
 
     if (ret)
-       memcpy(ret, str, (len + 1) * sizeof (char));
+        memcpy(ret, str, (len + 1) * sizeof (char));
 
     return ret;
 }
index b9b8cd3..2c20401 100644 (file)
@@ -8,8 +8,8 @@ bind_shell(struct wl_client *, void *, uint32_t, uint32_t);
 /* compositor interface */
 static void
 compositor_create_surface(struct wl_client   *client,
-                                struct wl_resource *resource,
-                                uint32_t            id)
+                          struct wl_resource *resource,
+                          uint32_t            id)
 {
     pepper_compositor_t *compositor = wl_resource_get_user_data(resource);
     pepper_surface_t    *surface;
@@ -19,18 +19,18 @@ compositor_create_surface(struct wl_client   *client,
     surface = (pepper_surface_t *)pepper_calloc(1, sizeof(pepper_surface_t));
     if (!surface)
     {
-       PEPPER_ERROR("%s Surface memory allocation failed\n", __FUNCTION__);
-       wl_resource_post_no_memory(resource);
+        PEPPER_ERROR("%s Surface memory allocation failed\n", __FUNCTION__);
+        wl_resource_post_no_memory(resource);
     }
 
     surface->resource = wl_resource_create(client, &wl_surface_interface,
-                                          wl_resource_get_version(resource), id);
+                                           wl_resource_get_version(resource), id);
     if (!surface->resource)
     {
-       PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
-       pepper_free(surface);
-       wl_resource_post_no_memory(resource);
-       return ;
+        PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
+        pepper_free(surface);
+        wl_resource_post_no_memory(resource);
+        return ;
     }
 
     wl_resource_set_implementation(surface->resource, &surface_implementation, surface, NULL);
@@ -38,8 +38,8 @@ compositor_create_surface(struct wl_client   *client,
 
 static void
 compositor_create_region(struct wl_client   *client,
-                        struct wl_resource *resource,
-                        uint32_t            id)
+                         struct wl_resource *resource,
+                         uint32_t            id)
 {
     PEPPER_TRACE("%s\n", __FUNCTION__);
 }
@@ -52,9 +52,9 @@ static const struct wl_compositor_interface compositor_interface =
 
 static void
 bind_compositor(struct wl_client *client,
-               void             *data,
-               uint32_t          version,
-               uint32_t          id)
+                void             *data,
+                uint32_t          version,
+                uint32_t          id)
 {
     pepper_compositor_t *compositor = (pepper_compositor_t *)data;
     struct wl_resource  *resource;
@@ -64,10 +64,10 @@ bind_compositor(struct wl_client *client,
     resource = wl_resource_create(client, &wl_compositor_interface, version, id);
     if (!resource)
     {
-       PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
+        PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
 
-       wl_client_post_no_memory(client);
-       return;
+        wl_client_post_no_memory(client);
+        return;
     }
     PEPPER_TRACE("%s wl_resource_create success\n", __FUNCTION__);
 
@@ -76,40 +76,40 @@ bind_compositor(struct wl_client *client,
 
 pepper_compositor_t *
 pepper_compositor_create(const char *socket_name,
-                        const char *backend_name,
-                        const char *input_name,
-                        const char *shell_name,
-                        const char *renderer_name)
+                         const char *backend_name,
+                         const char *input_name,
+                         const char *shell_name,
+                         const char *renderer_name)
 {
-    pepper_compositor_t        *compositor = NULL;
+    pepper_compositor_t *compositor = NULL;
 
     compositor = (pepper_compositor_t *)pepper_calloc(1, sizeof (pepper_compositor_t));
 
     if (!compositor)
-       goto error;
+        goto error;
 
     compositor->display = wl_display_create();
 
     if (!compositor->display)
     {
-       PEPPER_ERROR("Failed to create wayland display object.\n");
-       goto error;
+        PEPPER_ERROR("Failed to create wayland display object.\n");
+        goto error;
     }
 
     if (wl_display_add_socket(compositor->display, socket_name) != 0)
     {
-       PEPPER_ERROR("Failed to add socket display = %p socket_name = %s\n",
-                    compositor->display, socket_name);
-       goto error;
+        PEPPER_ERROR("Failed to add socket display = %p socket_name = %s\n",
+                     compositor->display, socket_name);
+        goto error;
     }
 
     wl_global_create(compositor->display, &wl_compositor_interface, 3, compositor,
-                    bind_compositor);
+                     bind_compositor);
 
     /* TODO: Load modules. */
 
     wl_global_create(compositor->display, &wl_shell_interface, 1, compositor,
-                    bind_shell);
+                     bind_shell);
 
     wl_display_init_shm(compositor->display);
 
@@ -117,7 +117,7 @@ pepper_compositor_create(const char *socket_name,
 
 error:
     if (compositor)
-       pepper_compositor_destroy(compositor);
+        pepper_compositor_destroy(compositor);
 
     return NULL;
 }
@@ -126,21 +126,21 @@ void
 pepper_compositor_destroy(pepper_compositor_t *compositor)
 {
     if (compositor->display)
-       wl_display_destroy(compositor->display);
+        wl_display_destroy(compositor->display);
 
     pepper_free(compositor);
 }
 
 pepper_output_t *
 pepper_compositor_add_output(pepper_compositor_t  *compositor,
-                            pepper_output_info_t *info)
+                             pepper_output_info_t *info)
 {
     pepper_output_t *output = NULL;
 
     output = (pepper_output_t *)pepper_calloc(1, sizeof (pepper_output_t));
 
     if (!output)
-       return NULL;
+        return NULL;
 
     /* TODO: Backend-side output initialization. */
 
@@ -180,7 +180,7 @@ pepper_compositor_frame(pepper_compositor_t *compositor)
 {
     if (compositor)
     {
-       wl_display_flush_clients(compositor->display);
-       wl_event_loop_dispatch(wl_display_get_event_loop(compositor->display), -1);
+        wl_display_flush_clients(compositor->display);
+        wl_event_loop_dispatch(wl_display_get_event_loop(compositor->display), -1);
     }
 }
index 4576756..82bc15a 100644 (file)
@@ -11,16 +11,16 @@ void
 pepper_output_get_geometry(pepper_output_t *output, int *x, int *y, int *w, int *h)
 {
     if (x)
-       *x = output->x;
+        *x = output->x;
 
     if (y)
-       *y = output->y;
+        *y = output->y;
 
     if (w)
-       *w = output->w;
+        *w = output->w;
 
     if (h)
-       *h = output->h;
+        *h = output->h;
 }
 
 pepper_compositor_t *
index cb4075b..d8b08ac 100644 (file)
@@ -3,16 +3,16 @@
 
 #include <stdint.h>
 
-#define PEPPER_FALSE   0
-#define PEPPER_TRUE    1
+#define PEPPER_FALSE    0
+#define PEPPER_TRUE     1
 
-typedef uint32_t                   pepper_bool_t;
+typedef uint32_t                    pepper_bool_t;
 
 typedef struct pepper_compositor    pepper_compositor_t;
-typedef struct pepper_output       pepper_output_t;
+typedef struct pepper_output        pepper_output_t;
 typedef struct pepper_output_info   pepper_output_info_t;
-typedef struct pepper_client       pepper_client_t;
-typedef struct pepper_surface      pepper_surface_t;
+typedef struct pepper_client        pepper_client_t;
+typedef struct pepper_surface       pepper_surface_t;
 typedef struct pepper_shell_surface pepper_shell_surface_t;
 
 struct pepper_output_info
@@ -24,17 +24,17 @@ struct pepper_output_info
 /* Compositor functions. */
 pepper_compositor_t *
 pepper_compositor_create(const char *socket_name,
-                        const char *backend_name,
-                        const char *input_name,
-                        const char *shell_name,
-                        const char *renderer_name);
+                         const char *backend_name,
+                         const char *input_name,
+                         const char *shell_name,
+                         const char *renderer_name);
 
 void
 pepper_compositor_destroy(pepper_compositor_t *compositor);
 
 pepper_output_t *
 pepper_compositor_add_output(pepper_compositor_t  *compositor,
-                            pepper_output_info_t *info);
+                             pepper_output_info_t *info);
 
 int
 pepper_compositor_get_output_count(pepper_compositor_t *compositor);
index f0514ee..9294195 100644 (file)
@@ -7,15 +7,15 @@
 
 struct pepper_compositor
 {
-    char               *socket_name;
-    struct wl_display  *display;
+    char                *socket_name;
+    struct wl_display   *display;
 };
 
 struct pepper_output
 {
-    pepper_compositor_t        *compositor;
+    pepper_compositor_t *compositor;
 
-    int        x;
+    int x;
     int y;
     int w;
     int h;
index cc2343e..519a47e 100644 (file)
@@ -4,13 +4,13 @@
 int
 main(int argc, char **argv)
 {
-    pepper_compositor_t        *compositor;
+    pepper_compositor_t *compositor;
 
     compositor = pepper_compositor_create("wayland-0", NULL, NULL, NULL, NULL);
 
     while (1)
     {
-       pepper_compositor_frame(compositor);
+        pepper_compositor_frame(compositor);
     }
 
     pepper_compositor_destroy(compositor);
index 6a72d71..b77e375 100644 (file)
@@ -3,8 +3,8 @@
 /* shell surface interface */
 static void
 shell_surface_pong(struct wl_client   *client,
-                  struct wl_resource *resource,
-                  uint32_t serial)
+                   struct wl_resource *resource,
+                   uint32_t serial)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -13,9 +13,9 @@ shell_surface_pong(struct wl_client   *client,
 
 static void
 shell_surface_move(struct wl_client   *client,
-                  struct wl_resource *resource,
-                  struct wl_resource *seat,
-                  uint32_t serial)
+                   struct wl_resource *resource,
+                   struct wl_resource *seat,
+                   uint32_t serial)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -24,10 +24,10 @@ shell_surface_move(struct wl_client   *client,
 
 static void
 shell_surface_resize(struct wl_client   *client,
-                    struct wl_resource *resource,
-                    struct wl_resource *seat,
-                    uint32_t            serial,
-                    uint32_t            edges)
+                     struct wl_resource *resource,
+                     struct wl_resource *seat,
+                     uint32_t            serial,
+                     uint32_t            edges)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -36,7 +36,7 @@ shell_surface_resize(struct wl_client   *client,
 
 static void
 shell_surface_set_toplevel(struct wl_client   *client,
-                          struct wl_resource *resource)
+                           struct wl_resource *resource)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -47,11 +47,11 @@ shell_surface_set_toplevel(struct wl_client   *client,
 
 static void
 shell_surface_set_transient(struct wl_client   *client,
-                           struct wl_resource *resource,
-                           struct wl_resource *parent_resource,
-                           int                 x,
-                           int                 y,
-                           uint32_t            flags)
+                            struct wl_resource *resource,
+                            struct wl_resource *parent_resource,
+                            int                 x,
+                            int                 y,
+                            uint32_t            flags)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -60,10 +60,10 @@ shell_surface_set_transient(struct wl_client   *client,
 
 static void
 shell_surface_set_fullscreen(struct wl_client   *client,
-                            struct wl_resource *resource,
-                            uint32_t            method,
-                            uint32_t            framerate,
-                            struct wl_resource *output_resource)
+                             struct wl_resource *resource,
+                             uint32_t            method,
+                             uint32_t            framerate,
+                             struct wl_resource *output_resource)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -72,13 +72,13 @@ shell_surface_set_fullscreen(struct wl_client   *client,
 
 static void
 shell_surface_set_popup(struct wl_client   *client,
-                       struct wl_resource *resource,
-                       struct wl_resource *seat_resource,
-                       uint32_t            serial,
-                       struct wl_resource *parent_resource,
-                       int32_t             x,
-                       int32_t             y,
-                       uint32_t            flags)
+                        struct wl_resource *resource,
+                        struct wl_resource *seat_resource,
+                        uint32_t            serial,
+                        struct wl_resource *parent_resource,
+                        int32_t             x,
+                        int32_t             y,
+                        uint32_t            flags)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -98,8 +98,8 @@ shell_surface_set_maximized(struct wl_client   *client,
 
 static void
 shell_surface_set_title(struct wl_client   *client,
-                       struct wl_resource *resource,
-                       const char         *title)
+                        struct wl_resource *resource,
+                        const char         *title)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -108,8 +108,8 @@ shell_surface_set_title(struct wl_client   *client,
 
 static void
 shell_surface_set_class(struct wl_client   *client,
-                       struct wl_resource *resource,
-                       const char         *class)
+                        struct wl_resource *resource,
+                        const char         *class)
 {
     pepper_shell_surface_t *shsurface = wl_resource_get_user_data(resource);
 
@@ -133,9 +133,9 @@ static const struct wl_shell_surface_interface pepper_shell_surface_implementati
 /* shell interface */
 static void
 shell_get_shell_surface(struct wl_client   *client,
-                              struct wl_resource *resource,
-                              uint32_t            id,
-                              struct wl_resource *surface_resource)
+                        struct wl_resource *resource,
+                        uint32_t            id,
+                        struct wl_resource *surface_resource)
 {
     pepper_compositor_t    *compositor = wl_resource_get_user_data(resource);
     pepper_surface_t       *surface    = wl_resource_get_user_data(surface_resource);
@@ -147,23 +147,23 @@ shell_get_shell_surface(struct wl_client   *client,
 
     if (!shsurface)
     {
-       PEPPER_ERROR("%s Shell surface memory allocation failed\n", __FUNCTION__);
-       wl_client_post_no_memory(client);
-       return ;
+        PEPPER_ERROR("%s Shell surface memory allocation failed\n", __FUNCTION__);
+        wl_client_post_no_memory(client);
+        return ;
     }
 
     shsurface->resource = wl_resource_create(client, &wl_shell_surface_interface,
-                                            wl_resource_get_version(resource), id);
+                                             wl_resource_get_version(resource), id);
     if (!shsurface->resource)
     {
-       PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
-       pepper_free(shsurface);
-       wl_client_post_no_memory(client);
-       return ;
+        PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
+        pepper_free(shsurface);
+        wl_client_post_no_memory(client);
+        return ;
     }
 
     wl_resource_set_implementation(shsurface->resource, &pepper_shell_surface_implementation,
-                                  shsurface, NULL);
+                                   shsurface, NULL);
 
 }
 
@@ -183,10 +183,10 @@ bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
     resource = wl_resource_create(client, &wl_shell_interface, version, id);
     if (!resource)
     {
-       PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
+        PEPPER_ERROR("%s wl_resource_create failed\n", __FUNCTION__);
 
-       wl_client_post_no_memory(client);
-       return;
+        wl_client_post_no_memory(client);
+        return;
     }
 
     wl_resource_set_implementation(resource, &shell_implementation, compositor, NULL);
index bd7c9f6..87d166f 100644 (file)
@@ -1,14 +1,11 @@
 #include "pepper_internal.h"
 
-
 void *
 pepper_surface_get_buffer(pepper_surface_t *surface)
 {
     return surface->buffer;
 }
 
-
-
 /* surface interface */
 static void
 surface_destroy(struct wl_client *client, struct wl_resource *resource)
@@ -20,10 +17,10 @@ surface_destroy(struct wl_client *client, struct wl_resource *resource)
 
 static void
 surface_attach(struct wl_client   *client,
-                     struct wl_resource *resource,
-                     struct wl_resource *buffer,
-                     int32_t x,
-                     int32_t y)
+               struct wl_resource *resource,
+               struct wl_resource *buffer,
+               int32_t x,
+               int32_t y)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
@@ -32,22 +29,21 @@ surface_attach(struct wl_client   *client,
 
 static void
 surface_damage(struct wl_client   *client,
-                     struct wl_resource *resource,
-                     int32_t x,
-                     int32_t y,
-                     int32_t width,
-                     int32_t height)
+               struct wl_resource *resource,
+               int32_t x,
+               int32_t y,
+               int32_t width,
+               int32_t height)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
     PEPPER_TRACE("%s\n", __FUNCTION__);
 }
 
-
 static void
 surface_frame(struct wl_client   *client,
-                    struct wl_resource *resource,
-                    uint32_t           callback)
+              struct wl_resource *resource,
+              uint32_t           callback)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
@@ -56,8 +52,8 @@ surface_frame(struct wl_client   *client,
 
 static void
 surface_set_opaque_region(struct wl_client   *client,
-                                struct wl_resource *resource,
-                                struct wl_resource *region)
+                          struct wl_resource *resource,
+                          struct wl_resource *region)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
@@ -66,15 +62,14 @@ surface_set_opaque_region(struct wl_client   *client,
 
 static void
 surface_set_input_region(struct wl_client   *client,
-                               struct wl_resource *resource,
-                               struct wl_resource *region)
+                         struct wl_resource *resource,
+                         struct wl_resource *region)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
     PEPPER_TRACE("%s\n", __FUNCTION__);
 }
 
-
 static void
 surface_commit(struct wl_client *client, struct wl_resource *resource)
 {
@@ -85,8 +80,8 @@ surface_commit(struct wl_client *client, struct wl_resource *resource)
 
 static void
 surface_set_buffer_transform(struct wl_client   *client,
-                                   struct wl_resource *resource,
-                                   int                 transform)
+                             struct wl_resource *resource,
+                             int                 transform)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
@@ -95,8 +90,8 @@ surface_set_buffer_transform(struct wl_client   *client,
 
 static void
 surface_set_buffer_scale(struct wl_client   *client,
-                               struct wl_resource *resource,
-                               int32_t             scale)
+                         struct wl_resource *resource,
+                         int32_t             scale)
 {
     pepper_surface_t *surface = wl_resource_get_user_data(resource);
 
@@ -115,6 +110,3 @@ const struct wl_surface_interface surface_implementation =
     surface_set_buffer_transform,
     surface_set_buffer_scale
 };
-
-
-