diff options
| author | Alexander Gramiak | 2019-04-14 08:41:48 -0600 |
|---|---|---|
| committer | Alexander Gramiak | 2019-04-14 08:56:10 -0600 |
| commit | 890440a44cd5f4f09742f521c7783785d114fffc (patch) | |
| tree | ee808cddf0c1ac69dcb6c8d6a4584930a4f7a93f | |
| parent | 29b36a007ae04839a4c29c62b2b1ee7940a8539a (diff) | |
| download | emacs-890440a44cd5f4f09742f521c7783785d114fffc.tar.gz emacs-890440a44cd5f4f09742f521c7783785d114fffc.zip | |
Simplify gdk_monitor_get_model string duplication
* src/xfns.c (x-display-monitor-attributes-list): Use dupstring over
explicit if/xstrdup.
* src/frame.c (free_monitors): Remove redundant check for NULL.
| -rw-r--r-- | src/frame.c | 3 | ||||
| -rw-r--r-- | src/xfns.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/frame.c b/src/frame.c index 22a3996af7f..192ef4244fb 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -5670,8 +5670,7 @@ free_monitors (struct MonitorInfo *monitors, int n_monitors) | |||
| 5670 | { | 5670 | { |
| 5671 | int i; | 5671 | int i; |
| 5672 | for (i = 0; i < n_monitors; ++i) | 5672 | for (i = 0; i < n_monitors; ++i) |
| 5673 | if (monitors[i].name) | 5673 | xfree (monitors[i].name); |
| 5674 | xfree (monitors[i].name); | ||
| 5675 | xfree (monitors); | 5674 | xfree (monitors); |
| 5676 | } | 5675 | } |
| 5677 | # endif | 5676 | # endif |
diff --git a/src/xfns.c b/src/xfns.c index dd1d8993f5e..e521ed12e40 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5030,8 +5030,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) | |||
| 5030 | mi->mm_height = height_mm; | 5030 | mi->mm_height = height_mm; |
| 5031 | 5031 | ||
| 5032 | #if GTK_CHECK_VERSION (3, 22, 0) | 5032 | #if GTK_CHECK_VERSION (3, 22, 0) |
| 5033 | if (gdk_monitor_get_model (monitor)) | 5033 | dupstring (&mi->name, (gdk_monitor_get_model (monitor))); |
| 5034 | mi->name = xstrdup (gdk_monitor_get_model (monitor)); | ||
| 5035 | #elif GTK_CHECK_VERSION (2, 14, 0) | 5034 | #elif GTK_CHECK_VERSION (2, 14, 0) |
| 5036 | mi->name = gdk_screen_get_monitor_plug_name (gscreen, i); | 5035 | mi->name = gdk_screen_get_monitor_plug_name (gscreen, i); |
| 5037 | #endif | 5036 | #endif |