>From a8d9f0810c8f1b7580098c75369386f56a159ab1 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <i...@extreme.hu>
Date: Mon, 15 Mar 2010 09:50:35 +0100
Subject: [PATCH] - unused wsmap, begone!
 - held only reference to wnew0, which was the only consumer of
   wmalloc0, safe trip both of them.

---
 WINGs/WINGs/WUtil.h |    2 -
 WINGs/memory.c      |   11 -------
 src/Makefile.am     |   13 --------
 src/wsmap.c         |   83 ---------------------------------------------------
 4 files changed, 0 insertions(+), 109 deletions(-)
 delete mode 100644 src/wsmap.c

diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h
index 7c3f2de..ee05c4b 100644
--- a/WINGs/WINGs/WUtil.h
+++ b/WINGs/WINGs/WUtil.h
@@ -237,12 +237,10 @@ char* wexpandpath(char *path);
 char* wgethomedir();
 
 void* wmalloc(size_t size);
-void* wmalloc0(size_t size);
 void* wrealloc(void *ptr, size_t newsize);
 void wfree(void *ptr);
 
 #define wnew(type, count) wmalloc(sizeof(type)*count)
-#define wnew0(type, count) wmalloc0(sizeof(type)*count)
 
 void wrelease(void *ptr);
 void* wretain(void *ptr);
diff --git a/WINGs/memory.c b/WINGs/memory.c
index 410de37..9d770b0 100644
--- a/WINGs/memory.c
+++ b/WINGs/memory.c
@@ -98,17 +98,6 @@ void *wmalloc(size_t size)
        return tmp;
 }
 
-void *wmalloc0(size_t size)
-{
-       void *ptr = wmalloc(size);
-       if (!ptr)
-               return NULL;
-
-       memset(ptr, 0, size);
-
-       return ptr;
-}
-
 void *wrealloc(void *ptr, size_t newsize)
 {
        void *nptr;
diff --git a/src/Makefile.am b/src/Makefile.am
index 21a8d82..64c6fde 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,12 +4,8 @@ BUILT_SOURCES = wconfig.h
 
 bin_PROGRAMS = wmaker
 
-#noinst_PROGRAMS = wsmap
-
 EXTRA_DIST = 
 
-#wsmap_SOURCES= wsmap.c
-
 wmaker_SOURCES =       \
        GNUstep.h \
        WindowMaker.h \
@@ -124,15 +120,6 @@ wmaker_LDADD = \
        @INTLIBS@ \
        @DLLIBS@
 
-#wsmap_LDADD = \
-#      $(top_builddir)/WINGs/libWINGs.a\
-#      $(top_builddir)/wrlib/libwraster.la\
-#      @XLFLAGS@ \
-#      @XFTLIBS@ \
-#      @XLIBS@ \
-#      @INTLIBS@ \
-#      @DLLIBS@
-
 LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
diff --git a/src/wsmap.c b/src/wsmap.c
deleted file mode 100644
index 1b9d3c9..0000000
--- a/src/wsmap.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#include "WindowMaker.h"
-#include "window.h"
-
-typedef struct {
-       WWindow *wwin;
-       WMLabel *mini;
-} WSMWindow;
-
-typedef struct {
-       WScreen *scr;
-
-       WMWindow *win;
-
-       WSMWindow *windows;
-       int windowCount;
-
-       int xcount, ycount;
-       int wswidth, wsheight;
-} WWorkspaceMap;
-
-#define WSMAP_DEFAULT_WIDTH 150
-
-static WWorkspaceMap *createWorkspaceMap(WMScreen * scr, int xcount, int 
ycount)
-{
-       WWorkspaceMap *wsm = wnew0(WWorkspaceMap, 1);
-       WMRect rect;
-       //
-       rect.width = 1024;
-       rect.height = 768;
-
-       wsm->win = WMCreateWindow(scr, "wsmap");
-
-       /* find out the ideal size of the mini-workspaces */
-
-       wsm->wswidth = WSMAP_DEFAULT_WIDTH;
-       wsm->wsheight = (wsm->wswidth * rect.height) / rect.width;
-
-       // check if it fits screen
-
-       wsm->xcount = xcount;
-       wsm->ycount = ycount;
-
-       return wsm;
-}
-
-static void handleEvent(WWorkspaceMap * map, XEvent * event)
-{
-       switch (event->type) {
-       }
-}
-
-void wShowWorkspaceMap(WScreen * scr)
-{
-
-}
-
-Display *dpy;
-
-int main(int argc, char **argv)
-{
-       WWorkspaceMap *wsmap;
-       WMScreen *scr;
-
-       WMInitializeApplication("WSMap", &argc, argv);
-
-       dpy = XOpenDisplay("");
-       if (!dpy) {
-               wfatal("cant open display");
-               exit(0);
-       }
-
-       scr = WMCreateSimpleApplicationScreen(dpy);
-
-       wsmap = createWorkspaceMap(scr);
-
-       WMRealizeWidget(wsmap->win);
-       WMMapWidget(wsmap->win);
-
-       WMScreenMainLoop(scr);
-
-       return 0;
-}
-- 
1.7.0


-- 
[-]

mkdir /nonexistent
From a8d9f0810c8f1b7580098c75369386f56a159ab1 Mon Sep 17 00:00:00 2001
From: Tamas TEVESZ <i...@extreme.hu>
Date: Mon, 15 Mar 2010 09:50:35 +0100
Subject: [PATCH] - unused wsmap, begone!
 - held only reference to wnew0, which was the only consumer of
   wmalloc0, safe trip both of them.

---
 WINGs/WINGs/WUtil.h |    2 -
 WINGs/memory.c      |   11 -------
 src/Makefile.am     |   13 --------
 src/wsmap.c         |   83 ---------------------------------------------------
 4 files changed, 0 insertions(+), 109 deletions(-)
 delete mode 100644 src/wsmap.c

diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h
index 7c3f2de..ee05c4b 100644
--- a/WINGs/WINGs/WUtil.h
+++ b/WINGs/WINGs/WUtil.h
@@ -237,12 +237,10 @@ char* wexpandpath(char *path);
 char* wgethomedir();
 
 void* wmalloc(size_t size);
-void* wmalloc0(size_t size);
 void* wrealloc(void *ptr, size_t newsize);
 void wfree(void *ptr);
 
 #define wnew(type, count) wmalloc(sizeof(type)*count)
-#define wnew0(type, count) wmalloc0(sizeof(type)*count)
 
 void wrelease(void *ptr);
 void* wretain(void *ptr);
diff --git a/WINGs/memory.c b/WINGs/memory.c
index 410de37..9d770b0 100644
--- a/WINGs/memory.c
+++ b/WINGs/memory.c
@@ -98,17 +98,6 @@ void *wmalloc(size_t size)
 	return tmp;
 }
 
