8000 Sync copyright notice and some minor cleanups by N-R-K · Pull Request #49 · mwh/dragon · GitHub
[go: up one dir, main page]

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
avoid using function with unspecified arguments
in C, fun(void) means this function takes _no arguments_, and it would
be a compile time error if this function was called with one.

however fun() means the function takes _unspecified_ arguments, so the
compiler can't do any type checking. calling such a function with
_any_ amount or any type of arguments will still end up compiling.

for example:

	void fun1()     { return; }
	void fun2(void) { return; }

	int
	main(void)
	{
		fun1(10, "string"); /* should compile fine */
		fun2(1); /* compile time error */
	}
  • Loading branch information
N-R-K committed Apr 7, 2022
commit 6fb2870ebfbbf6f766ea9b072236b2010cc133e2
10 changes: 5 additions & 5 deletions dragon.c
< A0BE td class="blob-num blob-num-expandable" colspan="2"> Expand Down Expand Up
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct draggable_thing fake_dragdata;
GtkWidget *all_button;
// ---

void add_target_button();
void add_target_button(void);

void *emalloc(size_t n) {
void *ret = malloc(n);
Expand Down Expand Up @@ -318,7 +318,7 @@ gboolean drag_drop (GtkWidget *widget,
return true;
}

void update_all_button() {
void update_all_button(void) {
sprintf(file_num_label, "%d files", uri_count);
gtk_button_set_label((GtkButton *)all_button, file_num_label);
}
@@ -371,7 +371,7 @@ drag_data_received (GtkWidget *widget,
gtk_main_quit();
}

void add_target_button() {
void add_target_button(void) {
GtkWidget *label = gtk_button_new();
gtk_button_set_label(GTK_BUTTON(label), "Drag something here...");
gtk_container_add(GTK_CONTAINER(vbox), label);
Expand All @@ -392,7 +392,7 @@ void add_target_button() {
G_CALLBACK(drag_data_received), NULL);
}

void target_mode() {
void target_mode(void) {
add_target_button();
gtk_widget_show_all(window);
gtk_main();
Expand Down Expand Up @@ -431,7 +431,7 @@ static void readstdin(void) {
}
}

void create_all_button() {
void create_all_button(void) {
sprintf(file_num_label, "%d files", uri_count);
all_button = gtk_button_new_with_label(file_num_label);

Expand Down
0