View | Details | Raw Unified | Return to bug 110221
Collapse All | Expand All

(-)graphics/libimg/Makefile (-8 / +29 lines)
Lines 7-23 Link Here
7
7
8
PORTNAME=	libimg
8
PORTNAME=	libimg
9
PORTVERSION=	1.2.4
9
PORTVERSION=	1.2.4
10
PORTREVISION=	2
10
PORTREVISION=	3
11
CATEGORIES=	graphics tk84
11
CATEGORIES?=	graphics tk84
12
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
12
MASTER_SITES=	${MASTER_SITE_SOURiCEFORGE}
13
MASTER_SITE_SUBDIR=	tkimg
13
MASTER_SITE_SUBDIR=	tkimg
14
DISTNAME=	img${PORTVERSION}
14
DISTNAME=	img${PORTVERSION}
15
15
16
MAINTAINER=	ports@FreeBSD.org
16
MAINTAINER=	martin@matuska.org
17
COMMENT=	A library of image format handlers for Tk4.1 and later
17
COMMENT=	A library of image format handlers for Tk4.1 and later
18
18
19
LIB_DEPENDS=	tk84:${PORTSDIR}/x11-toolkits/tk84 \
19
MAKEFILE=	${FILESDIR}/Makefile.bsd
20
		png:${PORTSDIR}/graphics/png \
20
21
.if defined(USE_TKSTEP80)
22
PKGNAMESUFFIX=	-tkstep80
23
MAKEFILE=	${FILESDIR}/Makefile.tkstep80
24
MAKE_ENV+=	TCL_VER=8.0
25
EXTRA_PATCHES=	${FILESDIR}/pre-tk84-warnings
26
BUILD_DEPENDS=	${LOCALBASE}/lib/tkstep8.0/tkstep.tcl:${PORTSDIR}/x11-toolkits/tkstep80
27
RUN_DEPENDS+=	${BUILD_DEPENDS}
28
CONFLICTS=	libimg-1.* libimg-tk83-1.*
29
.elif defined(USE_TK) && ${USE_TK} == 83
30
PKGNAMESUFFIX=	-tk83
31
USE_TK=		83
32
USE_TK_BUILD=	83
33
MAKE_ENV+=	TCL_VER=8.3
34
EXTRA_PATCHES=	${FILESDIR}/pre-tk84-warnings
35
CONFLICTS=	libimg-1.* libimg-tkstep-1.*
36
.else
37
USE_TK=		84
38
USE_TK_BUILD=	84
39
EXTRA_PATCHES=	${FILESDIR}/tk84-Tk_PhotoPutBlock ${FILESDIR}/tk84-warnings
40
CONFLICTS=	libimg-tk83-1.* libimg-tkstep-1.*
41
.endif
42
43
LIB_DEPENDS=	png:${PORTSDIR}/graphics/png \
21
		jpeg:${PORTSDIR}/graphics/jpeg \
44
		jpeg:${PORTSDIR}/graphics/jpeg \
22
		tiff:${PORTSDIR}/graphics/tiff
45
		tiff:${PORTSDIR}/graphics/tiff
23
46
Lines 27-34 Link Here
27
EXTRACT_AFTER_ARGS=	| ${TAR} -xf - --exclude '*/libz/*' \
50
EXTRACT_AFTER_ARGS=	| ${TAR} -xf - --exclude '*/libz/*' \
28
		--exclude '*/compat/*' --exclude '*/libtiff/*' \
51
		--exclude '*/compat/*' --exclude '*/libtiff/*' \
29
		--exclude '*/libjpeg/*' --exclude '*/libpng/*'
52
		--exclude '*/libjpeg/*' --exclude '*/libpng/*'
30
31
MAKEFILE=	${FILESDIR}/Makefile.bsd
32
53
33
MAKE_ARGS=	PORTVERSION="${PORTVERSION}" LOCALBASE="${LOCALBASE}" \
54
MAKE_ARGS=	PORTVERSION="${PORTVERSION}" LOCALBASE="${LOCALBASE}" \
34
		MKDIR="${MKDIR}" INSTALL_DATA="${INSTALL_DATA}"
55
		MKDIR="${MKDIR}" INSTALL_DATA="${INSTALL_DATA}"
(-)graphics/libimg/files/Makefile.tkstep80 (+68 lines)
Line 0 Link Here
1
SHLIB_NAME=	libimg.so.1
2
3
PORTVERSION?=	1.2.4
4
LOCALBASE?=	/usr/local
5
X11BASE?=	/usr/X11R6
6
TCL_VER=	8.0
7
8
.if exists(${LOCALBASE}/lib/tkstep${TCL_VER}/tkStepConfig.sh)
9
# If for some reason  the file does not exist -- make the best guess. In
10
# reality, it will exist by the time we are actually doing the build, so
11
# the quality of the guess does not matter. But we still try well. -mi
12
TCL_STUB_LIB_SPEC!=	. ${LOCALBASE}/lib/tcl${TCL_VER}/tclConfig.sh; \
13
		echo $$TCL_STUB_LIB_SPEC
