[PATCH] remove trailing whitespaces
Michael Vetter
g.bluehut at googlemail.com
Fri May 15 08:17:47 PDT 2015
Remove trailing whitespaces because they are not needed and jumping to
the end of al ine should do just that and not jump to the whitespace.
---
clients/desktop-shell.c | 10 ++++-----
clients/dnd.c | 12 +++++-----
clients/editor.c | 2 +-
clients/flower.c | 6 ++---
clients/fullscreen.c | 4 ++--
clients/gears.c | 4 ++--
clients/glmatrix.c | 12 +++++-----
clients/keyboard.c | 14 ++++++------
clients/nested.c | 2 +-
clients/terminal.c | 56 +++++++++++++++++++++++-----------------------
clients/transformed.c | 4 ++--
clients/window.c | 2 +-
desktop-shell/shell.c | 2 +-
ivi-shell/hmi-controller.c | 2 +-
14 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index e2f9f80..777a50a 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -34,7 +34,7 @@
#include <cairo.h>
#include <sys/wait.h>
#include <sys/timerfd.h>
-#include <sys/epoll.h>
+#include <sys/epoll.h>
#include <linux/input.h>
#include <libgen.h>
#include <ctype.h>
@@ -241,7 +241,7 @@ panel_launcher_motion_handler(struct widget *widget, struct input *input,
static void
set_hex_color(cairo_t *cr, uint32_t color)
{
- cairo_set_source_rgba(cr,
+ cairo_set_source_rgba(cr,
((color >> 16) & 0xff) / 255.0,
((color >> 8) & 0xff) / 255.0,
((color >> 0) & 0xff) / 255.0,
@@ -319,7 +319,7 @@ panel_launcher_touch_down_handler(struct widget *widget, struct input *input,
static void
panel_launcher_touch_up_handler(struct widget *widget, struct input *input,
- uint32_t serial, uint32_t time, int32_t id,
+ uint32_t serial, uint32_t time, int32_t id,
void *data)
{
struct panel_launcher *launcher;
@@ -440,7 +440,7 @@ panel_resize_handler(struct widget *widget,
struct panel_launcher *launcher;
struct panel *panel = data;
int x, y, w, h;
-
+
x = 10;
y = 16;
wl_list_for_each(launcher, &panel->launcher_list, link) {
@@ -521,7 +521,7 @@ panel_create(struct desktop *desktop)
widget_set_redraw_handler(panel->widget, panel_redraw_handler);
widget_set_resize_handler(panel->widget, panel_resize_handler);
-
+
panel_add_clock(panel);
s = weston_config_get_section(desktop->config, "shell", NULL, NULL);
diff --git a/clients/dnd.c b/clients/dnd.c
index e893d36..b5a7d41 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -103,12 +103,12 @@ item_create(struct display *display, int x, int y, int seed)
item = malloc(sizeof *item);
if (item == NULL)
return NULL;
-
-
+
+
gettimeofday(&tv, NULL);
item->seed = seed ? seed : tv.tv_usec;
srandom(item->seed);
-
+
const int petal_count = 3 + random() % 5;
const double r1 = 20 + random() % 10;
const double r2 = 5 + random() % 12;
@@ -289,7 +289,7 @@ static void
data_source_send(void *data, struct wl_data_source *source,
const char *mime_type, int32_t fd)
{
- struct dnd_flower_message dnd_flower_message;
+ struct dnd_flower_message dnd_flower_message;
struct dnd_drag *dnd_drag = data;
char buffer[128];
int n;
@@ -325,7 +325,7 @@ data_source_cancelled(void *data, struct wl_data_source *source)
* up the drag object created and the local state. */
wl_data_source_destroy(dnd_drag->data_source);
-
+
/* Destroy the item that has been dragged out */
cairo_surface_destroy(dnd_drag->item->surface);
free(dnd_drag->item);
@@ -619,7 +619,7 @@ dnd_receive_func(void *data, size_t len, int32_t x, int32_t y, void *user_data)
len, sizeof *message);
return;
}
-
+
widget_get_allocation(dnd->widget, &allocation);
item = item_create(dnd->display,
x - message->x_offset - allocation.x,
diff --git a/clients/editor.c b/clients/editor.c
index 29cab34..f77a48d 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -612,7 +612,7 @@ editor_copy_cut(struct editor *editor, struct input *input, bool cut)
if (!entry)
return;
-
+
if (entry->cursor != entry->anchor) {
int start_index = MIN(entry->cursor, entry->anchor);
int end_index = MAX(entry->cursor, entry->anchor);
diff --git a/clients/flower.c b/clients/flower.c
index 624525c..15315b2 100644
--- a/clients/flower.c
+++ b/clients/flower.c
@@ -86,7 +86,7 @@ draw_stuff(cairo_surface_t *surface, int width, int height)
cairo_curve_to(cr,
x1 - y1 * u, y1 + x1 * u,
x2 + y2 * v, y2 - x2 * v,
- x2, y2);
+ x2, y2);
cairo_curve_to(cr,
x2 - y2 * v, y2 + x2 * v,
@@ -155,8 +155,8 @@ button_handler(struct widget *widget,
}
static void
-touch_down_handler(struct widget *widget, struct input *input,
- uint32_t serial, uint32_t time, int32_t id,
+touch_down_handler(struct widget *widget, struct input *input,
+ uint32_t serial, uint32_t time, int32_t id,
float x, float y, void *data)
{
struct flower *flower = data;
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 5c5dd2b..5ec4e93 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -410,8 +410,8 @@ button_handler(struct widget *widget,
}
static void
-touch_handler(struct widget *widget, struct input *input,
- uint32_t serial, uint32_t time, int32_t id,
+touch_handler(struct widget *widget, struct input *input,
+ uint32_t serial, uint32_t time, int32_t id,
float x, float y, void *data)
{
struct fullscreen *fullscreen = data;
diff --git a/clients/gears.c b/clients/gears.c
index 1fb77e0..f98b483 100644
--- a/clients/gears.c
+++ b/clients/gears.c
@@ -76,7 +76,7 @@ struct gear_template {
static const struct gear_template gear_templates[] = {
{ { 0.8, 0.1, 0.0, 1.0 }, 1.0, 4.0, 1.0, 20, 0.7 },
{ { 0.0, 0.8, 0.2, 1.0 }, 0.5, 2.0, 2.0, 10, 0.7 },
- { { 0.2, 0.2, 1.0, 1.0 }, 1.3, 2.0, 0.5, 10, 0.7 },
+ { { 0.2, 0.2, 1.0, 1.0 }, 1.3, 2.0, 0.5, 10, 0.7 },
};
static GLfloat light_pos[4] = {5.0, 5.0, 10.0, 0.0};
@@ -313,7 +313,7 @@ redraw_handler(struct widget *widget, void *data)
die("Unable to acquire window surface, "
"compiled without cairo-egl?\n");
}
-
+
glViewport(allocation.x,
window_allocation.height - allocation.height - allocation.y,
allocation.width, allocation.height);
diff --git a/clients/glmatrix.c b/clients/glmatrix.c
index 4c5754e..cc4df6a 100644
--- a/clients/glmatrix.c
+++ b/clients/glmatrix.c
@@ -5,7 +5,7 @@
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
- * software for any purpose. It is provided "as is" without express or
+ * software for any purpose. It is provided "as is" without express or
* implied warranty.
*
* GLMatrix -- simulate the text scrolls from the movie "The Matrix".
@@ -140,7 +140,7 @@ typedef struct {
Bool highlight[GRID_SIZE];
/* some glyphs may be highlighted */
-
+
int spin_speed; /* Rotate all spinners every this-many frames */
int spin_tick; /* frame counter */
@@ -270,7 +270,7 @@ reset_strip (ModeInfo *mi, strip *s)
s->highlight[i] = True;
}
- time_displayed_p = True;
+ time_displayed_p = True;
}
else
{
@@ -420,7 +420,7 @@ draw_glyph (ModeInfo *mi, int glyph, Bool highlight,
int i = ratio * WAVE_SIZE;
if (i < 0) i = 0;
- else if (i >= WAVE_SIZE) i = WAVE_SIZE-1;
+ else if (i >= WAVE_SIZE) i = WAVE_SIZE-1;
a *= mp->brightness_ramp[i];
}
@@ -802,7 +802,7 @@ load_textures (ModeInfo *mi, Bool flip_p)
}
-ENTRYPOINT void
+ENTRYPOINT void
init_matrix (ModeInfo *mi)
{
matrix_configuration *mp;
@@ -1008,7 +1008,7 @@ draw_matrix (ModeInfo *mi)
glScalef(0.5, 0.5, 0.5);
# endif
# if 0
- glRotatef(-30, 0, 1, 0);
+ glRotatef(-30, 0, 1, 0);
# endif
draw_grid (mi);
#endif
diff --git a/clients/keyboard.c b/clients/keyboard.c
index 2579571..b8ea8c1 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -572,7 +572,7 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Return, key_state, mod_mask);
break;
case keytype_space:
@@ -616,35 +616,35 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Tab, key_state, mod_mask);
break;
case keytype_arrow_up:
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Up, key_state, mod_mask);
break;
case keytype_arrow_left:
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Left, key_state, mod_mask);
break;
case keytype_arrow_right:
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Right, key_state, mod_mask);
break;
case keytype_arrow_down:
virtual_keyboard_commit_preedit(keyboard->keyboard);
wl_input_method_context_keysym(keyboard->keyboard->context,
display_get_serial(keyboard->keyboard->display),
- time,
+ time,
XKB_KEY_Down, key_state, mod_mask);
break;
case keytype_style:
@@ -730,7 +730,7 @@ touch_down_handler(struct widget *widget, struct input *input,
uint32_t serial, uint32_t time, int32_t id,
float x, float y, void *data)
{
- touch_handler(input, time, x, y,
+ touch_handler(input, time, x, y,
WL_POINTER_BUTTON_STATE_PRESSED, data);
}
diff --git a/clients/nested.c b/clients/nested.c
index f094237..0b18dd5 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -615,7 +615,7 @@ compositor_create_surface(struct wl_client *client,
{
struct nested *nested = wl_resource_get_user_data(resource);
struct nested_surface *surface;
-
+
surface = zalloc(sizeof *surface);
if (surface == NULL) {
wl_resource_post_no_memory(resource);
diff --git a/clients/terminal.c b/clients/terminal.c
index 739d1d4..d7345d3 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -200,7 +200,7 @@ utf8_next_char(struct utf8_state_machine *machine, unsigned char c)
machine->state = utf8state_reject;
break;
}
-
+
return machine->state;
}
@@ -284,7 +284,7 @@ static void
apply_char_set(character_set cs, union utf8_char *utf8)
{
int i = 0;
-
+
while (cs[i].match.byte[0]) {
if ((*utf8).ch == cs[i].match.ch) {
*utf8 = cs[i].replace;
@@ -361,7 +361,7 @@ apply_key_map(keyboard_mode mode, int sym, uint32_t modifiers, char *response)
struct key_map map;
int len = 0;
int i = 0;
-
+
while (mode[i].sym) {
map = mode[i++];
if (sym == map.sym) {
@@ -371,7 +371,7 @@ apply_key_map(keyboard_mode mode, int sym, uint32_t modifiers, char *response)
break;
}
}
-
+
return len;
}
@@ -483,7 +483,7 @@ static void
terminal_init_tabs(struct terminal *terminal)
{
int i = 0;
-
+
while (i < terminal->width) {
if (i % 8 == 0)
terminal->tab_ruler[i] = 1;
@@ -654,7 +654,7 @@ terminal_scroll_window(struct terminal *terminal, int d)
int i;
int window_height;
int from_row, to_row;
-
+
// scrolling range is inclusive
window_height = terminal->margin_bottom - terminal->margin_top + 1;
d = d % (window_height + 1);
@@ -662,7 +662,7 @@ terminal_scroll_window(struct terminal *terminal, int d)
d = 0 - d;
to_row = terminal->margin_bottom;
from_row = terminal->margin_bottom - d;
-
+
for (i = 0; i < (window_height - d); i++) {
memcpy(terminal_get_row(terminal, to_row - i),
terminal_get_row(terminal, from_row - i),
@@ -679,7 +679,7 @@ terminal_scroll_window(struct terminal *terminal, int d)
} else {
to_row = terminal->margin_top;
from_row = terminal->margin_top + d;
-
+
for (i = 0; i < (window_height - d); i++) {
memcpy(terminal_get_row(terminal, to_row + i),
terminal_get_row(terminal, from_row + i),
@@ -710,7 +710,7 @@ terminal_shift_line(struct terminal *terminal, int d)
{
union utf8_char *row;
struct attr *attr_row;
-
+
row = terminal_get_row(terminal, terminal->row);
attr_row = terminal_get_attr_row(terminal, terminal->row);
@@ -718,7 +718,7 @@ terminal_shift_line(struct terminal *terminal, int d)
d = terminal->column + 1 - terminal->width;
if ((terminal->column + d) >= terminal->width)
d = terminal->width - terminal->column - 1;
-
+
if (d < 0) {
d = 0 - d;
memmove(&row[terminal->column],
@@ -1195,7 +1195,7 @@ handle_term_parameter(struct terminal *terminal, int code, int sr)
terminal_resize(terminal, 132, 24);
else
terminal_resize(terminal, 80, 24);
-
+
/* set columns, but also home cursor and clear screen */
terminal->row = 0; terminal->column = 0;
for (i = 0; i < terminal->height; i++) {
@@ -1328,7 +1328,7 @@ handle_escape(struct terminal *terminal)
set[i] = 1;
}
}
-
+
switch (*p) {
case '@': /* ICH */
count = set[0] ? args[0] : 1;
@@ -1386,7 +1386,7 @@ handle_escape(struct terminal *terminal)
case 'G': /* CHA */
y = set[0] ? args[0] : 1;
y = y <= 0 ? 1 : y > terminal->width ? terminal->width : y;
-
+
terminal->column = y - 1;
break;
case 'f': /* HVP */
@@ -1394,7 +1394,7 @@ handle_escape(struct terminal *terminal)
x = (set[1] ? args[1] : 1) - 1;
x = x < 0 ? 0 :
(x >= terminal->width ? terminal->width - 1 : x);
-
+
y = (set[0] ? args[0] : 1) - 1;
if (terminal->origin_mode) {
y += terminal->margin_top;
@@ -1404,7 +1404,7 @@ handle_escape(struct terminal *terminal)
y = y < 0 ? 0 :
(y >= terminal->height ? terminal->height - 1 : y);
}
-
+
terminal->row = y;
terminal->column = x;
break;
@@ -1527,7 +1527,7 @@ handle_escape(struct terminal *terminal)
case '`': /* HPA */
y = set[0] ? args[0] : 1;
y = y <= 0 ? 1 : y > terminal->width ? terminal->width : y;
-
+
terminal->column = y - 1;
break;
case 'b': /* REP */
@@ -1544,7 +1544,7 @@ handle_escape(struct terminal *terminal)
case 'd': /* VPA */
x = set[0] ? args[0] : 1;
x = x <= 0 ? 1 : x > terminal->height ? terminal->height : x;
-
+
terminal->row = x - 1;
break;
case 'g': /* TBC */
@@ -1680,7 +1680,7 @@ handle_escape(struct terminal *terminal)
default:
fprintf(stderr, "Unknown CSI escape: %c\n", *p);
break;
- }
+ }
}
static void
@@ -1936,7 +1936,7 @@ handle_special_char(struct terminal *terminal, char c)
default:
return 0;
}
-
+
return 1;
}
@@ -1945,24 +1945,24 @@ handle_char(struct terminal *terminal, union utf8_char utf8)
{
union utf8_char *row;
struct attr *attr_row;
-
+
if (handle_special_char(terminal, utf8.byte[0])) return;
apply_char_set(terminal->cs, &utf8);
-
+
/* There are a whole lot of non-characters, control codes,
* and formatting codes that should probably be ignored,
* for example: */
if (strncmp((char*) utf8.byte, "\xEF\xBB\xBF", 3) == 0) {
/* BOM, ignore */
return;
- }
-
+ }
+
/* Some of these non-characters should be translated, e.g.: */
if (utf8.byte[0] < 32) {
utf8.byte[0] = utf8.byte[0] + 64;
}
-
+
/* handle right margin effects */
if (terminal->column >= terminal->width) {
if (terminal->mode & MODE_AUTOWRAP) {
@@ -1976,10 +1976,10 @@ handle_char(struct terminal *terminal, union utf8_char utf8)
terminal->column--;
}
}
-
+
row = terminal_get_row(terminal, terminal->row);
attr_row = terminal_get_attr_row(terminal, terminal->row);
-
+
if (terminal->mode & MODE_IRM)
terminal_shift_line(terminal, +1);
row[terminal->column] = utf8;
@@ -2096,7 +2096,7 @@ terminal_data(struct terminal *terminal, const char *data, size_t length)
if (terminal->escape_length >= MAX_ESCAPE)
terminal->state = escape_state_normal;
}
-
+
if (isalpha(utf8.byte[0]) || utf8.byte[0] == '@' ||
utf8.byte[0] == '`')
{
@@ -2503,7 +2503,7 @@ key_handler(struct window *window, struct input *input, uint32_t time,
/* Handle special keys with alternate mappings */
len = apply_key_map(terminal->key_mode, sym, modifiers, ch);
if (len != 0) break;
-
+
if (modifiers & MOD_CONTROL_MASK) {
if (sym >= '3' && sym <= '7')
sym = (sym & 0x1f) + 8;
diff --git a/clients/transformed.c b/clients/transformed.c
index 880a0a9..599ea4d 100644
--- a/clients/transformed.c
+++ b/clients/transformed.c
@@ -213,8 +213,8 @@ button_handler(struct widget *widget,
}
static void
-touch_handler(struct widget *widget, struct input *input,
- uint32_t serial, uint32_t time, int32_t id,
+touch_handler(struct widget *widget, struct input *input,
+ uint32_t serial, uint32_t time, int32_t id,
float x, float y, void *data)
{
struct transformed *transformed = data;
diff --git a/clients/window.c b/clients/window.c
index 81e007b..45b0ec5 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3181,7 +3181,7 @@ touch_handle_frame(void *data, struct wl_touch *wl_touch)
wl_list_for_each_safe(tp, tmp, &input->touch_point_list, link) {
if (tp->widget->touch_frame_handler)
- (*tp->widget->touch_frame_handler)(tp->widget, input,
+ (*tp->widget->touch_frame_handler)(tp->widget, input,
tp->widget->user_data);
}
}
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index c05a5c7..452cd5f 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2115,7 +2115,7 @@ xdg_ping_timeout_handler(void *data)
continue;
if (seat->pointer->focus->surface->resource == NULL)
continue;
-
+
shsurf = get_shell_surface(seat->pointer->focus->surface);
if (shsurf &&
wl_resource_get_client(shsurf->resource) == sc->client)
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index cd79c38..88e9333 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -573,7 +573,7 @@ set_notification_configure_surface(struct ivi_layout_surface *ivisurf,
&length, &ivisurfs);
for (i = 0; i < length; i++) {
if (ivisurf == ivisurfs[i]) {
- /*
+ /*
* if it is non new invoked application, just call
* commit_changes to apply source_rectangle.
*/
--
2.1.4
More information about the wayland-devel
mailing list