Verified Commit c02f24b4 authored by Jan Ziak's avatar Jan Ziak 💬
Browse files

Code cleanup: Remove G_BEGIN_DECLS and G_END_DECLS directives

This adds parameter types to ELF symbols representing functions, which
slightly increases run-time type safety.
parent 9527ef01
Pipeline #11802 passed with stages
in 1 minute and 43 seconds
......@@ -25,8 +25,6 @@
#include "types.h"
G_BEGIN_DECLS
#define ACPI_PATH "/proc/acpi"
#define ACPI_DIR_THERMAL "thermal_zone"
#define ACPI_DIR_BATTERY "battery"
......@@ -189,6 +187,4 @@ gint acpi_ignore_directory_entry (struct dirent *entry);
*/
void free_acpi_chip (gpointer chip);
G_END_DECLS
#endif /* XFCE4_SENSORS_ACPI_H */
......@@ -24,8 +24,6 @@
#include "sensors-interface-common.h"
G_BEGIN_DECLS
/**
* Gets the internally used chipfeature index for the given parameters.
* @param chip_number: number of the chip to search for
......@@ -68,6 +66,4 @@ void sensors_read_config (XfcePanelPlugin *plugin, t_sensors *sensors);
*/
void sensors_read_preliminary_config (XfcePanelPlugin *plugin, t_sensors *sensors);
G_END_DECLS
#endif /* define XFCE4_SENSORS_CONFIGURATION_H */
......@@ -24,8 +24,6 @@
#include "types.h"
G_BEGIN_DECLS
#define HDDTEMP_DISK_SLEEPING ZERO_KELVIN /* must be larger than the remaining ones */
#define NO_VALID_HDDTEMP_PROGRAM ZERO_KELVIN-1 /* the calls/communication to hddtemp don't work */
#define NO_VALID_TEMPERATURE_VALUE ZERO_KELVIN-2 /* the value for a single disk is invalid */
......@@ -57,6 +55,4 @@ void refresh_hddtemp (gpointer chip_feature, gpointer sensors);
*/
double get_hddtemp_value (char *disk, gboolean *suppress_message);
G_END_DECLS
#endif /* XFCE4_SENSORS_HDDTEMP_H */
......@@ -29,8 +29,6 @@
#include "types.h"
G_BEGIN_DECLS
/**
* Initialize libsensors by reading sensor config and other stuff
* @param chips: Pointer to array of chips
......@@ -54,6 +52,4 @@ void refresh_lmsensors (gpointer chip_feature, gpointer unused);
*/
void free_lmsensors_chip (gpointer chip);
G_END_DECLS
#endif /* XFCE4_SENSORS_LMSENSORS_H */
......@@ -25,8 +25,6 @@
#include "sensors-interface-plugin.h"
#include "types.h"
G_BEGIN_DECLS
/**
* Initialize all sensors detected by iterating and calling init-routines
* @param out_chips: Double-pointer to pointer array of chips
......@@ -93,6 +91,4 @@ void cleanup_interfaces (void);
*/
void refresh_all_chips (GPtrArray *chips, t_sensors *sensors);
G_END_DECLS
#endif /* XFCE4_SENSORS_MIDDLELAYER_H */
......@@ -26,8 +26,6 @@
#include <glib.h>
G_BEGIN_DECLS
/**
* Initialize nvidia sensor
* @param chips: Pointer to pointer array to chips
......@@ -49,6 +47,4 @@ void refresh_nvidia (gpointer chip_feature, gpointer unused);
*/
double get_nvidia_value (int idx_gpu);
G_END_DECLS
#endif /* XFCE4_SENSORS_NVIDIA_H */
......@@ -31,8 +31,6 @@
#include "sensors-interface-plugin.h"
#include "types.h"
G_BEGIN_DECLS
/* Definitions */
// Newer Gnome 2 spacing?
//#define BORDER 18
......@@ -254,6 +252,4 @@ EXTERN void
void format_sensor_value (t_tempscale temperature_scale, t_chipfeature *feature,
double feature_value, gchar **formatted_value);
G_END_DECLS
#endif /* XFCE4_SENSORS_INTERFACE_COMMON_H */
......@@ -33,8 +33,6 @@
#include "sensors-interface-types.h"
#include "types.h"
G_BEGIN_DECLS
#define MAX_NUM_CHIPS 10
#define MAX_NUM_FEATURES 256
......@@ -188,6 +186,4 @@ t_sensors* sensors_new (XfcePanelPlugin *plugin, gchar *plugin_config_filename);
*/
void sensors_init_default_values (t_sensors *sensors, XfcePanelPlugin *plugin);
G_END_DECLS
#endif /* XFCE4_SENSORS_INTERFACE_PLUGIN_H */
......@@ -23,8 +23,6 @@
#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
/**
* compound widget displaying a levelbar and optional label
*/
......@@ -53,6 +51,4 @@ enum e_displaystyles {
DISPLAY_TACHO
};
G_END_DECLS
#endif /* __SENSORS_INTERFACE_TYPES */
......@@ -24,8 +24,6 @@
#include <gtk/gtk.h>
#include "sensors-interface-common.h"
G_BEGIN_DECLS
/* Initializing and filling functions */
/**
......@@ -112,6 +110,4 @@ void add_sensors_frame (GtkWidget *notebook, t_sensors_dialog *dialog);
*/
void add_update_time_box (GtkWidget *vbox, t_sensors_dialog *dialog);
G_END_DECLS
#endif /* XFCE4_SENSORS_INTERFACE_H */
......@@ -23,8 +23,6 @@
#include <cairo.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GtkSensorsTacho, gtk_sensorstacho, GTK, SENSORSTACHO, GtkDrawingArea)
typedef struct _GtkSensorsTacho GtkSensorsTacho;
......@@ -146,6 +144,4 @@ extern gfloat val_colorvalue;
*/
extern gfloat val_alpha;
G_END_DECLS
#endif /* __TACHO_H */
......@@ -53,8 +53,6 @@ struct sensors_chip_name {
};
#endif
G_BEGIN_DECLS
#define ZERO_KELVIN -273 /*.15 */
/**
......@@ -158,6 +156,4 @@ struct t_chip {
t_chiptype type;
};
G_END_DECLS
#endif /* XFCE4_SENSORS_TYPES_H */
......@@ -27,11 +27,8 @@
#include <libxfce4util/libxfce4util.h>
G_BEGIN_DECLS
#define APP_NAME N_("Sensors Plugin")
/* Functions for implementing the sensors interface common callback functions */
void adjustment_value_changed_ (GtkWidget *widget, t_sensors_dialog *dialog);
......@@ -55,6 +52,4 @@ void maximum_changed_ (GtkCellRendererText *cellrenderertext, gchar *path,
void temperature_unit_change_ (GtkWidget *widget, t_sensors_dialog *dialog);
G_END_DECLS
#endif /* XFCE4_SENSORS_SENSORS_H */
......@@ -27,8 +27,6 @@
#include <sensors-interface-common.h>
#include <tacho.h>
G_BEGIN_DECLS
/**
* Shall refresh the entire view of the application
* @param dialog: pointer to sensors dialog structure
......@@ -38,6 +36,4 @@ void refresh_view (t_sensors_dialog *dialog);
gboolean refresh_view_cb (gpointer user_data);
G_END_DECLS
#endif /* ACTIONS_H */
......@@ -27,8 +27,6 @@
/* Package includes */
#include <sensors-interface-common.h>
G_BEGIN_DECLS
/* there should also be some "private" callbacks such as closing/qutting
* the application.
*/
......@@ -95,6 +93,4 @@ void maximum_changed_ (GtkCellRendererText *cellrenderertext, gchar *path,
*/
void temperature_unit_change_ (GtkWidget *widget, t_sensors_dialog *dialog);
G_END_DECLS
#endif /* __CALLBACKS_H */
......@@ -18,14 +18,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __INTERFACE_H
#define __INTERFACE_H
#include <glib.h>
#include <gtk/gtk.h>
/* Package includes */
#include <sensors-interface-common.h>
G_BEGIN_DECLS
/**
* Populate the application's main window
* @param dialog: pointer to already filled sensors dialog structure
......@@ -33,4 +34,4 @@ G_BEGIN_DECLS
*/
GtkWidget* create_main_window (t_sensors_dialog *dialog);
G_END_DECLS
#endif /* __INTERFACE_H */
Supports Markdown
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