14
TK_STUB_LIB_SPEC!=	. ${LOCALBASE}/lib/tkstep${TCL_VER}/tkConfig.sh; \
15
		echo $$TK_STUB_LIB_SPEC
16
.else
17
TCL_STUB_LIB_SPEC=	-L${LOCALBASE}/lib -ltcl${TCL_VER:S/.//}
18
TK_STUB_LIB_SPEC=	-L${LOCALBASE}/lib -ltk${TCL_VER:S/.//}
19
.endif
20
21
LDADD=		-lm -lz -L${LOCALBASE}/lib -lpng -ljpeg -ltiff \
22
		-L${X11BASE}/lib -lX11
23
24
CFLAGS+=	-I${LOCALBASE}/include/tcl${TCL_VER}
25
CFLAGS+=	-I${LOCALBASE}/include/tcl${TCL_VER}/generic
26
CFLAGS+=	-D__X11__ -I${X11BASE}/include -DALLOW_B64
27
CFLAGS+=	-I${LOCALBASE}/include/tkstep${TCL_VER}
28
CFLAGS+=	-DNDEBUG -Wall -I.
29
CFLAGS+=	-DVERSION=\"${PORTVERSION}\" -I${LOCALBASE}/include
30
CFLAGS+=	-DHAVE_JPEGLIB_H -DHAVE_TIFF_H -DHAVE_DLFCN_H -DHAVE_IMG_H
31
32
all: pkgIndex.tcl
33
34
pkgIndex.tcl: pkgIndex.tcl.in
35
	sed -e 's,@IMG_PATCH_LEVEL@,${PORTVERSION},g' \
36
		-e 's,@IMG_SHARED_LIB_FILE@,../${SHLIB_NAME},g' \
37
		< pkgIndex.tcl.in > pkgIndex.tcl
38
39
DIR		= lib/Img1.2
40
INSTDIR		= ${LOCALBASE}/${DIR}
41
LIBDIR		= ${LOCALBASE}/lib
42
43
${INSTDIR} ${INSTDIR}/msgs:
44
	${MKDIR} $@
45
46
beforeinstall: ${INSTDIR} ${INSTDIR}/msgs
47
	${INSTALL_DATA} pkgIndex.tcl ${.CURDIR}/demo.tcl ${.CURDIR}/tkv.tcl \
48
		${.CURDIR}/imgmsg.tcl ${INSTDIR}
49
	${INSTALL_DATA} ${.CURDIR}/msgs/* ${INSTDIR}/msgs/
50
51
environ:
52
	@${ECHO} SHLIB_NAME=${SHLIB_NAME} SHLIB_LINK=${SHLIB_LINK} DIR=${DIR}
53
54
#		fundamentals of this library
55
SRCS	=	imgInit.c imgObj.c imgUtil.c imgPmap.c imgUnixPmap.c \
56
		imgBMP.c imgGIF.c imgJPEG.c imgPNG.c imgPS.c \
57
		imgTIFF.c \
58
		imgWindow.c imgXBM.c imgXPM.c
59
60
test:	$(SHLIB_NAME)
61
	PATH=${TK_BIN_DIR}:${PATH}; export PATH; \
62
	TCLLIBPATH=`pwd`; export TCLLIBPATH; \
63
	export SHLIB_PATH; \
64
	LD_LIBRARY_PATH=`pwd`; \
65
	export LD_LIBRARY_PATH; \
66
	wishstep${TCL_VER} demo.tcl
67
68
.include <bsd.lib.mk>
(-)graphics/libimg/files/patch-tk84_Tk_PhotoPutBlock (-145 lines)
Lines 1-145 Link Here
1
--- imgBMP.c.orig	Sun Aug 13 06:08:30 2000
2
+++ imgBMP.c	Mon Dec  1 12:49:07 2003
3
@@ -256,7 +256,7 @@
4
 	    for( y = height-1; y>=0; y--) {
5
 		ImgRead(handle, line, bytesPerLine);
6
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
7
-			width,1);
8
+			width,1,TK_PHOTO_COMPOSITE_SET);
9
 	    }
10
 	    break;
11
 	case 8:
12
@@ -268,7 +268,7 @@
13
 		    expline += 3;
14
 		}
15
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
16
-			width,1);
17
+			width,1,TK_PHOTO_COMPOSITE_SET);
18
 		expline = block.pixelPtr;
19
 	    }
20
 	    break;
21
@@ -287,7 +287,7 @@
22
 		    expline += 3;
23
 		}
24
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
25
-			width,1);
26
+			width,1,TK_PHOTO_COMPOSITE_SET);
27
 		expline = block.pixelPtr;
28
 	    }
29
 	    break;
30
@@ -302,7 +302,7 @@
31
 		    expline += 3;
32
 		}
33
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
34
-			width,1);
35
+			width,1,TK_PHOTO_COMPOSITE_SET);
36
 		expline = block.pixelPtr;
37
 	    }
38
 	    break;
39
--- imgGIF.c.orig	Sun Aug 13 06:09:39 2000
40
+++ imgGIF.c	Mon Dec  1 12:50:19 2003
41
@@ -482,7 +482,7 @@
42
     }
43
 
44
     if (transparent == -1) {
45
-	Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
46
+	Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
47
     } else {
48
 	ImgPhotoPutBlock(imageHandle, &block, destX, destY, width, height);
49
     }
50
--- imgJPEG.c.orig	Sun Aug 13 06:10:22 2000
51
+++ imgJPEG.c	Mon Dec  1 12:50:53 2003
52
@@ -1030,7 +1030,7 @@
53
     for (curY = 0; curY < stopY; curY++) {
54
       jpeg.read_scanlines(cinfo, buffer, 1);
55
       if (curY >= srcY) {
56
-	Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1);
57
+	Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1, TK_PHOTO_COMPOSITE_SET);
58
 	outY++;
59
       }
60
     }
61
--- imgPS.c.orig	Sun Aug 13 06:06:53 2000
62
+++ imgPS.c	Mon Dec  1 12:51:42 2003
63
@@ -395,7 +395,7 @@
64
 	        for (j = 0; j < width; j++) {
65
 		    line3[j] = ((line[(j+srcX)/8]>>(7-(j+srcX)%8) & 1)) ? 0 : 255;
66
 	        }
67
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
68
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
69
 	    }
70
 	    break;
71
 	case '5':
72
@@ -413,7 +413,7 @@
73
 			c++;
74
 		    }
75
 		}
76
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
77
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
78
 	    }
79
 	    break;
80
 	case '6':
81
@@ -435,7 +435,7 @@
82
 			c++;
83
 		    }
84
 		}
85
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
86
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
87
 	    }
88
 	    break;
89
     }
90
--- imgUtil.c	Tue Jan 15 15:59:59 2002
91
+++ imgUtil.c	Thu Jun  9 20:51:49 2005
92
@@ -95,7 +95,7 @@
93
 		}
94
 		if (end > X) {
95
  		    blockPtr->pixelPtr =  rowPtr + blockPtr->pixelSize * X;
96
-		    Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1);
97
+		    Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1, TK_PHOTO_COMPOSITE_SET);
98
 		}
99
 		X = end;
100
 	    }
101
@@ -103,12 +103,12 @@
102
 	}
103
 	blockPtr->pixelPtr = imagePtr;
104
     } else {
105
-	Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height);
106
+	Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height,TK_PHOTO_COMPOSITE_SET);
107
     }
108
     return TCL_OK;
109
 }
110
 
111
-
112
+#if 0 /* OS run-time linker is better suited for this job { */
113
 /*
114
  *----------------------------------------------------------------------
115
  *
116
@@ -248,4 +248,5 @@
117
 	dlclose(*handlePtr);
118
     }
119
     *handlePtr = IMG_FAILED;
120
-}
121
\ No newline at end of file
122
+}
123
+#endif /* } */
124
--- imgWindow.c.orig	Sat Jan 15 13:25:37 2000
125
+++ imgWindow.c	Mon Dec  1 12:52:11 2003
126
@@ -378,7 +378,7 @@
127
 	}
128
     }
