From 44455abdb376779d38bdb9dda3e918fd000d651e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sun, 16 Mar 2008 15:31:06 -0300 Subject: [PATCH] Ansification and compile warning fixes. Also some minor cleanup by declaring variables and functions used in a single file as static. --- dsimple.c | 90 ++++++++---------- list.c | 2 +- multiVis.c | 301 +++++++++++++++++++++++++++++------------------------------- xwd.c | 76 ++++++--------- 4 files changed, 218 insertions(+), 251 deletions(-) diff --git a/dsimple.c b/dsimple.c index c84ac3b..10f50b1 100644 --- a/dsimple.c +++ b/dsimple.c @@ -71,8 +71,8 @@ static void _bitmap_error(int, char *); /* * Malloc: like malloc but handles out of memory using Fatal_Error. */ -char *Malloc(size) - unsigned size; +char * +Malloc(unsigned size) { char *data; @@ -86,9 +86,8 @@ char *Malloc(size) /* * Realloc: like Malloc except for realloc, handles NULL using Malloc. */ -char *Realloc(ptr, size) - char *ptr; - int size; +char * +Realloc(char *ptr, int size) { char *new_ptr; @@ -106,9 +105,8 @@ char *Realloc(ptr, size) * Get_Display_Name (argc, argv) Look for -display, -d, or host:dpy (obselete) * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Display_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char * +Get_Display_Name(int *pargc/* MODIFIED */, char **argv/* MODIFIED */) { int argc = *pargc; char **pargv = argv+1; @@ -143,9 +141,8 @@ char *Get_Display_Name(pargc, argv) * Get_Printer_Name (argc, argv) Look for -printer, -p, * If found, remove it from command line. Don't go past a lone -. */ -char *Get_Printer_Name(pargc, argv) - int *pargc; /* MODIFIED */ - char **argv; /* MODIFIED */ +char * +Get_Printer_Name(int *pargc/* MODIFIED */, char **argv/* MODIFIED */) { int argc = *pargc; char **pargv = argv+1; @@ -179,8 +176,8 @@ char *Get_Printer_Name(pargc, argv) * Open_Display: Routine to open a display with correct error handling. * Does not require dpy or screen defined on entry. */ -Display *Open_Display(display_name) -char *display_name; +Display * +Open_Display(char *display_name) { Display *d; @@ -203,12 +200,13 @@ char *display_name; * for this display is then stored in screen. * Does not require dpy or screen defined. */ -void Setup_Display_And_Screen(argc, argv) -int *argc; /* MODIFIED */ -char **argv; /* MODIFIED */ +void +Setup_Display_And_Screen(int *argc/* MODIFIED */, char **argv/* MODIFIED */) { - char *displayname = NULL, - *printername = NULL; + char *displayname = NULL; +#ifdef BUILD_PRINTSUPPORT + char *printername = NULL; +#endif displayname = Get_Display_Name(argc, argv); #ifdef BUILD_PRINTSUPPORT @@ -267,8 +265,8 @@ void Close_Display(void) /* * Open_Font: This routine opens a font with error handling. */ -XFontStruct *Open_Font(name) -char *name; +XFontStruct * +Open_Font(char *name) { XFontStruct *font; @@ -282,7 +280,7 @@ char *name; /* * Beep: Routine to beep the display. */ -void Beep() +void Beep(void) { XBell(dpy, 50); } @@ -292,9 +290,8 @@ void Beep() * ReadBitmapFile: same as XReadBitmapFile except it returns the bitmap * directly and handles errors using Fatal_Error. */ -static void _bitmap_error(status, filename) - int status; - char *filename; +static void +_bitmap_error(int status, char *filename) { if (status == BitmapOpenFailed) Fatal_Error("Can't open file %s!", filename); @@ -304,10 +301,9 @@ static void _bitmap_error(status, filename) Fatal_Error("Out of memory!"); } -Pixmap ReadBitmapFile(d, filename, width, height, x_hot, y_hot) - Drawable d; - char *filename; - int *width, *height, *x_hot, *y_hot; +Pixmap +ReadBitmapFile(Drawable d, char *filename, + int *width, int *height, int *x_hot, int *y_hot) { Pixmap bitmap; int status; @@ -326,10 +322,9 @@ Pixmap ReadBitmapFile(d, filename, width, height, x_hot, y_hot) * WriteBitmapFile: same as XWriteBitmapFile except it handles errors * using Fatal_Error. */ -void WriteBitmapFile(filename, bitmap, width, height, x_hot, y_hot) - char *filename; - Pixmap bitmap; - int width, height, x_hot, y_hot; +void +WriteBitmapFile(char *filename, Pixmap bitmap, + int width, int height, int x_hot, int y_hot) { int status; @@ -362,9 +357,8 @@ void WriteBitmapFile(filename, bitmap, width, height, x_hot, y_hot) * all command line arguments, and other setup is done. * For examples of usage, see xwininfo, xwd, or xprop. */ -Window Select_Window_Args(rargc, argv) - int *rargc; - char **argv; +Window +Select_Window_Args(int *rargc, char **argv) #define ARGC (*rargc) { int nargc=1; @@ -429,9 +423,8 @@ Window Select_Window_Args(rargc, argv) * on the display. This routine does not require wind to * be defined. */ -unsigned long Resolve_Color(w, name) - Window w; - char *name; +unsigned long +Resolve_Color(Window w, char *name) { XColor c; Colormap colormap; @@ -465,12 +458,8 @@ unsigned long Resolve_Color(w, name) * Width and height are required solely for efficiency. * If needed, they can be obtained via. XGetGeometry. */ -Pixmap Bitmap_To_Pixmap(dpy, d, gc, bitmap, width, height) - Display *dpy; - Drawable d; - GC gc; - Pixmap bitmap; - int width, height; +Pixmap Bitmap_To_Pixmap(Display *dpy, Drawable d, GC gc, + Pixmap bitmap, int width, int height) { Pixmap pix; int x; @@ -491,7 +480,8 @@ Pixmap Bitmap_To_Pixmap(dpy, d, gc, bitmap, width, height) /* * blip: a debugging routine. Prints Blip! on stderr with flushing. */ -void blip() +void +blip(void) { fflush(stdout); fprintf(stderr, "blip!\n"); @@ -503,8 +493,8 @@ void blip() * Routine to let user select a window using the mouse */ -Window Select_Window(dpy) - Display *dpy; +Window +Select_Window(Display *dpy) { int status; Cursor cursor; @@ -554,10 +544,8 @@ Window Select_Window(dpy) * one found will be returned. Only top and its subwindows * are looked at. Normally, top should be the RootWindow. */ -Window Window_With_Name(dpy, top, name) - Display *dpy; - Window top; - char *name; +Window +Window_With_Name(Display *dpy, Window top, char *name) { Window *children, dummy; unsigned int nchildren; diff --git a/list.c b/list.c index c5ea6c8..85472a2 100644 --- a/list.c +++ b/list.c @@ -79,7 +79,7 @@ int add_to_list(list_ptr lp, void *item) Creates a new list and sets its pointers to NULL. Returns a pointer to the new list. -------------------------------------------------------------------- **/ -list_ptr new_list () +list_ptr new_list (void) { list_ptr lp; diff --git a/multiVis.c b/multiVis.c index e5ed2c7..5c85d56 100644 --- a/multiVis.c +++ b/multiVis.c @@ -105,18 +105,6 @@ typedef struct { #define GREEN_SHIFT 8 #define BLUE_SHIFT 0 -/* -extern list_ptr new_list(); -extern list_ptr dup_list_head(); -extern void * first_in_list(); -extern void * next_in_list(); -extern int add_to_list(); -extern void zero_list(); -extern void delete_list(); -extern void delete_list_destroying(); -extern unsigned int list_length(); -*/ - /* Prototype Declarations for Static Functions */ static int QueryColorMap( Display *, Colormap , Visual *, @@ -170,8 +158,8 @@ static void destroy_image_region( /* End of Prototype Declarations */ -void initFakeVisual(Vis) -Visual *Vis ; +void +initFakeVisual(Visual *Vis) { Vis->ext_data=NULL; Vis->class = DirectColor ; @@ -183,12 +171,14 @@ Visual *Vis ; } static int -QueryColorMap(disp,src_cmap,src_vis,src_colors,rShift,gShift,bShift) -Display *disp ; -Visual *src_vis ; -Colormap src_cmap ; -XColor **src_colors ; -int *rShift, *gShift, *bShift; +QueryColorMap( + Display *disp, + Colormap src_cmap, + Visual *src_vis, + XColor **src_colors, + int *rShift, + int *gShift, + int *bShift) { int ncolors,i ; unsigned long redMask, greenMask, blueMask; @@ -246,25 +236,23 @@ int *rShift, *gShift, *bShift; } int -GetMultiVisualRegions(disp,srcRootWinid, x, y, width, height, - transparentOverlays,numVisuals, pVisuals,numOverlayVisuals, pOverlayVisuals, - numImageVisuals, pImageVisuals,vis_regions,vis_image_regions,allImage) - Display *disp; - Window srcRootWinid; /* root win on which grab was done */ - int x; /* root rel UL corner of bounding box of grab */ - int y; - unsigned int width; /* size of bounding box of grab */ - unsigned int height; - int *transparentOverlays ; - int *numVisuals; - XVisualInfo **pVisuals; - int *numOverlayVisuals; - OverlayInfo **pOverlayVisuals; - int *numImageVisuals; - XVisualInfo ***pImageVisuals; - list_ptr *vis_regions; /* list of regions to read from */ - list_ptr *vis_image_regions ; - int *allImage ; +GetMultiVisualRegions( + Display *disp, + Window srcRootWinid,/* root win on which grab was done */ + int x, /* root rel UL corner of bounding box of grab */ + int y, + unsigned int width, /* size of bounding box of grab */ + unsigned int height, + int *transparentOverlays, + int *numVisuals, + XVisualInfo **pVisuals, + int *numOverlayVisuals, + OverlayInfo **pOverlayVisuals, + int *numImageVisuals, + XVisualInfo ***pImageVisuals, + list_ptr *vis_regions, /* list of regions to read from */ + list_ptr *vis_image_regions, + int *allImage) { int hasNonDefault; XRectangle bbox; /* bounding box of grabbed area */ @@ -304,12 +292,16 @@ GetMultiVisualRegions(disp,srcRootWinid, x, y, width, height, } -static void TransferImage(disp,reg_image,srcw,srch,reg, - target_image,dst_x,dst_y) -Display *disp; -XImage *reg_image,*target_image ; -image_region_type *reg; -int srcw,srch,dst_x , dst_y ; +static void +TransferImage( + Display *disp, + XImage *reg_image, + int srcw, + int srch, + image_region_type *reg, + XImage *target_image, + int dst_x, + int dst_y) { int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ; XColor *colors; @@ -388,13 +380,15 @@ int srcw,srch,dst_x , dst_y ; } static XImage * -ReadRegionsInList(disp,fakeVis,depth,format,width,height,bbox,regions) -Display *disp ; -Visual *fakeVis ; -int depth , width , height ; -int format ; -XRectangle bbox; /* bounding box of grabbed area */ -list_ptr regions;/* list of regions to read from */ +ReadRegionsInList( + Display *disp, + Visual *fakeVis, + int depth, + int format, + int width, + int height, + XRectangle bbox, /* bounding box of grabbed area */ + list_ptr regions) /* list of regions to read from */ { image_region_type *reg; int dst_x, dst_y; /* where in pixmap to write (UL) */ @@ -471,26 +465,25 @@ list_ptr regions;/* list of regions to read from */ /** ------------------------------------------------------------------------ ------------------------------------------------------------------------ **/ -XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, - numVisuals,pVisuals,numOverlayVisuals,pOverlayVisuals,numImageVisuals, - pImageVisuals,vis_regions,vis_image_regions,format,allImage) - Display *disp; - Window srcRootWinid; /* root win on which grab was done */ - int x; /* root rel UL corner of bounding box of grab */ - int y; - unsigned int width; /* size of bounding box of grab */ - unsigned int height; +XImage * +ReadAreaToImage( + Display *disp, + Window srcRootWinid, /* root win on which grab was done */ + int x, /* root rel UL corner of bounding box of grab */ + int y, + unsigned int width, /* size of bounding box of grab */ + unsigned int height, /** int transparentOverlays; ***/ - int numVisuals; - XVisualInfo *pVisuals; - int numOverlayVisuals; - OverlayInfo *pOverlayVisuals; - int numImageVisuals; - XVisualInfo **pImageVisuals; - list_ptr vis_regions; /* list of regions to read from */ - list_ptr vis_image_regions ;/* list of regions to read from */ - int format; - int allImage ; + int numVisuals, + XVisualInfo *pVisuals, + int numOverlayVisuals, + OverlayInfo *pOverlayVisuals, + int numImageVisuals, + XVisualInfo **pImageVisuals, + list_ptr vis_regions, /* list of regions to read from */ + list_ptr vis_image_regions,/* list of regions to read from */ + int format, + int allImage) { image_region_type *reg; XRectangle bbox; /* bounding box of grabbed area */ @@ -664,17 +657,17 @@ XImage *ReadAreaToImage(disp, srcRootWinid, x, y, width, height, image_wins must point to an existing list struct that's already been zeroed (zero_list()). ------------------------------------------------------------------------ **/ -static void make_src_list( disp, image_wins, bbox, curr, x_rootrel, y_rootrel, - curr_attrs, pclip) - Display *disp; - list_ptr image_wins; - XRectangle *bbox; /* bnding box of area we want */ - Window curr; - int x_rootrel; /* pos of curr WRT root */ - int y_rootrel; - XWindowAttributes *curr_attrs; - XRectangle *pclip; /* visible part of curr, not */ - /* obscurred by ancestors */ +static void +make_src_list( + Display *disp, + list_ptr image_wins, + XRectangle *bbox, /* bnding box of area we want */ + Window curr, + int x_rootrel, /* pos of curr WRT root */ + int y_rootrel, + XWindowAttributes *curr_attrs, + XRectangle *pclip) /* visible part of curr, not */ + /* obscurred by ancestors */ { XWindowAttributes child_attrs; Window root, parent, *child; /* variables for XQueryTree() */ @@ -760,15 +753,15 @@ static void make_src_list( disp, image_wins, bbox, curr, x_rootrel, y_rootrel, there will be two regions in the list. Returns a pointer to the list. ------------------------------------------------------------------------ **/ -static list_ptr make_region_list( disp, win, bbox, hasNonDefault, - numImageVisuals, pImageVisuals, allImage) - Display *disp; - Window win; - XRectangle *bbox; - int *hasNonDefault; - int numImageVisuals; - XVisualInfo **pImageVisuals; - int *allImage; +static list_ptr +make_region_list( + Display *disp, + Window win, + XRectangle *bbox, + int *hasNonDefault, + int numImageVisuals, + XVisualInfo **pImageVisuals, + int *allImage) { XWindowAttributes win_attrs; list image_wins; @@ -863,8 +856,8 @@ static list_ptr make_region_list( disp, win, bbox, hasNonDefault, /** ------------------------------------------------------------------------ Destructor called from destroy_region_list(). ------------------------------------------------------------------------ **/ -static void destroy_image_region(image_region) - image_region_type *image_region; +static void +destroy_image_region(image_region_type *image_region) { XDestroyRegion( image_region->visible_region); free( (void *) image_region); @@ -873,8 +866,8 @@ static void destroy_image_region(image_region) /** ------------------------------------------------------------------------ Destroys the region list, destroying all the regions contained in it. ------------------------------------------------------------------------ **/ -static void destroy_region_list( rlist) - list_ptr rlist; +static void +destroy_region_list(list_ptr rlist) { delete_list_destroying( rlist, (DESTRUCT_FUNC_PTR)destroy_image_region); } @@ -886,12 +879,13 @@ static void destroy_region_list( rlist) only provides a way to subtract one region from another, not a rectangle from a region. ------------------------------------------------------------------------ **/ -static void subtr_rect_from_image_region( image_region, x, y, width, height) - image_region_type *image_region; - int x; - int y; - int width; - int height; +static void +subtr_rect_from_image_region( + image_region_type *image_region, + int x, + int y, + int width, + int height) { XRectangle rect; Region rect_region; @@ -911,12 +905,13 @@ static void subtr_rect_from_image_region( image_region, x, y, width, height) /** ------------------------------------------------------------------------ Adds the specified rectangle to the region in image_region. ------------------------------------------------------------------------ **/ -static void add_rect_to_image_region( image_region, x, y, width, height) - image_region_type *image_region; - int x; - int y; - int width; - int height; +static void +add_rect_to_image_region( + image_region_type *image_region, + int x, + int y, + int width, + int height) { XRectangle rect; @@ -933,9 +928,10 @@ static void add_rect_to_image_region( image_region, x, y, width, height) Returns TRUE if the given src's visual is already represented in the image_regions list, FALSE otherwise. ------------------------------------------------------------------------ **/ -static int src_in_region_list( src, image_regions) - image_win_type *src; - list_ptr image_regions; +static int +src_in_region_list( + image_win_type *src, + list_ptr image_regions) { image_region_type *ir; @@ -954,20 +950,20 @@ static int src_in_region_list( src, image_regions) /** ------------------------------------------------------------------------ Makes a new entry in image_wins with the given fields filled in. ------------------------------------------------------------------------ **/ -static void add_window_to_list( image_wins, w, xrr, yrr, x_vis, y_vis, - width, height, border_width,vis, cmap, parent) - list_ptr image_wins; - Window w; - int xrr; - int yrr; - int x_vis; - int y_vis; - int width; - int height; - int border_width; - Visual *vis; - Colormap cmap; - Window parent; +static void +add_window_to_list( + list_ptr image_wins, + Window w, + int xrr, + int yrr, + int x_vis, + int y_vis, + int width, + int height, + int border_width, + Visual *vis, + Colormap cmap, + Window parent) { image_win_type *new_src; @@ -993,10 +989,11 @@ static void add_window_to_list( image_wins, w, xrr, yrr, x_vis, y_vis, Returns TRUE if the given src's visual is in the image planes, FALSE otherwise. ------------------------------------------------------------------------ **/ -static int src_in_image( src, numImageVisuals, pImageVisuals) - image_win_type *src; - int numImageVisuals; - XVisualInfo **pImageVisuals; +static int +src_in_image( + image_win_type *src, + int numImageVisuals, + XVisualInfo **pImageVisuals) { int i; @@ -1013,13 +1010,12 @@ static int src_in_image( src, numImageVisuals, pImageVisuals) Returns TRUE if the given src's visual is in the overlay planes and transparency is possible, FALSE otherwise. ------------------------------------------------------------------------ **/ -static int src_in_overlay( src, numOverlayVisuals, pOverlayVisuals, - transparentColor, transparentType) - image_region_type *src; - int numOverlayVisuals; - OverlayInfo *pOverlayVisuals; - int *transparentColor; - int *transparentType; +static int src_in_overlay( + image_region_type *src, + int numOverlayVisuals, + OverlayInfo *pOverlayVisuals, + int *transparentColor, + int *transparentType) { int i; @@ -1087,29 +1083,26 @@ static int weCreateServerOverlayVisualsProperty = False; * ******************************************************************************/ -int GetXVisualInfo(display, screen, transparentOverlays, - numVisuals, pVisuals, - numOverlayVisuals, pOverlayVisuals, - numImageVisuals, pImageVisuals) - - Display *display; /* Which X server (aka "display"). */ - int screen; /* Which screen of the "display". */ - int *transparentOverlays; /* Non-zero if there's at least one +int +GetXVisualInfo( + Display *display, /* Which X server (aka "display"). */ + int screen, /* Which screen of the "display". */ + int *transparentOverlays, /* Non-zero if there's at least one * overlay visual and if at least one * of those supports a transparent * pixel. */ - int *numVisuals; /* Number of XVisualInfo struct's + int *numVisuals, /* Number of XVisualInfo struct's * pointed to to by pVisuals. */ - XVisualInfo **pVisuals; /* All of the device's visuals. */ - int *numOverlayVisuals; /* Number of OverlayInfo's pointed + XVisualInfo **pVisuals, /* All of the device's visuals. */ + int *numOverlayVisuals, /* Number of OverlayInfo's pointed * to by pOverlayVisuals. If this * number is zero, the device does * not have overlay planes. */ - OverlayInfo **pOverlayVisuals; /* The device's overlay plane visual + OverlayInfo **pOverlayVisuals, /* The device's overlay plane visual * information. */ - int *numImageVisuals; /* Number of XVisualInfo's pointed + int *numImageVisuals, /* Number of XVisualInfo's pointed * to by pImageVisuals. */ - XVisualInfo ***pImageVisuals; /* The device's image visuals. */ + XVisualInfo ***pImageVisuals) /* The device's image visuals. */ { XVisualInfo getVisInfo; /* Paramters of XGetVisualInfo */ int mask; @@ -1221,11 +1214,11 @@ int GetXVisualInfo(display, screen, transparentOverlays, * ******************************************************************************/ -void FreeXVisualInfo(pVisuals, pOverlayVisuals, pImageVisuals) - - XVisualInfo *pVisuals; - OverlayInfo *pOverlayVisuals; - XVisualInfo **pImageVisuals; +void +FreeXVisualInfo( + XVisualInfo *pVisuals, + OverlayInfo *pOverlayVisuals, + XVisualInfo **pImageVisuals) { XFree(pVisuals); if (weCreateServerOverlayVisualsProperty) diff --git a/xwd.c b/xwd.c index 82d43ef..c173d13 100644 --- a/xwd.c +++ b/xwd.c @@ -92,29 +92,28 @@ typedef unsigned long Pixel; /* Setable Options */ -int format = ZPixmap; -Bool nobdrs = False; -Bool on_root = False; -Bool standard_out = True; -Bool debug = False; -Bool silent = False; -Bool use_installed = False; -long add_pixel_value = 0; - - -extern int main(int, char **); -extern void Window_Dump(Window, FILE *); -extern int Image_Size(XImage *); -extern int Get_XColors(XWindowAttributes *, XColor **); -extern void _swapshort(register char *, register unsigned); -extern void _swaplong(register char *, register unsigned); +static int format = ZPixmap; +static Bool nobdrs = False; +static Bool on_root = False; +static Bool standard_out = True; +static Bool debug = False; +static Bool silent = False; +static Bool use_installed = False; +static long add_pixel_value = 0; + + +static void Window_Dump(Window, FILE *); +static int Image_Size(XImage *); +static int Get_XColors(XWindowAttributes *, XColor **); +static void _swapshort(register char *, register unsigned); +static void _swaplong(register char *, register unsigned); static long parse_long(char *); static int Get24bitDirectColors(XColor **); static int ReadColors(Visual *, Colormap, XColor **); -static long parse_long (s) - char *s; +static long +parse_long(char *s) { char *fmt = "%lu"; long retval = 0L; @@ -130,9 +129,7 @@ static long parse_long (s) } int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { register int i; Window target_win; @@ -230,8 +227,7 @@ main(argc, argv) } static int -Get24bitDirectColors(colors) -XColor **colors ; +Get24bitDirectColors(XColor **colors) { int i , ncolors = 256 ; XColor *tcol ; @@ -253,10 +249,8 @@ XColor **colors ; * writting. */ -void -Window_Dump(window, out) - Window window; - FILE *out; +static void +Window_Dump(Window window, FILE *out) { unsigned long swaptest = 1; XColor *colors; @@ -530,7 +524,7 @@ Window_Dump(window, out) * Report the syntax for calling xwd. */ void -usage() +usage(void) { fprintf (stderr, "usage: %s [-display host:dpy] [-debug] [-help] %s [-nobdrs] [-out ]", @@ -544,8 +538,8 @@ usage() * Determine the pixmap size. */ -int Image_Size(image) - XImage *image; +static int +Image_Size(XImage *image) { if (image->format != ZPixmap) return(image->bytes_per_line * image->height * image->depth); @@ -556,10 +550,7 @@ int Image_Size(image) #define lowbit(x) ((x) & (~(x) + 1)) static int -ReadColors(vis,cmap,colors) -Visual *vis ; -Colormap cmap ; -XColor **colors ; +ReadColors(Visual *vis, Colormap cmap, XColor **colors) { int i,ncolors ; @@ -604,9 +595,8 @@ XColor **colors ; /* * Get the XColors of all pixels in image - returns # of colors */ -int Get_XColors(win_info, colors) - XWindowAttributes *win_info; - XColor **colors; +static int +Get_XColors(XWindowAttributes *win_info, XColor **colors) { int i, ncolors; Colormap cmap = win_info->colormap; @@ -620,10 +610,8 @@ int Get_XColors(win_info, colors) return ncolors ; } -void -_swapshort (bp, n) - register char *bp; - register unsigned n; +static void +_swapshort(register char *bp, register unsigned n) { register char c; register char *ep = bp + n; @@ -636,10 +624,8 @@ _swapshort (bp, n) } } -void -_swaplong (bp, n) - register char *bp; - register unsigned n; +static void +_swaplong(register char *bp, register unsigned n) { register char c; register char *ep = bp + n; -- 1.5.3.2