summaryrefslogtreecommitdiff
blob: ac71405e8f200a965bfcc23db1cf6721dc97b06e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
From 7df25a85ccbd28e22dee437272202fe966f861d1 Mon Sep 17 00:00:00 2001
From: A Schenck <galiven@users.sourceforge.net>
Date: Fri, 27 Jan 2023 15:09:58 -0800
Subject: [PATCH] Declare arguments on function pointers

Solves the errors with -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-function-pointer-types -Werror=deprecated-non-prototype
--- a/server/mail.c
+++ b/server/mail.c
@@ -42,12 +42,13 @@
 #define MBOX_MH_DIR		2
 
 
-typedef struct
+typedef struct Mailbox Mailbox;
+struct Mailbox
 	{
 	gchar		*path;
 	gchar		*homedir_path;
 	gint		mboxtype;
-	gboolean	(*check_func)();
+	gboolean	(*check_func)(Mailbox *mbox);
 	gint		mail_count;
 	gint		new_mail_count;
 	gint		old_mail_count;
@@ -57,8 +58,7 @@ typedef struct
 	off_t		last_size;
 	gboolean	is_internal;	/* Internal mail message (ie: localmachine) */
 	gboolean	changed;
-	}
-	Mailbox;
+	};
 
 static GList	*mailbox_list;
 
--- a/src/alerts.c
+++ b/src/alerts.c
@@ -765,7 +765,7 @@ gkrellm_alert_plugin_add(GkrellmMonitor *mon, gchar *name)
 void
 gkrellm_alert_plugin_alert_connect(GkrellmAlertPlugin *gap,
 			void (*alarm_func)(), void (*warn_func)(),
-			void (*update_func)(), void (*check_func)(),
+			void (*update_func)(), void (*check_func)(GkrellmAlert* alert, gpointer data, gfloat value),
 			void (*destroy_func)())
 	{
 	gap->alarm_func = alarm_func;
--- a/src/chart.c
+++ b/src/chart.c
@@ -2107,7 +2107,7 @@ gkrellm_get_chartconfig_grid_resolution(GkrellmChartconfig *cf)
 
 void
 gkrellm_chartconfig_grid_resolution_connect(GkrellmChartconfig *cf,
-			void (*func)(gpointer), gpointer data)
+			void (*func)(GkrellmChartconfig *, gpointer), gpointer data)
 	{
 	if (!cf)
 		return;
@@ -2206,7 +2206,7 @@ gkrellm_get_chartconfig_fixed_grids(GkrellmChartconfig *cf)
 
 void
 gkrellm_chartconfig_fixed_grids_connect(GkrellmChartconfig *cf,
-			void (*func)(gpointer), gpointer data)
+			void (*func)(GkrellmChartconfig*, gpointer), gpointer data)
 	{
 	if (!cf)
 		return;
@@ -2224,7 +2224,7 @@ gkrellm_get_chartconfig_height(GkrellmChartconfig *cf)
 
 void
 gkrellm_chartconfig_height_connect(GkrellmChartconfig *cf,
-			void (*func)(gpointer), gpointer data)
+			void (*func)(GkrellmChartconfig*, gpointer), gpointer data)
 	{
 	if (!cf)
 		return;
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -50,7 +50,8 @@ static void	cb_alert_config_create(GkrellmAlert *ap, GtkWidget *vbox,
 #endif
 
 
-typedef struct
+typedef struct CpuMon CpuMon;
+struct CpuMon
 	{
 	gchar			*name;
 	gchar			*panel_label;
@@ -87,8 +88,7 @@ typedef struct
 					nice,
 					sys,
 					idle;
-	}
-	CpuMon;
+	};
 
 
 static GkrellmMonitor
@@ -575,7 +575,7 @@ cb_cpu_extra(GtkWidget *widget, GdkEventButton *ev)
 	}
 
 static void
