[geany/geany] e49093: Fix warnings about casting pointer from/to different size integer

Dimitar Zhekov git-noreply at xxxxx
Tue Nov 24 19:04:05 UTC 2015


Branch:      refs/heads/master
Author:      Dimitar Zhekov <dimitar.zhekov at gmail.com>
Committer:   Dimitar Zhekov <dimitar.zhekov at gmail.com>
Date:        Tue, 24 Nov 2015 19:04:05 UTC
Commit:      e49093b75fb29ac4d0fb4b02cdce402e4feb039e
             https://github.com/geany/geany/commit/e49093b75fb29ac4d0fb4b02cdce402e4feb039e

Log Message:
-----------
Fix warnings about casting pointer from/to different size integer

These appear under 64-bit Windows. Only the sciwrappers.c warning is
potentially dangerous. For win32.c, the "handle" provides some useful
information, while "lStdHandle" does not.


Modified Paths:
--------------
    src/sciwrappers.c
    src/win32.c
    tagmanager/src/tm_workspace.c

Modified: src/sciwrappers.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -970,7 +970,7 @@ void sci_get_text_range(ScintillaObject *sci, gint start, gint end, gchar *text)
 	tr.chrg.cpMin = start;
 	tr.chrg.cpMax = end;
 	tr.lpstrText = text;
-	SSM(sci, SCI_GETTEXTRANGE, 0, (long) &tr);
+	SSM(sci, SCI_GETTEXTRANGE, 0, (sptr_t) &tr);
 }
 
 


Modified: src/win32.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -816,7 +816,7 @@ static FILE *open_std_handle(DWORD handle, const char *mode)
 	if (hConHandle == -1)
 	{
 		gchar *err = g_win32_error_message(GetLastError());
-		g_warning("_open_osfhandle(%ld, _O_TEXT) failed: %s", (long)lStdHandle, err);
+		g_warning("_open_osfhandle(handle(%ld), _O_TEXT) failed: %s", (long)handle, err);
 		g_free(err);
 		return NULL;
 	}


Modified: tagmanager/src/tm_workspace.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -398,7 +398,7 @@ static guint tm_file_inode_hash(gconstpointer key)
 #ifdef TM_DEBUG
 		g_message ("Hash for '%s' is '%d'\n", filename, file_stat.st_ino);
 #endif
-		return g_direct_hash ((gpointer)(gulong)file_stat.st_ino);
+		return g_direct_hash ((gpointer)(intptr_t)file_stat.st_ino);
 	} else {
 		return 0;
 	}



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list