summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jennings <mej@lanl.gov>2020-02-28 17:06:54 -0700
committerMichael Jennings <mej@lanl.gov>2020-02-28 17:06:54 -0700
commit5d475d010500ffaf1801266e7d1d99f7494b114e (patch)
tree0c38ac261f813ade37e69fc644bfaadaee6b5463
parent37d7e09045f5c4035f749cad4ffa7f5808f3f230 (diff)
src/*.c, Eterm.spec: Various build fixes
Several changes here to make it build on RHEL/CentOS 8: - Replace outdated MEMSET() macro with (g)libc memset() - Update Release field to use `git describe` just like LibAST - Fix `make distcheck` by adding an uninstall-hook for src/gdb.scr - At long last, remove the ancient RPM %changelog content - Fix incompatibility with my traditional choices for CFLAGS (-O0 -g3) and modern RHEL security/hardening goop which, due to being implemented in the GCC optimizer, is rendered non-functional by building with -O0! - Rename backgrounds tarball so that it doesn't have the Eterm version in its name since, shockingly, it never changes based on the version of Eterm!
-rw-r--r--Eterm.spec113
-rw-r--r--src/Makefile.am9
-rw-r--r--src/buttons.c4
-rw-r--r--src/command.c8
-rw-r--r--src/encoding.c4
-rw-r--r--src/events.c2
-rw-r--r--src/font.c12
-rw-r--r--src/menus.c4
-rw-r--r--src/options.c14
-rw-r--r--src/pixmap.c8
-rw-r--r--src/screen.c10
-rw-r--r--src/scrollbar.c2
-rw-r--r--src/startup.c2
-rw-r--r--src/utmp.c8
14 files changed, 59 insertions, 141 deletions
diff --git a/Eterm.spec b/Eterm.spec
index 26f095b..759f112 100644
--- a/Eterm.spec
+++ b/Eterm.spec
@@ -1,22 +1,23 @@
1%{!?_rel:%{expand:%%global _rel 0.%(git describe --abbrev=4 --always --tags --long --dirty=.1 | cut -d- -f 2- | tr '-' '.')}}
2
1%if %{!?compression:1}0 3%if %{!?compression:1}0
2%define compression gz 4%define compression gz
3%endif 5%endif
4 6
5%define __os_install_post /usr/lib/rpm/brp-compress 7%define __os_install_post /usr/lib/rpm/brp-compress
6%if %{?optflags:1}0 8%if %{?optflags:1}0
7%define optflags ${RPM_OPT_FLAGS:--O0 -g3} 9%{expand:%%define optflags %{!?el8:${RPM_OPT_FLAGS:--O0 -g3}}%{?el8:-O2 -ggdb3 -fPIC}}
8%endif 10%endif
9 11
10Summary: Enlightened terminal emulator 12Summary: Enlightened terminal emulator
11Name: Eterm 13Name: Eterm
12Version: 0.9.7 14Version: 0.9.7
13#Release: 1 15Release: %{_rel}%{?dist}
14Release: 0.%(date '+%Y%m%d')
15License: BSD 16License: BSD
16Group: User Interface/X 17Group: User Interface/X
17URL: http://www.eterm.org/ 18URL: http://www.eterm.org/
18Source0: http://www.eterm.org/download/%{name}-%{version}.tar.%{compression} 19Source0: http://www.eterm.org/download/%{name}-%{version}.tar.%{compression}
19Source1: http://www.eterm.org/download/%{name}-bg-%{version}.tar.%{compression} 20Source1: http://www.eterm.org/download/%{name}-backgrounds.tar.%{compression}
20#BuildSuggests: xorg-x11-devel, XFree86-devel, xorg-x11-proto-devel, libXext-devel, libXt-devel, freetype-devel 21#BuildSuggests: xorg-x11-devel, XFree86-devel, xorg-x11-proto-devel, libXext-devel, libXt-devel, freetype-devel
21BuildRequires: libast, imlib2-devel 22BuildRequires: libast, imlib2-devel
22Requires: imlib2, imlib2-loader_jpeg, imlib2-loader_png 23Requires: imlib2, imlib2-loader_jpeg, imlib2-loader_png
@@ -31,9 +32,11 @@ various themes and is very configurable, in keeping with the
31philosophy of Enlightenment. If you install Eterm, you'll also need to 32philosophy of Enlightenment. If you install Eterm, you'll also need to
32have the Imlib2 library installed. 33have the Imlib2 library installed.
33 34
35
34%prep 36%prep
35%setup -a 1 37%setup -a 1
36 38
39
37%build 40%build
38CFLAGS="%{optflags}" 41CFLAGS="%{optflags}"
39export CFLAGS 42export CFLAGS
@@ -46,6 +49,7 @@ export CFLAGS
46 --with-debugging=9 %{?acflags} 49 --with-debugging=9 %{?acflags}
47%{__make} %{?mflags} 50%{__make} %{?mflags}
48 51
52
49%install 53%install
50%{__rm} -rf $RPM_BUILD_ROOT 54%{__rm} -rf $RPM_BUILD_ROOT
51 55
@@ -74,6 +78,7 @@ Type=Application
74EOF 78EOF
75chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/Utilities/Eterm.desktop 79chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/Utilities/Eterm.desktop
76 80
81
77%post 82%post
78/sbin/ldconfig || : 83/sbin/ldconfig || :
79 84
@@ -81,12 +86,15 @@ if [ -d /usr/share/terminfo -a ! -f /usr/share/terminfo/E/Eterm ]; then
81 tic -o/usr/share/terminfo %{_docdir}/%{name}-%{version}/%{name}.ti || : 86 tic -o/usr/share/terminfo %{_docdir}/%{name}-%{version}/%{name}.ti || :
82fi 87fi
83 88
89
84%postun 90%postun
85/sbin/ldconfig || : 91/sbin/ldconfig || :
86 92
93
87%clean 94%clean
88rm -rf $RPM_BUILD_ROOT 95rm -rf $RPM_BUILD_ROOT
89 96
97
90%files 98%files
91%defattr(-, root, root) 99%defattr(-, root, root)
92%doc doc/Eterm_reference.html doc/Eterm.1.html doc/Eterm.tcap doc/Eterm.ti doc/README.Escreen 100%doc doc/Eterm_reference.html doc/Eterm.1.html doc/Eterm.tcap doc/Eterm.ti doc/README.Escreen
@@ -97,100 +105,5 @@ rm -rf $RPM_BUILD_ROOT
97%{_mandir}/man1/* 105%{_mandir}/man1/*
98%{_datadir}/%{name}/* 106%{_datadir}/%{name}/*
99 107
108
100%changelog 109%changelog
101* Tue Feb 20 2001 Tim Powers <timp@redhat.com>
102- builds on Alpha now. No need to excludearch (bug 28472)
103
104* Wed Feb 14 2001 Tim Powers <timp@redhat.com>
105- removed images which are from Digital Blasphemy from the extra
106 images tarball, had to delete those images because they are not
107 allowed to be redistributed on CD, or in compressed format
108
109* Tue Jan 9 2001 Tim Powers <timp@redhat.com>
110- fixed a bunch of pre and post in/uninstall brokenness by dropping
111 split backgrounds package, backgrounds now included in Eterm
112 proper. This also makes the spec file a lot cleaner :)
113
114* Sat Aug 19 2000 Tim Powers <timp@redhat.com>
115- fix bug #15687
116
117* Tue Aug 8 2000 Tim Powers <timp@redhat.com>
118- fixed bug #15687 using Hans' patch
119
120* Wed Aug 2 2000 Tim Powers <timp@redhat.com>
121- rebuilt against libpng-1.0.8
122
123* Mon Jul 24 2000 Prospector <prospector@redhat.com>
124- rebuilt
125
126* Sat Jul 22 2000 Tim Powers <timp@redhat.com>
127- fix spec file problem with configure picking up egcs and running with it,
128 fixes linking bugs
129
130* Mon Jul 10 2000 Tim Powers <timp@redhat.com>
131- rebuilt
132
133* Fri Jun 2 2000 Tim Powers <timp@redhat.com>
134- no more wmconfig :) converted to applnk
135- fix man page location. Now FHS compliant
136- use macros wherever possible
137- removed redundant defines at the top of the spec
138
139* Mon Apr 10 2000 Tim Powers <timp@redhat.com>
140- rebuilt for 7.0
141
142* Thu Feb 03 2000 Tim Powers <timp@redhat.com>
143- strip debug from libraries
144
145* Wed Feb 02 2000 Tim Powers <timp@redhat.com>
146- fixed problems when upgrading and error messages due to a faulty script in
147 the post section for the Eterm package
148
149* Tue Feb 01 2000 Tim Powers <timp@redhat.com>
150- applied patch from Hans de Goede <hans@highrise.nl> to fix some del, home
151 and end issues
152
153* Fri Jan 29 2000 Tim Powers <timp@redhat.com>
154- rebuilt for 6.2 powertools
155- bzipped source to conserve space
156- using percent configure so that libtoolize is run, needed for some of the
157 newer alphas instead of ./configure --prefix=
158- stripping binaries again
159
160* Fri Dec 10 1999 Michael Jennings <mej@eterm.org>
161- Added Tim's spec file to CVS as Eterm.spec.in for 0.9
162
163* Wed Dec 8 1999 Tim Powers <timp@redhat.com>
164- using unified patch for utempter and themes from Michael Jennings
165
166* Tue Dec 7 1999 Tim Powers <timp@redhat.com>
167- added wmconfig entry
168- split up into 2 packages, Eterm proper, and Eterm-backgrounds
169- thanks to ewt, we no longer have to make Eterm suid root, uses utempter
170 instead
171
172* Mon Dec 6 1999 Tim Powers <timp@redhat.com>
173- updated to 0.8.10
174- patched so that Eterm finds pix/themes in the right place
175- new version fixes problems with utmp, conforms to Eterm docs.
176- added RedHat.Eterm_suid which includes instructions on how to run Eterm in
177 order to have it seen by "w" and "who" as a regular user
178
179* Fri Aug 20 1999 Tim Powers <timp@redhat.com>
180- fixed roblem with removing all files when uninstalling Eterm.
181
182* Tue Jul 27 1999 Tim Powers <timp@redhat.com>
183- updated version to 0.8.9
184- cleaned up spec
185- updated patch
186- includes new backgrounds
187- built for 6.1
188
189* Mon Apr 05 1999 Michael Maher <mike@redhat.com>
190- update to 0.8.8
191
192* Fri Oct 23 1998 Jeff Johnson <jbj@redhat.com>
193- update to 0.8.7.
194
195* Fri Oct 08 1998 Michael Maher <mike@redhat.com>
196- built eterm
diff --git a/src/Makefile.am b/src/Makefile.am
index caaf5e9..52cf4f8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,8 +40,13 @@ Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
40Eterm_LDADD = libEterm.la 40Eterm_LDADD = libEterm.la
41 41
42EXTRA_DIST = gdb.scr mmx_cmod.S sse2_cmod.c 42EXTRA_DIST = gdb.scr mmx_cmod.S sse2_cmod.c
43MAINTAINERCLEANFILES = Makefile.in
44DISTCLEANFILES = Makefile
43 45
44install-exec-hook: 46install-exec-hook:
45 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) 47 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
46 test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) $(srcdir)/gdb.scr $(DESTDIR)$(pkgdatadir)/ || : 48 -test ! -z "$(GDB_CMD_FILE)" && $(INSTALL_DATA) $(srcdir)/gdb.scr $(DESTDIR)$(pkgdatadir)/
47MAINTAINERCLEANFILES=Makefile.in 49
50uninstall-hook:
51 $(RM) $(DESTDIR)$(pkgdatadir)/gdb.scr
52
diff --git a/src/buttons.c b/src/buttons.c
index 1c42d5a..21946ad 100644
--- a/src/buttons.c
+++ b/src/buttons.c
@@ -84,7 +84,7 @@ buttonbar_t *bbar_create(void)
84 XSetWindowAttributes xattr; 84 XSetWindowAttributes xattr;
85 85
86 bbar = (buttonbar_t *) MALLOC(sizeof(buttonbar_t)); 86 bbar = (buttonbar_t *) MALLOC(sizeof(buttonbar_t));
87 MEMSET(bbar, 0, sizeof(buttonbar_t)); 87 memset(bbar, 0, sizeof(buttonbar_t));
88 88
89 xattr.border_pixel = BlackPixel(Xdisplay, Xscreen); 89 xattr.border_pixel = BlackPixel(Xdisplay, Xscreen);
90 xattr.save_under = FALSE; 90 xattr.save_under = FALSE;
@@ -749,7 +749,7 @@ button_t *button_create(char *text)
749 button_t *button; 749 button_t *button;
750 750
751 button = (button_t *) MALLOC(sizeof(button_t)); 751 button = (button_t *) MALLOC(sizeof(button_t));
752 MEMSET(button, 0, sizeof(button_t)); 752 memset(button, 0, sizeof(button_t));
753 753
754 if (text) { 754 if (text) {
755 button->text = STRDUP(text); 755 button->text = STRDUP(text);
diff --git a/src/command.c b/src/command.c
index cd3f27e..bd6db62 100644
--- a/src/command.c
+++ b/src/command.c
@@ -2831,7 +2831,7 @@ matrix(int n)
2831 return; 2831 return;
2832 } 2832 }
2833 2833
2834 MEMSET(s, 0, TERM_WINDOW_GET_COLS()); 2834 memset(s, 0, TERM_WINDOW_GET_COLS());
2835#define MATRIX_HI CLEAR 2835#define MATRIX_HI CLEAR
2836#define MATRIX_LO ((4<<8)|CLEAR) 2836#define MATRIX_LO ((4<<8)|CLEAR)
2837 2837
@@ -3195,7 +3195,7 @@ tt_winsize(int fd)
3195 if (fd < 0) 3195 if (fd < 0)
3196 return; 3196 return;
3197 3197
3198 MEMSET(&ws, 0, sizeof(struct winsize)); 3198 memset(&ws, 0, sizeof(struct winsize));
3199 3199
3200 ws.ws_row = (unsigned short) TERM_WINDOW_GET_REPORTED_ROWS(); 3200 ws.ws_row = (unsigned short) TERM_WINDOW_GET_REPORTED_ROWS();
3201 ws.ws_col = (unsigned short) TERM_WINDOW_GET_REPORTED_COLS(); 3201 ws.ws_col = (unsigned short) TERM_WINDOW_GET_REPORTED_COLS();
@@ -3725,9 +3725,9 @@ main_loop(void)
3725 } 3725 }
3726 3726
3727 libast_print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen)); 3727 libast_print_warning("Moo2: %s\n", safe_print_string(outbuff, outlen));
3728 MEMSET(outbuff + outlen, 0, sizeof(wchar_t)); 3728 memset(outbuff + outlen, 0, sizeof(wchar_t));
3729 wcbuff = (wchar_t *) outbuff; 3729 wcbuff = (wchar_t *) outbuff;
3730 MEMSET(&mbs, 0, sizeof(mbstate_t)); 3730 memset(&mbs, 0, sizeof(mbstate_t));
3731 outlen = wcsrtombs(NULL, &wcbuff, 0, &mbs) + 1; 3731 outlen = wcsrtombs(NULL, &wcbuff, 0, &mbs) + 1;
3732 if (outlen > 0) { 3732 if (outlen > 0) {
3733 outbuff = (char *) MALLOC(outlen); 3733 outbuff = (char *) MALLOC(outlen);
diff --git a/src/encoding.c b/src/encoding.c
index 7ec76cf..7f274b9 100644
--- a/src/encoding.c
+++ b/src/encoding.c
@@ -184,7 +184,7 @@ static enc_context_t *enc_create_context(const char *id)
184 enc_context_t *tmp; 184 enc_context_t *tmp;
185 185
186 tmp = (enc_context_t *) MALLOC(sizeof(enc_context_t)); 186 tmp = (enc_context_t *) MALLOC(sizeof(enc_context_t));
187 MEMSET(tmp, 0, sizeof(enc_context_t)); 187 memset(tmp, 0, sizeof(enc_context_t));
188 tmp->id = STRDUP(id); 188 tmp->id = STRDUP(id);
189 return tmp; 189 return tmp;
190} 190}
@@ -204,7 +204,7 @@ static enc_state_t *enc_create_state(const char *id, unsigned char lifetime)
204 enc_state_t *tmp; 204 enc_state_t *tmp;
205 205
206 tmp = (enc_state_t *) MALLOC(sizeof(enc_state_t)); 206 tmp = (enc_state_t *) MALLOC(sizeof(enc_state_t));
207 MEMSET(tmp, 0, sizeof(enc_state_t)); 207 memset(tmp, 0, sizeof(enc_state_t));
208 tmp->id = STRDUP(id); 208 tmp->id = STRDUP(id);
209 tmp->lifetime = lifetime; 209 tmp->lifetime = lifetime;
210 return tmp; 210 return tmp;
diff --git a/src/events.c b/src/events.c
index 43f255d..ecf1744 100644
--- a/src/events.c
+++ b/src/events.c
@@ -133,7 +133,7 @@ void
133event_init_primary_dispatcher(void) 133event_init_primary_dispatcher(void)
134{ 134{
135 135
136 MEMSET(&primary_data, 0, sizeof(event_dispatcher_data_t)); 136 memset(&primary_data, 0, sizeof(event_dispatcher_data_t));
137 137
138 EVENT_DATA_ADD_HANDLER(primary_data, KeyPress, handle_key_press); 138 EVENT_DATA_ADD_HANDLER(primary_data, KeyPress, handle_key_press);
139 EVENT_DATA_ADD_HANDLER(primary_data, PropertyNotify, handle_property_notify); 139 EVENT_DATA_ADD_HANDLER(primary_data, PropertyNotify, handle_property_notify);
diff --git a/src/font.c b/src/font.c
index 4051f64..1feede9 100644
--- a/src/font.c
+++ b/src/font.c
@@ -79,23 +79,23 @@ eterm_font_add(char ***plist, const char *fontname, unsigned char idx)
79 79
80 /* The below looks messy with all the cpp stuff, but it really just malloc's/realloc's 80 /* The below looks messy with all the cpp stuff, but it really just malloc's/realloc's
81 both etfonts and etmfonts at the same time to the same size, zeros all the new 81 both etfonts and etmfonts at the same time to the same size, zeros all the new
82 memory space using MEMSET(), and then prints some goop. */ 82 memory space using memset(), and then prints some goop. */
83 if (etfonts) { 83 if (etfonts) {
84 etfonts = (char **) REALLOC(etfonts, new_size); 84 etfonts = (char **) REALLOC(etfonts, new_size);
85 MEMSET(etfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1)); 85 memset(etfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
86#ifdef MULTI_CHARSET 86#ifdef MULTI_CHARSET
87 etmfonts = (char **) REALLOC(etmfonts, new_size); 87 etmfonts = (char **) REALLOC(etmfonts, new_size);
88 MEMSET(etmfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1)); 88 memset(etmfonts + font_cnt, 0, sizeof(char *) * (idx - font_cnt + 1));
89 D_FONT((" -> Reallocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts)); 89 D_FONT((" -> Reallocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts));
90#else 90#else
91 D_FONT((" -> Reallocated font list: %u bytes at %8p\n", new_size, etfonts)); 91 D_FONT((" -> Reallocated font list: %u bytes at %8p\n", new_size, etfonts));
92#endif 92#endif
93 } else { 93 } else {
94 etfonts = (char **) MALLOC(new_size); 94 etfonts = (char **) MALLOC(new_size);
95 MEMSET(etfonts, 0, new_size); 95 memset(etfonts, 0, new_size);
96#ifdef MULTI_CHARSET 96#ifdef MULTI_CHARSET
97 etmfonts = (char **) MALLOC(new_size); 97 etmfonts = (char **) MALLOC(new_size);
98 MEMSET(etmfonts, 0, new_size); 98 memset(etmfonts, 0, new_size);
99 D_FONT((" -> Allocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts)); 99 D_FONT((" -> Allocated font lists: %u bytes at %8p/%8p\n", new_size, etfonts, etmfonts));
100#else 100#else
101 D_FONT((" -> Allocating font list: %u bytes at %8p\n", new_size, etfonts)); 101 D_FONT((" -> Allocating font list: %u bytes at %8p\n", new_size, etfonts));
@@ -751,7 +751,7 @@ parse_font_fx(char *line)
751 n = spiftool_num_words(line); 751 n = spiftool_num_words(line);
752 752
753 if (!BEG_STRCASECMP(line, "none")) { 753 if (!BEG_STRCASECMP(line, "none")) {
754 MEMSET(&fshadow, 0, sizeof(fontshadow_t)); 754 memset(&fshadow, 0, sizeof(fontshadow_t));
755 } else if (!BEG_STRCASECMP(line, "outline")) { 755 } else if (!BEG_STRCASECMP(line, "outline")) {
756 if (n != 2) { 756 if (n != 2) {
757 return 0; 757 return 0;
diff --git a/src/menus.c b/src/menus.c
index 0b7ea67..f8306d6 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -471,7 +471,7 @@ menu_t *menu_create(char *title)
471 | Button1MotionMask | Button2MotionMask | Button3MotionMask; 471 | Button1MotionMask | Button2MotionMask | Button3MotionMask;
472 } 472 }
473 menu = (menu_t *) MALLOC(sizeof(menu_t)); 473 menu = (menu_t *) MALLOC(sizeof(menu_t));
474 MEMSET(menu, 0, sizeof(menu_t)); 474 memset(menu, 0, sizeof(menu_t));
475 menu->title = STRDUP(title ? title : ""); 475 menu->title = STRDUP(title ? title : "");
476 476
477 menu->win = 477 menu->win =
@@ -715,7 +715,7 @@ menuitem_t *menuitem_create(char *text)
715 menuitem_t *menuitem; 715 menuitem_t *menuitem;
716 716
717 menuitem = (menuitem_t *) MALLOC(sizeof(menuitem_t)); 717 menuitem = (menuitem_t *) MALLOC(sizeof(menuitem_t));
718 MEMSET(menuitem, 0, sizeof(menuitem_t)); 718 memset(menuitem, 0, sizeof(menuitem_t));
719 719
720 if (text) { 720 if (text) {
721 menuitem->text = STRDUP(text); 721 menuitem->text = STRDUP(text);
diff --git a/src/options.c b/src/options.c
index aa19b9a..7531aa6 100644
--- a/src/options.c
+++ b/src/options.c
@@ -1731,11 +1731,11 @@ parse_image(char *buff, void *state)
1731 return NULL; 1731 return NULL;
1732 } 1732 }
1733 if (new) { 1733 if (new) {
1734 MEMSET(images[idx].current, 0, sizeof(simage_t)); 1734 memset(images[idx].current, 0, sizeof(simage_t));
1735 images[idx].current->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t)); 1735 images[idx].current->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
1736 images[idx].current->iml = (imlib_t *) MALLOC(sizeof(imlib_t)); 1736 images[idx].current->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
1737 MEMSET(images[idx].current->pmap, 0, sizeof(pixmap_t)); 1737 memset(images[idx].current->pmap, 0, sizeof(pixmap_t));
1738 MEMSET(images[idx].current->iml, 0, sizeof(imlib_t)); 1738 memset(images[idx].current->iml, 0, sizeof(imlib_t));
1739 } 1739 }
1740 } else if (!BEG_STRCASECMP(buff, "color ")) { 1740 } else if (!BEG_STRCASECMP(buff, "color ")) {
1741 char *fg = spiftool_get_word(2, buff), *bg = spiftool_get_word(3, buff); 1741 char *fg = spiftool_get_word(2, buff), *bg = spiftool_get_word(3, buff);
@@ -2546,10 +2546,10 @@ init_defaults(void)
2546 rs_path = NULL; 2546 rs_path = NULL;
2547#endif 2547#endif
2548 colorfgbg = DEFAULT_RSTYLE; 2548 colorfgbg = DEFAULT_RSTYLE;
2549 MEMSET(PixColors, 0, sizeof(PixColors)); 2549 memset(PixColors, 0, sizeof(PixColors));
2550 2550
2551 /* Font stuff. */ 2551 /* Font stuff. */
2552 MEMSET(rs_font, 0, sizeof(char *) * NFONTS); 2552 memset(rs_font, 0, sizeof(char *) * NFONTS);
2553#if AUTO_ENCODING 2553#if AUTO_ENCODING
2554 /* Auto-encoding means the default fonts are chosen by locale. */ 2554 /* Auto-encoding means the default fonts are chosen by locale. */
2555# ifdef MULTI_CHARSET 2555# ifdef MULTI_CHARSET
@@ -2756,8 +2756,8 @@ post_parse(void)
2756 simg->iml = (imlib_t *) MALLOC(sizeof(imlib_t)); 2756 simg->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
2757 simg->fg = WhitePixel(Xdisplay, Xscreen); 2757 simg->fg = WhitePixel(Xdisplay, Xscreen);
2758 simg->bg = BlackPixel(Xdisplay, Xscreen); 2758 simg->bg = BlackPixel(Xdisplay, Xscreen);
2759 MEMSET(simg->pmap, 0, sizeof(pixmap_t)); 2759 memset(simg->pmap, 0, sizeof(pixmap_t));
2760 MEMSET(simg->iml, 0, sizeof(imlib_t)); 2760 memset(simg->iml, 0, sizeof(imlib_t));
2761 images[i].mode = MODE_IMAGE & ALLOW_IMAGE; 2761 images[i].mode = MODE_IMAGE & ALLOW_IMAGE;
2762 } 2762 }
2763 images[i].current = simg; 2763 images[i].current = simg;
diff --git a/src/pixmap.c b/src/pixmap.c
index b544ad0..2403b62 100644
--- a/src/pixmap.c
+++ b/src/pixmap.c
@@ -357,7 +357,7 @@ image_t *create_eterm_image(void)
357 image_t *i; 357 image_t *i;
358 358
359 i = (image_t *) MALLOC(sizeof(image_t)); 359 i = (image_t *) MALLOC(sizeof(image_t));
360 MEMSET(i, 0, sizeof(image_t)); 360 memset(i, 0, sizeof(image_t));
361 return (i); 361 return (i);
362} 362}
363 363
@@ -431,11 +431,11 @@ simage_t *create_simage(void)
431 simage_t *s; 431 simage_t *s;
432 432
433 s = (simage_t *) MALLOC(sizeof(simage_t)); 433 s = (simage_t *) MALLOC(sizeof(simage_t));
434 MEMSET(s, 0, sizeof(simage_t)); 434 memset(s, 0, sizeof(simage_t));
435 s->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t)); 435 s->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
436 s->iml = (imlib_t *) MALLOC(sizeof(imlib_t)); 436 s->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
437 MEMSET(s->pmap, 0, sizeof(pixmap_t)); 437 memset(s->pmap, 0, sizeof(pixmap_t));
438 MEMSET(s->iml, 0, sizeof(imlib_t)); 438 memset(s->iml, 0, sizeof(imlib_t));
439 return s; 439 return s;
440} 440}
441 441
diff --git a/src/screen.c b/src/screen.c
index ed41535..582cdde 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -109,7 +109,7 @@ blank_line(text_t *et, rend_t *er, int width, rend_t efs)
109 register unsigned int i = width; 109 register unsigned int i = width;
110 rend_t *r = er, fs = efs; 110 rend_t *r = er, fs = efs;
111 111
112 MEMSET(et, ' ', i); 112 memset(et, ' ', i);
113 for (; i--;) 113 for (; i--;)
114 *r++ = fs; 114 *r++ = fs;
115} 115}
@@ -126,7 +126,7 @@ blank_screen_mem(text_t **tp, rend_t **rp, int row, rend_t efs)
126 tp[row] = MALLOC(sizeof(text_t) * (TERM_WINDOW_GET_REPORTED_COLS() + 1)); 126 tp[row] = MALLOC(sizeof(text_t) * (TERM_WINDOW_GET_REPORTED_COLS() + 1));
127 rp[row] = MALLOC(sizeof(rend_t) * TERM_WINDOW_GET_REPORTED_COLS()); 127 rp[row] = MALLOC(sizeof(rend_t) * TERM_WINDOW_GET_REPORTED_COLS());
128 } 128 }
129 MEMSET(tp[row], ' ', i); 129 memset(tp[row], ' ', i);
130 tp[row][i] = 0; 130 tp[row][i] = 0;
131 for (r = rp[row]; i--;) 131 for (r = rp[row]; i--;)
132 *r++ = fs; 132 *r++ = fs;
@@ -355,7 +355,7 @@ scr_poweron(void)
355 D_SCREEN(("scr_poweron()\n")); 355 D_SCREEN(("scr_poweron()\n"));
356 356
357 /* Reset all character sets to Latin1 */ 357 /* Reset all character sets to Latin1 */
358 MEMSET(charsets, 'B', sizeof(charsets)); 358 memset(charsets, 'B', sizeof(charsets));
359 rvideo = 0; 359 rvideo = 0;
360 /* Reset the rendering style to the default colors/style */ 360 /* Reset the rendering style to the default colors/style */
361 scr_rendition(0, ~RS_None); 361 scr_rendition(0, ~RS_None);
@@ -1304,7 +1304,7 @@ void
1304scr_set_tab(int mode) 1304scr_set_tab(int mode)
1305{ 1305{
1306 if (mode < 0) 1306 if (mode < 0)
1307 MEMSET(tabs, 0, (unsigned int) TERM_WINDOW_GET_REPORTED_COLS()); 1307 memset(tabs, 0, (unsigned int) TERM_WINDOW_GET_REPORTED_COLS());
1308 1308
1309 else if (screen.col < TERM_WINDOW_GET_REPORTED_COLS()) 1309 else if (screen.col < TERM_WINDOW_GET_REPORTED_COLS())
1310 tabs[screen.col] = (mode ? 1 : 0); 1310 tabs[screen.col] = (mode ? 1 : 0);
@@ -1510,7 +1510,7 @@ scr_expose(int x, int y, int width, int height)
1510 rect_end.col, rect_end.row)); 1510 rect_end.col, rect_end.row));
1511 1511
1512 for (i = rect_beg.row; i <= rect_end.row; i++) { 1512 for (i = rect_beg.row; i <= rect_end.row; i++) {
1513 MEMSET(&(drawn_text[i][rect_beg.col]), 0, rect_end.col - rect_beg.col + 1); 1513 memset(&(drawn_text[i][rect_beg.col]), 0, rect_end.col - rect_beg.col + 1);
1514 } 1514 }
1515} 1515}
1516 1516
diff --git a/src/scrollbar.c b/src/scrollbar.c
index 2c3fc3b..91189eb 100644
--- a/src/scrollbar.c
+++ b/src/scrollbar.c
@@ -73,7 +73,7 @@ void
73scrollbar_event_init_dispatcher(void) 73scrollbar_event_init_dispatcher(void)
74{ 74{
75 75
76 MEMSET(&scrollbar_event_data, 0, sizeof(event_dispatcher_data_t)); 76 memset(&scrollbar_event_data, 0, sizeof(event_dispatcher_data_t));
77 77
78 EVENT_DATA_ADD_HANDLER(scrollbar_event_data, EnterNotify, sb_handle_enter_notify); 78 EVENT_DATA_ADD_HANDLER(scrollbar_event_data, EnterNotify, sb_handle_enter_notify);
79 EVENT_DATA_ADD_HANDLER(scrollbar_event_data, LeaveNotify, sb_handle_leave_notify); 79 EVENT_DATA_ADD_HANDLER(scrollbar_event_data, LeaveNotify, sb_handle_leave_notify);
diff --git a/src/startup.c b/src/startup.c
index 576c60f..30cbd86 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -137,7 +137,7 @@ eterm_bootstrap(int argc, char *argv[])
137 get_modifiers(); /* Set up modifier masks before parsing config files. */ 137 get_modifiers(); /* Set up modifier masks before parsing config files. */
138 138
139 /* Get all our properties set up. */ 139 /* Get all our properties set up. */
140 MEMSET(props, 0, sizeof(props)); 140 memset(props, 0, sizeof(props));
141 props[PROP_TEXT] = XInternAtom(Xdisplay, "TEXT", False); 141 props[PROP_TEXT] = XInternAtom(Xdisplay, "TEXT", False);
142 props[PROP_COMPOUND_TEXT] = XInternAtom(Xdisplay, "COMPOUND_TEXT", False); 142 props[PROP_COMPOUND_TEXT] = XInternAtom(Xdisplay, "COMPOUND_TEXT", False);
143 props[PROP_UTF8_STRING] = XInternAtom(Xdisplay, "UTF8_STRING", False); 143 props[PROP_UTF8_STRING] = XInternAtom(Xdisplay, "UTF8_STRING", False);
diff --git a/src/utmp.c b/src/utmp.c
index 32c6745..daaa282 100644
--- a/src/utmp.c
+++ b/src/utmp.c
@@ -97,10 +97,10 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
97# ifdef HAVE_UTMPX_H 97# ifdef HAVE_UTMPX_H
98 struct utmpx utmp; 98 struct utmpx utmp;
99 struct utmp utmp2; 99 struct utmp utmp2;
100 MEMSET(&utmp, 0, sizeof(struct utmpx)); 100 memset(&utmp, 0, sizeof(struct utmpx));
101# else 101# else
102 struct utmp utmp; 102 struct utmp utmp;
103 MEMSET(&utmp, 0, sizeof(struct utmp)); 103 memset(&utmp, 0, sizeof(struct utmp));
104# endif 104# endif
105 105
106# ifdef WITH_DMALLOC 106# ifdef WITH_DMALLOC
@@ -336,7 +336,7 @@ add_utmp_entry(const char *pty, const char *hostname, int fd)
336 struct passwd *pwent = getpwuid(my_ruid); 336 struct passwd *pwent = getpwuid(my_ruid);
337 struct utmp utmp; 337 struct utmp utmp;
338 338
339 MEMSET(&utmp, 0, sizeof(struct utmp)); 339 memset(&utmp, 0, sizeof(struct utmp));
340 340
341 if (!strncmp(pty, "/dev/", 5)) 341 if (!strncmp(pty, "/dev/", 5))
342 pty += 5; /* skip /dev/ prefix */ 342 pty += 5; /* skip /dev/ prefix */
@@ -386,7 +386,7 @@ remove_utmp_entry(void)
386 privileges(INVOKE); 386 privileges(INVOKE);
387 if (!ut_id[0] && (fd = fopen(UTMP_FILENAME, "r+"))) { 387 if (!ut_id[0] && (fd = fopen(UTMP_FILENAME, "r+"))) {
388 struct utmp utmp; 388 struct utmp utmp;
389 MEMSET(&utmp, 0, sizeof(struct utmp)); 389 memset(&utmp, 0, sizeof(struct utmp));
390 390
391 fseek(fd, utmp_pos, 0); 391 fseek(fd, utmp_pos, 0);
392 fwrite(&utmp, sizeof(struct utmp), 1, fd); 392 fwrite(&utmp, sizeof(struct utmp), 1, fd);