[Pkg-wmaker-commits] [wmaker] 26/40: Fixed couple of compilator warning and removed unused macros.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sat Mar 11 13:08:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmaker.

commit 6e4698fe112b2d7f91019e8e644ffe3e935f61f2
Author: Roman Dobosz <gryf73 at gmail.com>
Date:   Sat Feb 25 08:00:23 2017 +0100

    Fixed couple of compilator warning and removed unused macros.
---
 WINGs/wcolorpanel.c |  3 ---
 WINGs/wfontpanel.c  |  4 ++--
 WINGs/wsplitview.c  |  3 ---
 src/defaults.c      |  9 ++++-----
 src/wmspec.c        |  1 -
 src/workspace.c     |  1 -
 util/wmiv.c         | 11 ++++++-----
 7 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c
index 8aea1df..2cd1806 100644
--- a/WINGs/wcolorpanel.c
+++ b/WINGs/wcolorpanel.c
@@ -67,9 +67,6 @@ static unsigned char Cursor_bits[] = {
 	0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x70
 };
 
-/* Cursor shape-mask */
-#define Cursor_shape_width 32
-#define Cursor_shape_height 32
 static unsigned char Cursor_shape_bits[] = {
 	0x00, 0x7e, 0x00, 0x00, 0xc0, 0x81, 0x03, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x08,
 	0x00, 0x08, 0x00, 0x10, 0x00, 0x04, 0x00, 0x20, 0x00, 0x02, 0x00, 0x40, 0x00, 0x02, 0x00,
diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c
index 019c710..df01ed6 100644
--- a/WINGs/wfontpanel.c
+++ b/WINGs/wfontpanel.c
@@ -700,7 +700,7 @@ static void typefaceClick(WMWidget * w, void *data)
 
 	WM_ITERATE_ARRAY(face->sizes, size, i) {
 		if (size != NULL) {
-			int size_int = (int) size;
+			int size_int = (intptr_t) size;
 
 			sprintf(buffer, "%i", size_int);
 
@@ -802,7 +802,7 @@ static void setFontPanelFontName(FontPanel * panel, const char *family, const ch
 		char buffer[32];
 
 		if (vsize != NULL) {
-			int size_int = (int) vsize;
+			int size_int = (intptr_t) vsize;
 
 			sprintf(buffer, "%i", size_int);
 
diff --git a/WINGs/wsplitview.c b/WINGs/wsplitview.c
index 60d8601..3d8072d 100644
--- a/WINGs/wsplitview.c
+++ b/WINGs/wsplitview.c
@@ -41,9 +41,6 @@ typedef struct W_SplitView {
 /* TODO: rewrite --Dan */
 #define _GetSubviewsCount() WMGetArrayItemCount(sPtr->subviews)
 
-#define _AddPSubviewStruct(P) \
-    (WMAddToArray(sPtr->subviews,((void*)P)))
-
 #define _GetPSubviewStructAt(i) \
     ((W_SplitViewSubview*)WMGetFromArray(sPtr->subviews,(i)))
 
diff --git a/src/defaults.c b/src/defaults.c
index 0ccb82a..f295ce1 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -180,14 +180,13 @@ static WDECallbackUpdate setCursor;
 #define REFRESH_WINDOW_FONT	(1<<8)
 #define REFRESH_ICON_TILE	(1<<9)
 #define REFRESH_ICON_FONT	(1<<10)
-#define REFRESH_WORKSPACE_BACK	(1<<11)
 
-#define REFRESH_BUTTON_IMAGES   (1<<12)
+#define REFRESH_BUTTON_IMAGES   (1<<11)
 
-#define REFRESH_ICON_TITLE_COLOR (1<<13)
-#define REFRESH_ICON_TITLE_BACK (1<<14)
+#define REFRESH_ICON_TITLE_COLOR (1<<12)
+#define REFRESH_ICON_TITLE_BACK (1<<13)
 
-#define REFRESH_WORKSPACE_MENU	(1<<15)
+#define REFRESH_WORKSPACE_MENU	(1<<14)
 
 #define REFRESH_FRAME_BORDER REFRESH_MENU_FONT|REFRESH_WINDOW_FONT
 
diff --git a/src/wmspec.c b/src/wmspec.c
index 75fcdde..0249c64 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -213,7 +213,6 @@ static atomitem_t atomNames[] = {
 	{"UTF8_STRING", &utf8_string},
 };
 
-#define _NET_WM_STATE_REMOVE 0
 #define _NET_WM_STATE_ADD 1
 #define _NET_WM_STATE_TOGGLE 2
 
diff --git a/src/workspace.c b/src/workspace.c
index 23da1ef..640d481 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -52,7 +52,6 @@
 #include "wsmap.h"
 #include "dialog.h"
 
-#define MC_NEW          0
 #define MC_DESTROY_LAST 1
 #define MC_LAST_USED    2
 /* index of the first workspace menu entry */
diff --git a/util/wmiv.c b/util/wmiv.c
index e99e3e3..64e6eb5 100755
--- a/util/wmiv.c
+++ b/util/wmiv.c
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <getopt.h>
+#include <math.h>
 #include "config.h"
 
 #ifdef HAVE_EXIF
@@ -218,7 +219,7 @@ int rescale_image(void)
 	long final_height = img->height;
 
 	/* check if there is already a zoom factor applied */
-	if (zoom_factor != 0) {
+	if (fabsf(zoom_factor) <= 0.0f) {
 		final_width = img->width + (int)(img->width * zoom_factor);
 		final_height = img->height + (int)(img->height * zoom_factor);
 	}
@@ -430,7 +431,7 @@ int zoom_in_out(int z)
 		return EXIT_FAILURE;
 
 	if (z) {
-		zoom_factor += 0.2;
+		zoom_factor += 0.2f;
 		img = RScaleImage(tmp, tmp->width + (int)(tmp->width * zoom_factor),
 				tmp->height + (int)(tmp->height * zoom_factor));
 		if (!img) {
@@ -438,11 +439,11 @@ int zoom_in_out(int z)
 			return EXIT_FAILURE;
 		}
 	} else {
-		zoom_factor -= 0.2;
+		zoom_factor -= 0.2f;
 		int new_width = tmp->width + (int) (tmp->width * zoom_factor);
 		int new_height = tmp->height + (int)(tmp->height * zoom_factor);
 		if ((new_width <= 0) || (new_height <= 0)) {
-			zoom_factor += 0.2;
+			zoom_factor += 0.2f;
 			RReleaseImage(tmp);
 			return EXIT_FAILURE;
 		}
@@ -966,7 +967,7 @@ int main(int argc, char **argv)
 				break;
 			case XK_Escape:
 				if (!fullscreen_flag) {
-					zoom_factor = -0.2;
+					zoom_factor = -0.2f;
 					/* zoom_in will increase the zoom factor by 0.2 */
 					zoom_in();
 				} else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmaker.git



More information about the Pkg-wmaker-commits mailing list