-void *wmalloc0(size_t size)
-{
-	void *ptr = wmalloc(size);
-	if (!ptr)
-		return NULL;
-
-	memset(ptr, 0, size);
-
-	return ptr;
-}
-
 void *wrealloc(void *ptr, size_t newsize)
 {
 	void *nptr;
diff --git a/src/Makefile.am b/src/Makefile.am
index 21a8d82..64c6fde 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,12 +4,8 @@ BUILT_SOURCES = wconfig.h
 
 bin_PROGRAMS = wmaker
 
-#noinst_PROGRAMS = wsmap
-
 EXTRA_DIST = 
 
-#wsmap_SOURCES= wsmap.c
-
 wmaker_SOURCES = 	\
 	GNUstep.h \
 	WindowMaker.h \
@@ -124,15 +120,6 @@ wmaker_LDADD = \
 	@INTLIBS@ \
 	@DLLIBS@
 
-#wsmap_LDADD = \
-#	$(top_builddir)/WINGs/libWINGs.a\
-#	$(top_builddir)/wrlib/libwraster.la\
-#	@XLFLAGS@ \
-#	@XFTLIBS@ \
-#	@XLIBS@ \
-#	@INTLIBS@ \
-#	@DLLIBS@
-
 LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
 
 .c.o:
diff --git a/src/wsmap.c b/src/wsmap.c
deleted file mode 100644
index 1b9d3c9..0000000
--- a/src/wsmap.c
+++ /dev/null
@@ -1,83 +0,0 @@
-
-#include "WindowMaker.h"
-#include "window.h"
-
-typedef struct {
-	WWindow *wwin;
-	WMLabel *mini;
-} WSMWindow;
-
-typedef struct {
-	WScreen *scr;
-
-	WMWindow *win;
-
-	WSMWindow *windows;
-	int windowCount;
-
-	int xcount, ycount;
-	int wswidth, wsheight;
-} WWorkspaceMap;
-
-#define WSMAP_DEFAULT_WIDTH 150
-
-static WWorkspaceMap *createWorkspaceMap(WMScreen * scr, int xcount, int ycount)
-{
-	WWorkspaceMap *wsm = wnew0(WWorkspaceMap, 1);
-	WMRect rect;
-	//
-	rect.width = 1024;
-	rect.height = 768;
-
-	wsm->win = WMCreateWindow(scr, "wsmap");
-
-	/* find out the ideal size of the mini-workspaces */
-
-	wsm->wswidth = WSMAP_DEFAULT_WIDTH;
-	wsm->wsheight = (wsm->wswidth * rect.height) / rect.width;
-
-	// check if it fits screen
-
-	wsm->xcount = xcount;
-	wsm->ycount = ycount;
-
-	return wsm;
-}
-
-static void handleEvent(WWorkspaceMap * map, XEvent * event)
-{
-	switch (event->type) {
-	}
-}
-
-void wShowWorkspaceMap(WScreen * scr)
-{
-
-}
-
-Display *dpy;
-
-int main(int argc, char **argv)
-{
-	WWorkspaceMap *wsmap;
-	WMScreen *scr;
-
-	WMInitializeApplication("WSMap", &argc, argv);
-
-	dpy = XOpenDisplay("");
-	if (!dpy) {
-		wfatal("cant open display");
-		exit(0);
-	}
-
-	scr = WMCreateSimpleApplicationScreen(dpy);
-
-	wsmap = createWorkspaceMap(scr);
-
-	WMRealizeWidget(wsmap->win);
-	WMMapWidget(wsmap->win);
-
-	WMScreenMainLoop(scr);
-
-	return 0;
-}
-- 
1.7.0

Reply via email to