summaryrefslogtreecommitdiff
path: root/cpufreq/src/cpufreq-selector
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-05-22 10:20:51 +0800
committerraveit65 <[email protected]>2019-05-27 17:21:31 +0200
commitadf5920f13380611d5e5b5cb712e5b2e6b1eed9c (patch)
tree38ef09c9903c69efdb24bd3b3313a564abbd0852 /cpufreq/src/cpufreq-selector
parent6fbca0cb8cfe6bedc6728a5e24384ffcbd769b9b (diff)
downloadmate-applets-adf5920f13380611d5e5b5cb712e5b2e6b1eed9c.tar.bz2
mate-applets-adf5920f13380611d5e5b5cb712e5b2e6b1eed9c.tar.xz
cpufreq: deprecated g_type_class_add_private
Diffstat (limited to 'cpufreq/src/cpufreq-selector')
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c9
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector.c9
2 files changed, 4 insertions, 14 deletions
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
index 990ea702..1cb87660 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
@@ -26,9 +26,6 @@
#include "cpufreq-selector-sysfs.h"
-#define CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_SELECTOR_SYSFS, CPUFreqSelectorSysfsPrivate))
-
struct _CPUFreqSelectorSysfsPrivate {
GList *available_freqs;
GList *available_govs;
@@ -47,12 +44,12 @@ static gboolean cpufreq_selector_sysfs_set_governor (CPUFreqSelector
#define CPUFREQ_SYSFS_BASE_PATH "/sys/devices/system/cpu/cpu%u/cpufreq/%s"
-G_DEFINE_TYPE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
static void
cpufreq_selector_sysfs_init (CPUFreqSelectorSysfs *selector)
{
- selector->priv = CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE (selector);
+ selector->priv = cpufreq_selector_sysfs_get_instance_private (selector);
selector->priv->available_freqs = NULL;
selector->priv->available_govs = NULL;
@@ -64,8 +61,6 @@ cpufreq_selector_sysfs_class_init (CPUFreqSelectorSysfsClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CPUFreqSelectorClass *selector_class = CPUFREQ_SELECTOR_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CPUFreqSelectorSysfsPrivate));
-
selector_class->set_frequency = cpufreq_selector_sysfs_set_frequency;
selector_class->set_governor = cpufreq_selector_sysfs_set_governor;
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector.c b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
index 23933c72..7f10c773 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector.c
@@ -22,9 +22,6 @@
#include <glib.h>
#include "cpufreq-selector.h"
-#define CPUFREQ_SELECTOR_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_SELECTOR, CPUFreqSelectorPrivate))
-
enum {
PROP_0,
PROP_CPU
@@ -46,7 +43,7 @@ static void cpufreq_selector_get_property (GObject *object,
GValue *value,
GParamSpec *spec);
-G_DEFINE_ABSTRACT_TYPE (CPUFreqSelector, cpufreq_selector, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (CPUFreqSelector, cpufreq_selector, G_TYPE_OBJECT)
GQuark
cpufreq_selector_error_quark (void)
@@ -64,7 +61,7 @@ static void
cpufreq_selector_init (CPUFreqSelector *selector)
{
- selector->priv = CPUFREQ_SELECTOR_GET_PRIVATE (selector);
+ selector->priv = cpufreq_selector_get_instance_private (selector);
selector->priv->cpu = 0;
}
@@ -74,8 +71,6 @@ cpufreq_selector_class_init (CPUFreqSelectorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CPUFreqSelectorPrivate));
-
object_class->set_property = cpufreq_selector_set_property;
object_class->get_property = cpufreq_selector_get_property;