Commit 74a635b1 authored by Dawid Gajownik's avatar Dawid Gajownik Committed by Bryce Harrington

Coding style fixes

- opening braces are on the same line as the if statement
- opening braces are not on the same line as the function name
- space between for/while/if and opening parenthesis
Signed-off-by: default avatarDawid Gajownik <gajownik@gmail.com>
Reviewed-by: default avatarDerek Foreman <derekf@osg.samsung.com>
parent 5e653caa
......@@ -172,8 +172,8 @@ keyboard_focus_handler(struct window *window,
int32_t x, y;
struct eventdemo *e = data;
if(log_focus) {
if(device) {
if (log_focus) {
if (device) {
input_get_position(device, &x, &y);
printf("focus x: %d, y: %d\n", x, y);
} else {
......@@ -200,7 +200,7 @@ key_handler(struct window *window, struct input *input, uint32_t time,
{
uint32_t modifiers = input_get_modifiers(input);
if(!log_key)
if (!log_key)
return;
printf("key key: %d, unicode: %d, state: %s, modifiers: 0x%x\n",
......@@ -300,7 +300,7 @@ eventdemo_create(struct display *d)
struct eventdemo *e;
e = malloc(sizeof (struct eventdemo));
if(e == NULL)
if (e == NULL)
return NULL;
e->window = window_create(d);
......
......@@ -1301,7 +1301,7 @@ int main(int argc, char **argv)
UI_ready(wlCtxCommon.hmiCtrl);
while(ret != -1)
while (ret != -1)
ret = wl_display_dispatch(wlCtxCommon.wlDisplay);
wl_list_for_each(pWlCtxSt, &wlCtxCommon.list_wlContextStruct, link) {
......
......@@ -134,28 +134,28 @@ utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
case utf8state_reject:
machine->s.ch = 0;
machine->len = 0;
if(c == 0xC0 || c == 0xC1) {
if (c == 0xC0 || c == 0xC1) {
/* overlong encoding, reject */
machine->state = utf8state_reject;
} else if((c & 0x80) == 0) {
} else if ((c & 0x80) == 0) {
/* single byte, accept */
machine->s.byte[machine->len++] = c;
machine->state = utf8state_accept;
machine->unicode = c;
} else if((c & 0xC0) == 0x80) {
} else if ((c & 0xC0) == 0x80) {
/* parser out of sync, ignore byte */
machine->state = utf8state_start;
} else if((c & 0xE0) == 0xC0) {
} else if ((c & 0xE0) == 0xC0) {
/* start of two byte sequence */
machine->s.byte[machine->len++] = c;
machine->state = utf8state_expect1;
machine->unicode = c & 0x1f;
} else if((c & 0xF0) == 0xE0) {
} else if ((c & 0xF0) == 0xE0) {
/* start of three byte sequence */
machine->s.byte[machine->len++] = c;
machine->state = utf8state_expect2;
machine->unicode = c & 0x0f;
} else if((c & 0xF8) == 0xF0) {
} else if ((c & 0xF8) == 0xF0) {
/* start of four byte sequence */
machine->s.byte[machine->len++] = c;
machine->state = utf8state_expect3;
......@@ -168,7 +168,7 @@ utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
case utf8state_expect3:
machine->s.byte[machine->len++] = c;
machine->unicode = (machine->unicode << 6) | (c & 0x3f);
if((c & 0xC0) == 0x80) {
if ((c & 0xC0) == 0x80) {
/* all good, continue */
machine->state = utf8state_expect2;
} else {
......@@ -179,7 +179,7 @@ utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
case utf8state_expect2:
machine->s.byte[machine->len++] = c;
machine->unicode = (machine->unicode << 6) | (c & 0x3f);
if((c & 0xC0) == 0x80) {
if ((c & 0xC0) == 0x80) {
/* all good, continue */
machine->state = utf8state_expect1;
} else {
......@@ -190,7 +190,7 @@ utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
case utf8state_expect1:
machine->s.byte[machine->len++] = c;
machine->unicode = (machine->unicode << 6) | (c & 0x3f);
if((c & 0xC0) == 0x80) {
if ((c & 0xC0) == 0x80) {
/* all good, accept */
machine->state = utf8state_accept;
} else {
......@@ -660,7 +660,7 @@ terminal_scroll_window(struct terminal *terminal, int d)
// scrolling range is inclusive
window_height = terminal->margin_bottom - terminal->margin_top + 1;
d = d % (window_height + 1);
if(d < 0) {
if (d < 0) {
d = 0 - d;
to_row = terminal->margin_bottom;
from_row = terminal->margin_bottom - d;
......@@ -701,7 +701,7 @@ terminal_scroll_window(struct terminal *terminal, int d)
static void
terminal_scroll(struct terminal *terminal, int d)
{
if(terminal->margin_top == 0 && terminal->margin_bottom == terminal->height - 1)
if (terminal->margin_top == 0 && terminal->margin_bottom == terminal->height - 1)
terminal_scroll_buffer(terminal, d);
else
terminal_scroll_window(terminal, d);
......@@ -1557,17 +1557,17 @@ handle_escape(struct terminal *terminal)
}
break;
case 'h': /* SM */
for(i = 0; i < 10 && set[i]; i++) {
for (i = 0; i < 10 && set[i]; i++) {
handle_term_parameter(terminal, args[i], 1);
}
break;
case 'l': /* RM */
for(i = 0; i < 10 && set[i]; i++) {
for (i = 0; i < 10 && set[i]; i++) {
handle_term_parameter(terminal, args[i], 0);
}
break;
case 'm': /* SGR */
for(i = 0; i < 10; i++) {
for (i = 0; i < 10; i++) {
if (i <= 7 && set[i] && set[i + 1] &&
set[i + 2] && args[i + 1] == 5)
{
......@@ -1579,9 +1579,9 @@ handle_escape(struct terminal *terminal)
break;
}
}
if(set[i]) {
if (set[i]) {
handle_sgr(terminal, args[i]);
} else if(i == 0) {
} else if (i == 0) {
handle_sgr(terminal, 0);
break;
} else {
......@@ -1602,7 +1602,7 @@ handle_escape(struct terminal *terminal)
}
break;
case 'r':
if(!set[0]) {
if (!set[0]) {
terminal->margin_top = 0;
terminal->margin_bottom = terminal->height-1;
terminal->row = 0;
......@@ -1614,14 +1614,14 @@ handle_escape(struct terminal *terminal)
bottom = (set[1] ? args[1] : 1) - 1;
bottom = bottom < 0 ? 0 :
(bottom >= terminal->height ? terminal->height - 1 : bottom);
if(bottom > top) {
if (bottom > top) {
terminal->margin_top = top;
terminal->margin_bottom = bottom;
} else {
terminal->margin_top = 0;
terminal->margin_bottom = terminal->height-1;
}
if(terminal->origin_mode)
if (terminal->origin_mode)
terminal->row = terminal->margin_top;
else
terminal->row = 0;
......@@ -1691,7 +1691,7 @@ handle_non_csi_escape(struct terminal *terminal, char code)
switch(code) {
case 'M': /* RI */
terminal->row -= 1;
if(terminal->row < terminal->margin_top) {
if (terminal->row < terminal->margin_top) {
terminal->row = terminal->margin_top;
terminal_scroll(terminal, -1);
}
......@@ -1701,7 +1701,7 @@ handle_non_csi_escape(struct terminal *terminal, char code)
// fallthrough
case 'D': /* IND */
terminal->row += 1;
if(terminal->row > terminal->margin_bottom) {
if (terminal->row > terminal->margin_bottom) {
terminal->row = terminal->margin_bottom;
terminal_scroll(terminal, +1);
}
......@@ -1753,7 +1753,7 @@ handle_special_escape(struct terminal *terminal, char special, char code)
/* fill with 'E', no cheap way to do this */
memset(terminal->data, 0, terminal->data_pitch * terminal->height);
numChars = terminal->width * terminal->height;
for(i = 0; i < numChars; i++) {
for (i = 0; i < numChars; i++) {
terminal->data[i].byte[0] = 'E';
}
break;
......@@ -1841,19 +1841,19 @@ handle_sgr(struct terminal *terminal, int code)
terminal->curr_attr.bg = terminal->color_scheme->default_attr.bg;
break;
default:
if(code >= 30 && code <= 37) {
if (code >= 30 && code <= 37) {
terminal->curr_attr.fg = code - 30;
if (terminal->curr_attr.a & ATTRMASK_BOLD)
terminal->curr_attr.fg += 8;
} else if(code >= 40 && code <= 47) {
} else if (code >= 40 && code <= 47) {
terminal->curr_attr.bg = code - 40;
} else if (code >= 90 && code <= 97) {
terminal->curr_attr.fg = code - 90 + 8;
} else if (code >= 100 && code <= 107) {
terminal->curr_attr.bg = code - 100 + 8;
} else if(code >= 256 && code < 512) {
} else if (code >= 256 && code < 512) {
terminal->curr_attr.fg = code - 256;
} else if(code >= 512 && code < 768) {
} else if (code >= 512 && code < 768) {
terminal->curr_attr.bg = code - 512;
} else {
fprintf(stderr, "Unknown SGR code: %d\n", code);
......
......@@ -5296,7 +5296,7 @@ input_destroy(struct input *input)
data_offer_destroy(input->selection_offer);
if (input->data_device) {
if(input->display->data_device_manager_version >= 2)
if (input->display->data_device_manager_version >= 2)
wl_data_device_release(input->data_device);
else
wl_data_device_destroy(input->data_device);
......
......@@ -229,7 +229,7 @@ layout_transition_destroy(struct ivi_layout_transition *transition)
struct ivi_layout *layout = get_instance();
remove_transition(layout, transition);
if(transition->destroy_func)
if (transition->destroy_func)
transition->destroy_func(transition);
free(transition);
}
......@@ -663,7 +663,7 @@ transition_move_layer_destroy(struct ivi_layout_transition *transition)
{
struct move_layer_data *data = transition->private_data;
if(data->destroy_func)
if (data->destroy_func)
data->destroy_func(transition->user_data);
free(data);
......
......@@ -704,7 +704,7 @@ commit_surface_list(struct ivi_layout *layout)
int32_t configured = 0;
wl_list_for_each(ivisurf, &layout->surface_list, link) {
if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEFAULT) {
if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEFAULT) {
dest_x = ivisurf->prop.dest_x;
dest_y = ivisurf->prop.dest_y;
dest_width = ivisurf->prop.dest_width;
......@@ -717,7 +717,7 @@ commit_surface_list(struct ivi_layout *layout)
ivisurf->pending.prop.dest_height,
ivisurf->pending.prop.transition_duration);
if(ivisurf->pending.prop.visibility) {
if (ivisurf->pending.prop.visibility) {
ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration);
} else {
ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration);
......@@ -731,7 +731,7 @@ commit_surface_list(struct ivi_layout *layout)
ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
} else if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY){
} else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_DEST_RECT_ONLY) {
dest_x = ivisurf->prop.dest_x;
dest_y = ivisurf->prop.dest_y;
dest_width = ivisurf->prop.dest_width;
......@@ -753,9 +753,9 @@ commit_surface_list(struct ivi_layout *layout)
ivisurf->prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
ivisurf->pending.prop.transition_type = IVI_LAYOUT_TRANSITION_NONE;
} else if(ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY){
} else if (ivisurf->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_VIEW_FADE_ONLY) {
configured = 0;
if(ivisurf->pending.prop.visibility) {
if (ivisurf->pending.prop.visibility) {
ivi_layout_transition_visibility_on(ivisurf, ivisurf->pending.prop.transition_duration);
} else {
ivi_layout_transition_visibility_off(ivisurf, ivisurf->pending.prop.transition_duration);
......@@ -797,9 +797,9 @@ commit_layer_list(struct ivi_layout *layout)
struct ivi_layout_surface *next = NULL;
wl_list_for_each(ivilayer, &layout->layer_list, link) {
if(ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_MOVE) {
if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_MOVE) {
ivi_layout_transition_move_layer(ivilayer, ivilayer->pending.prop.dest_x, ivilayer->pending.prop.dest_y, ivilayer->pending.prop.transition_duration);
} else if(ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_FADE) {
} else if (ivilayer->pending.prop.transition_type == IVI_LAYOUT_TRANSITION_LAYER_FADE) {
ivi_layout_transition_fade_layer(ivilayer,ivilayer->pending.prop.is_fade_in,
ivilayer->pending.prop.start_alpha,ivilayer->pending.prop.end_alpha,
NULL, NULL,
......@@ -845,7 +845,7 @@ commit_layer_list(struct ivi_layout *layout)
wl_list_init(&ivilayer->order.surface_list);
wl_list_for_each(ivisurf, &ivilayer->pending.surface_list,
pending.link) {
if(!wl_list_empty(&ivisurf->order.link)){
if (!wl_list_empty(&ivisurf->order.link)) {
wl_list_remove(&ivisurf->order.link);
wl_list_init(&ivisurf->order.link);
}
......@@ -940,7 +940,7 @@ commit_screen_list(struct ivi_layout *layout)
static void
commit_transition(struct ivi_layout* layout)
{
if(wl_list_empty(&layout->pending_transition_list)){
if (wl_list_empty(&layout->pending_transition_list)) {
return;
}
......@@ -1507,7 +1507,7 @@ ivi_layout_get_screens(int32_t *pLength, struct ivi_layout_screen ***ppArray)
length = wl_list_length(&layout->screen_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_screen *));
if (*ppArray == NULL) {
......@@ -1541,7 +1541,7 @@ ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
length = wl_list_length(&ivilayer->screen_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_screen *));
if (*ppArray == NULL) {
......@@ -1574,7 +1574,7 @@ ivi_layout_get_layers(int32_t *pLength, struct ivi_layout_layer ***ppArray)
length = wl_list_length(&layout->layer_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_layer *));
if (*ppArray == NULL) {
......@@ -1608,7 +1608,7 @@ ivi_layout_get_layers_on_screen(struct ivi_layout_screen *iviscrn,
length = wl_list_length(&iviscrn->order.layer_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_layer *));
if (*ppArray == NULL) {
......@@ -1642,7 +1642,7 @@ ivi_layout_get_layers_under_surface(struct ivi_layout_surface *ivisurf,
length = wl_list_length(&ivisurf->layer_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_layer *));
if (*ppArray == NULL) {
......@@ -1676,7 +1676,7 @@ ivi_layout_get_surfaces(int32_t *pLength, struct ivi_layout_surface ***ppArray)
length = wl_list_length(&layout->surface_list);
if (length != 0){
if (length != 0) {
/* the Array must be free by module which called this function */
*ppArray = calloc(length, sizeof(struct ivi_layout_surface *));
if (*ppArray == NULL) {
......@@ -2707,7 +2707,7 @@ ivi_layout_get_weston_view(struct ivi_layout_surface *surface)
{
struct weston_view *tmpview = NULL;
if(surface == NULL)
if (surface == NULL)
return NULL;
wl_list_for_each(tmpview, &surface->surface->views, surface_link)
......
......@@ -235,7 +235,7 @@ application_surface_create(struct wl_client *client,
layout_surface = ivi_layout_surface_create(weston_surface, id_surface);
/* check if id_ivi is already used for wl_surface*/
if (layout_surface == NULL){
if (layout_surface == NULL) {
wl_resource_post_error(resource,
IVI_APPLICATION_ERROR_IVI_ID,
"surface_id is already assigned "
......
......@@ -138,7 +138,8 @@ struct rdp_peer_context {
typedef struct rdp_peer_context RdpPeerContext;
static void
rdp_backend_config_init(struct rdp_backend_config *config) {
rdp_backend_config_init(struct rdp_backend_config *config)
{
config->width = 640;
config->height = 480;
config->bind_address = NULL;
......@@ -250,7 +251,8 @@ rdp_peer_refresh_nsc(pixman_region32_t *damage, pixman_image_t *image, freerdp_p
}
static void
pixman_image_flipped_subrect(const pixman_box32_t *rect, pixman_image_t *img, BYTE *dest) {
pixman_image_flipped_subrect(const pixman_box32_t *rect, pixman_image_t *img, BYTE *dest)
{
int stride = pixman_image_get_stride(img);
int h;
int toCopy = (rect->x2 - rect->x1) * 4;
......@@ -393,7 +395,8 @@ finish_frame_handler(void *data)
}
static struct weston_mode *
rdp_insert_new_mode(struct weston_output *output, int width, int height, int rate) {
rdp_insert_new_mode(struct weston_output *output, int width, int height, int rate)
{
struct weston_mode *ret;
ret = zalloc(sizeof *ret);
if (!ret)
......@@ -406,7 +409,8 @@ rdp_insert_new_mode(struct weston_output *output, int width, int height, int rat
}
static struct weston_mode *
ensure_matching_mode(struct weston_output *output, struct weston_mode *target) {
ensure_matching_mode(struct weston_output *output, struct weston_mode *target)
{
struct weston_mode *local;
wl_list_for_each(local, &output->mode_list, link) {
......@@ -418,7 +422,8 @@ ensure_matching_mode(struct weston_output *output, struct weston_mode *target) {
}
static int
rdp_switch_mode(struct weston_output *output, struct weston_mode *target_mode) {
rdp_switch_mode(struct weston_output *output, struct weston_mode *target_mode)
{
struct rdp_output *rdpOutput = container_of(output, struct rdp_output, base);
struct rdp_peers_item *rdpPeer;
rdpSettings *settings;
......@@ -558,13 +563,13 @@ rdp_destroy(struct weston_compositor *ec)
}
static
int rdp_listener_activity(int fd, uint32_t mask, void *data) {
int rdp_listener_activity(int fd, uint32_t mask, void *data)
{
freerdp_listener* instance = (freerdp_listener *)data;
if (!(mask & WL_EVENT_READABLE))
return 0;
if (!instance->CheckFileDescriptor(instance))
{
if (!instance->CheckFileDescriptor(instance)) {
weston_log("failed to check FreeRDP file descriptor\n");
return -1;
}
......@@ -572,7 +577,8 @@ int rdp_listener_activity(int fd, uint32_t mask, void *data) {
}
static
int rdp_implant_listener(struct rdp_backend *b, freerdp_listener* instance) {
int rdp_implant_listener(struct rdp_backend *b, freerdp_listener* instance)
{
int i, fd;
int rcount = 0;
void* rfds[MAX_FREERDP_FDS];
......@@ -590,7 +596,7 @@ int rdp_implant_listener(struct rdp_backend *b, freerdp_listener* instance) {
rdp_listener_activity, instance);
}
for( ; i < MAX_FREERDP_FDS; i++)
for ( ; i < MAX_FREERDP_FDS; i++)
b->listener_events[i] = 0;
return 0;
}
......@@ -626,7 +632,7 @@ rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context)
return;
wl_list_remove(&context->item.link);
for(i = 0; i < MAX_FREERDP_FDS; i++) {
for (i = 0; i < MAX_FREERDP_FDS; i++) {
if (context->events[i])
wl_event_source_remove(context->events[i]);
}
......@@ -645,7 +651,8 @@ rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* context)
static int
rdp_client_activity(int fd, uint32_t mask, void *data) {
rdp_client_activity(int fd, uint32_t mask, void *data)
{
freerdp_peer* client = (freerdp_peer *)data;
if (!client->CheckFileDescriptor(client)) {
......@@ -877,7 +884,7 @@ xf_peer_activate(freerdp_peer* client)
memset(&xkbRuleNames, 0, sizeof(xkbRuleNames));
if (settings->KeyboardType <= 7)
xkbRuleNames.model = rdp_keyboard_types[settings->KeyboardType];
for(i = 0; rdp_keyboards[i].rdpLayoutCode; i++) {
for (i = 0; rdp_keyboards[i].rdpLayoutCode; i++) {
if (rdp_keyboards[i].rdpLayoutCode == settings->KeyboardLayout) {
xkbRuleNames.layout = rdp_keyboards[i].xkbLayout;
xkbRuleNames.variant = rdp_keyboards[i].xkbVariant;
......@@ -934,7 +941,8 @@ static BOOL xf_peer_post_connect(freerdp_peer *client)
}
static FREERDP_CB_RET_TYPE
xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) {
xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
{
wl_fixed_t wl_x, wl_y, axis;
RdpPeerContext *peerContext = (RdpPeerContext *)input->context;
struct rdp_output *output;
......@@ -983,7 +991,8 @@ xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) {
}
static FREERDP_CB_RET_TYPE
xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y) {
xf_extendedMouseEvent(rdpInput *input, UINT16 flags, UINT16 x, UINT16 y)
{
wl_fixed_t wl_x, wl_y;
RdpPeerContext *peerContext = (RdpPeerContext *)input->context;
struct rdp_output *output;
......@@ -1048,7 +1057,7 @@ xf_input_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code)
full_code |= KBD_FLAGS_EXTENDED;
vk_code = GetVirtualKeyCodeFromVirtualScanCode(full_code, 4);
if(flags & KBD_FLAGS_EXTENDED)
if (flags & KBD_FLAGS_EXTENDED)
vk_code |= KBDEXT;
scan_code = GetKeycodeFromVirtualKeyCode(vk_code, KEYCODE_TYPE_EVDEV);
......@@ -1071,7 +1080,8 @@ xf_input_unicode_keyboard_event(rdpInput *input, UINT16 flags, UINT16 code)
static FREERDP_CB_RET_TYPE
xf_suppress_output(rdpContext *context, BYTE allow, RECTANGLE_16 *area) {
xf_suppress_output(rdpContext *context, BYTE allow, RECTANGLE_16 *area)
{
RdpPeerContext *peerContext = (RdpPeerContext *)context;
if (allow)
......@@ -1146,7 +1156,7 @@ rdp_peer_init(freerdp_peer *client, struct rdp_backend *b)
}
loop = wl_display_get_event_loop(b->compositor->wl_display);
for(i = 0; i < rcount; i++) {
for (i = 0; i < rcount; i++) {
fd = (int)(long)(rfds[i]);
peerCtx->events[i] = wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
......@@ -1216,7 +1226,7 @@ rdp_backend_create(struct weston_compositor *compositor,
compositor->capabilities |= WESTON_CAP_ARBITRARY_MODES;
if(!config->env_socket) {
if (!config->env_socket) {
b->listener = freerdp_listener_new();
b->listener->PeerAccepted = rdp_incoming_peer;
b->listener->param4 = b;
......
......@@ -1487,7 +1487,7 @@ rpi_renderer_attach(struct weston_surface *base, struct weston_buffer *buffer)
surface->buffer_type = BUFFER_TYPE_EGL;
if(surface->egl_back == NULL)
if (surface->egl_back == NULL)
surface->egl_back = zalloc(sizeof *surface->egl_back);
weston_buffer_reference(&surface->egl_back->buffer_ref, buffer);
......
......@@ -42,7 +42,8 @@ char *server_parameters="--use-pixman --width=320 --height=240";
* @returns true if successfully saved file; false otherwise.
*/
static bool
write_surface_as_png(const struct surface* weston_surface, const char *fname) {
write_surface_as_png(const struct surface* weston_surface, const char *fname)
{
cairo_surface_t *cairo_surface;
cairo_status_t status;
int bpp = 4; /* Assume ARGB */
......@@ -73,7 +74,8 @@ write_surface_as_png(const struct surface* weston_surface, const char *fname) {
* when no longer used; or, NULL in case of error.
*/
static struct surface*
load_surface_from_png(const char *fname) {
load_surface_from_png(const char *fname)
{
struct surface *reference;
cairo_surface_t *reference_cairo_surface;
cairo_status_t status;
......@@ -138,7 +140,8 @@ load_surface_from_png(const char *fname) {
* free'd when done using it.
*/
static struct surface*
create_screenshot_surface(struct client *client) {
create_screenshot_surface(struct client *client)
{
struct surface* screenshot;
screenshot = xzalloc(sizeof *screenshot);
if (screenshot == NULL)
......@@ -163,7 +166,8 @@ create_screenshot_surface(struct client *client) {
* longer needed.
*/
static struct surface *
capture_screenshot_of_output(struct client *client) {
capture_screenshot_of_output(struct client *client)
{
struct surface *screenshot;
/* Create a surface to hold the screenshot */
......
......@@ -40,7 +40,7 @@ TEST(simple_keyboard_test)
keyboard = client->input->keyboard;
while(1) {
while (1) {
assert(keyboard->key == expect_key);
assert(keyboard->state == expect_state);
assert(keyboard->focus == expect_focus);
......
......@@ -525,7 +525,7 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
/* we will create/update the devices only with the right (test) seat.
* If we haven't discovered which seat is the test seat, just
* store capabilities and bail out */
if(input->seat_name && strcmp(input->seat_name, "test-seat") == 0)
if (input->seat_name && strcmp(input->seat_name, "test-seat") == 0)
input_update_devices(input);
fprintf(stderr, "test-client: got seat %p capabilities: %x\n",
......
......@@ -218,7 +218,8 @@ emit_event(xmlNodePtr parent, struct zuc_event *event)
* @return the formatted time string upon success, NULL otherwise.
*/
static char *
as_duration(long ms) {
as_duration(long ms)
{
char *str = NULL;
if (asprintf(&str, "%1.3f", ms / 1000.0) < 0) {
......
......@@ -227,7 +227,7 @@ get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
cookie = xcb_get_atom_name (c, atom);
reply = xcb_get_atom_name_reply (c, cookie, &e);
if(reply) {
if (reply) {
snprintf(buffer, sizeof buffer, "%.*s",
xcb_get_atom_name_name_length (reply),
xcb_get_atom_name_name (reply));
......@@ -1087,7 +1087,7 @@ weston_wm_window_draw_decoration(void *data)
if (window->surface) {
pixman_region32_fini(&window->surface->pending.opaque);
if(window->has_alpha) {
if (window->has_alpha) {
pixman_region32_init(&window->surface->pending.opaque);
} else {
/* We leave an extra pixel around the X window area to
......@@ -1131,7 +1131,7 @@ weston_wm_window_schedule_repaint(struct weston_wm_window *window)
if (window->surface != NULL) {
weston_wm_window_get_frame_size(window, &width, &height);
pixman_region32_fini(&window->surface->pending.opaque);
if(window->has_alpha) {
if (window->has_alpha) {
pixman_region32_init(&window->surface->pending.opaque);
} else {
pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
......@@ -1209,7 +1209,7 @@ weston_wm_window_create(struct weston_wm *wm,
geometry_reply = xcb_get_geometry_reply(wm->conn, geometry_cookie, NULL);
/* technically we should use XRender and check the visual format's
alpha_mask, but checking depth is simpler and works in all known cases */
if(geometry_reply != NULL)
if (geometry_reply != NULL)
window->has_alpha = geometry_reply->depth == 32;
free(geometry_reply);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment