File: Remove-system-variables-from-ps_struct.patch

package info (click to toggle)
coyote 2022.04.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,316 kB
  • sloc: python: 184; makefile: 14; sh: 13
file content (90 lines) | stat: -rw-r--r-- 3,686 bytes parent folder | download | duplicates (4)
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
From: Ole Streicher <olebole@debian.org>
Date: Tue, 4 Oct 2016 22:42:20 +0200
Subject: Remove system variables from ps_struct.

These variables cause a segfault on gdl-0.9.5.
---
 cgps_close.pro         |  8 --------
 cgps_open.pro          | 16 ++++++----------
 cgps_setup__define.pro |  6 +-----
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/cgps_close.pro b/cgps_close.pro
index 81a7a13..31c3bd4 100644
--- a/cgps_close.pro
+++ b/cgps_close.pro
@@ -246,10 +246,6 @@ PRO cgPS_Close, $
    
        ; Clean up.
        IF ps_struct.currentDevice NE "" THEN Set_Plot, ps_struct.currentDevice
-       !P = ps_struct.p
-       !X = ps_struct.x
-       !Y = ps_struct.y
-       !Z = ps_struct.z
        ps_struct.setup = 0
        ps_struct.currentDevice = ""
        ps_struct.filename = ""
@@ -373,10 +369,6 @@ PRO cgPS_Close, $
    
    ; Clean up.
    IF ps_struct.currentDevice NE "" THEN Set_Plot, ps_struct.currentDevice
-   !P = ps_struct.p
-   !X = ps_struct.x
-   !Y = ps_struct.y
-   !Z = ps_struct.z
    ps_struct.setup = 0
    ps_struct.currentDevice = ""
    ps_struct.filename = ""
diff --git a/cgps_open.pro b/cgps_open.pro
index 8e8eddf..f12c36e 100644
--- a/cgps_open.pro
+++ b/cgps_open.pro
@@ -313,17 +313,13 @@ PRO cgPS_Open, filename, $
    ; Save current setup information in the PS_STRUCT structure.
    ps_struct.setup = 1
    ps_struct.currentDevice = !D.Name
-   ps_struct.p = !P
-   ps_struct.x = !X
-   ps_struct.y = !Y
-   ps_struct.z = !Z
    
    ; Change any parameters you feel like changing.
-   IF ps_struct.p.thick EQ 0 THEN !P.Thick = default_thickness
-   IF ps_struct.p.charthick EQ 0 THEN !P.Charthick = default_thickness
-   IF ps_struct.x.thick EQ 0 THEN !X.Thick = default_thickness
-   IF ps_struct.y.thick EQ 0 THEN !Y.Thick = default_thickness
-   IF ps_struct.z.thick EQ 0 THEN !Z.Thick = default_thickness
+   IF !P.Thick EQ 0 THEN !P.Thick = default_thickness
+   IF !P.Charthick EQ 0 THEN !P.Charthick = default_thickness
+   IF !X.Thick EQ 0 THEN !X.Thick = default_thickness
+   IF !Y.Thick EQ 0 THEN !Y.Thick = default_thickness
+   IF !Z.Thick EQ 0 THEN !Z.Thick = default_thickness
    
    ; Set the true-type font.
    thisWindow = !D.Window
@@ -377,7 +373,7 @@ PRO cgPS_Open, filename, $
    IF N_Elements(setfont) NE 0 THEN Device, Set_Font=setfont, /TT_Font
    
    ; Determine the character size.
-   IF ps_struct.p.charsize EQ 0 THEN BEGIN
+   IF !P.Charsize EQ 0 THEN BEGIN
        IF N_Elements(charsize) EQ 0 THEN BEGIN
            !P.Charsize = cgDefCharsize(FONT=font)
        ENDIF ELSE !P.Charsize = charsize
diff --git a/cgps_setup__define.pro b/cgps_setup__define.pro
index 00c8d76..f94ad2a 100644
--- a/cgps_setup__define.pro
+++ b/cgps_setup__define.pro
@@ -84,11 +84,7 @@ PRO cgPS_SETUP__DEFINE
                tt_font:"", $          ; The name of the True-Type font in effect.
                tt_font_old:"", $      ; The name of the  True-Type font in effect before entering PostScript device.
                font: 0, $             ; The type of font being used. -1 Hershey, 0 PostScript, 1 True-type
-               rasterFileType: "", $  ; The type of raster file to be created from the PostScript file.
-               p: !P, $               ; The plotting system variable.
-               x: !X, $               ; The X axis system variable.
-               y: !Y, $               ; The Y axis system variable.
-               z: !Z $                ; The Z axis system variable.
+               rasterFileType: ""  $  ; The type of raster file to be created from the PostScript file.
               }
             
 END ;---------------------------------------------------------------