aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c7
-rw-r--r--editors/diff.c2
-rw-r--r--editors/ed.c2
-rw-r--r--editors/vi.c2
4 files changed, 7 insertions, 6 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 983b31116..f04ea5ced 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -394,7 +394,8 @@ static const uint16_t PRIMES[] ALIGN2 = { 251, 1021, 4093, 16381, 65521 };
394/* Globals. Split in two parts so that first one is addressed 394/* Globals. Split in two parts so that first one is addressed
395 * with (mostly short) negative offsets */ 395 * with (mostly short) negative offsets */
396struct globals { 396struct globals {
397 chain beginseq, mainseq, endseq, *seq; 397 chain beginseq, mainseq, endseq;
398 chain *seq;
398 node *break_ptr, *continue_ptr; 399 node *break_ptr, *continue_ptr;
399 rstream *iF; 400 rstream *iF;
400 xhash *vhash, *ahash, *fdhash, *fnhash; 401 xhash *vhash, *ahash, *fdhash, *fnhash;
@@ -445,7 +446,7 @@ struct globals2 {
445 tsplitter fsplitter, rsplitter; 446 tsplitter fsplitter, rsplitter;
446}; 447};
447#define G1 (ptr_to_globals[-1]) 448#define G1 (ptr_to_globals[-1])
448#define G (*(struct globals2 *const)ptr_to_globals) 449#define G (*(struct globals2 *)ptr_to_globals)
449/* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */ 450/* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */
450/* char G1size[sizeof(G1)]; - 0x6c */ 451/* char G1size[sizeof(G1)]; - 0x6c */
451/* char Gsize[sizeof(G)]; - 0x1cc */ 452/* char Gsize[sizeof(G)]; - 0x1cc */
@@ -485,7 +486,7 @@ struct globals2 {
485#define fsplitter (G.fsplitter ) 486#define fsplitter (G.fsplitter )
486#define rsplitter (G.rsplitter ) 487#define rsplitter (G.rsplitter )
487#define INIT_G() do { \ 488#define INIT_G() do { \
488 PTR_TO_GLOBALS = xzalloc(sizeof(G1) + sizeof(G)) + sizeof(G1); \ 489 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G1) + sizeof(G)) + sizeof(G1)); \
489 G.next_token__ltclass = TC_OPTERM; \ 490 G.next_token__ltclass = TC_OPTERM; \
490 G.evaluate__seed = 1; \ 491 G.evaluate__seed = 1; \
491} while (0) 492} while (0)
diff --git a/editors/diff.c b/editors/diff.c
index 64b7daa11..8844ec1c0 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -151,7 +151,7 @@ struct globals {
151#define stb1 (G.stb1 ) 151#define stb1 (G.stb1 )
152#define stb2 (G.stb2 ) 152#define stb2 (G.stb2 )
153#define INIT_G() do { \ 153#define INIT_G() do { \
154 PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ 154 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
155 context = 3; \ 155 context = 3; \
156 max_context = 64; \ 156 max_context = 64; \
157} while (0) 157} while (0)
diff --git a/editors/ed.c b/editors/ed.c
index a569788ad..15f0147be 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -51,7 +51,7 @@ struct globals {
51#define lines (G.lines ) 51#define lines (G.lines )
52#define marks (G.marks ) 52#define marks (G.marks )
53#define INIT_G() do { \ 53#define INIT_G() do { \
54 PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ 54 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
55} while (0) 55} while (0)
56 56
57 57
diff --git a/editors/vi.c b/editors/vi.c
index 6f4bd06f2..d2d267036 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -233,7 +233,7 @@ struct globals {
233#define readbuffer (G.readbuffer ) 233#define readbuffer (G.readbuffer )
234#define scr_out_buf (G.scr_out_buf ) 234#define scr_out_buf (G.scr_out_buf )
235#define INIT_G() do { \ 235#define INIT_G() do { \
236 PTR_TO_GLOBALS = xzalloc(sizeof(G)); \ 236 SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
237} while (0) 237} while (0)
238 238
239static int init_text_buffer(char *); // init from file or create new 239static int init_text_buffer(char *); // init from file or create new