Permalink
Browse files

Merge pull request #63 from SiegeLord/master

Remove some questionable pointer->int casts
  • Loading branch information...
2 parents 57a1725 + f2a116a commit 590171801f954d93ad4024ce3a7762fec1af2bdb @frlan frlan committed Jul 26, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −1 geanylua/glspi_app.c
  2. +6 −6 geanylua/glspi_sci.c
@@ -580,7 +580,7 @@ static gint glspi_keygrab(lua_State* L)
if (prompt && doc && doc->is_valid ) {
gint fvl=scintilla_send_message(doc->editor->sci,SCI_GETFIRSTVISIBLELINE, 0,0);
gint pos=sci_get_position_from_line(doc->editor->sci, fvl+1);
- scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (glong)prompt);
+ scintilla_send_message(doc->editor->sci,SCI_CALLTIPSHOW,pos+3, (sptr_t)prompt);
}
gdk_window_add_filter(main_widgets->window->window, keygrab_cb, &km);
do {
View
@@ -626,8 +626,8 @@ static gint glspi_fail_arg_count(lua_State* L, const gchar*funcname, const gchar
static gint glspi_scintilla(lua_State* L)
{
- gint wparam=0;
- gint lparam=0;
+ uptr_t wparam=0;
+ sptr_t lparam=0;
SciCmdHashEntry*he=NULL;
gint argc=lua_gettop(L);
gchar*resultbuf=NULL;
@@ -673,7 +673,7 @@ static gint glspi_scintilla(lua_State* L)
break;
case SLT_STRING:
if (!lua_isstring(L,2)) {return FAIL_STRING_ARG(2); };
- wparam=GPOINTER_TO_INT(lua_tostring(L,2));
+ wparam=(uptr_t)lua_tostring(L,2);
break;
case SLT_CELLS: return FAIL_API;
case SLT_BOOL:
@@ -696,7 +696,7 @@ static gint glspi_scintilla(lua_State* L)
break;
case SLT_STRING:
if (!lua_isstring(L,3)) {return FAIL_STRING_ARG(2); };
- lparam=GPOINTER_TO_INT(lua_tostring(L,3));
+ lparam=(sptr_t)lua_tostring(L,3);
break;
case SLT_CELLS: return FAIL_API;
case SLT_BOOL:
@@ -721,7 +721,7 @@ static gint glspi_scintilla(lua_State* L)
bufsize=scintilla_send_message(doc->editor->sci, he->msgid, wparam, 0);
if (bufsize) {
resultbuf=g_malloc0((guint)(bufsize+1));
- lparam=GPOINTER_TO_INT(resultbuf);
+ lparam=(sptr_t)resultbuf;
} else {
lua_pushnil(L);
return 1;
@@ -802,7 +802,7 @@ static gint glspi_find(lua_State* L)
lua_pop(L, 1);
}
- if (scintilla_send_message(doc->editor->sci,SCI_FINDTEXT,flags,GPOINTER_TO_INT(&ttf))!=-1) {
+ if (scintilla_send_message(doc->editor->sci,SCI_FINDTEXT,flags,(sptr_t)&ttf)!=-1) {
push_number(L,ttf.chrgText.cpMin);
push_number(L,ttf.chrgText.cpMax);
g_free(ttf.lpstrText);

0 comments on commit 5901718

Please sign in to comment.