Remove extra whitespace at end of lines in all source files.

* Processed with rstrip-whitespace.py script added to scripts/ directory.
* Script run on all .c and .h files in src/ and plugins/ directories.
* Also remove more than one newline at the end of files.
This commit is contained in:
Matthew Brush 2011-10-11 21:52:58 -07:00
parent 182bdc3b17
commit bd5fba7eb5
22 changed files with 31 additions and 35 deletions

View File

@ -805,5 +805,3 @@ void plugin_cleanup(void)
if (config_file != NULL) if (config_file != NULL)
g_free(config_file); g_free(config_file);
} }

23
scripts/rstrip-whitespace.py Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
import sys
filenames = sys.argv[1:]
def backup_file (fn):
open ("%s~" % fn, "w").write (open (fn, "r").read ())
for fn in filenames:
#backup_file (fn)
contents = open (fn, "r").read ()
lines = contents.split ('\n')
with open (fn, "w") as fobj:
for line in lines:
line = line.rstrip ()
fobj.write ("%s\n" % line)
contents = open (fn, "r").read ()
contents.rstrip ()
while contents[-1] in " \t\r\n":
contents = contents[:-1]
open (fn, "w").write ("%s\n" % contents)

View File

@ -2767,5 +2767,3 @@ void build_init(void)
/* set the submenu to the toolbar item */ /* set the submenu to the toolbar item */
geany_menu_button_action_set_menu(GEANY_MENU_BUTTON_ACTION(widgets.build_action), toolmenu); geany_menu_button_action_set_menu(GEANY_MENU_BUTTON_ACTION(widgets.build_action), toolmenu);
} }

View File

@ -1703,5 +1703,3 @@ gint dialogs_show_prompt(GtkWidget *parent,
g_free(string); g_free(string);
return result; return result;
} }

View File

@ -1736,4 +1736,3 @@ const gchar *filetypes_get_display_name(GeanyFiletype *ft)
{ {
return ft->id == GEANY_FILETYPES_NONE ? _("None") : ft->name; return ft->id == GEANY_FILETYPES_NONE ? _("None") : ft->name;
} }

View File

@ -1811,5 +1811,3 @@ static gboolean gb_on_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointe
} }
} }
} }

View File

@ -184,4 +184,3 @@ GtkAction *geany_entry_action_new(const gchar *name, const gchar *label,
return action; return action;
} }

View File

@ -369,4 +369,3 @@ GObject *geany_object_new(void)
{ {
return g_object_new(GEANY_OBJECT_TYPE, NULL); return g_object_new(GEANY_OBJECT_TYPE, NULL);
} }

View File

@ -3978,4 +3978,3 @@ gboolean highlighting_is_code_style(gint lexer, gint style)
return !(highlighting_is_comment_style(lexer, style) || return !(highlighting_is_comment_style(lexer, style) ||
highlighting_is_string_style(lexer, style)); highlighting_is_string_style(lexer, style));
} }

View File

@ -1689,4 +1689,3 @@ static const guint8 save_all_tango_inline[] =
"\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0" "\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0\12\0\0\0"
"\7\0\0\0\4\0\0\0\2\377\377\377\0\377\377\377\0\377\377\377\0\377\377" "\7\0\0\0\4\0\0\0\2\377\377\377\0\377\377\377\0\377\377\377\0\377\377"
"\377\0"}; "\377\0"};

View File

@ -5816,4 +5816,3 @@ create_project_dialog (void)
return project_dialog; return project_dialog;
} }

View File

@ -1209,5 +1209,3 @@ void msgwin_clear_tab(gint tabnum)
return; return;
gtk_list_store_clear(store); gtk_list_store_clear(store);
} }

View File

@ -505,5 +505,3 @@ on_window_drag_data_received(GtkWidget *widget, GdkDragContext *drag_context,
} }
gtk_drag_finish(drag_context, success, FALSE, event_time); gtk_drag_finish(drag_context, success, FALSE, event_time);
} }

View File

@ -917,4 +917,3 @@ void printing_print_doc(GeanyDocument *doc)
else else
print_external(doc); print_external(doc);
} }

View File

@ -788,5 +788,3 @@ gint socket_fd_write(gint fd, const gchar *buf, gint len)
#endif #endif

View File

@ -2202,5 +2202,3 @@ void symbols_finalize(void)
g_strfreev(html_entities); g_strfreev(html_entities);
g_strfreev(c_tags_ignore); g_strfreev(c_tags_ignore);
} }

View File

@ -1114,5 +1114,3 @@ void toolbar_configure(GtkWindow *parent)
tb_editor_free_path(tbw); tb_editor_free_path(tbw);
g_free(tbw); g_free(tbw);
} }

View File

@ -960,5 +960,3 @@ void tools_color_chooser(const gchar *color)
gtk_window_present(GTK_WINDOW(ui_widgets.open_colorsel)); gtk_window_present(GTK_WINDOW(ui_widgets.open_colorsel));
#endif #endif
} }