changeset 27:fe72a5ed4069

Clean up a bunch of warnings reported by gcc and clang including using DW_POINTER_TO_INT etc to avoid compiler warnings on 64bit.
author Brian Smith <brian@dbsoft.org>
date Mon, 25 Jul 2011 23:28:08 -0500
parents 33f27176a7fb
children c621bd64fc83
files account.c dmail.c dmail.h gtk/resources.c parse.c
diffstat 5 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/account.c	Sat Jun 25 21:15:38 2011 -0500
+++ b/account.c	Mon Jul 25 23:28:08 2011 -0500
@@ -496,5 +496,5 @@
 
 	account_dialog_core(as, TRUE, TRUE);
 
-	return (int)dw_dialog_wait(dialog);
+	return DW_POINTER_TO_INT(dw_dialog_wait(dialog));
 }
--- a/dmail.c	Sat Jun 25 21:15:38 2011 -0500
+++ b/dmail.c	Mon Jul 25 23:28:08 2011 -0500
@@ -336,7 +336,7 @@
 	else
 		count = 0;
 	dw_window_set_text(stext1, textbuf);
-	dw_window_set_data(stext1, "count", (void *)count);
+	dw_window_set_data(stext1, "count", DW_INT_TO_POINTER(count));
 }
 
 int DWSIGNAL generic_cancel(HWND window, void *data)
@@ -360,13 +360,13 @@
 int DWSIGNAL deleteitem(HWND hwnd, void *data)
 {
 	MailItem *mi = (MailItem *)dw_container_query_start(hwndContainer, DW_CRA_SELECTED);
-	int plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 	AccountInfo *ai = findaccount(mi);
 	MailFolder *mf = findfolder(ai, "Trash");
 
 	if(dw_messagebox("DynamicMail", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to delete the selected messages?"))
 	{
-		int deleted = 0, count = (int)dw_window_get_data(stext1, "count");
+		int deleted = 0, count = DW_POINTER_TO_INT(dw_window_get_data(stext1, "count"));
 
 		while(mi)
 		{
@@ -477,7 +477,7 @@
 int DWSIGNAL containerselect(HWND hwnd, char *text, void *data)
 {
 	MailItem *mi = (MailItem *)text;
-	int plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 
 	if(mi && mi->Type == DATA_TYPE_ITEM)
 	{
@@ -501,7 +501,7 @@
 int DWSIGNAL containerfocus(HWND hwnd, HWND treeitem, char *text, void *data)
 {
 	MailItem *mi = (MailItem *)text;
-	int plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 
 	if(mi && mi->Type == DATA_TYPE_ITEM)
 	{
@@ -532,7 +532,7 @@
 	MailFolder *mf = (MailFolder *)itemdata;
 	int clear = TRUE;
 	HWND mle = (HWND)dw_window_get_data(hwndContainer, "mle");
-	int plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 	MailItem *olditems = (MailItem *)cdata;
 	int count = 0;
 
@@ -556,7 +556,7 @@
 		if(ai)
 		{
 			plug = ai->Plug;
-			dw_window_set_data(hwndContainer, "plug", (void *)plug);
+			dw_window_set_data(hwndContainer, "plug", DW_INT_TO_POINTER(plug));
 			dw_window_set_data(hwndContainer, "account", (void *)ai);
 
 			mi = plugin_list[plug].getitems(mf->Acc, mf);
@@ -627,7 +627,7 @@
 /* Delete event */
 int DWSIGNAL message_deleteevent(HWND hwnd, void *data)
 {
-	int readonly = (int)dw_window_get_data(hwnd, "readonly");
+	int readonly = DW_POINTER_TO_INT(dw_window_get_data(hwnd, "readonly"));
 
 	if(readonly || (!readonly && dw_messagebox("DynamicMail", DW_MB_YESNO | DW_MB_QUESTION, "Are you sure you want to close this unsent message?")))
 	{
@@ -1257,7 +1257,7 @@
 
 void reply_dialog(HWND hwnd, MailItem *mi, int reply)
 {
-	int plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 
 	if(mi && mi->Type == DATA_TYPE_ITEM)
 	{
@@ -1280,7 +1280,7 @@
 int DWSIGNAL empty_trash(HWND hwnd, void *data)
 {
 	MailFolder *mf = (MailFolder *)data;
-	int n = 0, plug = (int)dw_window_get_data(hwndContainer, "plug");
+	int n = 0, plug = DW_POINTER_TO_INT(dw_window_get_data(hwndContainer, "plug"));
 	MailItem *mi = plugin_list[plug].getitems(mf->Acc, mf);
 	HWND mle = (HWND)dw_window_get_data(hwndContainer, "mle");
 
--- a/dmail.h	Sat Jun 25 21:15:38 2011 -0500
+++ b/dmail.h	Mon Jul 25 23:28:08 2011 -0500
@@ -79,7 +79,8 @@
 typedef struct {
 	char *plugins[PLUGIN_MAX];
 	char *accounts[ACCOUNT_MAX];
-	unsigned long x, y, width, height;
+    long x, y;
+	unsigned long width, height;
 	unsigned long hsplit, vsplit;
 } DmailConfig;
 
--- a/gtk/resources.c	Sat Jun 25 21:15:38 2011 -0500
+++ b/gtk/resources.c	Mon Jul 25 23:28:08 2011 -0500
@@ -74,7 +74,7 @@
 };
 
 typedef struct _resource_struct {
-	long resource_max, resource_id;
+	long resource_max, *resource_id;
 	char **resource_data;
 } DWResources;
 
--- a/parse.c	Sat Jun 25 21:15:38 2011 -0500
+++ b/parse.c	Mon Jul 25 23:28:08 2011 -0500
@@ -161,7 +161,7 @@
 				{
 					mp->text[*textcount] = calloc(1, partlen+1);
 					memcpy(mp->text[*textcount], part, partlen);
-					*textcount++;
+					(*textcount)++;
 				}
 			}
 			if(!mp)
@@ -192,7 +192,7 @@
 				{
 					mp->html[*htmlcount] = calloc(1, partlen+1);
 					memcpy(mp->html[*htmlcount], part, partlen);
-					*htmlcount++;
+					(*htmlcount)++;
 				}
 			}
 			if(type == TYPE_ATTA)
@@ -201,7 +201,7 @@
 				{
 					mp->attach[*attachcount] = calloc(1, partlen+1);
 					memcpy(mp->attach[*attachcount], part, partlen);
-					*attachcount++;
+					(*attachcount)++;
 				}
 			}
 		}