322 lines
11 KiB
Diff
322 lines
11 KiB
Diff
--- src/FileSel.c
|
|
+++ src/FileSel.c 2008-03-27 17:10:04.806005718 +0100
|
|
@@ -40,6 +40,7 @@
|
|
#include <stdlib.h> /* for malloc etc.*/
|
|
#include <ctype.h> /* for toupper */
|
|
#include <stdio.h>
|
|
+#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
@@ -1045,9 +1046,9 @@ static void FS_listAction(w, event, para
|
|
if (!scrolling) {
|
|
int entry = VlistEntryOfPosition(list,(int)event->xbutton.y);
|
|
if (entry >=0 && entry < VlistEntries(list)) {
|
|
- if (list == FS_CURLIST) CurDirSelectionProc(list,NULL,(XtPointer)entry);
|
|
- else if (list == FS_SUBLIST) SubDirSelectionProc(list,NULL,(XtPointer)entry);
|
|
- else if (list == FS_TOPLIST) TopDirSelectionProc(list,NULL,(XtPointer)entry);
|
|
+ if (list == FS_CURLIST) CurDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
|
|
+ else if (list == FS_SUBLIST) SubDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
|
|
+ else if (list == FS_TOPLIST) TopDirSelectionProc(list,NULL,(XtPointer)(intptr_t)entry);
|
|
}
|
|
}
|
|
}
|
|
@@ -1660,7 +1661,7 @@ TopDirSelectionProc(w, client_data, call
|
|
XtPointer client_data, call_data;
|
|
{
|
|
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
|
|
- int item = (int) call_data;
|
|
+ intptr_t item = (intptr_t) call_data;
|
|
char newpath[FS_MAXNAMLEN];
|
|
|
|
BEGINMESSAGE(TopDirSelectionProc)
|
|
@@ -1706,7 +1707,7 @@ CurDirSelectionProc(w, client_data, call
|
|
{
|
|
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
|
|
char name[10];
|
|
- int item = (int) call_data;
|
|
+ intptr_t item = (intptr_t) call_data;
|
|
|
|
BEGINMESSAGE(CurDirSelectionProc)
|
|
|
|
@@ -1748,7 +1749,7 @@ SubDirSelectionProc(w, client_data, call
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int item = (int)call_data;
|
|
+ intptr_t item = (intptr_t)call_data;
|
|
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
|
|
char newpath[FS_MAXNAMLEN];
|
|
|
|
@@ -1845,14 +1846,14 @@ SMESSAGE(XtName(p))
|
|
{
|
|
Widget clip=NULL,aaa=NULL,scroll=NULL;
|
|
FS_WIDGET p;
|
|
- int style = (int)client_data;
|
|
+ intptr_t style = (intptr_t)client_data;
|
|
if (s[0] == 'c') { clip = FS_CURCLIP; aaa = FS_CURAAA; scroll = FS_CURSCROLL; }
|
|
else if (s[0] == 's') { clip = FS_SUBCLIP; aaa = FS_SUBAAA; scroll = FS_SUBSCROLL; }
|
|
else style=0;
|
|
if (style == SCROLL_SCROLLPROC || style == SCROLL_JUMPPROC) {
|
|
int x,y;
|
|
x = (int) aaa->core.x;
|
|
- if (((int)client_data)==1) y = (int) aaa->core.y - (int)call_data;
|
|
+ if (((intptr_t)client_data)==1) y = (int) aaa->core.y - (intptr_t)call_data;
|
|
else y = (int)(-*((float*)call_data) * aaa->core.height);
|
|
ClipWidgetSetCoordinates(clip, x, y);
|
|
} else if (style == SCROLL_CLIPREPORT) {
|
|
--- src/actions.c
|
|
+++ src/actions.c 2004-04-30 16:35:07.000000000 +0200
|
|
@@ -40,6 +40,7 @@
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
+#include <stdint.h>
|
|
|
|
#include "paths.h"
|
|
#include INC_X11(Intrinsic.h)
|
|
@@ -897,7 +898,7 @@ action_setPageMark(w, event, params, num
|
|
else if (!strcmp(params[1],mark)) spm=spm|SPM_MARK;
|
|
else spm=spm|SPM_UNMARK;
|
|
|
|
- cb_setPageMark((Widget)NULL,(XtPointer)spm,NULL);
|
|
+ cb_setPageMark((Widget)NULL,(XtPointer)(intptr_t)spm,NULL);
|
|
|
|
ENDMESSAGE(action_setPageMark)
|
|
}
|
|
@@ -945,7 +946,7 @@ action_setScale(w, event, params, num_pa
|
|
if (i<0) i = (-i)|SCALE_MIN;
|
|
i |= SCALE_REL;
|
|
}
|
|
- cb_setScale(w, (XtPointer)i, NULL);
|
|
+ cb_setScale(w, (XtPointer)(intptr_t)i, NULL);
|
|
ENDMESSAGE(action_setScale)
|
|
}
|
|
|
|
@@ -971,7 +972,7 @@ action_setOrientation(w, event, params,
|
|
return;
|
|
}
|
|
o = doc_convStringToDocOrient(params[0]);
|
|
- if (o != O_UNSPECIFIED) cb_setOrientation(w, (XtPointer)o, NULL);
|
|
+ if (o != O_UNSPECIFIED) cb_setOrientation(w, (XtPointer)(intptr_t)o, NULL);
|
|
ENDMESSAGE(action_setOrientation)
|
|
}
|
|
|
|
@@ -999,7 +1000,7 @@ action_setPagemedia(w, event, params, nu
|
|
}
|
|
|
|
m = doc_convStringToPageMedia(doc,params[0]);
|
|
- if (m!= MEDIA_ID_INVALID) cb_setPagemedia(w, (XtPointer)m, NULL);
|
|
+ if (m!= MEDIA_ID_INVALID) cb_setPagemedia(w, (XtPointer)(intptr_t)m, NULL);
|
|
|
|
ENDMESSAGE(action_setPagemedia)
|
|
}
|
|
--- src/callbacks.c
|
|
+++ src/callbacks.c 2008-03-27 17:13:48.466712393 +0100
|
|
@@ -40,6 +40,7 @@
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include <ctype.h>
|
|
+#include <stdint.h>
|
|
|
|
#ifndef BUFSIZ
|
|
# define BUFSIZ 1024
|
|
@@ -152,9 +153,9 @@ cb_newtocScrollbar(w, client_data, call_
|
|
|
|
BEGINMESSAGE(cb_newtocScrollbar)
|
|
x = (int) newtocControl->core.x;
|
|
- if (((int)client_data)==1) {
|
|
- int dy = (int)call_data;
|
|
- y = (int) newtocControl->core.y - dy;
|
|
+ if (((intptr_t)client_data)==1) {
|
|
+ intptr_t dy = (intptr_t)call_data;
|
|
+ y = (int)((intptr_t) newtocControl->core.y - dy);
|
|
} else {
|
|
float *percent = (float *) call_data;
|
|
y = (int)(-*percent * newtocControl->core.height);
|
|
@@ -262,7 +263,7 @@ void cb_useBackingPixmap(w, client_data,
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int i = (int)client_data;
|
|
+ intptr_t i = (intptr_t)client_data;
|
|
|
|
BEGINMESSAGE(cb_useBackingPixmap)
|
|
if (i&1) {
|
|
@@ -366,7 +367,7 @@ cb_checkFile(w, client_data, call_data)
|
|
int changed;
|
|
|
|
BEGINMESSAGE(cb_checkFile)
|
|
- changed = check_file(((int)client_data));
|
|
+ changed = check_file(((intptr_t)client_data));
|
|
if (changed==1)
|
|
{
|
|
cb_stopInterpreter(page,NULL,NULL);
|
|
@@ -392,7 +393,7 @@ static void watch_file (client_data, idp
|
|
|
|
BEGINMESSAGE(watch_file)
|
|
/* notification after timeout */
|
|
- if ((int)client_data && app_res.watch_file) {
|
|
+ if ((intptr_t)client_data && app_res.watch_file) {
|
|
if (!file_fileIsNotUseful(gv_filename)) {
|
|
int error;
|
|
String s;
|
|
@@ -509,7 +510,7 @@ cb_print(w, client_data, call_data)
|
|
return;
|
|
}
|
|
|
|
- gv_print_mode = (int)client_data;
|
|
+ gv_print_mode = (intptr_t)client_data;
|
|
pagelist=get_pagelist(&gv_print_mode);
|
|
if (pagelist) GV_XtFree(pagelist);
|
|
if (gv_print_mode==PAGE_MODE_INVALID) {
|
|
@@ -627,7 +628,7 @@ cb_save(w, client_data, call_data)
|
|
|
|
BEGINMESSAGE(cb_save)
|
|
|
|
- gv_save_mode = (int)client_data;
|
|
+ gv_save_mode = (intptr_t)client_data;
|
|
pagelist=get_pagelist(&gv_save_mode);
|
|
if (pagelist) GV_XtFree(pagelist);
|
|
if (gv_save_mode==PAGE_MODE_INVALID) {
|
|
@@ -708,10 +709,10 @@ cb_doSave(w, client_data, call_data)
|
|
String name;
|
|
String error=NULL;
|
|
char *pagelist;
|
|
- int type;
|
|
+ intptr_t type;
|
|
|
|
BEGINMESSAGE(cb_doSave)
|
|
- if (client_data) type = (int)client_data;
|
|
+ if (client_data) type = (intptr_t)client_data;
|
|
else type = FILE_TYPE_PS;
|
|
|
|
name = XawFileSelectionGetPath(FileSel);
|
|
@@ -932,7 +933,7 @@ cb_positionPage(w, client_data, call_dat
|
|
cow = (int)control->core.width;
|
|
coh = (int)control->core.height;
|
|
|
|
- if ((int)client_data) center = True;
|
|
+ if ((intptr_t)client_data) center = True;
|
|
if (!center) have_pagepos=misc_restorePagePosition(&px,&py);
|
|
if (app_res.auto_center == True) center = True;
|
|
|
|
@@ -973,7 +974,7 @@ cb_setPageMark(w, client_data, call_data
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int r=(int)client_data;
|
|
+ intptr_t r = (intptr_t)client_data;
|
|
int entry=XawVlistInvalid,change=XawVlistInvalid;
|
|
|
|
BEGINMESSAGE(cb_setPageMark)
|
|
@@ -1026,10 +1027,10 @@ cb_setScale(w, client_data, call_data)
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int i=(int)client_data;
|
|
+ intptr_t i=(intptr_t)client_data;
|
|
|
|
BEGINMESSAGE(cb_setScale)
|
|
- i = scale_checkScaleNum(gv_scales,i);
|
|
+ i = scale_checkScaleNum(gv_scales, (int)i);
|
|
if (i>=0) {
|
|
if (i&SCALE_BAS) gv_scale_base = i&SCALE_VAL;
|
|
else gv_scale = i&SCALE_VAL;
|
|
@@ -1051,7 +1052,7 @@ cb_setOrientation(w, client_data, call_d
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int o = (int) client_data;
|
|
+ intptr_t o = (intptr_t) client_data;
|
|
int changed = 1;
|
|
|
|
BEGINMESSAGE(cb_setOrientation)
|
|
@@ -1097,7 +1098,7 @@ cb_setPagemedia(w, client_data, call_dat
|
|
Widget w;
|
|
XtPointer client_data, call_data;
|
|
{
|
|
- int media = (int)client_data;
|
|
+ intptr_t media = (intptr_t)client_data;
|
|
int media_bbox = doc ? doc->nummedia : 0;
|
|
|
|
BEGINMESSAGE(cb_setPagemedia)
|
|
--- src/main.c
|
|
+++ src/main.c 2004-04-30 16:36:16.000000000 +0200
|
|
@@ -72,6 +72,8 @@
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
|
|
+#include <stdint.h>
|
|
+
|
|
#include "types.h"
|
|
#include "actions.h"
|
|
#include "callbacks.h"
|
|
@@ -1349,8 +1351,8 @@ void main_createScaleMenu()
|
|
have_line=True;
|
|
}
|
|
scaleEntry[i] = XtCreateManagedWidget(gv_scales[i]->name, smeBSBObjectClass,scaleMenu,args,n);
|
|
- if (gv_scales[i]->is_base) XtAddCallback(scaleEntry[i], XtNcallback,cb_setScale,(XtPointer)(i|SCALE_BAS));
|
|
- else XtAddCallback(scaleEntry[i], XtNcallback,cb_setScale,(XtPointer)(i|SCALE_ABS));
|
|
+ if (gv_scales[i]->is_base) XtAddCallback(scaleEntry[i], XtNcallback,cb_setScale,(XtPointer)(intptr_t)(i|SCALE_BAS));
|
|
+ else XtAddCallback(scaleEntry[i], XtNcallback,cb_setScale,(XtPointer)(intptr_t)(i|SCALE_ABS));
|
|
}
|
|
ENDMESSAGE(main_createScaleMenu)
|
|
}
|
|
--- src/misc.c
|
|
+++ src/misc.c 2004-04-30 16:35:07.000000000 +0200
|
|
@@ -65,6 +65,7 @@
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <ctype.h>
|
|
+#include <stdint.h>
|
|
|
|
#ifndef SEEK_SET
|
|
# define SEEK_SET 0
|
|
@@ -1555,7 +1556,7 @@ void misc_buildPagemediaMenu()
|
|
if (doc && doc->nummedia) {
|
|
for (i = 0; i < doc->nummedia; i++) {
|
|
pagemediaEntry[i] = XtCreateManagedWidget(doc->media[i].name,smeBSBObjectClass, pagemediaMenu,NULL,(Cardinal)0);
|
|
- XtAddCallback(pagemediaEntry[i], XtNcallback,cb_setPagemedia, (XtPointer)i);
|
|
+ XtAddCallback(pagemediaEntry[i], XtNcallback,cb_setPagemedia, (XtPointer)(intptr_t)i);
|
|
}
|
|
w = XtCreateManagedWidget("line", smeLineObjectClass, pagemediaMenu,NULL,(Cardinal)0);
|
|
}
|
|
@@ -1565,7 +1566,7 @@ void misc_buildPagemediaMenu()
|
|
if (!(gv_medias[i]->used)) continue;
|
|
pagemediaEntry[i+num_doc_media] =
|
|
XtCreateManagedWidget(gv_medias[i]->name,smeBSBObjectClass, pagemediaMenu,NULL,(Cardinal)0);
|
|
- XtAddCallback(pagemediaEntry[i+num_doc_media], XtNcallback,cb_setPagemedia, (XtPointer)(i+num_doc_media));
|
|
+ XtAddCallback(pagemediaEntry[i+num_doc_media], XtNcallback,cb_setPagemedia, (XtPointer)(intptr_t)(i+num_doc_media));
|
|
}
|
|
{
|
|
Boolean b = (doc_mediaIsOk(doc,current_page,num_doc_media) ? True : False);
|
|
--- src/options_gv.c
|
|
+++ src/options_gv.c 2004-04-30 16:35:07.000000000 +0200
|
|
@@ -40,6 +40,7 @@
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <ctype.h>
|
|
+#include <stdint.h>
|
|
|
|
#include "paths.h"
|
|
#include INC_X11(Intrinsic.h)
|
|
@@ -252,7 +253,7 @@ static void options_gv_cb_apply(w, clien
|
|
k = gv_pagemedia;
|
|
gv_pagemedia_auto = 0;
|
|
i = doc_convStringToPageMedia(doc,app_res.default_pagemedia);
|
|
- cb_setPagemedia(NULL,(XtPointer)i,(XtPointer)1);
|
|
+ cb_setPagemedia(NULL,(XtPointer)(intptr_t)i,(XtPointer)(intptr_t)1);
|
|
if ((j != gv_pagemedia_auto) || (k != gv_pagemedia)) redisplay = True;
|
|
}
|
|
s_media = True;
|
|
@@ -277,7 +278,7 @@ static void options_gv_cb_apply(w, clien
|
|
j = gv_orientation_auto;
|
|
k = gv_orientation;
|
|
gv_orientation_auto = 0;
|
|
- cb_setOrientation(NULL,(XtPointer)i,(XtPointer)1);
|
|
+ cb_setOrientation(NULL,(XtPointer)(intptr_t)i,(XtPointer)(intptr_t)1);
|
|
if ((j != gv_orientation_auto) || (k != gv_orientation)) redisplay = True;
|
|
}
|
|
s_orient = True;
|