gv/intptr_t.patch

312 lines
10 KiB
Diff

--- gv-3.5.8/source/FileSel.c 1997-06-07 00:00:00.000000000 +0200
+++ gv-3.5.8.new/source/FileSel.c 2004-04-30 16:35:07.317969358 +0200
@@ -35,6 +35,7 @@
#include <stdlib.h> /* for malloc etc.*/
#include <ctype.h> /* for toupper */
#include <stdio.h>
+#include <stdint.h>
#ifdef VMS
# include <unixio.h> /* for chdir etc. */
@@ -1085,9 +1086,9 @@
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);
}
}
}
@@ -1753,7 +1754,7 @@
XtPointer client_data, call_data;
{
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
- int item = (int) call_data;
+ int item = (intptr_t) call_data;
char newpath[FS_MAXNAMLEN];
BEGINMESSAGE(TopDirSelectionProc)
@@ -1799,7 +1800,7 @@
{
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
char name[10];
- int item = (int) call_data;
+ int item = (intptr_t) call_data;
BEGINMESSAGE(CurDirSelectionProc)
@@ -1841,7 +1842,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int item = (int)call_data;
+ int item = (intptr_t)call_data;
FS_WIDGET XtParent(XtParent(XtParent(XtParent(w))));
char newpath[FS_MAXNAMLEN];
@@ -1946,14 +1947,14 @@
{
Widget clip=NULL,aaa=NULL,scroll=NULL;
FS_WIDGET p;
- int style = (int)client_data;
+ int 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) {
--- gv-3.5.8/source/actions.c 1997-06-21 00:00:00.000000000 +0200
+++ gv-3.5.8.new/source/actions.c 2004-04-30 16:35:07.317969358 +0200
@@ -36,6 +36,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 @@
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 @@
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 @@
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 @@
}
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)
}
--- gv-3.5.8/source/callbacks.c 2004-04-30 16:29:44.124745274 +0200
+++ gv-3.5.8.new/source/callbacks.c 2004-04-30 16:35:07.318969151 +0200
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
+#include <stdint.h>
#ifndef BUFSIZ
# define BUFSIZ 1024
@@ -150,8 +151,8 @@
BEGINMESSAGE(cb_newtocScrollbar)
x = (int) newtocControl->core.x;
- if (((int)client_data)==1) {
- int dy = (int)call_data;
+ if (((intptr_t)client_data)==1) {
+ int dy = (intptr_t)call_data;
y = (int) newtocControl->core.y - dy;
} else {
float *percent = (float *) call_data;
@@ -260,7 +261,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int i = (int)client_data;
+ int i = (intptr_t)client_data;
BEGINMESSAGE(cb_useBackingPixmap)
if (i&1) {
@@ -364,7 +365,7 @@
int changed;
BEGINMESSAGE(cb_checkFile)
- changed = check_file(((int)client_data));
+ changed = check_file(((intptr_t)client_data));
if (changed==1) show_page(current_page,NULL);
ENDMESSAGE(cb_checkFile)
}
@@ -386,7 +387,7 @@
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;
@@ -506,7 +507,7 @@
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) {
@@ -624,7 +625,7 @@
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,7 +709,7 @@
int 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);
@@ -929,7 +930,7 @@
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;
@@ -970,7 +971,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int r=(int)client_data;
+ int r=(intptr_t)client_data;
int entry=XawVlistInvalid,change=XawVlistInvalid;
BEGINMESSAGE(cb_setPageMark)
@@ -1023,7 +1024,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int i=(int)client_data;
+ int i=(intptr_t)client_data;
BEGINMESSAGE(cb_setScale)
i = scale_checkScaleNum(gv_scales,i);
@@ -1048,7 +1049,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int o = (int) client_data;
+ int o = (intptr_t) client_data;
int changed = 1;
BEGINMESSAGE(cb_setOrientation)
@@ -1094,7 +1095,7 @@
Widget w;
XtPointer client_data, call_data;
{
- int media = (int)client_data;
+ int media = (intptr_t)client_data;
int media_bbox = doc ? doc->nummedia : 0;
BEGINMESSAGE(cb_setPagemedia)
--- gv-3.5.8/source/main.c 2004-04-30 16:33:43.972188696 +0200
+++ gv-3.5.8.new/source/main.c 2004-04-30 16:36:16.194740767 +0200
@@ -72,6 +72,8 @@
# include <unistd.h>
#endif
+#include <stdint.h>
+
#include "types.h"
#include "actions.h"
#include "callbacks.h"
@@ -1038,8 +1040,8 @@
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)
}
--- gv-3.5.8/source/misc.c 1997-06-21 00:00:00.000000000 +0200
+++ gv-3.5.8.new/source/misc.c 2004-04-30 16:35:07.370958411 +0200
@@ -64,6 +64,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <stdint.h>
#ifndef SEEK_SET
# define SEEK_SET 0
@@ -1647,7 +1648,7 @@
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);
}
@@ -1657,7 +1658,7 @@
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);
--- gv-3.5.8/source/options_gv.c 1997-06-07 00:00:00.000000000 +0200
+++ gv-3.5.8.new/source/options_gv.c 2004-04-30 16:35:07.374957585 +0200
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <stdint.h>
#include "paths.h"
#include INC_X11(Intrinsic.h)
@@ -251,7 +252,7 @@
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;
@@ -276,7 +277,7 @@
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;