129
 
130
-    Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
131
+    Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
132
 
133
 #ifndef	__WIN32__
134
     XDestroyImage(ximage);
135
--- imgXPM.c.orig	Sun Aug 13 06:41:31 2000
136
+++ imgXPM.c	Mon Dec  1 12:52:34 2003
137
@@ -504,7 +504,7 @@
138
 			    col = (int)0;
139
 		    }
140
 		} while ((i < width) && col);
141
-		Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1);
142
+		Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1, TK_PHOTO_COMPOSITE_SET);
143
 	    } else {
144
 	        p += byteSize;
145
 	        i++;
(-)graphics/libimg/files/patch-warnings (-229 lines)
Lines 1-229 Link Here
1
--- imgObj.c	Tue Jan 15 16:00:08 2002
2
+++ imgObj.c	Thu Jun  9 05:28:23 2005
3
@@ -33,5 +33,5 @@
4
     return (initialized = IMG_PERL|IMG_OBJS);
5
 #else
6
-    char *version;
7
+    const char *version;
8
     initialized = IMG_TCL;
9
     if (!Tcl_GetCommandInfo(interp,"image", &cmdInfo)) {
10
--- imgInit.c	Tue Jan 15 15:59:58 2002
11
+++ imgInit.c	Thu Jun  9 05:27:40 2005
12
@@ -94,5 +94,5 @@
13
 {
14
     Tk_PhotoImageFormat **formatPtr = Formats;
15
-    char *version;
16
+    const char *version;
17
 
18
     if ((version = Tcl_InitStubs(interp, "8.0", 0)) == NULL) {
19
--- imgPmap.h	Tue Jan 15 15:59:58 2002
20
+++ imgPmap.h	Thu Jun  9 05:48:57 2005
21
@@ -53,5 +53,5 @@
22
     int ncolors;		/* number of colors */
23
     int cpp;			/* characters per pixel */
24
-    char ** data;		/* The data that defines this pixmap 
25
+    const char ** data;		/* The data that defines this pixmap 
26
 				 * image (array of strings). It is
27
 				 * converted into an X Pixmap when this
28
--- imgPmap.c	Tue Jan 15 15:59:58 2002
29
+++ imgPmap.c	Thu Jun  9 05:52:31 2005
30
@@ -49,6 +53,5 @@
31
 			    Display *display));
32
 static void		ImgXpmDelete _ANSI_ARGS_((ClientData clientData));
33
-static int		ImgXpmCmd _ANSI_ARGS_((ClientData clientData,
34
-			    Tcl_Interp *interp, int argc, char **argv));
35
+static Tcl_CmdProc	ImgXpmCmd;
36
 static void		ImgXpmCmdDeletedProc _ANSI_ARGS_((
37
 			    ClientData clientData));
38
@@ -56,11 +59,11 @@
39
 			    PixmapInstance *instancePtr));
40
 static int		ImgXpmConfigureMaster _ANSI_ARGS_((
41
-			    PixmapMaster *masterPtr, int argc, char **argv,
42
-			    int flags));
43
+			    PixmapMaster *masterPtr, int argc,
44
+			    const char **argv, int flags));
45
 static int		ImgXpmGetData _ANSI_ARGS_((Tcl_Interp *interp,
46
 			    PixmapMaster *masterPtr));
47
-static char ** 		ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
48
+static const char ** 	ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
49
 			    char * string, int * numLines_return));
50
-static char ** 		ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
51
+static const char **	ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
52
 			    char * string, int * numLines_return));
53
 static void 		ImgXpmGetPixmapFromData _ANSI_ARGS_((
54
@@ -68,7 +71,7 @@
55
 			    PixmapMaster *masterPtr,
56
 			    PixmapInstance *instancePtr));
57
-static char *		GetType _ANSI_ARGS_((char * colorDefn,
58
+static const char *	GetType _ANSI_ARGS_((const char * colorDefn,
59
 			    int  * type_ret));
60
-static char *		GetColor _ANSI_ARGS_((char * colorDefn,
61
+static const char *	GetColor _ANSI_ARGS_((const char * colorDefn,
62
 			    char * colorName, int * type_ret));
63
 
64
@@ -131,6 +134,6 @@
65
     PixmapMaster *masterPtr;
66
     int i;
67
-    char *argvbuf[10];
68
-    char **args = argvbuf;
69
+    const char *argvbuf[10];
70
+    const char **args = argvbuf;
71
 
72
     /*
73
@@ -138,5 +141,5 @@
74
      */
75
     if (argc > 10) {
76
-	args = (char **) ckalloc(argc * sizeof(char *));
77
+	args = (const char **)ckalloc(argc * sizeof(char *));
78
     }
79
     for (i = 0; i < argc; i++) {
80
@@ -197,5 +200,5 @@
81
 				 * overall pixmap image to (reconfigure). */
82
     int argc;			/* Number of entries in argv. */
83
-    char **argv;		/* Pairs of configuration options for image. */
84
+    const char **argv;		/* Pairs of configuration options for image. */
85
     int flags;			/* Flags to pass to Tk_ConfigureWidget,
86
 				 * such as TK_CONFIG_ARGV_ONLY. */
87
@@ -280,8 +283,8 @@
88
     PixmapMaster *masterPtr;
89
 {
90
-    char ** data = NULL;
91
+    const char ** data = NULL;
92
     int  isAllocated = 0;		/* do we need to free "data"? */
93
     int listArgc;
94
-    char ** listArgv = NULL;
95
+    const char ** listArgv = NULL;
96
     int numLines;
97
     int size[2];
98
@@ -371,5 +374,6 @@
99
 }
100
 
101
-static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
102
+static const char **
103
+ImgXpmGetDataFromString(interp, string, numLines_return)
104
     Tcl_Interp * interp;
105
     char * string;
106
@@ -379,5 +383,5 @@
107
     char * p, * list;
108
     int numLines;
109
-    char ** data;
110
+    const char ** data;
111
 
112
     /* skip the leading blanks (leading blanks are not defined in the
113
@@ -497,8 +501,9 @@
114
   error:
115
     Tcl_AppendResult(interp, "File format error", NULL);
116
-    return (char**) NULL;
117
+    return NULL;
118
 }
119
 
120
-static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
121
+static const char **
122
+ImgXpmGetDataFromFile(interp, fileName, numLines_return)
123
     Tcl_Interp * interp;
124
     char * fileName;
125
@@ -507,10 +512,10 @@
126
     Tcl_Channel chan;
127
     int size;
128
-    char ** data = (char **) NULL;
129
+    const char ** data = NULL;
130
     char *cmdBuffer = NULL;
131
 
132
     chan = ImgOpenFileChannel(interp, fileName, 0);
133
     if (!chan) {
134
-	return (char **) NULL;
135
+	return NULL;
136
     }
137
 
138
@@ -540,10 +545,10 @@
139
 
140
 
141
-static char *
142
+static const char *
143
 GetType(colorDefn, type_ret)
144
-    char * colorDefn;
145
+    const char * colorDefn;
146
     int  * type_ret;
147
 {
148
-    char * p = colorDefn;
149
+    const char * p = colorDefn;
150
 
151
     /* skip white spaces */
152
@@ -590,7 +595,7 @@
153
  * colorName is guaranteed to be big enough
154
  */
155
-static char *
156
+static const char *
157
 GetColor(colorDefn, colorName, type_ret)
158
-    char * colorDefn;
159
+    const char * colorDefn;
160
     char * colorName;		/* if found, name is copied to this array */
161
     int  * type_ret;
162
@@ -699,5 +704,5 @@
163
 
164
     for (i=0; i<masterPtr->ncolors; i++) {
165
-	char * colorDefn;		/* the color definition line */
166
+	const char * colorDefn;		/* the color definition line */
167
 	char * colorName;		/* temp place to hold the color name
168
 					 * defined for one type of visual */
169
@@ -790,5 +795,5 @@
170
      */
171
     for (i=0; i<masterPtr->size[1]; i++) {
172
-	char * p = masterPtr->data[i+lOffset];
173
+	const char * p = masterPtr->data[i+lOffset];
174
 
175
 	for (j=0; j<masterPtr->size[0]; j++) {
176
@@ -905,5 +910,5 @@
177
     Tcl_Interp *interp;		/* Current interpreter. */
178
     int argc;			/* Number of arguments. */
179
-    char **argv;		/* Argument strings. */
180
+    const char *argv[];		/* Argument strings. */
181
 {
182
     PixmapMaster *masterPtr = (PixmapMaster *) clientData;
183
--- imgPS.c	Tue Jan 15 16:00:10 2002
184
+++ imgPS.c	Thu Jun  9 05:58:04 2005
185
@@ -269,5 +269,5 @@
186
 {
187
 #ifndef MAC_TCL
188
-    char *argv[10];
189
+    const char *argv[10];
190
     int len, i, j, fileWidth, fileHeight, maxintensity, index;
191
     char *p, type;
192
--- imgXPM.c	Tue Jan 15 16:00:08 2002
193
+++ imgXPM.c	Thu Jun  9 20:33:32 2005
194
@@ -287,6 +287,6 @@
195
     char buffer[MAX_BUFFER];
196
     int i, isMono;
197
-    int color1;
198
-    unsigned int data;
199
+    intptr_t color1;
200
+    uintptr_t data;
201
     Tcl_HashEntry *hPtr;
202
 
203
@@ -466,5 +466,5 @@
204
 	
205
 	for (i = 0; i < width; ) {
206
-	    unsigned int col;
207
+	    uintptr_t col;
208
 
209
 	    memcpy((char *) &color1, p, byteSize);
210
@@ -476,7 +476,7 @@
211
 	     */
212
 	    if (hPtr != (Tcl_HashEntry *)NULL) 
213
-	        col = (int)Tcl_GetHashValue(hPtr);
214
+	        col = (uintptr_t)Tcl_GetHashValue(hPtr);
215
 	    else 
216
-	        col = (int)0;
217
+	        col = 0;
218
 	    
219
 	    /*
220
@@ -500,7 +500,7 @@
221
 			hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
222
 			if (hPtr != (Tcl_HashEntry *)NULL) 
223
-			    col = (int)Tcl_GetHashValue(hPtr);
224
+			    col = (uintptr_t)Tcl_GetHashValue(hPtr);
225
 			else 
226
-			    col = (int)0;
227
+			    col = 0;
228
 		    }
229
 		} while ((i < width) && col);
(-)graphics/libimg/files/pre-tk84-warnings (+38 lines)
Line 0 Link Here
1
--- imgXPM.c	Tue Jan 15 16:00:08 2002
2
+++ imgXPM.c	Thu Jun  9 20:33:32 2005
3
@@ -287,6 +287,6 @@
4
     char buffer[MAX_BUFFER];
5
     int i, isMono;
6
-    int color1;
7
-    unsigned int data;
8
+    intptr_t color1;
9
+    uintptr_t data;
10
     Tcl_HashEntry *hPtr;
11
 
12
@@ -466,5 +466,5 @@
13
 	
14
 	for (i = 0; i < width; ) {
15
-	    unsigned int col;
16
+	    uintptr_t col;
17
 
18
 	    memcpy((char *) &color1, p, byteSize);
19
@@ -476,7 +476,7 @@
20
 	     */
21
 	    if (hPtr != (Tcl_HashEntry *)NULL) 
22
-	        col = (int)Tcl_GetHashValue(hPtr);
23
+	        col = (uintptr_t)Tcl_GetHashValue(hPtr);
24
 	    else 
25
-	        col = (int)0;
26
+	        col = 0;
27
 	    
28
 	    /*
29
@@ -500,7 +500,7 @@
30
 			hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
31
 			if (hPtr != (Tcl_HashEntry *)NULL) 
32
-			    col = (int)Tcl_GetHashValue(hPtr);
33
+			    col = (uintptr_t)Tcl_GetHashValue(hPtr);
34
 			else 
35
-			    col = (int)0;
36
+			    col = 0;
37
 		    }
38
 		} while ((i < width) && col);
(-)graphics/libimg/files/tk84-Tk_PhotoPutBlock (+145 lines)
Line 0 Link Here
1
--- imgBMP.c.orig	Sun Aug 13 06:08:30 2000
2
+++ imgBMP.c	Mon Dec  1 12:49:07 2003
3
@@ -256,7 +256,7 @@
4
 	    for( y = height-1; y>=0; y--) {
5
 		ImgRead(handle, line, bytesPerLine);
6
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
7
-			width,1);
8
+			width,1,TK_PHOTO_COMPOSITE_SET);
9
 	    }
10
 	    break;
11
 	case 8:
12
@@ -268,7 +268,7 @@
13
 		    expline += 3;
14
 		}
15
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
16
-			width,1);
17
+			width,1,TK_PHOTO_COMPOSITE_SET);
18
 		expline = block.pixelPtr;
19
 	    }
20
 	    break;
21
@@ -287,7 +287,7 @@
22
 		    expline += 3;
23
 		}
24
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
25
-			width,1);
26
+			width,1,TK_PHOTO_COMPOSITE_SET);
27
 		expline = block.pixelPtr;
28
 	    }
29
 	    break;
30
@@ -302,7 +302,7 @@
31
 		    expline += 3;
32
 		}
33
 		Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
34
-			width,1);
35
+			width,1,TK_PHOTO_COMPOSITE_SET);
36
 		expline = block.pixelPtr;
37
 	    }
38
 	    break;
39
--- imgGIF.c.orig	Sun Aug 13 06:09:39 2000
40
+++ imgGIF.c	Mon Dec  1 12:50:19 2003
41
@@ -482,7 +482,7 @@
42
     }
43
 
44
     if (transparent == -1) {
45
-	Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
46
+	Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
47
     } else {
48
 	ImgPhotoPutBlock(imageHandle, &block, destX, destY, width, height);
49
     }
50
--- imgJPEG.c.orig	Sun Aug 13 06:10:22 2000
51
+++ imgJPEG.c	Mon Dec  1 12:50:53 2003
52
@@ -1030,7 +1030,7 @@
53
     for (curY = 0; curY < stopY; curY++) {
54
       jpeg.read_scanlines(cinfo, buffer, 1);
55
       if (curY >= srcY) {
56
-	Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1);
57
+	Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1, TK_PHOTO_COMPOSITE_SET);
58
 	outY++;
59
       }
60
     }
61
--- imgPS.c.orig	Sun Aug 13 06:06:53 2000
62
+++ imgPS.c	Mon Dec  1 12:51:42 2003
63
@@ -395,7 +395,7 @@
64
 	        for (j = 0; j < width; j++) {
65
 		    line3[j] = ((line[(j+srcX)/8]>>(7-(j+srcX)%8) & 1)) ? 0 : 255;
66
 	        }
67
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
68
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
69
 	    }
70
 	    break;
71
 	case '5':
72
@@ -413,7 +413,7 @@
73
 			c++;
74
 		    }
75
 		}
76
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
77
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
78
 	    }
79
 	    break;
80
 	case '6':
81
@@ -435,7 +435,7 @@
82
 			c++;
83
 		    }
84
 		}
85
-		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
86
+		Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
87
 	    }
88
 	    break;
89
     }
90
--- imgUtil.c	Tue Jan 15 15:59:59 2002
91
+++ imgUtil.c	Thu Jun  9 20:51:49 2005
92
@@ -95,7 +95,7 @@
93
 		}
94
 		if (end > X) {
95
  		    blockPtr->pixelPtr =  rowPtr + blockPtr->pixelSize * X;
96
-		    Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1);
97
+		    Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1, TK_PHOTO_COMPOSITE_SET);
98
 		}
99
 		X = end;
100
 	    }
101
@@ -103,12 +103,12 @@
102
 	}
103
 	blockPtr->pixelPtr = imagePtr;
104
     } else {
105
-	Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height);
106
+	Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height,TK_PHOTO_COMPOSITE_SET);
107
     }
108
     return TCL_OK;
109
 }
110
 
111
-
112
+#if 0 /* OS run-time linker is better suited for this job { */
113
 /*
114
  *----------------------------------------------------------------------
115
  *
116
@@ -248,4 +248,5 @@
117
 	dlclose(*handlePtr);
118
     }
119
     *handlePtr = IMG_FAILED;
120
-}
121
\ No newline at end of file
122
+}
123
+#endif /* } */
124
--- imgWindow.c.orig	Sat Jan 15 13:25:37 2000
125
+++ imgWindow.c	Mon Dec  1 12:52:11 2003
126
@@ -378,7 +378,7 @@
127
 	}
128
     }
129
 
130
-    Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
131
+    Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
132
 
133
 #ifndef	__WIN32__
134
     XDestroyImage(ximage);
135
--- imgXPM.c.orig	Sun Aug 13 06:41:31 2000
136
+++ imgXPM.c	Mon Dec  1 12:52:34 2003
137
@@ -504,7 +504,7 @@
138
 			    col = (int)0;
139
 		    }
140
 		} while ((i < width) && col);
141
-		Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1);
142
+		Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1, TK_PHOTO_COMPOSITE_SET);
143
 	    } else {
144
 	        p += byteSize;
145
 	        i++;
(-)graphics/libimg/files/tk84-warnings (+229 lines)
Line 0 Link Here
1
--- imgObj.c	Tue Jan 15 16:00:08 2002
2
+++ imgObj.c	Thu Jun  9 05:28:23 2005
3
@@ -33,5 +33,5 @@
4
     return (initialized = IMG_PERL|IMG_OBJS);
5
 #else
6
-    char *version;
7
+    const char *version;
8
     initialized = IMG_TCL;
9
     if (!Tcl_GetCommandInfo(interp,"image", &cmdInfo)) {
10
--- imgInit.c	Tue Jan 15 15:59:58 2002
11
+++ imgInit.c	Thu Jun  9 05:27:40 2005
12
@@ -94,5 +94,5 @@
13
 {
14
     Tk_PhotoImageFormat **formatPtr = Formats;
15
-    char *version;
16
+    const char *version;
17
 
18
     if ((version = Tcl_InitStubs(interp, "8.0", 0)) == NULL) {
19
--- imgPmap.h	Tue Jan 15 15:59:58 2002
20
+++ imgPmap.h	Thu Jun  9 05:48:57 2005
21
@@ -53,5 +53,5 @@
22
     int ncolors;		/* number of colors */
23
     int cpp;			/* characters per pixel */
24
-    char ** data;		/* The data that defines this pixmap 
25
+    const char ** data;		/* The data that defines this pixmap 
26
 				 * image (array of strings). It is
27
 				 * converted into an X Pixmap when this
28
--- imgPmap.c	Tue Jan 15 15:59:58 2002
29
+++ imgPmap.c	Thu Jun  9 05:52:31 2005
30
@@ -49,6 +53,5 @@
31
 			    Display *display));
32
 static void		ImgXpmDelete _ANSI_ARGS_((ClientData clientData));
33
-static int		ImgXpmCmd _ANSI_ARGS_((ClientData clientData,
34
-			    Tcl_Interp *interp, int argc, char **argv));
35
+static Tcl_CmdProc	ImgXpmCmd;
36
 static void		ImgXpmCmdDeletedProc _ANSI_ARGS_((
37
 			    ClientData clientData));
38
@@ -56,11 +59,11 @@
39
 			    PixmapInstance *instancePtr));
40
 static int		ImgXpmConfigureMaster _ANSI_ARGS_((
41
-			    PixmapMaster *masterPtr, int argc, char **argv,
42
-			    int flags));
43
+			    PixmapMaster *masterPtr, int argc,
44
+			    const char **argv, int flags));
45
 static int		ImgXpmGetData _ANSI_ARGS_((Tcl_Interp *interp,
46
 			    PixmapMaster *masterPtr));
47
-static char ** 		ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
48
+static const char ** 	ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
49
 			    char * string, int * numLines_return));
50
-static char ** 		ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
51
+static const char **	ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
52
 			    char * string, int * numLines_return));
53
 static void 		ImgXpmGetPixmapFromData _ANSI_ARGS_((
54
@@ -68,7 +71,7 @@
55
 			    PixmapMaster *masterPtr,
56
 			    PixmapInstance *instancePtr));
57
-static char *		GetType _ANSI_ARGS_((char * colorDefn,
58
+static const char *	GetType _ANSI_ARGS_((const char * colorDefn,
59
 			    int  * type_ret));
60
-static char *		GetColor _ANSI_ARGS_((char * colorDefn,
61
+static const char *	GetColor _ANSI_ARGS_((const char * colorDefn,
62
 			    char * colorName, int * type_ret));
63
 
64
@@ -131,6 +134,6 @@
65
     PixmapMaster *masterPtr;
66
     int i;
67
-    char *argvbuf[10];
68
-    char **args = argvbuf;
69
+    const char *argvbuf[10];
70
+    const char **args = argvbuf;
71
 
72
     /*
73
@@ -138,5 +141,5 @@
74
      */
75
     if (argc > 10) {
76
-	args = (char **) ckalloc(argc * sizeof(char *));
77
+	args = (const char **)ckalloc(argc * sizeof(char *));
78
     }
79
     for (i = 0; i < argc; i++) {
80
@@ -197,5 +200,5 @@
81
 				 * overall pixmap image to (reconfigure). */
82
     int argc;			/* Number of entries in argv. */
83
-    char **argv;		/* Pairs of configuration options for image. */
84
+    const char **argv;		/* Pairs of configuration options for image. */
85
     int flags;			/* Flags to pass to Tk_ConfigureWidget,
86
 				 * such as TK_CONFIG_ARGV_ONLY. */
87
@@ -280,8 +283,8 @@
88
     PixmapMaster *masterPtr;
89
 {
90
-    char ** data = NULL;
91
+    const char ** data = NULL;
92
     int  isAllocated = 0;		/* do we need to free "data"? */
93
     int listArgc;
94
-    char ** listArgv = NULL;
95
+    const char ** listArgv = NULL;
96
     int numLines;
97
     int size[2];
98
@@ -371,5 +374,6 @@
99
 }
100
 
101
-static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
102
+static const char **
103
+ImgXpmGetDataFromString(interp, string, numLines_return)
104
     Tcl_Interp * interp;
105
     char * string;
106
@@ -379,5 +383,5 @@
107
     char * p, * list;
108
     int numLines;
109
-    char ** data;
110
+    const char ** data;
111
 
112
     /* skip the leading blanks (leading blanks are not defined in the
113
@@ -497,8 +501,9 @@
114
   error:
115
     Tcl_AppendResult(interp, "File format error", NULL);
116
-    return (char**) NULL;
117
+    return NULL;
118
 }
119
 
120
-static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
121
+static const char **
122
+ImgXpmGetDataFromFile(interp, fileName, numLines_return)
123
     Tcl_Interp * interp;
124
     char * fileName;
125
@@ -507,10 +512,10 @@
126
     Tcl_Channel chan;
127
     int size;
128
-    char ** data = (char **) NULL;
129
+    const char ** data = NULL;
130
     char *cmdBuffer = NULL;
131
 
132
     chan = ImgOpenFileChannel(interp, fileName, 0);
133
     if (!chan) {
134
-	return (char **) NULL;
135
+	return NULL;
136
     }
137
 
138
@@ -540,10 +545,10 @@
139
 
140
 
141
-static char *
142
+static const char *
143
 GetType(colorDefn, type_ret)
144
-    char * colorDefn;
145
+    const char * colorDefn;
146
     int  * type_ret;
147
 {
148
-    char * p = colorDefn;
149
+    const char * p = colorDefn;
150
 
151
     /* skip white spaces */
152
@@ -590,7 +595,7 @@
153
  * colorName is guaranteed to be big enough
154
  */
155
-static char *
156
+static const char *
157
 GetColor(colorDefn, colorName, type_ret)
158
-    char * colorDefn;
159
+    const char * colorDefn;
160
     char * colorName;		/* if found, name is copied to this array */
161
     int  * type_ret;
162
@@ -699,5 +704,5 @@
163
 
164
     for (i=0; i<masterPtr->ncolors; i++) {
165
-	char * colorDefn;		/* the color definition line */
166
+	const char * colorDefn;		/* the color definition line */
167
 	char * colorName;		/* temp place to hold the color name
168
 					 * defined for one type of visual */
169
@@ -790,5 +795,5 @@
170
      */
171
     for (i=0; i<masterPtr->size[1]; i++) {
172
-	char * p = masterPtr->data[i+lOffset];
173
+	const char * p = masterPtr->data[i+lOffset];
174
 
175
 	for (j=0; j<masterPtr->size[0]; j++) {
176
@@ -905,5 +910,5 @@
177
     Tcl_Interp *interp;		/* Current interpreter. */
178
     int argc;			/* Number of arguments. */
179
-    char **argv;		/* Argument strings. */
180
+    const char *argv[];		/* Argument strings. */
181
 {
182
     PixmapMaster *masterPtr = (PixmapMaster *) clientData;
183
--- imgPS.c	Tue Jan 15 16:00:10 2002
184
+++ imgPS.c	Thu Jun  9 05:58:04 2005
185
@@ -269,5 +269,5 @@
186
 {
187
 #ifndef MAC_TCL
188
-    char *argv[10];
189
+    const char *argv[10];
190
     int len, i, j, fileWidth, fileHeight, maxintensity, index;
191
     char *p, type;
192
--- imgXPM.c	Tue Jan 15 16:00:08 2002
193
+++ imgXPM.c	Thu Jun  9 20:33:32 2005
194
@@ -287,6 +287,6 @@
195
     char buffer[MAX_BUFFER];
196
     int i, isMono;
197
-    int color1;
198
-    unsigned int data;
199
+    intptr_t color1;
200
+    uintptr_t data;
201
     Tcl_HashEntry *hPtr;
202
 
203
@@ -466,5 +466,5 @@
204
 	
205
 	for (i = 0; i < width; ) {
206
-	    unsigned int col;
207
+	    uintptr_t col;
208
 
209
 	    memcpy((char *) &color1, p, byteSize);
210
@@ -476,7 +476,7 @@
211
 	     */
212
 	    if (hPtr != (Tcl_HashEntry *)NULL) 
213
-	        col = (int)Tcl_GetHashValue(hPtr);
214
+	        col = (uintptr_t)Tcl_GetHashValue(hPtr);
215
 	    else 
216
-	        col = (int)0;
217
+	        col = 0;
218
 	    
219
 	    /*
220
@@ -500,7 +500,7 @@
221
 			hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
222
 			if (hPtr != (Tcl_HashEntry *)NULL) 
223
-			    col = (int)Tcl_GetHashValue(hPtr);
224
+			    col = (uintptr_t)Tcl_GetHashValue(hPtr);
225
 			else 
226
-			    col = (int)0;
227
+			    col = 0;
228
 		    }
229
 		} while ((i < width) && col);

Return to bug 110221