|
|
40af0b0 |
diff -up magicpoint-1.13a/contrib/xwintoppm/dsimple.c.xwintoppm magicpoint-1.13a/contrib/xwintoppm/dsimple.c
|
|
|
40af0b0 |
--- magicpoint-1.13a/contrib/xwintoppm/dsimple.c.xwintoppm 1998-02-13 08:48:29.000000000 +0100
|
|
|
40af0b0 |
+++ magicpoint-1.13a/contrib/xwintoppm/dsimple.c 2012-05-15 12:18:50.957861102 +0200
|
|
|
40af0b0 |
@@ -35,6 +35,7 @@ from the X Consortium.
|
|
|
40af0b0 |
#include <X11/Xutil.h>
|
|
|
40af0b0 |
#include <X11/cursorfont.h>
|
|
|
40af0b0 |
#include <stdio.h>
|
|
|
40af0b0 |
+#include <stdarg.h>
|
|
|
40af0b0 |
/*
|
|
|
40af0b0 |
* Other_stuff.h: Definitions of routines in other_stuff.
|
|
|
40af0b0 |
*
|
|
|
40af0b0 |
@@ -55,6 +56,8 @@ void out();
|
|
|
40af0b0 |
void blip();
|
|
|
40af0b0 |
Window Window_With_Name();
|
|
|
40af0b0 |
void Fatal_Error();
|
|
|
40af0b0 |
+void outl(char *msg, ...);
|
|
|
40af0b0 |
+int usage(void);
|
|
|
40af0b0 |
|
|
|
40af0b0 |
/*
|
|
|
40af0b0 |
* Just_display: A group of routines designed to make the writting of simple
|
|
|
40af0b0 |
@@ -495,12 +497,17 @@ Window Window_With_Name(dpy, top, name)
|
|
|
40af0b0 |
* printf with up to 7 arguments.
|
|
|
40af0b0 |
*/
|
|
|
40af0b0 |
/* VARARGS1 */
|
|
|
40af0b0 |
-outl(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6)
|
|
|
40af0b0 |
- char *msg;
|
|
|
40af0b0 |
- char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
|
|
|
40af0b0 |
+void
|
|
|
40af0b0 |
+outl(char *msg, ...)
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
+ va_list args;
|
|
|
40af0b0 |
+
|
|
|
40af0b0 |
fflush(stdout);
|
|
|
40af0b0 |
- fprintf(stderr, msg, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
|
|
|
40af0b0 |
+
|
|
|
40af0b0 |
+ va_start(args, msg);
|
|
|
40af0b0 |
+ vfprintf(stderr, msg, args);
|
|
|
40af0b0 |
+ va_end(args);
|
|
|
40af0b0 |
+
|
|
|
40af0b0 |
fprintf(stderr, "\n");
|
|
|
40af0b0 |
fflush(stderr);
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
diff -up magicpoint-1.13a/contrib/xwintoppm/list.c~ magicpoint-1.13a/contrib/xwintoppm/list.c
|
|
|
40af0b0 |
--- magicpoint-1.13a/contrib/xwintoppm/list.c~ 1998-02-13 08:48:31.000000000 +0100
|
|
|
40af0b0 |
+++ magicpoint-1.13a/contrib/xwintoppm/list.c 2012-05-15 13:24:29.377808335 +0200
|
|
|
40af0b0 |
@@ -101,7 +101,7 @@ list_ptr new_list ()
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
list_ptr lp;
|
|
|
40af0b0 |
|
|
|
40af0b0 |
- if (lp = (list_ptr) malloc( sizeof( list_item))) {
|
|
|
40af0b0 |
+ if ((lp = (list_ptr) malloc( sizeof( list_item)))) {
|
|
|
40af0b0 |
lp->next = NULL;
|
|
|
40af0b0 |
lp->ptr.item = NULL;
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
diff -up magicpoint-1.13a/contrib/xwintoppm/multiVis.c~ magicpoint-1.13a/contrib/xwintoppm/multiVis.c
|
|
|
40af0b0 |
--- magicpoint-1.13a/contrib/xwintoppm/multiVis.c~ 1998-02-13 08:48:33.000000000 +0100
|
|
|
40af0b0 |
+++ magicpoint-1.13a/contrib/xwintoppm/multiVis.c 2012-05-15 13:26:28.463806740 +0200
|
|
|
40af0b0 |
@@ -331,7 +331,7 @@ int srcw,srch,dst_x , dst_y ;
|
|
|
40af0b0 |
int *indexMap,ncolors ;
|
|
|
40af0b0 |
int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ;
|
|
|
40af0b0 |
XColor *colors;
|
|
|
40af0b0 |
- int rShift,gShift,bShift;
|
|
|
40af0b0 |
+ int rShift = 0, gShift = 0, bShift = 0;
|
|
|
40af0b0 |
int targetBytesPerLine ;
|
|
|
40af0b0 |
|
|
|
40af0b0 |
ncolors = QueryColorMap(disp,reg->cmap,reg->vis,&colors,
|
|
|
40af0b0 |
@@ -519,7 +519,7 @@ XImage *ReadAreaToImage(disp, srcRootWin
|
|
|
40af0b0 |
image_region_type *reg;
|
|
|
40af0b0 |
XRectangle bbox; /* bounding box of grabbed area */
|
|
|
40af0b0 |
int depth ;
|
|
|
40af0b0 |
- XImage *ximage, *ximage_ipm ;
|
|
|
40af0b0 |
+ XImage *ximage, *ximage_ipm = NULL;
|
|
|
40af0b0 |
Visual fakeVis ;
|
|
|
40af0b0 |
int x1, y1;
|
|
|
40af0b0 |
XImage *image;
|
|
|
40af0b0 |
diff -up magicpoint-1.13a/contrib/xwintoppm/xwintoppm.c.xwintoppm magicpoint-1.13a/contrib/xwintoppm/xwintoppm.c
|
|
|
40af0b0 |
--- magicpoint-1.13a/contrib/xwintoppm/xwintoppm.c.xwintoppm 1998-08-26 07:30:16.000000000 +0200
|
|
|
40af0b0 |
+++ magicpoint-1.13a/contrib/xwintoppm/xwintoppm.c 2012-05-15 12:18:50.957861102 +0200
|
|
|
40af0b0 |
@@ -96,6 +96,7 @@ in this Software without prior written a
|
|
|
40af0b0 |
%*/
|
|
|
40af0b0 |
|
|
|
40af0b0 |
#include <stdio.h>
|
|
|
40af0b0 |
+#include <stdarg.h>
|
|
|
40af0b0 |
#include <errno.h>
|
|
|
40af0b0 |
#include <X11/Xos.h>
|
|
|
40af0b0 |
|
|
|
40af0b0 |
@@ -125,6 +126,12 @@ typedef unsigned long Pixel;
|
|
|
40af0b0 |
#include <X11/extensions/XKBbells.h>
|
|
|
40af0b0 |
#endif
|
|
|
40af0b0 |
|
|
|
40af0b0 |
+void usage(void);
|
|
|
40af0b0 |
+void Error(char *);
|
|
|
40af0b0 |
+void outl(char *msg, ...);
|
|
|
40af0b0 |
+int Image_Size(XImage *image);
|
|
|
40af0b0 |
+int Get_XColors(XWindowAttributes *win_info, XColor **colors);
|
|
|
40af0b0 |
+
|
|
|
40af0b0 |
/* Setable Options */
|
|
|
40af0b0 |
|
|
|
40af0b0 |
int format = ZPixmap;
|
|
|
40af0b0 |
@@ -138,6 +138,7 @@ long add_pixel_value = 0;
|
|
|
40af0b0 |
|
|
|
40af0b0 |
extern int (*_XErrorFunction)();
|
|
|
40af0b0 |
extern int _XDefaultError();
|
|
|
40af0b0 |
+void Window_Dump(Window window, FILE *out);
|
|
|
40af0b0 |
|
|
|
40af0b0 |
static long parse_long (s)
|
|
|
40af0b0 |
char *s;
|
|
|
40af0b0 |
@@ -163,11 +163,11 @@ static long parse_long (s)
|
|
|
40af0b0 |
return (thesign * retval);
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
|
|
|
40af0b0 |
-main(argc, argv)
|
|
|
40af0b0 |
+int main(argc, argv)
|
|
|
40af0b0 |
int argc;
|
|
|
40af0b0 |
char **argv;
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
- register i;
|
|
|
40af0b0 |
+ int i;
|
|
|
40af0b0 |
Window target_win;
|
|
|
40af0b0 |
FILE *out_file = stdout;
|
|
|
40af0b0 |
Bool frame_only = False;
|
|
|
40af0b0 |
@@ -281,6 +282,7 @@ XColor **colors ;
|
|
|
40af0b0 |
* writting.
|
|
|
40af0b0 |
*/
|
|
|
40af0b0 |
|
|
|
40af0b0 |
+void
|
|
|
40af0b0 |
Window_Dump(window, out)
|
|
|
40af0b0 |
Window window;
|
|
|
40af0b0 |
FILE *out;
|
|
|
40af0b0 |
@@ -590,7 +590,7 @@ Window_Dump(window, out)
|
|
|
40af0b0 |
buf[1] = (pixel & mask[1]) >> shift0[1] << shift8[1];
|
|
|
40af0b0 |
buf[2] = (pixel & mask[2]) >> shift0[2] << shift8[2];
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
- fwrite(buf, 3, 1, out);
|
|
|
40af0b0 |
+ i = fwrite(buf, 3, 1, out);
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
@@ -618,7 +618,7 @@ Window_Dump(window, out)
|
|
|
40af0b0 |
/*
|
|
|
40af0b0 |
* Report the syntax for calling xwd.
|
|
|
40af0b0 |
*/
|
|
|
40af0b0 |
-usage()
|
|
|
40af0b0 |
+void usage()
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
fprintf (stderr,
|
|
|
40af0b0 |
"usage: %s [-display host:dpy] [-debug] [-help] %s [-nobdrs] [-out <file>]",
|
|
|
40af0b0 |
@@ -632,7 +632,7 @@ usage()
|
|
|
40af0b0 |
* Error - Fatal xwd error.
|
|
|
40af0b0 |
*/
|
|
|
40af0b0 |
|
|
|
40af0b0 |
-Error(string)
|
|
|
40af0b0 |
+void Error(string)
|
|
|
40af0b0 |
char *string; /* Error description string. */
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
outl("\nxwd: Error => %s\n", string);
|
|
|
40af0b0 |
@@ -716,9 +718,9 @@ int Get_XColors(win_info, colors)
|
|
|
40af0b0 |
return ncolors ;
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
|
|
|
40af0b0 |
-_swapshort (bp, n)
|
|
|
40af0b0 |
- register char *bp;
|
|
|
40af0b0 |
- register unsigned n;
|
|
|
40af0b0 |
+void
|
|
|
40af0b0 |
+_swapshort (register char *bp,
|
|
|
40af0b0 |
+ register unsigned n)
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
register char c;
|
|
|
40af0b0 |
register char *ep = bp + n;
|
|
|
40af0b0 |
@@ -731,9 +733,9 @@ _swapshort (bp, n)
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
}
|
|
|
40af0b0 |
|
|
|
40af0b0 |
-_swaplong (bp, n)
|
|
|
40af0b0 |
- register char *bp;
|
|
|
40af0b0 |
- register unsigned n;
|
|
|
40af0b0 |
+void
|
|
|
40af0b0 |
+_swaplong (register char *bp,
|
|
|
40af0b0 |
+ register unsigned n)
|
|
|
40af0b0 |
{
|
|
|
40af0b0 |
register char c;
|
|
|
40af0b0 |
register char *ep = bp + n;
|