diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-07-20 00:07:30 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-07-20 00:09:16 -0700 |
commit | cc51f7fce1cefb7a2318c624a2e1ebc124775ec8 (patch) | |
tree | 129705b18905c1233cc1f1e38b6c29bcb202ec89 | |
parent | e89c0797e8b21b543a228fb56957ba3a1e91c38e (diff) |
Fix some clang warnings about integer size/sign conversions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | clientwin.c | 4 | ||||
-rw-r--r-- | dsimple.c | 2 | ||||
-rw-r--r-- | multiVis.c | 20 | ||||
-rw-r--r-- | xwd.c | 6 |
4 files changed, 15 insertions, 17 deletions
diff --git a/clientwin.c b/clientwin.c index cce35ad..afb06f8 100644 --- a/clientwin.c +++ b/clientwin.c @@ -117,7 +117,7 @@ Find_Client_In_Children(Display * dpy, Window win) * Find virtual roots (_NET_VIRTUAL_ROOTS) */ static unsigned long * -Find_Roots(Display * dpy, Window root, unsigned int *num) +Find_Roots(Display * dpy, Window root, unsigned long *num) { Atom type_ret; int format_ret; @@ -179,7 +179,7 @@ Window Find_Client(Display * dpy, Window root, Window subwin) { unsigned long *roots; - unsigned int i, n_roots; + unsigned long i, n_roots; Window win; /* Check if subwin is a virtual root */ @@ -292,7 +292,7 @@ Window Window_With_Name( { Window *children, dummy; unsigned int nchildren; - int i; + unsigned int i; Window w=0; char *window_name; @@ -116,7 +116,7 @@ extern unsigned int list_length(); */ /* Prototype Declarations for Static Functions */ -static int QueryColorMap( +static void QueryColorMap( Display *, Colormap , Visual *, XColor **, int *, int *, int * ); @@ -125,8 +125,8 @@ static void TransferImage( XImage *,int ,int ); static XImage * ReadRegionsInList( - Display *, Visual *, int ,int ,int , - int , XRectangle, list_ptr + Display *, Visual *, int, int, unsigned int, + unsigned int, XRectangle, list_ptr ); static list_ptr make_region_list( @@ -179,16 +179,16 @@ void initFakeVisual(Visual *Vis) Vis->bits_per_rgb = 8 ; } -static int +static void QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis, XColor **src_colors, int *rShift, int *gShift, int *bShift) { - int ncolors,i ; + unsigned int ncolors,i ; unsigned long redMask, greenMask, blueMask; int redShift, greenShift, blueShift; XColor *colors ; - ncolors = src_vis->map_entries ; + ncolors = (unsigned) src_vis->map_entries ; *src_colors = colors = (XColor *)malloc(ncolors * sizeof(XColor) ) ; if(src_vis->class != TrueColor && src_vis->class != DirectColor) @@ -233,9 +233,7 @@ QueryColorMap(Display *disp, Colormap src_cmap, Visual *src_vis, } } - - XQueryColors(disp, src_cmap, colors, ncolors); - return ncolors ; + XQueryColors(disp, src_cmap, colors, (int) ncolors); } int @@ -301,7 +299,7 @@ static void TransferImage(Display *disp, XImage *reg_image, XColor *colors; int rShift = 0, gShift = 0, bShift = 0; - (void) QueryColorMap(disp,reg->cmap,reg->vis,&colors, + QueryColorMap(disp,reg->cmap,reg->vis,&colors, &rShift,&gShift,&bShift) ; switch (reg->vis->class) { @@ -375,7 +373,7 @@ static void TransferImage(Display *disp, XImage *reg_image, static XImage * ReadRegionsInList(Display *disp, Visual *fakeVis, int depth, int format, - int width,int height, + unsigned int width, unsigned int height, XRectangle bbox, /* bounding box of grabbed area */ list_ptr regions) /* list of regions to read from */ { @@ -251,8 +251,8 @@ Window_Dump(Window window, FILE *out) unsigned long swaptest = 1; XColor *colors; unsigned buffer_size; - int win_name_size; - int header_size; + size_t win_name_size; + CARD32 header_size; int ncolors, i; char *win_name; char default_win_name[] = "xwdump"; @@ -407,7 +407,7 @@ Window_Dump(Window window, FILE *out) * Calculate header size. */ if (debug) outl("xwd: Calculating header size.\n"); - header_size = SIZEOF(XWDheader) + win_name_size; + header_size = SIZEOF(XWDheader) + (CARD32) win_name_size; /* * Write out header information. |