-setup_cpu_scaling(GkrellmChartconfig *cf)
+setup_cpu_scaling(GkrellmChartconfig *cf, gpointer data)
 	{
 	gint	grids;
 
@@ -741,7 +741,7 @@ static gchar			*nice_color_string,
 						*nice_grid_color_string;
 
 static void
-cb_height(GkrellmChartconfig *cf, CpuMon *cpu)
+cb_height(GkrellmChartconfig *cf, gpointer data)
 	{
 	GList			*list;
 	GkrellmChart	*cp;
@@ -879,7 +879,7 @@ create_cpu(GtkWidget *vbox, gint first_create)
 		gkrellm_chartconfig_fixed_grids_connect(cp->config,
 					setup_cpu_scaling, NULL);
 		gkrellm_chartconfig_height_connect(cp->config, cb_height, cpu);
-		setup_cpu_scaling(cp->config);
+		setup_cpu_scaling(cp->config, NULL);
 
 		cpu->sensor_decal = cpu->fan_decal = NULL;
 		if (show_panel_labels)
--- a/src/disk.c
+++ b/src/disk.c
@@ -104,8 +104,8 @@ static gboolean	sys_handles_composite_reset;
 static gboolean	units_are_blocks;
 
 static void		(*read_disk_data)();
-static gchar	*(*name_from_device)();
-static gint		(*order_from_name)();
+static gchar	*(*name_from_device)(gint device_number, gint uint_number, gint *order);
+static gint		(*order_from_name)(const gchar *name);
 
 
 
@@ -703,9 +703,10 @@ cb_disk_extra(GtkWidget *widget, GdkEventButton *ev)
 	}
 
 static void
-setup_disk_scaling(GkrellmChartconfig *cf, GkrellmChart *cp)
+setup_disk_scaling(GkrellmChartconfig *cf, gpointer data)
 	{
 	gint	grids, res;
+	GkrellmChart *cp = (GkrellmChart*)data;
 
 	grids = gkrellm_get_chartconfig_fixed_grids(cf);
 	if (!grids)
--- a/src/fs.c
+++ b/src/fs.c
@@ -115,7 +115,7 @@ static GList	*fstab_list;
 static gint		uid;
 
 void			(*get_mounts_list)(),
-				(*get_fsusage)(),
+				(*get_fsusage)(gpointer mon, gchar *dir),
 				(*get_fstab_list)();
 gboolean		(*get_fstab_modified)();
 
@@ -123,8 +123,8 @@ gboolean		(*get_fstab_modified)();
 /* If ejecting is available via an ioctl() or if there is an eject command,
 |  set these up in gkrellm_sys_fs_init() by calling gkrellm_fs_setup_eject().
 */
-void			(*eject_cdrom_func)(),
-				(*close_cdrom_func)();
+void			(*eject_cdrom_func)(gchar *dev),
+				(*close_cdrom_func)(gchar *dev);
 static gchar	*eject_cdrom_command,
 				*close_cdrom_command;
 static gboolean	cdrom_thread_busy;		/* for the cdrom_funcs */
@@ -1536,7 +1536,7 @@ static GtkWidget	*alert_button;
 
 static GtkWidget	*data_format_combo_box;
 
-static gboolean	(*original_row_drop_possible)();
+static gboolean	(*original_row_drop_possible)(GtkTreeDragDest *dest, GtkTreePath *path, GtkSelectionData *selection_data);
 
 
 static void
--- a/src/gkrellm-public-proto.h
+++ b/src/gkrellm-public-proto.h
@@ -116,8 +116,8 @@ void		gkrellm_chartconfig_grid_resolution_adjustment(
 void		gkrellm_set_chartconfig_grid_resolution(GkrellmChartconfig *,
 						gint);
 gint		gkrellm_get_chartconfig_grid_resolution(GkrellmChartconfig *);
-void		gkrellm_chartconfig_grid_resolution_connect(
-						GkrellmChartconfig *, void (*fn)(), gpointer);
+void		gkrellm_chartconfig_grid_resolution_connect(GkrellmChartconfig* cf,
+						void (*fn)(GkrellmChartconfig*, gpointer), gpointer);
 void		gkrellm_set_chartconfig_flags(GkrellmChartconfig *, gint);
 
 void		gkrellm_chartconfig_grid_resolution_label(
@@ -131,10 +131,10 @@ void		gkrellm_set_chartconfig_sequence_125(GkrellmChartconfig *,
 void		gkrellm_set_chartconfig_fixed_grids(GkrellmChartconfig *, gint);
 gint		gkrellm_get_chartconfig_fixed_grids(GkrellmChartconfig *);
 void		gkrellm_chartconfig_fixed_grids_connect(GkrellmChartconfig *,
-						void (*fn)(), gpointer);
+						void (*fn)(GkrellmChartconfig*, gpointer), gpointer);
 gint		gkrellm_get_chartconfig_height(GkrellmChartconfig *);
-void		gkrellm_chartconfig_height_connect(GkrellmChartconfig *,
-						void (*fn)(), gpointer);
+void		gkrellm_chartconfig_height_connect(GkrellmChartconfig* cf,
+						void (*fn)(GkrellmChartconfig*, gpointer), gpointer);
 void		gkrellm_chartconfig_callback_block(GkrellmChartconfig *, gboolean);
 void		gkrellm_save_chartconfig(FILE *, GkrellmChartconfig *,
 						gchar *, gchar *);
@@ -274,7 +274,7 @@ GkrellmDecalbutton *gkrellm_make_scaled_button(GkrellmPanel *p,
 GkrellmDecalbutton *gkrellm_decal_is_button(GkrellmDecal *);
 void		gkrellm_set_in_button_callback(GkrellmDecalbutton *,
 						gint (*func)(), gpointer data);
-gboolean	gkrellm_in_button(GkrellmDecalbutton *button, GdkEventButton *);
+gboolean	gkrellm_in_button(GkrellmDecalbutton *button, GdkEventButton *, gpointer data);
 gboolean	gkrellm_in_decal(GkrellmDecal *, GdkEventButton *);
 void		gkrellm_decal_button_connect(GkrellmDecalbutton *, void (*func)(),
 						void *);
@@ -415,7 +415,7 @@ GkrellmAlertPlugin	*gkrellm_alert_plugin_add(GkrellmMonitor *mon,
 						gchar *name);
 void		gkrellm_alert_plugin_alert_connect(GkrellmAlertPlugin *gap,
             			void (*alarm_func)(), void (*warn_func)(),
-						void (*update_func)(), void (*check_func)(),
+						void (*update_func)(), void (*check_func)(GkrellmAlert* alert, gpointer data, gfloat value),
 						void (*destroy_func)());
 void		gkrellm_alert_plugin_config_connect(GkrellmAlertPlugin *gap,
 						gchar *tab_name,
--- a/src/gkrellm.h
+++ b/src/gkrellm.h
@@ -546,14 +546,15 @@ typedef struct
 #define	NO_CONFIG_AUTO_GRID_RESOLUTION	1
 #define	NO_CONFIG_FIXED_GRIDS			2
 
-typedef struct
+typedef struct GkrellmChartconfig GkrellmChartconfig;
+struct GkrellmChartconfig
 	{
 	gint		flags;
 	gboolean	config_loaded;
 	gboolean	log;
 
 	gint		h;
-	void		(*cb_height)();
+	void		(*cb_height)(GkrellmChartconfig *config, gpointer data);
 	gpointer	cb_height_data;
 	GtkWidget	*height_spin_button;
 
@@ -566,7 +567,7 @@ typedef struct
 	gboolean	auto_grid_resolution;
 	gboolean	auto_resolution_stick;
 	gboolean	sequence_125;
-	void		(*cb_grid_resolution)();
+	void		(*cb_grid_resolution)(GkrellmChartconfig *config, gpointer data);
 	gpointer	cb_grid_resolution_data;
 	GtkWidget	*grid_resolution_spin_button;
 	GtkWidget	*auto_resolution_control_menubar;
@@ -583,7 +584,7 @@ typedef struct
 				width;
 
 	gboolean	fixed_grids;
-	void		(*cb_fixed_grids)();
+	void		(*cb_fixed_grids)(GkrellmChartconfig *config, gpointer data);
 	gpointer	cb_fixed_grids_data;
 	GtkWidget	*fixed_grids_spin_button;
 
@@ -591,8 +592,7 @@ typedef struct
 	GList		**chart_cd_list;
 
 	gboolean	cb_block;
-	}
-	GkrellmChartconfig;
+	};
 
   /* GkrellmCharts are drawn in layers and each data value drawn has its own
   |  layer (the GkrellmChartdata struct -> image/color of the drawn data and
@@ -750,13 +750,14 @@ typedef struct
 	GkrellmChartdata;
 
 
-typedef struct
+typedef struct GkrellmDecalbutton GkrellmDecalbutton;
+struct GkrellmDecalbutton
 	{
 	GkrellmPanel *panel;
 	GkrellmDecal *decal;
-	void		(*cb_button_click)();
+	void		(*cb_button_click)(GkrellmDecalbutton *b, gpointer data);
 	gpointer	data;
-	gint		(*cb_in_button)();
+	gint		(*cb_in_button)(GkrellmDecalbutton *b, GdkEventButton *ev, gpointer data);
 	gpointer	in_button_data;
 	gpointer	privat;
 	gint		cur_index;
@@ -764,10 +765,9 @@ typedef struct
 	gint		saved_index;
 	gint		sensitive;
 	gint		type;
-	void		(*cb_button_right_click)();
+	void		(*cb_button_right_click)(GkrellmDecalbutton *b, gpointer data);
 	gpointer	right_data;
-	}
-	GkrellmDecalbutton;
+	};
 
 
 
@@ -791,20 +791,21 @@ typedef struct
 /* ------- Alerts ------- */
 #define	GKRELLM_ALERTCONFIG_KEYWORD			"alert_config"
 
+typedef struct GkrellmAlert GkrellmAlert;
 typedef struct
 	{
 	struct _GkrellmMonitor	*mon;
 	gchar		*name,
 				*tab_name;
-	void		(*warn_func)(),
-				(*alarm_func)(),
-				(*update_func)(),
-				(*check_func)(),
-				(*destroy_func)();
-	void		(*config_create_func)(),
-				(*config_apply_func)(),
-				(*config_save_func)(),
-				(*config_load_func)();
+	void		(*warn_func)(GkrellmAlert *alert, gpointer data, gboolean state),
+				(*alarm_func)(GkrellmAlert *alert, gpointer data, gboolean state),
+				(*update_func)(GkrellmAlert *alert, gpointer data),
+				(*check_func)(GkrellmAlert *alert, gpointer data, gfloat value),
+				(*destroy_func)(GkrellmAlert *alert, gpointer data);
+	void		(*config_create_func)(GtkWidget *vbox, GkrellmAlert *alert, gpointer data),
+				(*config_apply_func)(GkrellmAlert *alert, gpointer data, gboolean closing),
+				(*config_save_func)(GkrellmAlert *alert, gpointer data, FILE *f, gchar *p, gchar *id),
+				(*config_load_func)(GkrellmAlert *alert, gchar *config_id, gchar *alert_id);
 	}
 	GkrellmAlertPlugin;
 
@@ -847,7 +848,7 @@ typedef struct
 	}
 	GkrellmAlertkrell;
 
-typedef struct
+struct GkrellmAlert
 	{
 	GkrellmPanel *panel;
 	gchar		*name,
@@ -870,15 +871,15 @@ typedef struct
 				alarm_repeat;
 	gint		delay;
 
-	void		(*cb_trigger)();
+	void		(*cb_trigger)(GkrellmAlert *alert, gpointer data);
 	gpointer	cb_trigger_data;
 	void		(*cb_stop)();
 	gpointer	cb_stop_data;
-	void		(*cb_config)();
+	void		(*cb_config)(GkrellmAlert *alert, gpointer data);
 	gpointer	cb_config_data;
-	void		(*cb_config_create)();
+	void		(*cb_config_create)(GkrellmAlert *alert, GtkWidget *vbox1, gpointer data);
 	gpointer	cb_config_create_data;
-	void		(*cb_command_process)();
+	void		(*cb_command_process)(GkrellmAlert *alert, gchar *src, gchar *buf, gint size, void* target);
 	gpointer	cb_command_process_data;
 
 	GtkWidget	*config_window,
@@ -910,8 +911,7 @@ typedef struct
 
 	gchar		*id_string;		/* For unique alert names for alert plugins */
 	GList		*plugin_list;
-	}
-	GkrellmAlert;
+	};
 
 /* ------------------------ */
 
--- a/src/inet.c
+++ b/src/inet.c
@@ -36,7 +36,8 @@
 #include "gkrellm-sysdeps.h"
 #include "inet.h"
 
-typedef struct
+typedef struct InetMon InetMon;
+struct InetMon
 	{
 	GtkWidget	*vbox;
 	gchar		*name;
@@ -87,8 +88,7 @@ typedef struct
 						port1_1;
 
 	gulong				krell_hits;
-	}
-	InetMon;
+	};
 
 static GkrellmMonitor *mon_inet;
 
@@ -824,9 +824,10 @@ cb_panel_press(GtkWidget *widget, GdkEventButton *ev)
   /* Lock the hour and minute heights together.
   */
 static void
-cb_inet_height(GkrellmChartconfig *cf, InetMon *in)
+cb_inet_height(GkrellmChartconfig *cf, gpointer data)
 	{
 	gint	h;
+	InetMon	*in = (InetMon*) data;
 
 	h = gkrellm_get_chartconfig_height(cf);
 	if (in->chart_minute->h != h)
--- a/src/krell.c
+++ b/src/krell.c
@@ -1483,7 +1483,7 @@ gkrellm_show_button(GkrellmDecalbutton *b)
 	}
 
 gboolean
-gkrellm_in_button(GkrellmDecalbutton *b, GdkEventButton *ev)
+gkrellm_in_button(GkrellmDecalbutton *b, GdkEventButton *ev, gpointer data)
 	{
 	return gkrellm_in_decal(b->decal, ev);
 	}
--- a/src/mail.c
+++ b/src/mail.c
@@ -255,12 +255,13 @@ typedef struct
 	}
 	MailAccount;
 
-typedef struct
+typedef struct Mailbox Mailbox;
+struct Mailbox
 	{
 	MailAccount	*account;
 	gboolean	busy;
 	GString		*tcp_in;
-	gboolean	(*check_func)();
+	gboolean	(*check_func)(Mailbox *mbox);
 	gpointer	data;			/* For external mailboxes (in plugins) */
 	GThread*	thread;
 	gint		mail_count;
@@ -277,8 +278,7 @@ typedef struct
 	gchar		*uidl;
 	gboolean	warned;
 	void		*private;
-	}
-	Mailbox;
+	};
 
 static GList	*mailbox_list;
 
