]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_screen.c
ncurses 6.4 - patch 20230429
[ncurses.git] / ncurses / base / lib_screen.c
index eacb03a606f14479117057cca464a1cb7aaae092..e2647b54e2ebad81063bcf5b3f7d2e9f145dbbad 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019-2020,2021 Thomas E. Dickey                                *
+ * Copyright 2019-2021,2023 Thomas E. Dickey                                *
  * Copyright 1998-2017,2018 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -42,7 +42,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_screen.c,v 1.103 2021/10/18 22:40:48 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.105 2023/04/28 20:58:54 tom Exp $")
 
 #define MAX_SIZE 0x3fff                /* 16k is big enough for a window or pad */
 
@@ -90,7 +90,6 @@ typedef struct {
 typedef struct {
     const char name[17];
     PARAM_TYPE type;
-    size_t size;
     size_t offset;
 } SCR_PARAMS;
 
@@ -120,8 +119,7 @@ static const SCR_ATTRS scr_attrs[] =
 };
 #undef DATA
 
-#define sizeof2(type,name) sizeof(((type *)0)->name)
-#define DATA(name, type) { { #name }, type, sizeof2(WINDOW, name), offsetof(WINDOW, name) }
+#define DATA(name, type) { { #name }, type, offsetof(WINDOW, name) }
 
 static const SCR_PARAMS scr_params[] =
 {
@@ -542,7 +540,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
        returnWin(0);
     }
 
-    if (tmp._flags & _ISPAD) {
+    if (IS_PAD(&tmp)) {
        nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
                                        tmp._maxy + 1,
                                        tmp._maxx + 1);
@@ -587,7 +585,7 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep)
        nwin->_regtop = tmp._regtop;
        nwin->_regbottom = tmp._regbottom;
 
-       if (tmp._flags & _ISPAD)
+       if (IS_PAD(&tmp))
            nwin->_pad = tmp._pad;
 
        if (old_format) {
@@ -824,7 +822,7 @@ putwin(WINDOW *win, FILE *filep)
            attr_t attr;
 
            *buffer = '\0';
-           if (!strncmp(name, "_pad.", (size_t) 5) && !(win->_flags & _ISPAD)) {
+           if (!strncmp(name, "_pad.", (size_t) 5) && !IS_PAD(win)) {
                continue;
            }
            switch (scr_params[y].type) {