@@ -2309,9 +2309,8 @@ reset_mail_fetch(void)
 	}
 
 static gboolean
-run_fetch_program(void)
+run_fetch_program(Mailbox *mbox)
 	{
-	Mailbox		*mbox;
 	Mailproc	*mp	= (Mailproc *) mail_fetch->private;
 	GList		*list;
 
--- a/src/mem.c
+++ b/src/mem.c
@@ -662,8 +662,9 @@ cb_panel_motion(GtkWidget *widget, GdkEventButton *ev)
 	}
 
 static void
-setup_scaling(GkrellmChartconfig *cf, MeminfoChart *mc)
+setup_scaling(GkrellmChartconfig *cf, gpointer data)
 	{
+	MeminfoChart* mc = (MeminfoChart*)data;
 	GkrellmChart	*cp	  = mc->chart;
 	gint	res   = DEFAULT_GRID_RES,
 			grids = FULL_SCALE_GRIDS;
--- a/src/net.c
+++ b/src/net.c
@@ -1165,8 +1165,9 @@ grid_resolution_default(NetMon *net)
 	}
 
 static void
-setup_net_scaling(GkrellmChartconfig *cf, NetMon *net)
+setup_net_scaling(GkrellmChartconfig *cf, gpointer data)
 	{
+	NetMon *net = (NetMon*)data;
 	GkrellmChart	*cp  = net->chart;
 	gint	grids, res;
 
--- a/src/proc.c
+++ b/src/proc.c
@@ -333,7 +333,7 @@ cb_proc_extra(GtkWidget *widget, GdkEventButton *ev)
 	}
 
 static void
-setup_proc_scaling(void)
+setup_proc_scaling(GkrellmChartconfig *config, gpointer data)
 	{
 	GkrellmChart	*cp		= proc.chart;
 	gint			grids, res, new_fork_scaling;
@@ -567,7 +567,7 @@ create_proc_monitor(GtkWidget *vbox, gint first_create)
 					_("Average process load per minute"));
 
 	gkrellm_alloc_chartdata(cp);
-	setup_proc_scaling();
+	setup_proc_scaling(NULL, NULL);
 
 	/* I put motherboard temp on Proc panel (if temperature sensors found)
 	*/
--- a/src/sensors.c
+++ b/src/sensors.c
@@ -1985,7 +1985,7 @@ static Sensor		*dragged_sensor;
 
 static gint			sensor_last_group;
 
-static gboolean		(*original_row_drop_possible)();
+static gboolean		(*original_row_drop_possible)(GtkTreeDragDest *drag_dest, GtkTreePath *path, GtkSelectionData *selection_data);
 
 
 
--- a/src/sysdeps-unix.c
+++ b/src/sysdeps-unix.c
@@ -89,7 +89,7 @@
 #endif
 
 #if !defined(SENSORS_COMMON) && !defined(WIN32)
-static gboolean (*mbmon_check_func)();
+static gboolean (*mbmon_check_func)(gboolean);
 #endif
 
 gchar *
--- a/src/sysdeps/sensors-common.c
+++ b/src/sysdeps/sensors-common.c
@@ -54,7 +54,7 @@ static gchar	gkrellm_decimal_point,
 				mbmon_decimal_point;
 static gboolean	mbmon_need_decimal_point_fix;
 
-static gboolean (*mbmon_check_func)();
+static gboolean (*mbmon_check_func)(gboolean);
 
 static gboolean
 mbmon_decimal_point_fix(gchar *buf)
-- 
2.39.1