diff -u5 -r saoimage-1.35.1/btnlib/border.c saoimage-1.35.2/btnlib/border.c --- saoimage-1.35.1/btnlib/border.c 1995-05-04 19:21:13.000000000 +0200 +++ saoimage-1.35.2/btnlib/border.c 2012-10-30 20:15:36.676606128 +0100 @@ -19,10 +19,23 @@ * {2} MVH form defines all 4 corners uniquely 26 March 1990 * {3} Doug Mink cast before shifting right 4 May 1995 * {n} -- -- */ +#include +#include + +static unsigned char btn_ReverseByte ( unsigned char byte ) ; + +static void btn_MakeBdrLine ( unsigned char * line, unsigned char * form, + int byte_width, int inverse, + int right_bdr_byte, int right_bdr_bit, + int right_form_byte, int right_form_bit ) ; + +static void btn_RightBorder ( unsigned char * src, unsigned char * dst, + int src_byte, int src_bit, int dst_bit ) ; + /* * Subroutine: btn_MakeBdrBitmap * Purpose: Fill a bitmap of an empty button with a border pattern made * from the given form. * Returns: void @@ -33,16 +46,16 @@ * Method: Creates rectangular button bitmap (no symmetry assumed). The * pattern form is 32x32 with all 4 edges of button. * Note: For each byte, bit 0 (0x01) appears on the left. * Note: For each byte, bit 7 (0x80) appears on the right. */ -void btn_MakeBdrBitmap ( buttonmap, width, height, byte_width, form, inverse ) - unsigned char *buttonmap; /* i,o: pointer to bitmap of button */ - int width, height; /* i: dimensions of button window (to cover) */ - int byte_width; /* i: bytes in one line or row */ - unsigned char *form; /* i: ptr to pattern form for entier button */ - int inverse; /* i: flag to invert bits (reverse video) */ +void btn_MakeBdrBitmap ( unsigned char * buttonmap, int width, int height, int byte_width, unsigned char * form, int inverse ) + /* i,o: pointer to bitmap of button */ + /* i: dimensions of button window (to cover) */ + /* i: bytes in one line or row */ + /* i: ptr to pattern form for entier button */ + /* i: flag to invert bits (reverse video) */ { unsigned char *top_line; /* l: ptr to line from top in buttonmap */ unsigned char *bottom_line; /* l: ptr to line from bottom in buttonmap */ unsigned char *top_form; /* l: ptr to current top row in form */ unsigned char *bottom_form; /* l: ptr to current bottom row in form */ @@ -50,12 +63,10 @@ int row; /* l: loop counter */ int right_form_byte; /* l: index of first right form byte to use */ int right_form_bit; /* l: bit in first right form byte to use */ int right_bdr_byte; /* l: index of first line byte for right bdr */ int right_bdr_bit; /* l: bit in first line byte for right bdr */ - static unsigned char btn_ReverseByte(); - static void btn_MakeBdrLine(); /* portion of pattern form used (clip overlap if button very small) */ /* middle overlap on odd size counted for height, omitted for width */ if( height >= 32 ) form_rows = 16; @@ -117,23 +128,23 @@ /* * Subroutine: btn_MakeBdrLine * Purpose: set the bits for one line of the button's border */ -static void btn_MakeBdrLine ( line, form, byte_width, inverse, - right_bdr_byte, right_bdr_bit, - right_form_byte, right_form_bit ) - unsigned char *line; /* l: ptr to line from top in buttonmap */ - unsigned char *form; /* l: ptr to current top row in form */ - int byte_width; /* i: bytes in one line or row */ - int inverse; /* i: flag to invert bits (reverse video) */ - int right_form_byte; /* l: index of first right form byte to use */ - int right_form_bit; /* l: bit in first right form byte to use */ - int right_bdr_byte; /* l: index of first line byte for right bdr */ - int right_bdr_bit; /* l: bit in first line byte for right bdr */ +static void btn_MakeBdrLine ( unsigned char * line, unsigned char * form, + int byte_width, int inverse, + int right_bdr_byte, int right_bdr_bit, + int right_form_byte, int right_form_bit ) + /* l: ptr to line from top in buttonmap */ + /* l: ptr to current top row in form */ + /* i: bytes in one line or row */ + /* i: flag to invert bits (reverse video) */ + /* l: index of first right form byte to use */ + /* l: bit in first right form byte to use */ + /* l: index of first line byte for right bdr */ + /* l: bit in first line byte for right bdr */ { - static void btn_RightBorder(); /* copy in top left, store reverse for top right */ *line = *form; *(line+1) = *(++form); /* fill middle across the row */ if( *form & 0x80 ) { @@ -165,12 +176,11 @@ */ static unsigned char flip[16] = { 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf }; -static unsigned char btn_ReverseByte ( byte ) - unsigned char byte; +static unsigned char btn_ReverseByte ( unsigned char byte ) { unsigned char reverse; reverse = flip[byte >> 4]; reverse += flip[byte & 0xf] << 4; @@ -192,16 +202,17 @@ */ /* mask of ones for bits included at index and to the right */ static unsigned char rmask[8] = { 0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80 }; /* mask of ones for bits included at index and to the left */ static unsigned char lmask[8] = { 0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f }; -static void btn_RightBorder ( src, dst, src_byte, src_bit, dst_bit ) - unsigned char *src; /* i: ptr to two reversed form pattern bytes */ - unsigned char *dst; /* i: ptr to first map byte affected */ - int src_byte; /* i: index of first form pattern byte used */ - int src_bit; /* i: bit in first source byte (7 on left) */ - int dst_bit; /* i: bit in dst (7 on left) */ +static void btn_RightBorder ( unsigned char * src, unsigned char * dst, + int src_byte, int src_bit, int dst_bit ) + /* i: ptr to two reversed form pattern bytes */ + /* i: ptr to first map byte affected */ + /* i: index of first form pattern byte used */ + /* i: bit in first source byte (7 on left) */ + /* i: bit in dst (7 on left) */ { /* if there is perfect allignment, easy work and no shift */ if( src_bit == dst_bit ) { *dst = (*dst & lmask[dst_bit]) | (src[src_byte] & rmask[src_bit]); if( src_byte < 1 ) diff -u5 -r saoimage-1.35.1/btnlib/create.c saoimage-1.35.2/btnlib/create.c --- saoimage-1.35.1/btnlib/create.c 1990-04-28 22:17:46.000000000 +0200 +++ saoimage-1.35.2/btnlib/create.c 2012-10-30 20:13:43.728966004 +0100 @@ -21,17 +21,20 @@ * {1} Jay Travisano (STScI) VMS,IMTOOL changes 10 Nov 1989 * {n} -- -- */ #include /* define stderr */ +#include /* define free */ #include /* define Xlib types and calls */ #include "buttons.h" /* 16x16 (2 bytes * 16) bitmaps with default corner patterns of border */ #include "borders.h" /* static BorderPatterns defBorders */ #include "motf.h" +static void btn_CreateWindows( ButtonBox buttonbox, GC gc, int btn_wdth, int btn_hght ) ; + static int motf_look = 0; /* if set, buttons harmonize better w/ motif */ #if VMS && IMTOOL extern void XZ_ast(); extern int XZ_efn; @@ -51,28 +54,28 @@ * Method: Make a subwindow exactly covering parent window. Fill it with * subwindows as buttons, create drawing stuff for each button * Note: Buttonboxes must later be combined into menus and panels * Note: Call TouchButton to activate buttons and submenus when ready */ -ButtonBox MakeButtonBox ( parent, gc, visual, background, geo, defs, borders ) - BoxParent *parent; /* i: Parent window info */ - GC gc; /* i: graphics context for drawing labels */ - Visual *visual; /* i: visual for XCreateImage() */ - unsigned long background; /* i: window background pixel value */ - BoxGeometry *geo; /* i: button arrangement and count info */ - ButtonSpec defs[]; /* i: Button descriptors */ - BorderPatterns *borders; /* i: optional non-default border look */ +ButtonBox MakeButtonBox ( BoxParent * parent, GC gc, Visual * visual, unsigned long background, + BoxGeometry *geo, ButtonSpec defs[], BorderPatterns *borders ) + /* i: Parent window info */ + /* i: graphics context for drawing labels */ + /* i: visual for XCreateImage() */ + /* i: window background pixel value */ + /* i: button arrangement and count info */ + /* i: Button descriptors */ + /* i: optional non-default border look */ { ButtonBox buttonbox; /* o: handle for buttonbox record */ unsigned int width, height; /* l: dimensions of parent window */ Display *display; /* l: X server */ int screen; /* l: screen number for default stuff */ int btn_wdth, btn_hght; /* l: dimensions of all buttons */ int x, y; /* l: coordinates of box in parent */ int i; /* l: loop counter */ char *btn_Alloc(); - static void btn_CreateWindows(); void btn_LabelButtons(), btn_Dimensions(); /* allocate the space for the new record */ buttonbox = (ButtonBox) btn_Alloc(1, sizeof(struct _ButtonBox), "Buttonbox"); @@ -121,13 +124,17 @@ /* set pointers for user specified (and default) look and feel */ if( borders != NULL ) buttonbox->borders = borders; else { if( motf_look ) + { buttonbox->borders = &motfBorders; + } else + { buttonbox->borders = &defBorders; + } } for( i = 0; i < buttonbox->btn_cnt; i++ ) { buttonbox->buttons[i].look = defs[i].look; buttonbox->buttons[i].feel = defs[i].feel; } @@ -201,14 +208,14 @@ * and window_list is filled. * Method: All buttons are the same size, and arranged according to * ButtonBox rows and cols specifications. * Note: Each button is a borderless window. */ -static void btn_CreateWindows( buttonbox, gc, btn_wdth, btn_hght ) - ButtonBox buttonbox; /* i: handle of buttonbox record */ - GC gc; /* i: graphics context for drawing labels */ - int btn_wdth, btn_hght; /* i: dimensions of each buttons */ +static void btn_CreateWindows( ButtonBox buttonbox, GC gc, int btn_wdth, int btn_hght ) + /* i: handle of buttonbox record */ + /* i: graphics context for drawing labels */ + /* i: dimensions of each buttons */ { int x, y; int j, i; int btn; unsigned long background; @@ -270,26 +277,27 @@ * Xlib calls: none * Post-state: box record has XImages filled for all buttons * Method: Creates basic pattern for button minus label which is used as * the starting point for adding labels to make each button. */ -void btn_LabelButtons ( buttonbox, btn_wdth, btn_hght, off, on ) - ButtonBox buttonbox; /* i: structure for boxed group of buttons */ - int btn_wdth, btn_hght; /* i: dimensions of each button */ - int off, on; /* i: flag set if off or on has invert bits */ +void btn_LabelButtons ( ButtonBox buttonbox, int btn_wdth, int btn_hght, int off, int on ) + /* i: structure for boxed group of buttons */ + /* i: dimensions of each button */ + /* i: flag set if off or on has invert bits */ { int byte_width; /* l: width in bytes of the button bitmap */ int mapsz; /* l: size of button bitmap in bytes */ int btn_cnt; /* l: number of buttons specificied */ int i; /* l: loop counter */ Visual *visual; /* l: visual for XCreateImage() */ unsigned char *off_out; /* l: filled bitmap with only border pattern */ unsigned char *off_in; /* l: filled bitmap with only border pattern */ unsigned char *on_out; /* l: filled bitmap with only border pattern */ unsigned char *on_in; /* l: filled bitmap with only border pattern */ - char *btn_Alloc(); - void btn_MakeBdrBitmap(), btn_MakeXImages(); + char *btn_Alloc(int, unsigned int, char *); +void btn_MakeBdrBitmap ( unsigned char * buttonmap, int width, int height, int byte_width, unsigned char * form, int inverse ) ; + void btn_MakeXImages(); /* calculate number of bytes in one line and in whole bitmap */ byte_width = (btn_wdth + 7) / 8; mapsz = btn_hght * byte_width; /* allocate space for patterns (initially empty) */ diff -u5 -r saoimage-1.35.1/btnlib/draw.c saoimage-1.35.2/btnlib/draw.c --- saoimage-1.35.1/btnlib/draw.c 1991-06-22 01:40:21.000000000 +0200 +++ saoimage-1.35.2/btnlib/draw.c 2012-10-30 13:30:53.181787905 +0100 @@ -50,12 +50,11 @@ * Returns: void * Called by: * Uses: btn_PutImage() below * Xlib calls: none */ -void btn_DrawButton ( button ) - ButtonRecord *button; +void btn_DrawButton ( ButtonRecord * button ) { void btn_PutImage(); if( button->highlight ) { if( button->occupied ) @@ -77,23 +76,23 @@ * Returns: void * Called by: btn_DrawButton() above * Xlib calls: XPutImage() * Pre-state: XImages for button and a GC must have been prepared before */ -void btn_PutImage ( button, phase ) - ButtonRecord *button; - int phase; +void btn_PutImage ( ButtonRecord * button, int phase ) { #ifdef ALLIANT if (bad_buttons) put_z_image(button, phase); else #endif XPutImage(button->display, button->wndwID, button->gc, button->image[phase], 0, 0, 0, 0, button->width, button->height); } + static void btn_DimButtons(ButtonBox buttonbox); + /* * Subroutine: btn_DelightButtons * Purpose: Make all highlighted buttons at this level of submenu * unhighlighted (used with While and Co-mode buttons to supress * some buttons while highlighting a specific one) @@ -101,15 +100,13 @@ * Uses: btn_DimButtons() below * Called by: * Xlib calls: none * Method: Dim this box and all co-menu boxes */ -void btn_DelightButtons ( buttonbox ) - ButtonBox buttonbox; +void btn_DelightButtons ( ButtonBox buttonbox ) { int i; - static void btn_DimButtons(); btn_DimButtons(buttonbox); for( i=0; i < buttonbox->co_menu_count; i++ ) { btn_DimButtons(buttonbox->co_menu[i]); } @@ -126,12 +123,11 @@ * Uses: btn_PutImage() above * Xlib calls: none * Method: Unhighlight any buttons currently highlighted, except the one * presently being pressed */ -static void btn_DimButtons ( buttonbox ) - ButtonBox buttonbox; +static void btn_DimButtons ( ButtonBox buttonbox ) { int i; void btn_PutImage(); for( i = 0; i < buttonbox->btn_cnt; i++ ) { @@ -141,25 +137,24 @@ btn_PutImage(&buttonbox->buttons[i], OFF_OUT); } } } + static void btn_LightButtons(ButtonBox buttonbox); /* * Subroutine: btn_RelightButtons * Purpose: Make all selected buttons at this level of submenu highlighted * (used to restore default condition after btn_DelightButtons()) * Returns: void * Called by: * Uses: btn_LightButtons() below * Xlib calls: none */ -void btn_RelightButtons ( buttonbox ) - ButtonBox buttonbox; +void btn_RelightButtons ( ButtonBox buttonbox ) { int i; - static void btn_LightButtons(); btn_LightButtons(buttonbox); for( i=0; i < buttonbox->co_menu_count; i++ ) { btn_LightButtons(buttonbox->co_menu[i] ); } @@ -172,12 +167,11 @@ * Returns: void * Called by: btn_RelightButtons() above * Uses: btn_PutImage() above * Xlib calls: none */ -static void btn_LightButtons ( buttonbox ) - ButtonBox buttonbox; +static void btn_LightButtons ( ButtonBox buttonbox ) { int i; void btn_PutImage(); for( i = 0; i < buttonbox->btn_cnt; i++ ) { @@ -194,13 +188,11 @@ #ifdef ALLIANT /* * Subroutine: put_z_image */ -void put_z_image(button, phase) - ButtonRecord *button; - int phase; +void put_z_image(ButtonRecord * button, init phase) { char *d; int i,j,l; void init_z_image(); diff -u5 -r saoimage-1.35.1/btnlib/event.c saoimage-1.35.2/btnlib/event.c --- saoimage-1.35.1/btnlib/event.c 1995-05-04 19:27:33.000000000 +0200 +++ saoimage-1.35.2/btnlib/event.c 2012-10-30 13:35:03.144120981 +0100 @@ -34,10 +34,12 @@ /* STATIC VARIABLES FOR USING UNIX SELECT TO DETECT NON-WINDOW EVENTS */ static int select_flag, x_mask[2], select_mask[2]; static int select_size=0; +static int btn_Event ( ButtonBox buttonbox, XEvent * event ) ; +static int btn_Control ( ButtonBox buttonbox, XEvent * event, int **response ) ; /* * Subroutine: ButtonEvent * Purpose: Determine if the given event belongs to the button * box hierarchy @@ -50,16 +52,15 @@ * check this box and the branches of active submenus. * Then check on each of this boxes co-horts and do the same * with their active submenus. * Note: Must be called with a buttonbox at the base of the menu tree */ -int ButtonEvent ( buttonbox, event ) - ButtonBox buttonbox; /* i: top handle for button menu group */ - XEvent *event; /* i: pointer to filled event record */ +int ButtonEvent ( ButtonBox buttonbox, XEvent *event ) + /* i: top handle for button menu group */ + /* i: pointer to filled event record */ { int i; /* l: loop counter */ - static int btn_Event(); /* is the event in the primary buttonbox (or its sub-menus) */ if( btn_Event(buttonbox, event) != 0 ) { return( 1 ); } else { @@ -83,13 +84,13 @@ * Xlib calls: none * Post-state: takes no action * Method: Check this buttonbox, then recurse on each active submenu * and co-submenus. */ -static int btn_Event ( buttonbox, event ) - ButtonBox buttonbox; /* i: top handle for button menu tree */ - XEvent *event; /* i: pointer to filled event record */ +static int btn_Event ( ButtonBox buttonbox, XEvent * event ) + /* i: top handle for button menu tree */ + /* i: pointer to filled event record */ { int i; /* l: loop counter */ /* go through our window list to find a match */ for( i = 0; i < buttonbox->window_count; i++ ) @@ -145,12 +146,10 @@ int **response; /* o: ptr to button data ptr set on response */ { int status; /* o: reason for return code (-1,0,1) */ int not_found; /* l: event search status */ int i; /* l: loop counter */ - static int btn_Event(); - static int btn_Control(); status = 1; *response = NULL; while( 1 ) { not_found = 1; @@ -204,23 +203,22 @@ * made. In each loop, check btn_Event to see if it belongs to * this button box, if not, recurse on submenus and cosubmenus * until one fields it. If still not, return NULL, else (it * was fielded) get the next event and loop again. */ -static int btn_Control ( buttonbox, event, response ) - ButtonBox buttonbox; /* i: top handle for button menu tree */ - XEvent *event; /* i: pointer to filled event record */ - int **response; /* o: ptr to button data ptr set on response */ +static int btn_Control ( ButtonBox buttonbox, XEvent * event, int **response ) + /* i: top handle for button menu tree */ + /* i: pointer to filled event record */ + /* o: ptr to button data ptr set on response */ { int status; /* o: reason for return code (-1,0,1) */ int i; /* l: loop counter */ int virgin; /* l: flag that 1st event was never fielded */ int not_claimed; /* l: flag that current event was not fielded */ int type; /* l: temp for button response type */ int id; /* l: temp for button id */ int mask[2]; /* l: temp store for select mask (select changes it) */ - static int btn_Event(); int btn_PushButton(); void btn_PutImage(), btn_DrawButton(), btn_ReleaseButton(); /* indicate that this is the passed event */ virgin = 1; diff -u5 -r saoimage-1.35.1/btnlib/image.c saoimage-1.35.2/btnlib/image.c --- saoimage-1.35.1/btnlib/image.c 1991-08-04 00:42:11.000000000 +0200 +++ saoimage-1.35.2/btnlib/image.c 2012-10-30 13:54:30.879512255 +0100 @@ -21,13 +21,18 @@ * Modified: {0} Michael VanHilst initial version 18 March 1989 * {n} -- -- */ #include /* define NULL */ +#include /* define bcopy */ #include #include "buttons.h" +static void btn_AddLabel ( ButtonLabel * label, int width, int height, int byte_width, unsigned char * bitmap, int inverse ) ; +static int btn_LabelX ( ButtonLabel * label, int width, int *lbl_x, int *btn_x ) ; +static int btn_LabelY ( ButtonLabel * label, int height, int * lbl_y, int * btn_y ) ; + /* * Subroutine: btn_MakeXImages * Purpose: Create XImage bitmaps for four states of a button * Returns: void * Called by: btn_LabelButtons() in MakeBox.c @@ -54,11 +59,10 @@ int motf; /* i: don't use occupied labels */ { unsigned char *data; /* l: pointer to bitmap currently processing */ XImage *ximage; char *btn_Alloc(); - static void btn_AddLabel(); #ifdef ALLIANT extern int nbutton; #endif @@ -171,23 +175,21 @@ * Pre-state: bitmap already contains border pattern * Post-state: bitmap has label stenciled on * Exception: Label is not stenciled if one dimension would be zero. * Method: Get basic alignment parameters and call btn_StencilLabel(); */ -static void btn_AddLabel ( label, width, height, byte_width, bitmap, inverse ) - ButtonLabel *label; /* i: record of label bitmap to stencil in */ - int width; /* i: width in pixels of button */ - int height; /* i: height in pixels of button */ - int byte_width; /* i: width in bytes of the button bitmap */ - unsigned char *bitmap; - int inverse; /* i: invert the bits for reverse video look */ +static void btn_AddLabel ( ButtonLabel * label, int width, int height, int byte_width, unsigned char * bitmap, int inverse ) + /* i: record of label bitmap to stencil in */ + /* i: width in pixels of button */ + /* i: height in pixels of button */ + /* i: width in bytes of the button bitmap */ + /* i: invert the bits for reverse video look */ { int src_x, src_y; /* l: coords of start of stencil in src (label) */ int dst_x, dst_y; /* l: coords of start of stencil in dst (button) */ int xwdth; /* l: width (cols) to stencil */ int yhght; /* l: number of lines (rows) to stencil */ - static int btn_LabelX(), btn_LabelY(); void btn_StencilLabel(); if( ((xwdth = btn_LabelX(label, width, &src_x, &dst_x)) > 0) && ((yhght = btn_LabelY(label, height, &src_y, &dst_y)) > 0) ) { btn_StencilLabel(label->label, label->mask, bitmap, @@ -214,15 +216,11 @@ * The postition within the button is determined by x_ratio: * 0 is at the left, .5 in the middle, 1 at the right, and then * offset x_offset pixels. This has no meaning when cutting was * needed, as the label will fill the entire width. */ -static int btn_LabelX ( label, width, lbl_x, btn_x ) - ButtonLabel *label; - int width; - int *lbl_x; - int *btn_x; +static int btn_LabelX ( ButtonLabel * label, int width, int *lbl_x, int *btn_x ) { int xwdth; /* if full label height fits */ if( width >= label->width ) { @@ -283,15 +281,11 @@ * The postition within the button is determined by y_ratio: * 0 is at the left, .5 in the middle, 1 at the right, and then * offset y_offset pixels. This has no meaning when cutting was * needed, as the label will fill the entire height. */ -static int btn_LabelY ( label, height, lbl_y, btn_y ) - ButtonLabel *label; - int height; - int *lbl_y; - int *btn_y; +static int btn_LabelY ( ButtonLabel * label, int height, int * lbl_y, int * btn_y ) { int yhght; /* if full label height fits */ if( height >= label->height ) { diff -u5 -r saoimage-1.35.1/btnlib/label.c saoimage-1.35.2/btnlib/label.c --- saoimage-1.35.1/btnlib/label.c 1995-05-04 19:19:37.000000000 +0200 +++ saoimage-1.35.2/btnlib/label.c 2012-10-30 19:28:40.459719145 +0100 @@ -19,10 +19,30 @@ * Modified: {0} Michael VanHilst initial version 18 March 1989 * {1} Doug Mink cast before right shifting 4 May 1995 * {n} -- -- */ +#include +#include + +static void btn_Stencil ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, + int first_mask, int last_mask, int rshift, int lshift, + int src_byte_width, int dst_byte_width, int height ) ; + +static void btn_StencilInv ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, + int first_mask, int last_mask, + int rshift, int lshift, + int src_byte_width, int dst_byte_width, int height ) ; + +static void btn_StencilAlligned ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, int first_mask, + int last_mask, int src_byte_width, int dst_byte_width, + int height ) ; + +static void btn_StencilAllignedInv ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, int first_mask, + int last_mask, int src_byte_width, int dst_byte_width, + int height) ; + /* one byte bitmask for bits included at index and to the right */ static unsigned char rmask[8] = { 0xff,0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80 }; /* one byte bitmask for bits included at index and to the left */ static unsigned char lmask[8] = { 0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff }; @@ -64,12 +84,10 @@ int lshift; /* l: shift to align 2nt src byte with dst */ unsigned char *last_dst; /* l: ptr to last byte used in first line */ int first_mask; /* l: bit mask, with coded sign (see above) */ int last_mask; /* l: bit mask, with coded sign (see above) */ - static void btn_Stencil(), btn_StencilInv(); - static void btn_StencilAlligned(),btn_StencilAllignedInv(); /* advance src and msk to their first used bytes */ byte_offset = (src_y * src_byte_width) + (src_x / 8); src += byte_offset; msk += byte_offset; @@ -148,24 +166,24 @@ * Note: src and msk are assumed to be matching bitmaps. * Note: For each byte, bit 0 (0x01) appears on the left. * Note: For each byte, bit 7 (0x80) appears on the right. * Note: ~*s >> rshift does not work on SPARK and MIPS, use (0xff - *s) */ -static void btn_Stencil ( src, msk, dst, last_dst, first_mask, last_mask, - rshift, lshift, - src_byte_width, dst_byte_width, height ) - unsigned char *src; /* i: ptr to first byte used of pattern */ - unsigned char *msk; /* i: ptr to same byte as src, but in msk */ - unsigned char *dst; /* i: ptr to first byte used of destination */ - unsigned char *last_dst; /* i: ptr to last byte used in first line */ - int first_mask; /* i: bit mask, with coded sign (see above) */ - int last_mask; /* i: bit mask, with coded sign (see above) */ - int rshift; /* i: shift to align 1st src byte with dst */ - int lshift; /* i: shift to align 2nt src byte with dst */ - int src_byte_width; /* i: width in bytes of the src bitmap */ - int dst_byte_width; /* i: width in bytes of the dst bitmap */ - int height; /* i: number of line (rows) to stencil */ +static void btn_Stencil ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, + int first_mask, int last_mask, int rshift, int lshift, + int src_byte_width, int dst_byte_width, int height ) + /* i: ptr to first byte used of pattern */ + /* i: ptr to same byte as src, but in msk */ + /* i: ptr to first byte used of destination */ + /* i: ptr to last byte used in first line */ + /* i: bit mask, with coded sign (see above) */ + /* i: bit mask, with coded sign (see above) */ + /* i: shift to align 1st src byte with dst */ + /* i: shift to align 2nt src byte with dst */ + /* i: width in bytes of the src bitmap */ + /* i: width in bytes of the dst bitmap */ + /* i: number of line (rows) to stencil */ { unsigned char mask, val; /* l: composite mask and source val */ register unsigned char *s, *m, *d; unsigned char ff = 0xff; /* -1 for ~ operation */ @@ -217,24 +235,25 @@ msk += src_byte_width; dst += dst_byte_width; last_dst += dst_byte_width; } } -static void btn_StencilInv ( src, msk, dst, last_dst, first_mask, last_mask, - rshift, lshift, - src_byte_width, dst_byte_width, height ) - unsigned char *src; /* i: ptr to first byte used of pattern */ - unsigned char *msk; /* i: ptr to same byte as src, but in msk */ - unsigned char *dst; /* i: ptr to first byte used of destination */ - unsigned char *last_dst; /* i: ptr to last byte used in first line */ - int first_mask; /* i: bit mask, with coded sign (see above) */ - int last_mask; /* i: bit mask, with coded sign (see above) */ - int rshift; /* i: shift to align 1st src byte with dst */ - int lshift; /* i: shift to align 2nt src byte with dst */ - int src_byte_width; /* i: width in bytes of the src bitmap */ - int dst_byte_width; /* i: width in bytes of the dst bitmap */ - int height; /* i: number of line (rows) to stencil */ +static void btn_StencilInv ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, + int first_mask, int last_mask, + int rshift, int lshift, + int src_byte_width, int dst_byte_width, int height ) + /* i: ptr to first byte used of pattern */ + /* i: ptr to same byte as src, but in msk */ + /* i: ptr to first byte used of destination */ + /* i: ptr to last byte used in first line */ + /* i: bit mask, with coded sign (see above) */ + /* i: bit mask, with coded sign (see above) */ + /* i: shift to align 1st src byte with dst */ + /* i: shift to align 2nt src byte with dst */ + /* i: width in bytes of the src bitmap */ + /* i: width in bytes of the dst bitmap */ + /* i: number of line (rows) to stencil */ { unsigned char mask, val; /* l: composite mask and source val */ register unsigned char *s, *m, *d; unsigned char ff = 0xff; /* -1 for ~ operation */ @@ -305,22 +324,21 @@ * Note: src and msk are assumed to be matching bitmaps. * Note: For each byte, bit 0 (0x01) appears on the left. * Note: For each byte, bit 7 (0x80) appears on the right. * Note: ~*s >> rshift does not work on SPARK and MIPS, use (0xff - *s) */ -static void btn_StencilAlligned ( src, msk, dst, last_dst, first_mask, - last_mask, src_byte_width, dst_byte_width, - height, inverse ) - unsigned char *src; /* i: ptr to first byte used of pattern */ - unsigned char *msk; /* i: ptr to same byte as src, but in msk */ - unsigned char *dst; /* i: ptr to first byte used of destination */ - unsigned char *last_dst; /* i: ptr to last byte used in first line */ - int first_mask; /* i: bit mask, with coded sign (see above) */ - int last_mask; /* i: bit mask, with coded sign (see above) */ - int src_byte_width; /* i: width in bytes of the src bitmap */ - int dst_byte_width; /* i: width in bytes of the dst bitmap */ - int height; /* i: number of line (rows) to stencil */ +static void btn_StencilAlligned ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, int first_mask, + int last_mask, int src_byte_width, int dst_byte_width, + int height ) + /* i: ptr to first byte used of pattern */ + /* i: ptr to same byte as src, but in msk */ + /* i: ptr to first byte used of destination */ + /* i: ptr to last byte used in first line */ + /* i: bit mask, with coded sign (see above) */ + /* i: bit mask, with coded sign (see above) */ + /* i: width in bytes of the src bitmap */ + /* i: width in bytes of the dst bitmap */ { unsigned char mask; /* l: composite mask for use on end bytes */ register unsigned char *s, *m, *d; unsigned char ff = 0xff; /* -1 for ~ operation */ @@ -350,22 +368,22 @@ msk += src_byte_width; dst += dst_byte_width; last_dst += dst_byte_width; } } -static void btn_StencilAllignedInv ( src, msk, dst, last_dst, first_mask, - last_mask, src_byte_width, dst_byte_width, - height, inverse ) - unsigned char *src; /* i: ptr to first byte used of pattern */ - unsigned char *msk; /* i: ptr to same byte as src, but in msk */ - unsigned char *dst; /* i: ptr to first byte used of destination */ - unsigned char *last_dst; /* i: ptr to last byte used in first line */ - int first_mask; /* i: bit mask, with coded sign (see above) */ - int last_mask; /* i: bit mask, with coded sign (see above) */ - int src_byte_width; /* i: width in bytes of the src bitmap */ - int dst_byte_width; /* i: width in bytes of the dst bitmap */ - int height; /* i: number of line (rows) to stencil */ +static void btn_StencilAllignedInv ( unsigned char * src, unsigned char * msk, unsigned char * dst, unsigned char * last_dst, int first_mask, + int last_mask, int src_byte_width, int dst_byte_width, + int height) + /* i: ptr to first byte used of pattern */ + /* i: ptr to same byte as src, but in msk */ + /* i: ptr to first byte used of destination */ + /* i: ptr to last byte used in first line */ + /* i: bit mask, with coded sign (see above) */ + /* i: bit mask, with coded sign (see above) */ + /* i: width in bytes of the src bitmap */ + /* i: width in bytes of the dst bitmap */ + /* i: number of line (rows) to stencil */ { unsigned char mask; /* l: composite mask for use on end bytes */ register unsigned char *s, *m, *d; unsigned char ff = 0xff; /* -1 for ~ operation */ Only in saoimage-1.35.1/btnlib: libbtn.a diff -u5 -r saoimage-1.35.1/btnlib/mount.c saoimage-1.35.2/btnlib/mount.c --- saoimage-1.35.1/btnlib/mount.c 1990-04-20 23:56:27.000000000 +0200 +++ saoimage-1.35.2/btnlib/mount.c 2012-10-30 13:55:51.778874317 +0100 @@ -24,10 +24,13 @@ #include /* define stderr */ #include /* needed for Buttons.h */ #include "buttons.h" +static void btn_MapButtonbox ( ButtonBox buttonbox ) ; +static void btn_UnmapButtonbox ( ButtonBox buttonbox ) ; + /* * Subroutine: MountButtonMenu * Purpose: User call to initially display the button-panels * Returns: void * Called by: Application program @@ -37,11 +40,10 @@ */ void MountButtonMenu ( buttonbox ) ButtonBox buttonbox; { int i; - static void btn_MapButtonbox(); btn_MapButtonbox(buttonbox); for( i = 0; i < buttonbox->co_menu_count; i++ ) btn_MapButtonbox(buttonbox->co_menu[i]); } @@ -54,12 +56,11 @@ * Called by: btn_ReplaceSubmenus(), btn_ReplaceCosubmenus() below * Uses: recursion * Xlib calls: XMapWindow * Method: Map the buttonbox and recurse on its submenus. */ -static void btn_MapButtonbox ( buttonbox ) - ButtonBox buttonbox; +static void btn_MapButtonbox ( ButtonBox buttonbox ) { int i; if( buttonbox != NULL ) { /* map this button box */ @@ -79,12 +80,11 @@ * Called by: btn_ReplaceSubmenus(), btn_ReplaceCosubmenus() below * Uses: recursion * Xlib calls: XUnmapWindow * Method: Unmap the buttonbox and recurse on its submenus. */ -static void btn_UnmapButtonbox ( buttonbox ) - ButtonBox buttonbox; +static void btn_UnmapButtonbox ( ButtonBox buttonbox ) { int i; if( buttonbox != NULL ) { /* unmap this set of buttons */ @@ -114,11 +114,10 @@ int btn; int op_num; int mapping; /* i: switch allows suppression of mapping */ { int i; - static void btn_UnmapButtonbox(), btn_MapButtonbox(); /* clear out the old submenus */ for( i=0; i < buttonbox->submenu_count; i++ ) btn_UnmapButtonbox(buttonbox->submenu[i]); /* install the new submenus */ @@ -154,11 +153,10 @@ int btn; int op_num; int mapping; /* i: switch allows suppression of mapping */ { int i, j; - static void btn_UnmapButtonbox(), btn_MapButtonbox(); /* check to see if we have the co-mode submenus */ if( buttonbox->cosubmenu_count > 0 ) { /* clear out the old cosubmenus */ for( i=0; i < buttonbox->cosubmenu_count; i++ ) diff -u5 -r saoimage-1.35.1/btnlib/resize.c saoimage-1.35.2/btnlib/resize.c --- saoimage-1.35.1/btnlib/resize.c 1990-04-21 00:15:57.000000000 +0200 +++ saoimage-1.35.2/btnlib/resize.c 2012-10-30 16:51:35.888564188 +0100 @@ -21,26 +21,27 @@ */ #include #include "buttons.h" +static void btn_ChkResize ( ButtonBox buttonbox, BoxParent * parent ) ; + /* * Subroutine: ResizeButtons * Purpose: Resize all buttons affected by resize of parent window * Returns: void * Called by: Application program * Uses: btn_ChkResize() * Xlib calls: none * Post-state: All buttonboxes having given parent are resized to fill * Method: Call btn_ChkResize with this menu and then its co-menus. */ -void ResizeButtons ( buttonbox, parent ) - ButtonBox buttonbox; /* i: top handle for button menu group */ - BoxParent *parent; /* i: record describing parent window */ +void ResizeButtons ( ButtonBox buttonbox, BoxParent * parent ) + /* i: top handle for button menu group */ + /* i: record describing parent window */ { int i; /* l: loop counter */ - static void btn_ChkResize(); /* check this buttonbox */ btn_ChkResize(buttonbox, parent); /* check co-buttonboxes */ for( i = 0; i < buttonbox->co_menu_count; i++ ) @@ -57,13 +58,13 @@ * Xlib calls: none * Post-state: All buttonboxes having given parent are resized to fill * Method: Check parentage of this box, then recurse on each submenu of * each button. */ -static void btn_ChkResize ( buttonbox, parent ) - ButtonBox buttonbox; /* i: top handle for button menu tree */ - BoxParent *parent; /* i: record describing parent window */ +static void btn_ChkResize ( ButtonBox buttonbox, BoxParent * parent ) + /* i: top handle for button menu tree */ + /* i: record describing parent window */ { int btn; /* l: index of active button */ int op; /* l: index of button pressing modifier mask */ int i; /* l: index of button submenu */ diff -u5 -r saoimage-1.35.1/btnlib/util.c saoimage-1.35.2/btnlib/util.c --- saoimage-1.35.1/btnlib/util.c 1990-04-21 00:28:44.000000000 +0200 +++ saoimage-1.35.2/btnlib/util.c 2012-10-30 19:49:01.107594149 +0100 @@ -17,10 +17,11 @@ * Modified: {0} Michael VanHilst initial version 18 March 1989 * {n} -- -- */ #include /* define stderr, NULL */ +#include /* define exit */ /* * Subroutine: btn_Alloc * Purpose: calloc with printf'less error message and exit for failure * Returns: char pointer to allocated and cleared space @@ -29,17 +30,13 @@ * Xlib calls: none * Post-state: space allocated on aligned boundary and zeroed * Note: printf does malloc so don't use it to report a malloc failure */ static char *errnote = " allocation failure\n"; -char *btn_Alloc ( count, size, errmess ) - int count; - unsigned int size; - char *errmess; +char *btn_Alloc ( int count, unsigned int size, char * errmess ) { char *space; - char *calloc(); if( (space = (char *)calloc((unsigned)count, size)) == NULL ) { fputs(errmess, stderr); fputs(errnote, stderr); exit( 0 ); diff -u5 -r saoimage-1.35.1/clralloc.c saoimage-1.35.2/clralloc.c --- saoimage-1.35.1/clralloc.c 1999-05-12 20:40:45.000000000 +0200 +++ saoimage-1.35.2/clralloc.c 2012-10-30 14:22:36.823749504 +0100 @@ -19,15 +19,19 @@ * {3} Doug Mink Compare XAllocColorCell to int 12 May 1999 * {n} -- -- */ #include /* stderr, FILE, NULL, etc. */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/define.h" /* YES, NO, MIN, MAX and more */ #include "hfiles/color.h" /* color structs */ +static Colormap create_colormap ( struct colorRec *color ) ; +static int alloc_color_cells ( struct colorRec * color, Colormap colormap, XVisualInfo * vinfo ) ; + #define COPIES 20 /* max number of default colors to copy to private map */ static unsigned int _npixels; /* for XAllocColorCells */ static unsigned int _nplanes; /* for XAllocColorCells */ static unsigned long overlay_mask; /* for XAllocColorCells */ @@ -41,12 +45,10 @@ */ int alloc_colors( color ) struct colorRec *color; { int verify_pseudocolor(); - static Colormap create_colormap(); - static int alloc_color_cells(); if( (color->map.default_permit != NO) && (color->map.default_enable == YES) && (alloc_color_cells(color, color->map.default_colormap, color->map.default_vinfo)) ) { @@ -91,14 +93,13 @@ * Returns: 1 if alloc's at least min cells, else 0 * PostState: * Xlib calls: XAllocColorCells() * Method: Grab as many cells as possible with overlay as specified */ -static int alloc_color_cells ( color, colormap, vinfo ) - struct colorRec *color; /* i: color info and handling struct */ - Colormap colormap; /* i: colormap in which to allocate */ - XVisualInfo *vinfo; +static int alloc_color_cells ( struct colorRec * color, Colormap colormap, XVisualInfo * vinfo ) + /* i: color info and handling struct */ + /* i: colormap in which to allocate */ { void free_color_cells(); int contig = 0; /* For those with few colors, let them see what they can do */ @@ -163,12 +164,11 @@ * Purpose: Create a private colormap with some of the default map's colors * copied into it. The copied colors are static (reducing the * number of available colors should the user attempt to increase * them later on. */ -static Colormap create_colormap ( color ) - struct colorRec *color; +static Colormap create_colormap ( struct colorRec *color ) { Colormap private_colormap; XColor cdef[COPIES]; int color_levels, copy_levels, i; void exit_errmsg(); diff -u5 -r saoimage-1.35.1/clrctrl.c saoimage-1.35.2/clrctrl.c --- saoimage-1.35.1/clrctrl.c 1990-04-20 16:43:37.000000000 +0200 +++ saoimage-1.35.2/clrctrl.c 2012-10-30 17:17:11.654329411 +0100 @@ -27,10 +27,13 @@ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/cgraph.h" extern struct cgraphRec cgraph; +static void new_color_table ( int map_code ) ; +static void invert_table ( struct subtableRec * table ) ; + #define BUTTONMASK (Button1Mask|Button2Mask|Button3Mask) #define EVENTMASK (ButtonPressMask|ButtonReleaseMask|ButtonMotionMask) /* * Subroutine: select_color @@ -40,11 +43,10 @@ { static int overlay = 0; static int cells = 0; static int mode = VOP_PseudoColor; void invert_rgb(), reinit_color(); - static void new_color_table(); if( control.response[0] == VOP ) { switch( control.response[1] ) { case 0: /* 0 is main menu, change only main mode */ @@ -186,12 +188,11 @@ /* * Subroutine: new_color_table * Purpose: Install a new pre-defined color table */ -static void new_color_table ( map_code ) - int map_code; +static void new_color_table ( int map_code ) { int fetch_colortable(); void make_cellstore_from_tables(), draw_cgraph(), label_gamma(); void set_submenu_toggle(); @@ -219,11 +220,10 @@ * Xlib call: XStoreColors() */ void invert_rgb ( ) { void make_cellstore_from_cellmaps(), draw_cgraph(); - static void invert_table(); /* invert color tables and remake storemap */ invert_table(&color.ctable.red); invert_table(&color.ctable.green); invert_table(&color.ctable.blue); @@ -233,12 +233,11 @@ /* redraw the color graph */ if( graphbox.active ) draw_cgraph(1, 0); } -static void invert_table ( table ) - struct subtableRec *table; +static void invert_table ( struct subtableRec * table ) { double *intensity; /* l: intensity by table vertex or cell */ int i, cnt; intensity = table->intensity; @@ -279,11 +278,11 @@ } adjust_main_colorbar(); draw_colorbar(0); /* force the blinking parameters to be rechecked */ clear_blink(); - if( cgraph.graph.ID != NULL ) { + if( cgraph.graph.ID != 0 ) { if( !color.single_plane ) { /* sometimes redundant: it also happens when the window is mapped */ adjust_color_graph(); adjust_graph_colorbar(); } diff -u5 -r saoimage-1.35.1/clrhard.c saoimage-1.35.2/clrhard.c --- saoimage-1.35.1/clrhard.c 1990-04-20 15:54:21.000000000 +0200 +++ saoimage-1.35.2/clrhard.c 2012-10-30 14:04:30.215281833 +0100 @@ -23,19 +23,24 @@ #include /* stderr, FILE, NULL, etc. */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* color structs */ +static int get_hard_color ( Display * display, Colormap colormap, char * name, int red, int green, int blue ) ; +static void lookup_color ( Display * display, Colormap colormap, XColor * xcolor, + char * desired_name, char * default_name ) ; +static int alloc_hard_color ( Display * display, Colormap colormap, XColor *xcolor ) ; +static void free_readonly_color ( struct colorRec * color, int pixel_value ) ; + /* * Subroutine: init_hard_colors * Purpose: Set up basic hardware colors */ void init_hard_colors ( color, colormap ) struct colorRec *color; Colormap colormap; { - static int get_hard_color(); color->hard.red = get_hard_color(color->display, colormap, "red", 63000, 0, 0); color->gcset.red.foreground = color->hard.red; color->hard.green = @@ -61,11 +66,10 @@ void lookup_cursor_colors ( color, colormap, init ) struct colorRec *color; Colormap colormap; int init; { - static void lookup_color(); /* update xcolor structs if needed */ if( init || (color->cur.desired_cur != NULL) ) { lookup_color(color->display, colormap, &(color->cur.color_cur), color->cur.desired_cur, color->cur.default_cur); @@ -93,11 +97,10 @@ int alloc_cursor_cell_color ( color, colormap ) struct colorRec *color; Colormap colormap; { int val; - static int alloc_hard_color(); if( (color->cur.disp_one = alloc_hard_color(color->display, colormap, &color->cur.color_one)) < 0 ) color->cur.disp_one = color->hard.blue; if( (color->cur.disp_two = @@ -114,11 +117,10 @@ * Purpose: Free cell color overlay colors */ void free_cursor_cell_color ( color ) struct colorRec *color; { - static void free_readonly_color(); free_readonly_color(color, (int)color->cur.color_one.pixel); free_readonly_color(color, (int)color->cur.color_two.pixel); free_readonly_color(color, (int)color->cur.color_cur.pixel); } @@ -126,13 +128,11 @@ /* * Subroutine: free_readonly_color * Purpose: Free cursor color if it is not one of the essential ones * Xlib calls: XFreeColors() */ -static void free_readonly_color ( color, pixel_value ) - struct colorRec *color; - int pixel_value; +static void free_readonly_color ( struct colorRec * color, int pixel_value ) { if( (pixel_value != color->hard.red) && (pixel_value != color->hard.green) && (pixel_value != color->hard.blue) && (pixel_value != color->hard.true_black) && @@ -147,15 +147,11 @@ * Subroutine: get_hard_color * Purpose: Alloc a read-only color cell with a common color * Xlib calls: XAllocNamedColor(), XAllocColor() * Method: Get a color by name if possible, else reserve it by value */ -static int get_hard_color ( display, colormap, name, red, green, blue ) - Display *display; - Colormap colormap; - char *name; - int red, green, blue; +static int get_hard_color ( Display * display, Colormap colormap, char * name, int red, int green, int blue ) { XColor actual, ideal; /* see if we can get a standard named color */ if( XAllocNamedColor(display, colormap, name, &actual, &ideal) == 0 ) { @@ -177,17 +173,12 @@ * Purpose: Set up the rgb values in the Xcolor * Xlib calls: XLookupColor * Method: Use the desired color if given and known to Xlib, else use * the defaut color. */ -static void lookup_color ( display, colormap, xcolor, - desired_name, default_name ) - Display *display; - Colormap colormap; - XColor *xcolor; - char *desired_name; - char *default_name; +static void lookup_color ( Display * display, Colormap colormap, XColor * xcolor, + char * desired_name, char * default_name ) { XColor ideal; if( desired_name != NULL ) { if( XLookupColor(display, colormap, desired_name, &ideal, xcolor) ) { @@ -204,14 +195,11 @@ * Subroutine: alloc_hard_color * Purpose: Given rgb values, set the pixel * Xlib calls: XAllocColor() * Returns: Pixel value used or -1 if failed */ -static int alloc_hard_color ( display, colormap, xcolor ) - Display *display; - Colormap colormap; - XColor *xcolor; +static int alloc_hard_color ( Display * display, Colormap colormap, XColor *xcolor ) { if( XAllocColor(display, colormap, xcolor) ) return( (int)xcolor->pixel ); else return( -1 ); diff -u5 -r saoimage-1.35.1/clrinit.c saoimage-1.35.2/clrinit.c --- saoimage-1.35.1/clrinit.c 2001-12-15 00:17:55.000000000 +0100 +++ saoimage-1.35.2/clrinit.c 2012-10-30 17:01:14.865807708 +0100 @@ -16,18 +16,21 @@ * {1} SGK support for 24B 14 Dec 2001 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* bcopy */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* color structs */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/control.h" /* to find verbose */ #include "hfiles/define.h" /* YES, NO, MIN, MAX and more */ extern struct controlRec control; /* decide how much to print */ +static int init_visual ( struct colorRec * color, int mindepth ) ; + #define MINPLANES 4 #define MAXPLANES 8 static int screen; static XVisualInfo default_vinfo; /* info about the default visual */ @@ -44,11 +47,10 @@ { int alloc_colors(); void exit_errmsg(), init_hard_colors(), init_halftone(); void free_color_cells(), lookup_cursor_colors(), free_cursor_cell_color(); void init_overlay_color(), init_cell_color(), init_halftone_color(); - static int init_visual(); if( init ) { display = color->display; if( init_visual(color, MINPLANES) == 0 ) { color->colormap_mode = VOP_Halftone; @@ -102,13 +104,12 @@ /* * Subroutine: init_visual * Purpose: Get basic info about the color hardware on hand */ -static int init_visual ( color, mindepth ) - struct colorRec *color; - int mindepth; /* i: minimum planes needed for color */ +static int init_visual ( struct colorRec * color, int mindepth ) + /* i: minimum planes needed for color */ { int verify_pseudocolor(); void exit_errmsg(); display = color->display; diff -u5 -r saoimage-1.35.1/clrmenu.c saoimage-1.35.2/clrmenu.c --- saoimage-1.35.1/clrmenu.c 1990-04-29 00:40:14.000000000 +0200 +++ saoimage-1.35.2/clrmenu.c 2012-10-30 14:08:18.495394037 +0100 @@ -15,20 +15,27 @@ * Modified: {0} Michael VanHilst initial version 16 May 1989 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* code values */ #include "hfiles/color.h" /* color structs */ #include "hfiles/colormap.h" /* color table storage structs */ #include "hfiles/define.h" /* define SZ_FNAME, etc. */ #include "hfiles/edit.h" /* EditStruct */ #include "defs/colormap.def" /* define color tables */ +static void load_newtable ( struct colorTable * ctable, ColorTable * new ) ; +static ColorTable *read_color_file ( ) ; +static void write_color_file ( char * imagefile, struct colorRec * color ) ; +static void print_one_color ( FILE * fp, struct subtableRec * table ) ; +static void load_subtable ( struct subtableRec * subtable, struct SubTable * new ) ; + EditStruct *color_edit; /* key to popup editor for file name input */ /* * Subroutine: fetch_colortable @@ -39,12 +46,10 @@ struct colorRec *color; int table_code; char *imagefile; /* i: imagefile name to print in output file */ { ColorTable *newtable; - static void load_newtable(), write_color_file(); - static ColorTable *read_color_file(); switch( table_code ) { case MOP_Init_A: newtable = &gray_map; break; @@ -109,17 +114,14 @@ /* * Subroutine: write_color_file * Purpose: Open and write a color table file */ -static void write_color_file ( imagefile, color ) - char *imagefile; - struct colorRec *color; +static void write_color_file ( char * imagefile, struct colorRec * color ) { FILE *fp; int error; - static void print_one_color(); EditStruct *init_edit_popup(); int open_output_file(); void timestamp(); error = 0; @@ -164,13 +166,11 @@ /* * Subroutine: * Purpose: */ -static void print_one_color ( fp, table ) - FILE *fp; - struct subtableRec *table; +static void print_one_color ( FILE * fp, struct subtableRec * table ) { int i, j; if( table->do_gamma ) (void)fprintf(fp, " gamma %.3f\n", table->gamma); else @@ -187,28 +187,23 @@ /* * Subroutine: load_newtable * Purpose: Load an internally stored color table for use */ -static void load_newtable ( ctable, new ) - struct colorTable *ctable; - ColorTable *new; +static void load_newtable ( struct colorTable * ctable, ColorTable * new ) { - static void load_subtable(); load_subtable(&ctable->red, &new->red); load_subtable(&ctable->green, &new->green); load_subtable(&ctable->blue, &new->blue); } /* * Subroutine: load_subtable * Purpose: Load one color of the internal color table */ -static void load_subtable ( subtable, new ) - struct subtableRec *subtable; - struct SubTable *new; +static void load_subtable ( struct subtableRec * subtable, struct SubTable * new ) { int i; subtable->fixed_cells = 0; if( new->do_gamma ) { diff -u5 -r saoimage-1.35.1/clrread.c saoimage-1.35.2/clrread.c --- saoimage-1.35.1/clrread.c 1990-04-29 01:30:35.000000000 +0200 +++ saoimage-1.35.2/clrread.c 2012-10-30 14:13:06.790831485 +0100 @@ -15,14 +15,21 @@ * Modified: {0} Michael VanHilst initial version 21 Nov 1989 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* strcpy */ #include /* toupper, isalpha, etc. */ #include "hfiles/colormap.h" /* color table storage structs */ #include "hfiles/define.h" /* define SZ_LINE, etc. */ +static int advance_to_ascii ( FILE * fp, char * line, char * scratch, int len, int * line_num, int dont_end ) ; +static int parse_color_table ( FILE * fp, char * line, char * cbuf, int i, int len, int * line_num, + struct SubTable * farb, int max_entries, int color_cnt ) ; +static int prep_alpha ( char * line, int len ) ; +static int find_token ( char * line, int len ) ; + /* * Subroutine: parse_color_file * Purpose: Parse values after color identifier */ int parse_color_file ( fp, ctable, max_entries ) @@ -33,11 +40,10 @@ int len, i; int line_num; char line[SZ_LINE]; char cbuf[SZ_LINE]; struct SubTable *table; - static int parse_color_table(), advance_to_ascii(); line_num = 0; /* advance to first non-comment line */ len = advance_to_ascii(fp, line, cbuf, SZ_LINE, &line_num, 1); if( len == 0 ) @@ -93,26 +99,24 @@ /* * Subroutine: parse_color_table * Purpose: Read color table entries for one color * Note: Values may start with word "gamma" and its value */ -static int parse_color_table ( fp, line, cbuf, i, len, line_num, - farb, max_entries, color_cnt ) - FILE *fp; - char *line; /* i/l: line as read from file */ - char *cbuf; /* i/l: buffer for processing string */ - int i; /* i/l: index in working buffer of token */ - int len; /* i: length of character buffers */ - int *line_num; /* i/o: line number in file */ - struct SubTable *farb; /* i/o: structure to get color table info */ - int max_entries; /* i: maximum number of entries in table */ - int color_cnt; /* i: number of colors done so far */ +static int parse_color_table ( FILE * fp, char * line, char * cbuf, int i, int len, int * line_num, + struct SubTable * farb, int max_entries, int color_cnt ) + /* i/l: line as read from file */ + /* i/l: buffer for processing string */ + /* i/l: index in working buffer of token */ + /* i: length of character buffers */ + /* i/o: line number in file */ + /* i/o: structure to get color table info */ + /* i: maximum number of entries in table */ + /* i: number of colors done so far */ { float level, intensity; char *level_token, *intensity_token; int status, entry; - static int advance_to_ascii(), prep_alpha(); int check_parens(); char *next_token(); status = 0; intensity_token = NULL; @@ -225,20 +229,19 @@ * Purpose: Get next processable line, and prepare a copy for processing * Returns: Positive character count if string starts with a name * Negative val if string starts with a number or paren * 0 if file ended, or first character was neither char nor num */ -static int advance_to_ascii ( fp, line, scratch, len, line_num, dont_end ) - FILE *fp; /* i: file descriptor */ - char *line; /* i: buffer to get entire line */ - char *scratch; /* i/o: buffer to get string ready for processing */ - int len; /* i: length of buffers */ - int *line_num; /* i/o: current line number */ - int dont_end; /* flag that more is definitely expected */ +static int advance_to_ascii ( FILE * fp, char * line, char * scratch, int len, int * line_num, int dont_end ) + /* i: file descriptor */ + /* i: buffer to get entire line */ + /* i/o: buffer to get string ready for processing */ + /* i: length of buffers */ + /* i/o: current line number */ + /* flag that more is definitely expected */ { int i; - static int find_token(), prep_alpha(); int check_parens(); /* advance to first non-comment line */ do { if( fgets(line, len, fp) == NULL ) { @@ -274,13 +277,11 @@ /* * Subroutine: find_token * Purpose: Point at first non-space character if it might be parsable * Returns: index of character, or -1 if line ends or is comment */ -static int find_token ( line, len ) - char *line; - int len; +static int find_token ( char * line, int len ) { int i = 0; /* advance to next first non-space character */ while( (line[i] == ' ') || (line[i] == '\t') ) { if( ++i >= len ) @@ -295,12 +296,11 @@ /* * Subroutine: prep_alpha * Purpose: Convert all characters to upper case and null terminate word * Returns: Number of characters in the word */ -static int prep_alpha ( line, len ) - char *line; +static int prep_alpha ( char * line, int len ) { int i = 0; /* advance to next first non-space character */ while( (i < len) && (isalpha(line[i])) ) { if( islower(line[i]) ) diff -u5 -r saoimage-1.35.1/clrsetup.c saoimage-1.35.2/clrsetup.c --- saoimage-1.35.1/clrsetup.c 1990-06-03 06:07:29.000000000 +0200 +++ saoimage-1.35.2/clrsetup.c 2012-10-30 14:24:13.038249278 +0100 @@ -22,21 +22,25 @@ #include /* stderr, NULL, etc. */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* color structs */ +static void init_cellstore ( XColor *cellstore, unsigned long * pixvalmap, int ncolors ) ; +static void copy_xcolor_rgb ( XColor * orig, XColor * dup ) ; + +static void set_cursor_overlay_color ( struct colorRec * color, XColor * cellstore ) ; + /* * Subroutine: init_overlay_color * Purpose: Set up color parameters unique to overlay type usage * Xlib calls: XStoreColors() */ void init_overlay_color ( color ) struct colorRec *color; { int ncolors; void make_cellstore_from_tables(); - static void set_cursor_overlay_color(), copy_xcolor_rgb(), init_cellstore(); init_cellstore(color->cellstore, color->pixvalmap, color->ncolors); /* color in the cursor range of the color map */ set_cursor_overlay_color(color, &color->cellstore[color->ncolors]); /* set aside two pixel values for region maps */ @@ -78,11 +82,10 @@ void init_cell_color ( color ) struct colorRec *color; { void make_cellstore_from_tables(); int alloc_cursor_cell_color(); - static void init_cellstore(); init_cellstore(color->cellstore, color->pixvalmap, color->ncolors); /* Not cursor plane */ color->image_plane_mask = AllPlanes; /* Set up the cursor drawing parameters */ @@ -149,14 +152,11 @@ /* * Subroutine: init_cellstore * Purpose: Set the pixel values in the color cellstore */ -static void init_cellstore ( cellstore, pixvalmap, ncolors ) - XColor *cellstore; - unsigned long *pixvalmap; - int ncolors; +static void init_cellstore ( XColor *cellstore, unsigned long * pixvalmap, int ncolors ) { int i; for( i=0; ired = orig->red; dup->green = orig->green; dup->blue = orig->blue; } /* * Subroutine: set_cursor_overlay_color * Purpose: Set the cellstore entries for an overlay cursor */ -static void set_cursor_overlay_color ( color, cellstore ) - struct colorRec *color; - XColor *cellstore; +static void set_cursor_overlay_color ( struct colorRec * color, XColor * cellstore ) { unsigned long *pixvalmap, overlay_bit; unsigned short red, green, blue; int i; diff -u5 -r saoimage-1.35.1/clrvary.c saoimage-1.35.2/clrvary.c --- saoimage-1.35.1/clrvary.c 1990-04-20 15:57:20.000000000 +0200 +++ saoimage-1.35.2/clrvary.c 2012-10-30 14:25:10.671549376 +0100 @@ -22,10 +22,11 @@ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/cgraph.h" /* color graph structs */ #include "hfiles/define.h" /* define SQR */ extern struct cgraphRec cgraph; +static void invert_table ( struct subtableRec * table ) ; /* * Subroutine: vary_colors * Purpose: Modify colors as per mode and the mouse position */ @@ -135,11 +136,10 @@ double contrast; /* i: normal = 1.0 */ double bias; /* i: normal = 0.5 */ { double *base_level, *cell_level; int vertex_cnt; - static void invert_table(); base_level = table->base_level; cell_level = table->cell_level; vertex_cnt = table->vertex_cnt; if( contrast < 0.0 ) { @@ -157,12 +157,11 @@ } table->bias = bias; table->contrast = contrast; } -static void invert_table ( table ) - struct subtableRec *table; +static void invert_table ( struct subtableRec * table ) { int i, j; double *intensity; intensity = table->intensity; for( i = 0, j = table->vertex_cnt - 1; i < j; i++, j-- ) { diff -u5 -r saoimage-1.35.1/cmdnew.c saoimage-1.35.2/cmdnew.c --- saoimage-1.35.1/cmdnew.c 1997-06-06 16:52:04.000000000 +0200 +++ saoimage-1.35.2/cmdnew.c 2012-10-30 20:21:49.746715351 +0100 @@ -21,10 +21,12 @@ * {4} Doug Mink do not initialize min/max flags 6 June 1997 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* strcpy */ +#include /* free */ #ifndef VMS #ifdef SYSV #include #else @@ -44,10 +46,18 @@ #include "hfiles/edit.h" #ifdef VMS #define close_disk close_pipe #endif +static int new_command ( char * input_line ) ; +static char **make_argv ( int maxargs ) ; +static void redo_displays ( ) ; +static void clear_params ( ) ; +static void reset_dispparams ( ) ; +static void free_argv ( char ** argv, int maxargs ) ; +static int form_tokens ( char * input_string, char ** argv, int maxargs ) ; +static int new_file ( ) ; static char input_line[SZ_LINE]; static char fname[SZ_FNAME]; /* @@ -73,11 +83,10 @@ * Called by: key_response() in MainKey.c * Called by: select_environment() in MainSelect.c */ void get_new_cmd ( ) { - static int new_command(); int get_edit_input(); EditStruct *init_edit_popup(); if( cmd_edit == NULL ) cmd_edit = init_edit_popup(input_line, SZ_LINE); @@ -93,22 +102,18 @@ /* * Subroutine: new_command * Purpose: Given a new command line, parse it and do what is called for * Returns: 1 = success, 0 = user decided not to do anything, -1 = error */ -static int new_command ( input_line ) - char *input_line; +static int new_command ( char * input_line ) { char **argv; int argc; int parse_status; int headersize; int parse_cmdline(), check_image(); void reinit_color(), redraw_magnifier(), touch_submenu_button(); - static char **make_argv(); - static int new_file(), form_tokens(); - static void redo_displays(), clear_params(), reset_dispparams(), free_argv(); /* store some key initial values */ headersize = img.headersize; /* reinitialize user settings */ clear_params(); @@ -226,12 +231,11 @@ /* * Subroutine: make_argv * Purpose: Allocate space used for commandline */ -static char **make_argv ( maxargs ) - int maxargs; +static char **make_argv ( int maxargs ) { int i; char **argv; char *calloc_errchk(); @@ -243,13 +247,11 @@ /* * Subroutine: free_argv * Purpose: Free the space used for parsing the command line */ -static void free_argv ( argv, maxargs ) - int maxargs; - char **argv; +static void free_argv ( char ** argv, int maxargs ) { int i; for( i=0; i /* stderr, NULL, etc. */ #include +#include /* strcpy */ #ifndef VMS #ifdef SYSV #include #else @@ -39,10 +40,11 @@ extern int init_done; /* flag set at end of initialization indicates redo */ #ifdef ALLIANT extern int bad_buttons; #endif +static int parse_etc ( int argc, char * argv[], int * argi ) ; /* * Subroutine: parse_cmdline * Purpose: Process options to set filename and change defaults * Returns: -1 on error, 0 OK but no filename, 1 OK and new filename given @@ -56,11 +58,10 @@ int got, init; int parse_display(), parse_filename(), parse_filetype(), parse_connection(); int parse_rotate(), parse_scale(), parse_color(), parse_fileread(), usage(); int parse_cursor(); void init_cmdline(); - static int parse_etc(); if( displayname != NULL ) { /* if initial program command line, strip off program name, store line */ argc--; argv = &(argv[1]); @@ -141,14 +142,14 @@ /* * Subroutine: parse_etc * Purpose: Parse command line for things settings from the etc menu */ -static int parse_etc ( argc, argv, argi ) - int argc; /* total number of arg tokens */ - char *argv[]; /* array of arg tokens */ - int *argi; /* arg to check */ +static int parse_etc ( int argc, char * argv[], int * argi ) + /* total number of arg tokens */ + /* array of arg tokens */ + /* arg to check */ { void set_submenu_toggle(); extern void setdefwcs(); extern void center_pointer(); int i; diff -u5 -r saoimage-1.35.1/crdinvrt.c saoimage-1.35.2/crdinvrt.c --- saoimage-1.35.1/crdinvrt.c 1990-04-20 16:00:26.000000000 +0200 +++ saoimage-1.35.2/crdinvrt.c 2012-10-30 14:34:18.133233071 +0100 @@ -20,10 +20,12 @@ #include /* stderr, NULL, etc */ #include /* get trig functions, sqrt, and fabs */ #include "hfiles/coord.h" /* Transform and other coord structs */ #define N 3 /* all matrices are 3x3 */ +static void lu_decompose ( float mtrx[3][3], int pivots[3] ) ; +static void lu_backsub ( float lumtrx[N][N], int pivots[N], float result [N]) ; /* * Subroutine: invert_matrix * Purpose: Compute parameters of the inverse transform * Method: Uses LU decomposition method @@ -31,11 +33,10 @@ void invert_matrix ( old, new ) Transform *old, *new; { float scratch[3][3], column[3]; int pivots[3]; - static void lu_decompose(), lu_backsub(); scratch[0][0] = old->inx_outx; scratch[1][0] = old->iny_outx; scratch[2][0] = old->add_outx; scratch[0][1] = old->inx_outy; @@ -69,11 +70,10 @@ Transform *old, *new; float ioff; { float scratch[3][3], column[3]; int pivots[3]; - static void lu_decompose(), lu_backsub(); /* set transform equations in matrix form */ scratch[0][0] = old->inx_outx; scratch[1][0] = old->iny_outx; scratch[2][0] = old->add_outx + ioff; @@ -97,13 +97,11 @@ /* * Subroutine: lu_decompose * Purpose: lower upper decompose matrix (in place) for matrix inversion */ -static void lu_decompose ( mtrx, pivots ) - float mtrx[3][3]; - int pivots[3]; +static void lu_decompose ( float mtrx[3][3], int pivots[3] ) { int i, j, k, imax; double sum, mag, column_max; float merit; float rescale[3]; @@ -171,14 +169,11 @@ /* * Subroutine: lu_backsub * Purpose: LowerUpper backsubstitute one column to solve matrix inversion */ -static void lu_backsub ( lumtrx, pivots, result ) - float lumtrx[N][N]; - int pivots[N]; - float result[N]; +static void lu_backsub ( float lumtrx[N][N], int pivots[N], float result [N]) { int index, pivot; double sum; int i, j; diff -u5 -r saoimage-1.35.1/crdrot.c saoimage-1.35.2/crdrot.c --- saoimage-1.35.1/crdrot.c 1990-04-20 16:00:51.000000000 +0200 +++ saoimage-1.35.2/crdrot.c 2012-10-30 14:36:59.490033752 +0100 @@ -14,11 +14,16 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 16 March 1988 * {n} -- -- */ +#include /* bzero */ #include "hfiles/coord.h" /* coord structs */ +static void move_mtrx ( Transform * mtrx, double xtran, double ytran, double ioff, int prior ) ; +static void mult_mtrx ( Transform * new, Transform * first, Transform * second ) ; +static void flip_mtrx ( Transform * mtrx, int prior ) ; +static void turn_mtrx ( Transform * mtrx, int angle, int prior ) ; /* * rotation matrix for coordinates (rotate on perpendicular (Z) axis) * * | cos() sin() 0 | cos(0)= 1, cos(90)= 0, cos(180)=-1, cos(270)= 0 @@ -61,11 +66,10 @@ int flip; int rotcode; { double xmove, ymove; int angle; - static void move_mtrx(), flip_mtrx(), turn_mtrx(); /* if no rotation, do nothing */ if( (rotcode == 0) && (flip == 0) ) return; /* determine offset from real edge to real center */ xmove = (double)img->width / 2.0; @@ -91,18 +95,13 @@ * Parameter: prior: 1: move, do transform, move, 0: do transform, move * Parameter: ioff: offset of integer coord (i.e. 0.5), needed for prior=1 * Note: ioff is not used for turn or flip, as it is assumed that both * will be bracketed between two moves (to place origin at center) */ -static void move_mtrx ( mtrx, xtran, ytran, ioff, prior ) - Transform *mtrx; - double xtran, ytran; - double ioff; - int prior; +static void move_mtrx ( Transform * mtrx, double xtran, double ytran, double ioff, int prior ) { Transform translate; - static void mult_mtrx(); bzero((char *)(&translate), sizeof(Transform)); translate.inx_outx = 1.0; translate.iny_outy = 1.0; translate.add_outx = (float)xtran; @@ -117,16 +116,14 @@ /* * Subroutine: flip_mtrx * Purpose: Apply a mirror reflection to the passed Transform */ -static void flip_mtrx ( mtrx, prior ) - Transform *mtrx; - int prior; /* i: 1: move, transform, move, 0: transform, move */ +static void flip_mtrx ( Transform * mtrx, int prior ) + /* i: 1: move, transform, move, 0: transform, move */ { Transform reflect; - static void mult_mtrx(); bzero((char *)(&reflect), sizeof(Transform)); reflect.inx_outx = 1.0; reflect.iny_outy = -1.0; if( prior ) @@ -139,18 +136,15 @@ * Subroutine: turn_mtrx * Purpose: Apply given angular rotation to the passed Transform * Note: the pivot is 0,0 of the passed Transform's coordinate system * Exception: only multiples of 90 degrees are allowed */ -static void turn_mtrx ( mtrx, angle, prior ) - Transform *mtrx; - int angle; - int prior; /* i: 1: move, transform, move, 0: transform, move */ +static void turn_mtrx ( Transform * mtrx, int angle, int prior ) + /* i: 1: move, transform, move, 0: transform, move */ { Transform rotate; void exit_errmsg(); - static void mult_mtrx(); while( angle >= 360 ) angle -= 360; while( angle < 0 ) angle += 360; bzero((char *)(&rotate), sizeof(Transform)); switch( angle ) { @@ -191,14 +185,14 @@ * Method: algorithm is 3x3 matrix multiplication (3rd row is 0 0 1) * [i][j] is sum of products of column j of 1st and row i of 2nd * Note: iadd is computed to be able to transform from integer coords * calculation uses integer input offset of first and float offset of second */ -static void mult_mtrx ( new, first, second ) - Transform *new; /* i/o: gets result, can be same as first or second */ - Transform *first; /* i: matrices in non-commutative multiply */ - Transform *second; /* i: as above (new = 1st * 2nd) */ +static void mult_mtrx ( Transform * new, Transform * first, Transform * second ) + /* i/o: gets result, can be same as first or second */ + /* i: matrices in non-commutative multiply */ + /* i: as above (new = 1st * 2nd) */ { Transform temp; temp.inx_outx = ((second->inx_outx * first->inx_outx) + (second->iny_outx * first->inx_outy)); diff -u5 -r saoimage-1.35.1/crdset.c saoimage-1.35.2/crdset.c --- saoimage-1.35.1/crdset.c 1996-02-26 21:12:33.000000000 +0100 +++ saoimage-1.35.2/crdset.c 2012-10-30 14:37:23.899155380 +0100 @@ -28,10 +28,11 @@ * Modified: {0} Michael VanHilst initial version 1 September 1988 * {1} MVH support for file buffer coord sys 19 Feb 1990 * {2} Doug Mink different X,Y zoom factors 26 Feb 1996 * {n} -- -- */ +#include /* bcopy */ #include "hfiles/coord.h" /* coord structs */ #include "hfiles/image.h" /* image struct */ /* diff -u5 -r saoimage-1.35.1/crdsynth.c saoimage-1.35.2/crdsynth.c --- saoimage-1.35.1/crdsynth.c 1990-04-20 16:01:55.000000000 +0200 +++ saoimage-1.35.2/crdsynth.c 2012-10-30 14:37:54.099306048 +0100 @@ -20,10 +20,11 @@ */ #include /* stderr, NULL, etc */ #include /* get trig functions, sqrt, and fabs */ #include "hfiles/coord.h" /* coord structs */ +static int integer_test ( double fzoom, int * izoom ) ; /* * Subroutine: invert_transform * Purpose: Create matrix to perform opposite transformation * Given AtoB (old) and Bsys ioff, compute BtoA (new) @@ -149,11 +150,10 @@ */ void set_trans_speed ( trans ) Transform *trans; { int xzm, yzm; - static int integer_test(); trans->ixzoom = 0; trans->iyzoom = 0; /* is it an unflipped transform? */ if( CLOSE(trans->iny_outx, 0) && CLOSE(trans->inx_outy, 0) ) { @@ -203,13 +203,13 @@ * Subroutine: integer_test * Returns: 0 if not possible, 1 for zoom up, -1 for zoom down * Purpose: Test zoom to determine whether it could be computed * with integer math */ -static int integer_test ( fzoom, izoom ) - double fzoom; /* i: zoom factor (>1, ==1, or <1) */ - int *izoom; /* o: integer zoom factor (>1 or ==1) */ +static int integer_test ( double fzoom, int * izoom ) + /* i: zoom factor (>1, ==1, or <1) */ + /* o: integer zoom factor (>1 or ==1) */ { int ival; /* test for unity scaling */ if( CLOSE(fzoom, 1) ) { diff -u5 -r saoimage-1.35.1/crdtemp.c saoimage-1.35.2/crdtemp.c --- saoimage-1.35.1/crdtemp.c 1996-02-26 21:14:19.000000000 +0100 +++ saoimage-1.35.2/crdtemp.c 2012-10-30 14:39:56.414918004 +0100 @@ -21,11 +21,14 @@ * {2} Doug Mink add argument to set_transform 26 Feb 1996 * {n} -- -- */ #include /* stderr, NULL, etc */ +#include /* bcopy */ #include "hfiles/coord.h" /* coord structs */ +void panedge_zoom ( struct coordRec * coord, Transform * wintoimgtrans, int win_x, int win_y ) ; + static int choose_zoom ( int dst_width, int dst_height, int src_width, int src_height ) ; #define MAX(a,b) (((a) > (b)) ? (a) : (b)) /* * Subroutine: set_tdisp @@ -124,19 +127,18 @@ /* * Subroutine: panedge_zoom * Purpose: set up zoom given edges of desired display and * appropriate img transform */ -void panedge_zoom ( coord, wintoimgtrans, win_x, win_y ) - struct coordRec *coord; /* i: collected coords */ - Transform *wintoimgtrans; /* i: transform from mouse's window to img */ - int win_x, win_y; /* i: window coords of mouse event */ +void panedge_zoom ( struct coordRec * coord, Transform * wintoimgtrans, int win_x, int win_y ) + /* i: collected coords */ + /* i: transform from mouse's window to img */ + /* i: window coords of mouse event */ { float imgX, imgY; int box_width, box_height; void i_transform(); - static int choose_zoom(); /* calculate image coordinates of win_x and win_y */ i_transform(wintoimgtrans, win_x, win_y, &imgX, &imgY); /* select zoom based on this box */ box_width = abs((int)coord->tid.cenX - (int)imgX) * 2 + 1; @@ -161,15 +163,15 @@ * display window * Method: Choose a zoom which comes closest to putting the ref point * on an edge while still enclosing it * Returns: Source-to-dest integer blocking code */ - static int choose_zoom ( dst_width, dst_height, src_width, src_height ) - int dst_width; /* width of window */ - int dst_height; /* height of window */ - int src_width; /* width of image section */ - int src_height; /* height of image section */ + static int choose_zoom ( int dst_width, int dst_height, int src_width, int src_height ) + /* width of window */ + /* height of window */ + /* width of image section */ + /* height of image section */ { int i; /* limit width and height just in case */ src_width = MAX(1, src_width); diff -u5 -r saoimage-1.35.1/csrarea.c saoimage-1.35.2/csrarea.c --- saoimage-1.35.1/csrarea.c 1990-04-20 16:07:03.000000000 +0200 +++ saoimage-1.35.2/csrarea.c 2012-10-30 14:44:40.851350800 +0100 @@ -20,10 +20,12 @@ #include "hfiles/color.h" /* cursor colors needed by Cursor.h */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/cursor.h" /* define cursor parameter structures */ #define PI 3.14159265358979323846 +static int test_cross ( PolyPoint * pt, int cnt, int j, int i ) ; +static int intercept ( double x21, double y21, double x22, double y22 ) ; /* * Subroutine: cursor_area * Purpose: Calculate area, in float units file pixels, enclosed by cursor * Method: Use mathematical formula appropriate to cursor type @@ -32,11 +34,10 @@ struct cursorRec *cursor; int user_info; /* flag, data is for user info */ { double area; int i, j; - static int test_cross(); switch( cursor->type ) { case COP_Circle: area = PI * cursor->file.Xdim * cursor->file.Xdim; break; @@ -81,17 +82,16 @@ * method: Starting with last edge, test each edge against subsequent * edges. Routine recurses with for next edge. Adjacent edges * are not tested since neighbors cannot cross but neighbors do * share a common point. */ -static int test_cross ( pt, cnt, j, i ) - PolyPoint *pt; /* list of vertices */ - int cnt; /* number of vertices */ - int j, i; /* two vertices at ends of edge being tested */ +static int test_cross ( PolyPoint * pt, int cnt, int j, int i ) + /* list of vertices */ + /* number of vertices */ + /* two vertices at ends of edge being tested */ { int k; - static int intercept(); if( (i+2) >= cnt ) { return( 0 ); } else { x11 = pt[j].fileX; @@ -114,12 +114,11 @@ * Purpose: Test this edge against the reference edge * Method: A) Minmax test if two edges have overlapping coordinates. * B) Calculate the intercept of the two lines. * C) Test if intercept is within both edges. */ -static int intercept ( x21, y21, x22, y22 ) - double x21, y21, x22, y22; +static int intercept ( double x21, double y21, double x22, double y22 ) { double xpt, ypt, m1, m2; /* try minmax test */ if( x11 > x12 ) { diff -u5 -r saoimage-1.35.1/csrgrab.c saoimage-1.35.2/csrgrab.c --- saoimage-1.35.1/csrgrab.c 1990-04-20 16:08:42.000000000 +0200 +++ saoimage-1.35.2/csrgrab.c 2012-10-30 14:47:01.666064389 +0100 @@ -24,10 +24,14 @@ #include "hfiles/constant.h" /* define codes */ #include "hfiles/cursor.h" /* define cursor parameter structures */ #include "hfiles/define.h" /* SMALL_NUMBER, LARGE_NUMBER and more */ extern struct colorRec color; /* need to know color.gcset */ +static void size_annulus ( struct cursorRec * cursor, XEvent * event ) ; +static int on_annulus ( struct cursorRec * cursor, struct cursorRec ** pointer ) ; +static void remove_annulus ( struct cursorRec * parent ) ; +static void grab_annulus ( struct cursorRec * cursor ) ; #define GRAB_RANGE 5.0 #define ANN_INSIDE 2 #define ANN_ON 1 #define ANN_BETWEEN 8 @@ -41,11 +45,10 @@ void size_annuli ( cursor, event ) struct cursorRec *cursor; XEvent *event; /* i: event for location of mouse */ { void draw_cursor(), make_cursor(); - static void size_annulus(), grab_annulus(); /* if this event is initiating tracking, don't erase the cursor */ if( event->type == MotionNotify ) /* erase existing cursor */ draw_cursor(cursor, &color.gcset.undraw); @@ -67,12 +70,10 @@ void delete_annulus ( cursor, event ) struct cursorRec *cursor; XEvent *event; /* i: XMotionEvent or XButtonEvent */ { struct cursorRec *parent; - static int on_annulus(); - static void size_annulus(), remove_annulus(); /* if there are two or more annuli */ if( (cursor->next_annulus != 0) && (cursor->next_annulus->next_annulus != 0) ) { /* size the cursor so we can compare its size with the annuli */ @@ -86,13 +87,12 @@ /* * Subroutine: size_annulus * Purpose: Change size of cursor to intersect current mouse cursor * while keeping aspect ratio of cursor constant */ -static void size_annulus ( cursor, event ) - struct cursorRec *cursor; - XEvent *event; /* i: XMotionEvent for location of mouse */ +static void size_annulus ( struct cursorRec * cursor, XEvent * event ) + /* i: XMotionEvent for location of mouse */ { double rayX, rayY; double axis_ratio; /* compute distance from center */ @@ -139,12 +139,12 @@ /* * Subroutine: remove_annulus * Purpose: Remove an annular ring from annulus linked list and screen */ -static void remove_annulus ( parent ) - struct cursorRec *parent; /* i: annulus just before one to be removed */ +static void remove_annulus ( struct cursorRec * parent ) + /* i: annulus just before one to be removed */ { int index; struct cursorRec *annulus; void draw_cursor(), free_cursor(); @@ -167,18 +167,15 @@ /* * Subroutine: grab_annulus * Purpose: Set up cursor to for a size annulus interaction * Called by: size_annuli() */ -static void grab_annulus ( cursor ) - struct cursorRec *cursor; +static void grab_annulus ( struct cursorRec * cursor ) { double inc; int code; struct cursorRec *parent, *annulus; - static int on_annulus(); - static void remove_annulus(); code = on_annulus(cursor, &parent); /* decide what to draw */ /* if grab, erase grabbed */ if( code == ANN_ON ) { @@ -211,13 +208,11 @@ * Subroutine: on_annulus * Purpose: Compare size of cursor with annuli * Returns: Code describing relation to annuli * PostState: Sets pointer to nearest annulus inside of cursor */ -static int on_annulus ( cursor, pointer ) - struct cursorRec *cursor; - struct cursorRec **pointer; +static int on_annulus ( struct cursorRec * cursor, struct cursorRec ** pointer ) { double grabmax, grabmin; struct cursorRec *last_ann, *annulus; int code; diff -u5 -r saoimage-1.35.1/csrpoly1.c saoimage-1.35.2/csrpoly1.c --- saoimage-1.35.1/csrpoly1.c 1990-04-20 16:11:54.000000000 +0200 +++ saoimage-1.35.2/csrpoly1.c 2012-10-30 14:48:15.349453275 +0100 @@ -17,19 +17,23 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 4 June 1989 * {n} -- -- */ +#include /* bcopy */ + #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* cursor colors needed by Cursor.h */ #include "hfiles/coord.h" /* coord structs */ #include "hfiles/cursor.h" /* define cursor parameter structures */ #include "hfiles/define.h" /* define SQR, etc */ extern struct colorRec color; /* need to know color.gcset */ +static int on_polygon_vertex ( int x, int y, XPoint * vertex, int cnt ) ; + #define GRAB_RANGE 8 /* * Subroutine: grab_polygon_vertex * Purpose: Identify or create polygon vertex for manipulation @@ -43,11 +47,10 @@ { int x, y; /* l: coordinates of event */ int pt; /* l: index of polygon vertex */ int closest_polygon_line(); void draw_cursor(), add_polygon_vertex(); - static int on_polygon_vertex(); /* erase existing cursor */ draw_cursor(cursor, &color.gcset.undraw); x = event->xbutton.x; y = event->xbutton.y; @@ -88,11 +91,10 @@ struct cursorRec *cursor; XEvent *event; /* i: XbuttonEvent (ButtonPress) for x & y */ { int i; void delete_polygon_vertex(), draw_cursor(); - static int on_polygon_vertex(); i = on_polygon_vertex((int)event->xbutton.x, (int)event->xbutton.y, cursor->points, cursor->poly_cnt); if( i >= 0 ) { /* if changing cursor messes up image, request repainted image */ @@ -205,14 +207,11 @@ * Subroutine: on_polygon_vertex * Purpose: Test for being on a polygon point, return its index * Note: If more than one vertex are within range, choose closest * Note: (if ambiguity, favor point towards end - top down search) */ -static int on_polygon_vertex ( x, y, vertex, cnt ) - int x, y; - XPoint *vertex; - int cnt; +static int on_polygon_vertex ( int x, int y, XPoint * vertex, int cnt ) { register int i; int match = -1; for( i=cnt-1; i>=0; i-- ) { diff -u5 -r saoimage-1.35.1/csrpoly2.c saoimage-1.35.2/csrpoly2.c --- saoimage-1.35.1/csrpoly2.c 1998-07-09 18:29:27.000000000 +0200 +++ saoimage-1.35.2/csrpoly2.c 2012-10-30 14:49:05.133719935 +0100 @@ -21,16 +21,18 @@ * {1} Paul Sydney declare polysz int 9 July 1998 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* bcopy */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* cursor colors needed by Cursor.h */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/coord.h" /* coord structs */ #include "hfiles/cursor.h" /* define cursor parameter structures */ +static void init_polygon ( ) ; /* define parameters for hash marks (size, number of vertices available */ #define HASH_RAY 2 #define HASH_SIDE 4 @@ -75,11 +77,10 @@ void start_polygon ( cursor, coord ) struct cursorRec *cursor; struct coordRec *coord; { void set_polygon_from_file_coords(); - static void init_polygon(); if( polysz == 0 ) init_polygon(); cursor->poly_cnt = 1; cursor->rectangle_cnt = 1; diff -u5 -r saoimage-1.35.1/csrpoly3.c saoimage-1.35.2/csrpoly3.c --- saoimage-1.35.1/csrpoly3.c 1990-04-20 16:11:40.000000000 +0200 +++ saoimage-1.35.2/csrpoly3.c 2012-10-30 14:50:41.065233237 +0100 @@ -18,10 +18,12 @@ #include /* define sqrt() */ #include /* X window stuff */ #define ABS(a) ((a) < 0 ? (-(a)) : (a)) #define SQR(a) ((a) * (a)) +static double distance_from_segment ( int x_ref, int y_ref, int x1, int y1, int x2, int y2, int * endpoint ) ; +static double cos_to_segment ( int x_ref, int y_ref, int x1, int y1, int x2, int y2, int endpoint ) ; /* * Subroutine: closest_polygon_line * Purpose: Test for the closest polygon segment * Note: in case of tie chose segment forming smallest angle with @@ -36,11 +38,10 @@ double min_distance, min_cosine; double new_distance, new_cosine; int min_endpoint, endpoint; int min_j; int i, j; - static double distance_from_segment(), cos_to_segment(); min_distance = 1.0E30; min_j = 0; for( j=cnt, i=j-1; i>=0; i--, j-- ) { new_distance = distance_from_segment(x, y, vertex[i].x, vertex[i].y, @@ -79,14 +80,14 @@ * Perpendicular line passing through x, y: aax + bb = y * aa = -1/a, bb = y_ref - (aa * x_ref) * Intersection of two lines: x_norm, y_norm * x_norm = (b - bb) / (a - aa), y_norm = (a * x_norm) + b */ -static double distance_from_segment ( x_ref, y_ref, x1, y1, x2, y2, endpoint ) - int x_ref, y_ref; /* i: coordinates of reference point */ - int x1, y1, x2, y2; /* i: coordinates of segment endpoints */ - int *endpoint; /* o: closest pt end1=1 end2=2 between=0 */ +static double distance_from_segment ( int x_ref, int y_ref, int x1, int y1, int x2, int y2, int * endpoint ) + /* i: coordinates of reference point */ + /* i: coordinates of segment endpoints */ + /* o: closest pt end1=1 end2=2 between=0 */ { double x_norm, y_norm; int orthogonal; /* determine closest point of line to reference point */ @@ -155,14 +156,14 @@ * Returns: cosine squared of angle between vector from reference to * closest point on line and vector along line away from reference * Method: cos = vector scalar (cross) product / product of lengths * Note: Cosine-squared uses one multiply where cosine needs 2 sqrts */ -static double cos_to_segment ( x_ref, y_ref, x1, y1, x2, y2, endpoint ) - int x_ref, y_ref; /* i: coordinates of reference point */ - int x1, y1, x2, y2; /* i: coordinates of segment endpoints */ - int endpoint; /* i: closest pt end1=-1 end2=1 between=0 */ +static double cos_to_segment ( int x_ref, int y_ref, int x1, int y1, int x2, int y2, int endpoint ) + /* i: coordinates of reference point */ + /* i: coordinates of segment endpoints */ + /* i: closest pt end1=-1 end2=1 between=0 */ { int segment_i, segment_j; int ray_i, ray_j; int segment_len; diff -u5 -r saoimage-1.35.1/csrsave.c saoimage-1.35.2/csrsave.c --- saoimage-1.35.1/csrsave.c 1991-01-04 05:50:01.000000000 +0100 +++ saoimage-1.35.2/csrsave.c 2012-10-30 14:51:24.624466124 +0100 @@ -20,10 +20,12 @@ * {1} MVH support for Arrow cursor 1 Jan 1991 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* free */ +#include /* bcopy */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* cursor colors needed by Cursor.h */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/cursor.h" /* define cursor parameter structures */ diff -u5 -r saoimage-1.35.1/csrshape.c saoimage-1.35.2/csrshape.c --- saoimage-1.35.1/csrshape.c 1998-10-19 20:46:41.000000000 +0200 +++ saoimage-1.35.2/csrshape.c 2012-10-30 14:53:56.173275185 +0100 @@ -29,42 +29,33 @@ #include "hfiles/cursor.h" /* Cursor structure */ #include "hfiles/wcs.h" /* World coordinate system structure */ #include "defs/circle.def" /* Define Unit_circles */ -#ifdef ANSIC /* Exported declarations must be centralized before ANSI C can be used */ void make_cursor( struct cursorRec *cursor); static int make_arrow( double xtip, double ytip, double xray, double rotsin, double rotcos, XPoint *points); static int make_boxcur( double xcen, double ycen, double xray, double yray, double rotsin, double rotcos, XPoint *points); static int make_circur( double xcen, double ycen, double radius, - XPoint *points ) + XPoint *points ) ; static int make_sqrcur( double xcen, double ycen, double radius, - XPoint *points ) + XPoint *points ) ; static int make_diacur( double xcen, double ycen, double radius, - XPoint *points ) + XPoint *points ) ; static int make_crosscur( double xcen, double ycen, double radius, - XPoint *points ) + XPoint *points ) ; static int make_excur( double xcen, double ycen, double radius, - XPoint *points ) + XPoint *points ) ; static int make_ellipse( double xcen, double ycen, double xradius, double yradius, double rotsin, double rotcos, XPoint *points); static int make_piecur( double xcen, double ycen, double radius, - XPoint *points ) - -#else - - static int make_arrow(), make_boxcur(), make_circur(); - static int make_ellipse(), make_piecur(); - -#endif - + XPoint *points ) ; /* Declare and initialize drawing tools */ double *UnitPieX = Circle12X; double *UnitPieY = Circle12Y; double *UnitCircleX = Circle48X; @@ -289,19 +280,12 @@ /* Subroutine: make_sqrcur * Purpose: Create a new square cursor with given center and half-width * Returns: Number of points needed to draw square */ -#ifdef ANSIC static int make_sqrcur ( double xcen, double ycen, double radius, XPoint *points ) -#else -static int -make_sqrcur ( xcen, ycen, radius, points ) - double xcen, ycen, radius; - XPoint *points; -#endif { int loop; register int xoff, yoff; xoff = radius; diff -u5 -r saoimage-1.35.1/csrtext.c saoimage-1.35.2/csrtext.c --- saoimage-1.35.1/csrtext.c 1998-07-09 18:29:51.000000000 +0200 +++ saoimage-1.35.2/csrtext.c 2012-10-30 14:54:13.806369225 +0100 @@ -20,10 +20,11 @@ * Modified: {0} Michael VanHilst initial version 1 Jan 1991 * {1} Paul Sydney fixed foreground assignment in 321 9 Jul 1998 * {n} -- -- */ +#include /* strlen, strcat, strcpy, strrchr */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else #include /* strlen, strcat, strcpy, rindex */ diff -u5 -r saoimage-1.35.1/ctrlcntn.c saoimage-1.35.2/ctrlcntn.c --- saoimage-1.35.1/ctrlcntn.c 1998-07-09 18:29:00.000000000 +0200 +++ saoimage-1.35.2/ctrlcntn.c 2012-10-30 14:54:59.473612695 +0100 @@ -22,17 +22,19 @@ * {1} Paul Sydney fix control.select_mask[3] set 9 July 1998 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* free */ #include /* X window stuff */ #include "hfiles/control.h" /* declare control structure types */ extern struct controlRec control; extern Display *display; #define IOP_socket_listener 777 #define IOP_socket_acceptee 555 +static void init_select () ; /* * Subroutine: init_connections * Purpose: set up connections after display connection has been opened * Note: necessary since parser precedes display connection @@ -69,11 +71,10 @@ extern int open_mailbox(); #else extern int ButtonSelectMask(), open_pipe(); extern int open_socket_listener(); extern struct connectRec *accept_socket_connection(); - static void init_select(); #endif #ifdef NOPIPEFLUSH flush_flag = 0; #else diff -u5 -r saoimage-1.35.1/ctrlfile.c saoimage-1.35.2/ctrlfile.c --- saoimage-1.35.1/ctrlfile.c 1990-04-20 15:49:12.000000000 +0200 +++ saoimage-1.35.2/ctrlfile.c 2012-10-30 14:55:52.239893822 +0100 @@ -17,10 +17,11 @@ * Modified: {0} Michael VanHilst initial version 9 July 1989 * {n} -- -- */ #include /* FILE, stderr, NULL, etc. */ +#include /* strncpy */ #include /* macros for isupper, tolower, etc */ #include /* needed for lstat */ #include /* needed for lstat, struct stat */ #include /* ENOENT */ #include /* X window stuff */ @@ -28,10 +29,11 @@ #ifdef VMS #define lstat stat #define unlink delete #endif +static int file_exists ( char * name ) ; /* May not get defined on some systems, redeclaration doesn't seem to hurt */ extern int errno; /* @@ -54,11 +56,10 @@ char open_type[4]; int done; /* l: return status */ int get_edit_input(); EditStruct *init_edit_popup(); void clear_edit_buf(), unmap_popwin(); - static int file_exists(); open_type[0] = 0; if( (get_edit_input(edit, one_popup_row, 1, 0, prompt) <= 0) || (edit->char_cnt == 0) ) { unmap_popwin(); @@ -144,11 +145,10 @@ char *prompt; { char filename[132]; int exist; int get_edit_input(); - static int file_exists(); if( get_edit_input(edit, one_popup_row, 1, 1, prompt) <= 0 ) return( 0 ); strncpy(filename, edit->string, edit->char_cnt); filename[edit->char_cnt] = '\0'; @@ -174,12 +174,11 @@ /* * Subroutine: file_exists * Purpose: does a file exist for opening (1=yes, 0=no, -1=problem) */ -static int file_exists ( name ) - char *name; +static int file_exists ( char * name ) { int i; struct stat buf; i = lstat(name, &buf); diff -u5 -r saoimage-1.35.1/ctrlgc.c saoimage-1.35.2/ctrlgc.c --- saoimage-1.35.1/ctrlgc.c 1990-05-02 10:19:55.000000000 +0200 +++ saoimage-1.35.2/ctrlgc.c 2012-10-30 14:57:34.805439805 +0100 @@ -27,10 +27,12 @@ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/define.h" /* define DONT_CARE, U_DONT_CARE */ #include "hfiles/color.h" /* color and GCspec param structure */ extern struct colorRec color; +static int init_font ( int app_code ) ; +static int open_font ( int index ) ; static GC main_gc = NULL; static Display *main_display; static XGCValues gcvalue; @@ -238,28 +240,26 @@ * Returns: Pointer to the specified fontstruct */ XFontStruct *get_fontstruct ( app_code ) int app_code; /* i: see comments above */ { - static int init_font(); - if( (app_font[app_code] == NULL) && (init_font(app_code) == NULL) ) + if( (app_font[app_code] == NULL) && (init_font(app_code) == 0) ) return( NULL ); else return( app_font[app_code] ); } /* * Subroutine: init_font * Purpose: Load the fonts used by this program * Returns: Font on success, else 0 */ -static int init_font ( app_code ) - int app_code; /* i: font application type index */ +static int init_font ( int app_code ) + /* i: font application type index */ { int i, name_index; - static int open_font(); for( i=0; i +#include #include #include /* socket(), bind(), listen(), accept(), etc */ #include #include /* htonl(), struct sockaddr_in */ #ifdef SYSV @@ -37,16 +38,15 @@ /* * Subroutine: open_socket_listener * Purpose: Get a socket on which to listen for connections */ -int open_socket_listener ( host_name, port_address ) - char **host_name; - int port_address; +int open_socket_listener ( char ** host_name, int port_address ) { struct hostent *host_port; struct sockaddr_in net_address; + /* struct sockaddr net_address; */ int ipc; static char *local_name; char *calloc_errchk(); bzero(&net_address, sizeof(net_address)); @@ -71,10 +71,11 @@ port_address, *host_name); return( -1 ); } /* fill in the network address structure */ net_address.sin_family = AF_INET; + /* net_address.sa_family = AF_INET; */ /* convert port address from host to network byte order */ net_address.sin_port = htonl(port_address); bcopy(host_port->h_addr, &(net_address.sin_addr), sizeof(net_address.sin_addr)); /* create a socket communication endpoint */ diff -u5 -r saoimage-1.35.1/defs/cgraph.def saoimage-1.35.2/defs/cgraph.def --- saoimage-1.35.1/defs/cgraph.def 1989-11-09 16:21:10.000000000 +0100 +++ saoimage-1.35.2/defs/cgraph.def 2012-10-30 15:14:14.892764801 +0100 @@ -8,11 +8,11 @@ * {n} -- -- */ struct colbarRec colorbar = { /* parameters for display color bar */ NULL, /* Display *display; display handle of colorbox */ - NULL, /* Window ID; handle of bar subwindow */ + 0, /* Window ID; handle of bar subwindow */ 0, 0, /* int ref_width, ref_height; colorbox size when last checked */ 0, 0, /* unsigned int width,height; dimensions of bar subwindow */ 0, /* int ncolors; number of shades represented */ NULL, /* XImage *image; uses image struct of colorbox */ 0, /* int data_size; data allocated (both byte and bit) */ @@ -25,56 +25,56 @@ 1, /* int inactive; do-not-draw-graph */ 0, /* int vertical; 1=vertical sweep, else horizontal */ 0, /* int ncolors; number of image color cells */ 0, /* int point_cnt; applies to all color lines */ 0, /* int bargraph; use-bar-type-instead-of-line */ - NULL, /* Font font; font id for XDrawImageString */ + 0, /* Font font; font id for XDrawImageString */ NULL, /* XFontStruct *fontstruct; struct for font size info */ NULL, /* GCspec *disp; gc info to draw bar */ NULL, /* GCspec *menu; gc info for text */ NULL, /* GCspec *black; gc info for black text and lines */ { /* struct colbarRec bar; parameters for graph color bar */ NULL, /* Display *display; display handle of colorbox */ - NULL, /* Window ID; handle of bar subwindow */ + 0, /* Window ID; handle of bar subwindow */ 0, 0, /* int ref_width, ref_height; colorbox size when last checked */ 0, 0, /* unsigned int width,height; dimensions of bar subwindow */ 0, /* int ncolors; number of shades represented */ NULL, /* XImage *image; uses image struct of colorbox */ 0, /* int data_size; data allocated (both byte and bit) */ 0, /* int bytes_per_bit_line; bytes per line for bitmap */ NULL, /* char *byte_data; one byte per pixel */ NULL /* char *bit_data; one bit per pixel (after byte_data */ }, { /* struct { parameters to label the bar */ - NULL, /* Window min_ID; lowest color (0) subwindow */ - NULL, /* Window max_ID; highest color (ncolors-1) subwindow */ + 0, /* Window min_ID; lowest color (0) subwindow */ + 0, /* Window max_ID; highest color (ncolors-1) subwindow */ 0, 0, /* int min_x, min_y; lowest color label placement */ 0, 0, /* int max_x, max_y; highest color label placement */ 0, 0, /* int width, height; size of both label subwindows */ 0, /* int base_width; dimension of basic label to center */ 0 /* int base_height; */ }, /* } barlabel; */ { /* struct { parameters for color graph */ NULL, /* Display *display; display handle of graphbox */ - NULL, /* Window ID; handle of graph subwindow */ + 0, /* Window ID; handle of graph subwindow */ 0, 0, /* int ref_width, ref_height; size of graphbox when last checked */ 0, /* int ncolors; number of shades represented */ 0, 0, /* int width, height; size of graph subwindow */ 0, 0, /* int xzero, yzero; graph area offset */ 0, 0, /* int xwidth, yheight; graph area dimensions */ 0, 0, /* int xmax, ymax; maximum drawing coordinate */ 0.0,0.0, /* double Xwidth, Yheight; often used double version */ 0.0,0.0 /* double Xinc, Yinc; color spacing (ncolors/wdth;hght) */ }, /* } graph; */ { /* struct { parameters to label the graph */ - NULL, /* Window gamma_ID; window in which to label gamma */ - NULL, /* Window minmax_ID; window in which to label min & max */ + 0, /* Window gamma_ID; window in which to label gamma */ + 0, /* Window minmax_ID; window in which to label min & max */ 0, 0, /* int width, height; size of both label subwindows */ - NULL, /* Window geq_ID; borderless box with "g=" */ - NULL, /* Window red_ID; red border box for red gamma */ - NULL, /* Window green_ID; green border box for green gamma */ - NULL, /* Window blue_ID; blue border box for blue gamma */ + 0, /* Window geq_ID; borderless box with "g=" */ + 0, /* Window red_ID; red border box for red gamma */ + 0, /* Window green_ID; green border box for green gamma */ + 0, /* Window blue_ID; blue border box for blue gamma */ 0, 0, /* int box_width, box_height; size of each gamma val boxes */ 0, 0, /* int box_x, box_y; text string coord in box */ 0, 0, /* int geq_width, geq_height; size of "g=" box */ 0, 0, /* int geq_text_x, geq_text_y;text string coord in "g=" box */ 0, /* int three_limit; minimum size to hold 3 gamma vals */ diff -u5 -r saoimage-1.35.1/defs/cursor.def saoimage-1.35.2/defs/cursor.def --- saoimage-1.35.1/defs/cursor.def 1996-10-25 19:46:44.000000000 +0200 +++ saoimage-1.35.2/defs/cursor.def 2012-10-30 15:57:51.735631847 +0100 @@ -13,11 +13,11 @@ -1.0,0.0, /* float X, Y; center dimension (or other ref) */ 10.0,10.0, /* float Xdim, Ydim; dimension appropriate to type */ 0.0 }, /* double area; area if computed */ { /* CurWCoord win; window coordinates */ NULL, /* Display *display; display where draw */ - NULL, /* Window ID; drawable where to draw */ + 0, /* Window ID; drawable where to draw */ 0, 0, /* int x, y; integer center coordinates */ 0.0,0.0, /* double X, Y; float center coordinates */ 0.0,0.0 }, /* double rayX, rayY; center to side distance */ { /* CurRot rot; rotation angle parameters */ 0.0, /* double angle; rotation angle in radians */ @@ -32,11 +32,11 @@ 0, /* int cut; apply-pie-cut flag */ 0, /* int label_point; label-the-point flag */ 1, /* int overwrites_image_data; cursor-overwrites-image-data */ 0, /* int index; index for regions and annuli */ 0, /* int exclude_region; region type and suppress drawing */ - NULL, /* int point_cnt; number of points for XDrawLines */ + 0, /* int point_cnt; number of points for XDrawLines */ NULL, /* XPoint *points; absolute-coord drawing vertices */ 0, /* int rectangle_cnt; number of hash-mark boxes */ NULL, /* XRectangle *rectangles; for XDrawRectangles */ 0, /* int poly_cnt; number of vertices in polygon */ NULL, /* PolyPoint *poly; array of polygon vertex coords */ diff -u5 -r saoimage-1.35.1/dispblnk.c saoimage-1.35.2/dispblnk.c --- saoimage-1.35.1/dispblnk.c 1990-04-20 16:23:14.000000000 +0200 +++ saoimage-1.35.2/dispblnk.c 2012-10-30 18:18:22.546977747 +0100 @@ -18,17 +18,20 @@ * Modified: {0} Michael VanHilst initial version 26 May 1989 * {n} -- -- */ #include /* get stderr, NULL */ +#include /* free */ +#include /* bcopy */ #include /* get X types and constants */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main ximage parameter structures */ #include "hfiles/constant.h" /* define SOP */ #define MetaMask Mod1Mask +static int display_blink ( int index ) ; static struct { char *buf; Pixmap pixmap; int depth; @@ -66,22 +69,22 @@ if( blink[index].bufsz != bufsz ) { if( blink[index].buf != NULL ) { free((char *)blink[index].buf); blink[index].buf = NULL; } - if( blink[index].pixmap != NULL ) { + if( blink[index].pixmap != 0 ) { XFreePixmap (dispbox.display, blink[index].pixmap); - blink[index].pixmap = NULL; + blink[index].pixmap = 0; } blink[index].depth = blink[0].depth; if( (blink[index].pixmap = XCreatePixmap(dispbox.display, dispbox.ID, dispbox.xwidth, - dispbox.yheight, blink[index].depth)) == NULL ) + dispbox.yheight, dispbox.depth)) == 0 ) blink[index].buf = calloc_errchk(bufsz, 1, "blink"); blink[index].bufsz = bufsz; } - if( blink[index].pixmap != NULL ) { + if( blink[index].pixmap != 0 ) { gc = set_gc(&(color.gcset.disp)); if( blink[index].depth == 1 ) XCopyPlane(dispbox.display, dispbox.ID, blink[index].pixmap, gc, dispbox.xzero, dispbox.yzero, dispbox.xwidth, dispbox.yheight, 0, 0, 1); @@ -109,13 +112,13 @@ for( i=1; i<4; i++ ) { if( blink[i].buf != NULL ) { free((char *)blink[i].buf); blink[i].buf = NULL; } - if( blink[i].pixmap != NULL ) { + if( blink[i].pixmap != 0 ) { XFreePixmap (dispbox.display, blink[i].pixmap); - blink[i].pixmap = NULL; + blink[i].pixmap = 0; } blink[i].bufsz = 0; } } @@ -145,17 +148,16 @@ } /* * Subroutine: display_blink */ -static int display_blink ( index ) - int index; +static int display_blink ( int index ) { GC gc, set_gc(); void disp_dispbox(); - if( blink[index].pixmap != NULL ) { + if( blink[index].pixmap != 0 ) { gc = set_gc(&(color.gcset.disp)); if( blink[index].depth == 1 ) XCopyPlane(dispbox.display, blink[index].pixmap, dispbox.ID, gc, 0, 0, dispbox.xwidth, dispbox.yheight, dispbox.xzero, dispbox.yzero, 1); @@ -185,11 +187,10 @@ { static int oldmode; static int buttons = 0; static int btnstack[4]; int i; - static int display_blink(); if( control.event.type == ButtonPress ) { /* don't respond if it's with a meta key (window resize) */ if( control.event.xbutton.state & (ControlMask | MetaMask) ) return; diff -u5 -r saoimage-1.35.1/dispbtmp.c saoimage-1.35.2/dispbtmp.c --- saoimage-1.35.1/dispbtmp.c 1991-06-22 00:58:15.000000000 +0200 +++ saoimage-1.35.2/dispbtmp.c 2012-10-30 15:05:47.659055206 +0100 @@ -22,18 +22,20 @@ * {4} MVH changed calls for replcate zoom 21 June 1991 * {n} -- -- */ #include /* stderr, FILE, NULL, etc. */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/define.h" /* MIN, MAX and more */ #include "hfiles/struct.h" /* all struct record types */ #include "hfiles/extern.h" /* major declared structs */ #include "hfiles/scale.h" /* scaling parameters & struct */ #include "defs/dither.def" /* halftoning tool buffers */ +static void new_halftone ( int magnifier ) ; /* * Subroutine: init_halftone * Purpose: Initialize color struct pointers for halftoning */ @@ -55,11 +57,10 @@ * Subroutine: select_halftone * Purpose: Respond to halftone selection command */ void select_halftone () { - static void new_halftone(); switch( control.response[1] ) { case 0: /*0 is main menu selection, change only main mode */ control.mode = BOP; @@ -98,12 +99,12 @@ /* * Subroutine: new_halftone * Purpose: Redo halftone images of both dispbox and panbox */ -static void new_halftone ( magnifier ) - int magnifier; /* i: include-magnifier */ +static void new_halftone ( int magnifier ) + /* i: include-magnifier */ { void make_halftone_display(), disp_dispbox(), disp_panbox(), draw_colorbar(); void set_magnifier_matrix(), panimage_halftone(), map_halftone_colorbar(); map_halftone_colorbar( 1, 0 ); diff -u5 -r saoimage-1.35.1/display.c saoimage-1.35.2/display.c --- saoimage-1.35.1/display.c 1998-10-13 19:22:58.000000000 +0200 +++ saoimage-1.35.2/display.c 2012-10-30 16:56:04.410070610 +0100 @@ -17,10 +17,11 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 26 May 1989 * {n} -- -- */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/define.h" /* define MIN, MAX, DONT_CARE, etc. */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ diff -u5 -r saoimage-1.35.1/disppsct.c saoimage-1.35.2/disppsct.c --- saoimage-1.35.1/disppsct.c 2003-09-03 20:23:08.000000000 +0200 +++ saoimage-1.35.2/disppsct.c 2012-10-30 20:32:37.773304936 +0100 @@ -25,10 +25,12 @@ #ifndef SUN #include #endif #include /* stderr, NULL, etc. */ +#include /* mkstemp */ +#include /* mkstemp */ #ifndef VMS #include #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ @@ -124,13 +126,10 @@ unsigned long excl_fore, excl_back; int filled; unsigned long fore, back; XImage *ximage; -#ifndef SUN - char *mktemp(); -#endif char *calloc_errchk(), *getenv(); void close_disk(), clear_margins(), map_buf_repzoom(); void map_buf_subzoom(), disp_dispbox(), disp_panbox(); @@ -301,15 +300,15 @@ #else sprintf(tempfile, "_ps%cXXXXXX.tmp", 'a' + index); #endif if( ++index > 26 ) index = 0; /* open a file with a system chosen unique name */ -#ifdef SUN +#if 1 if( (fd = mkstemp(tempfile)) == -1 ) { perror("Cannot make temp file"); #else - (void)mktemp(tempfile); + (void)mkstemp(tempfile); /* open the file with a call to open with both write and create flags */ if( (fp = fopen(tempfile, "w")) == NULL ) { #endif (void)fprintf(stderr, "cannot create temporary file %s\n", tempfile); (void)fflush(stderr); @@ -328,11 +327,11 @@ /* Translate the bitmap into a postscript program. */ bitmap_to_postscript(fp, obuf, width, height, depth, width, zero, scale); free((char *)zero); (void)fclose(fp); -#ifdef SUN +#if 1 close_disk(fd, tempfile); #endif /* Dispose of tempfile to the printer. We leave it up to the dispose * command to delete the temporary file when finished. The dispose diff -u5 -r saoimage-1.35.1/disppxmp.c saoimage-1.35.2/disppxmp.c --- saoimage-1.35.1/disppxmp.c 2000-09-13 21:34:46.000000000 +0200 +++ saoimage-1.35.2/disppxmp.c 2012-10-30 17:16:37.810130770 +0100 @@ -18,10 +18,11 @@ * {1} MVH Replaced zoom rep code, dumped adj stuff 21 June 1991 * {2} Doug Mink Fixed limit bug on block sample 13 Sept 2000 * {n} -- -- */ +#include #include "hfiles/coord.h" /* * Subroutine: map_buf_subzoom * Purpose: Map data to a display buffer, zoomed down by sub-sampling @@ -193,11 +194,11 @@ while( dst_y < yrep_limit ) { #ifdef ANSIC memcopy((char *)dst_line, (char *)dst, x_dst_count); #else bcopy((char *)dst, (char *)dst_line, x_dst_count); -#endif ANSIC +#endif dst_line += dst_width; dst_y++; } /* Set up next line replication counter */ yrep_limit += zoom; diff -u5 -r saoimage-1.35.1/distort.c saoimage-1.35.2/distort.c --- saoimage-1.35.1/distort.c 2003-11-18 17:45:23.000000000 +0100 +++ saoimage-1.35.2/distort.c 2012-10-30 17:39:31.776202834 +0100 @@ -34,10 +34,12 @@ * Subroutine: foc2pix (wcs, u, v, x, y) focal plane coordinates -> pixel coordinates * Subroutine: setdistcode (wcs,ctype) sets distortion code from CTYPEi * Subroutine: getdistcode (wcs) returns distortion code string for CTYPEi */ +#include +#include #include #include #include "wcs.h" void diff -u5 -r saoimage-1.35.1/editctrl.c saoimage-1.35.2/editctrl.c --- saoimage-1.35.1/editctrl.c 1990-06-03 06:07:48.000000000 +0200 +++ saoimage-1.35.2/editctrl.c 2012-10-30 15:07:55.699732720 +0100 @@ -20,10 +20,11 @@ * {2} MVH BSDonly strings.h compatability 19 Feb 1990 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* strlen */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else @@ -41,10 +42,12 @@ extern struct colorRec color; extern struct windowRec btnbox; extern struct windowRec desktop; extern Window root; +static void init_popwin ( unsigned long foreground, unsigned long background ) ; +static void map_popwin ( EditStruct * edit, int one_row, char * prompt, int map ) ; #define XOFF 2 #define YOFF 1 #define BDRWDTH 2 #define WDTHLESS 12 @@ -67,11 +70,10 @@ { EditStruct *edit; int len; EditStruct *get_edit_struct(); void init_edit_struct(), load_edit_struct(); - static void init_popwin(); if( init_window ) { init_popwin(color.gcset.menu.foreground, color.gcset.menu.background); init_window = 0; } @@ -102,11 +104,10 @@ int init, got_configure, answer; GC gc, set_edit_gc(); int emacs_response(); void draw_new_string(), redraw_edit_string(); void adjust_desktop(), redraw_window(), unmap_popwin(); - static void map_popwin(); map_popwin(edit, one_row, prompt, map); if( !map ) { /* window already up, don't wait for expose event */ XClearWindow(pop.display, pop.ID); @@ -183,12 +184,11 @@ /* * Subroutine: init_popwin * Purpose: Set the popup parameters and create the popup window * Xlib calls: XCreateSimpleWindow(), XSelectInput(); */ -static void init_popwin ( foreground, background ) - unsigned long foreground, background; +static void init_popwin ( unsigned long foreground, unsigned long background ) { int text_yoff; XWMHints wmhints; XFontStruct *get_fontstruct(); @@ -226,15 +226,14 @@ /* * Subroutine: map_popwin * Purpose: map the popwindow, noting its current size and setting params * Xlib calls: XMapWindow() */ -static void map_popwin ( edit, one_row, prompt, map ) - EditStruct *edit; - int one_row; /* i: put-edit-after-prompt-on-same-line */ - char *prompt; /* i: prompt string such as "Enter file name:" */ - int map; /* i: map-the-window-when-ready */ +static void map_popwin ( EditStruct * edit, int one_row, char * prompt, int map ) + /* i: put-edit-after-prompt-on-same-line */ + /* i: prompt string such as "Enter file name:" */ + /* i: map-the-window-when-ready */ { int text_yoff; Window root_ret, child_ret; int x_ret, y_ret; unsigned int mask_ret; diff -u5 -r saoimage-1.35.1/editinit.c saoimage-1.35.2/editinit.c --- saoimage-1.35.1/editinit.c 1990-05-02 07:21:29.000000000 +0200 +++ saoimage-1.35.2/editinit.c 2012-10-30 15:08:25.215888793 +0100 @@ -21,10 +21,11 @@ * {2} MVH load_edit_string() without save 18 March 1990 * {n} -- -- */ #include +#include #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else diff -u5 -r saoimage-1.35.1/fitsfile.c saoimage-1.35.2/fitsfile.c --- saoimage-1.35.1/fitsfile.c 2003-11-18 17:38:47.000000000 +0100 +++ saoimage-1.35.2/fitsfile.c 2012-10-30 16:38:35.886164911 +0100 @@ -898,11 +898,10 @@ /* Make sure this is really a FITS table file header */ temp[0] = 0; hgets (header,"XTENSION",16,temp); if (strncmp (temp, "TABLE", 5) != 0) { snprintf (fitserrmsg,79, "FITSRTHEAD: Not a FITS table file\n"); - free (temp); return (-1); } /* Get table size from FITS header */ *nchar = 0; diff -u5 -r saoimage-1.35.1/grphbtmp.c saoimage-1.35.2/grphbtmp.c --- saoimage-1.35.1/grphbtmp.c 1990-04-20 16:31:04.000000000 +0200 +++ saoimage-1.35.2/grphbtmp.c 2012-10-30 15:11:13.947780344 +0100 @@ -14,16 +14,23 @@ * Modified: {0} Michael VanHilst initial version 7 July 1989 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" #include "hfiles/constant.h" /* define codes */ extern struct colorRec color; +static void byte_dither_sample ( unsigned char * byte_data, int data_width, int zoom, + unsigned char * bitmap, int bytes_per_line, + int x, int y, int width, int height, unsigned long * lookup, short *dither_matrix ) ; +static void byte_diffuse_sample ( unsigned char * byte_data, int data_width, int zoom, + unsigned char * bitmap, int bytes_per_line, + int x, int y, int width, int height, unsigned long * lookup, short * errbuf ) ; /* * Subroutine: make_halftone_panimage * Purpose: Make halftone bitmap for pan window (panbox) */ @@ -32,11 +39,10 @@ unsigned char *bytedata; unsigned char *bitdata; int width, height; int bytes_per_line; { - static void byte_dither_sample(), byte_diffuse_sample(); bzero((char *)bitdata, bytes_per_line * height); if( color.halftone.mode == BOP_Dither ) { byte_dither_sample(bytedata, width, 1, bitdata, bytes_per_line, 0, 0, width, height, color.pixvalmap, color.halftone.matrix); @@ -53,21 +59,13 @@ * from 16 bit signed data through a scaling lookup table. * Used when bitmap is same size or smaller than data image. * Method: Sample every zoom'th data element in each direction * Note: This is a copy of the disp dither code but for byte data */ -static void byte_dither_sample ( byte_data, data_width, zoom, - bitmap, bytes_per_line, - x, y, width, height, lookup, dither_matrix ) - unsigned char *byte_data; - int data_width; - int zoom; - unsigned char *bitmap; - int bytes_per_line; - int x, y, width, height; - register unsigned long *lookup; - short *dither_matrix; +static void byte_dither_sample ( unsigned char * byte_data, int data_width, int zoom, + unsigned char * bitmap, int bytes_per_line, + int x, int y, int width, int height, unsigned long * lookup, short *dither_matrix ) { register unsigned char *data; /* ptr to current data input */ register short *matrix; /* ptr to current dither value */ register unsigned char *bitmap_byte; /* ptr to current output byte */ register int bitmap_bit; /* current bit in current output byte */ @@ -161,21 +159,13 @@ * image from 16 bit signed data through a scaling lookup table. * Used when bitmap is same size or smaller than data image. * Method: Sample every zoom'th data element in each direction * Note: This is a copy of the DispDiffuse code but for byte data */ -static void byte_diffuse_sample ( byte_data, data_width, zoom, - bitmap, bytes_per_line, - x, y, width, height, lookup, errbuf ) - unsigned char *byte_data; - int data_width; - int zoom; - unsigned char *bitmap; - int bytes_per_line; - int x, y, width, height; - register unsigned long *lookup; - short *errbuf; +static void byte_diffuse_sample ( unsigned char * byte_data, int data_width, int zoom, + unsigned char * bitmap, int bytes_per_line, + int x, int y, int width, int height, unsigned long * lookup, short * errbuf ) { register int val; register short *error; register unsigned char *data; register unsigned char *bitmap_byte; diff -u5 -r saoimage-1.35.1/grphctrl.c saoimage-1.35.2/grphctrl.c --- saoimage-1.35.1/grphctrl.c 1990-04-20 16:31:49.000000000 +0200 +++ saoimage-1.35.2/grphctrl.c 2012-10-30 15:14:39.475907949 +0100 @@ -45,11 +45,11 @@ if( graphbox.active ) { XUnmapWindow(graphbox.display, graphbox.ID); graphbox.active = 0; cgraph.inactive = 1; } else { - if( graphbox.ID == NULL ) { + if( graphbox.ID == 0 ) { init = 1; create_graphbox(); } else init = 0; XMapWindow(graphbox.display, graphbox.ID); diff -u5 -r saoimage-1.35.1/grphgrab.c saoimage-1.35.2/grphgrab.c --- saoimage-1.35.1/grphgrab.c 1990-04-20 16:33:27.000000000 +0200 +++ saoimage-1.35.2/grphgrab.c 2012-10-30 15:18:59.406411335 +0100 @@ -23,19 +23,24 @@ #include "hfiles/define.h" /* YES, NO, MIN, MAX and more */ extern struct cgraphRec cgraph; #define GRAB_RANGE 8 /* radius in screen pixels within which to grab mark */ +static void get_color_vertex ( int x, int y, struct colgRec * col ) ; +static int drop_color_vertex ( struct colgRec * col, int x,int y ) ; +static int grab_old_color_vertex ( int x, int y, struct colgRec * col ) ; +static void install_new_color_vertex ( int x, int y, struct colgRec * col ) ; +static void add_color_vertex ( struct subtableRec * table, int index, double new_cell_level, double new_intensity ) ; +static void add_color_vertex_hash ( struct colgRec * col, int index, int x, int y ) ; /* * Subroutine: grab_cgraph_vertex * Purpose: When a mouse button is pressed, assign a vertex to that button */ void get_cgraph_vertex ( event ) XEvent *event; { - static void get_color_vertex(); switch( event->xbutton.button ) { case Button1: /* note: Sun compiler sometimes muffs these pointers */ get_color_vertex(event->xbutton.x, event->xbutton.y, &(cgraph.red)); @@ -59,11 +64,10 @@ * Returns: 1 if a vertex was dropped, else 0 */ int drop_cgraph_vertex ( event ) XEvent *event; { - static int drop_color_vertex(); switch( event->xbutton.button ) { case Button1: return( drop_color_vertex(&cgraph.red, event->xbutton.x, event->xbutton.y) ); @@ -81,17 +85,13 @@ /* * Subroutine: get_color_vertex * Purpose: Handle grab vertex event for single color * Method: Grab old vertex or make new vertex - under mouse pointer */ -static void get_color_vertex ( x, y, col ) - int x, y; - struct colgRec *col; +static void get_color_vertex ( int x, int y, struct colgRec * col ) { void install_draw_queue_end(); - static int grab_old_color_vertex(); - static void install_new_color_vertex(); /* clip against limits */ if( x < cgraph.graph.xzero ) x = cgraph.graph.xzero; else if( x > cgraph.graph.xmax ) @@ -109,13 +109,11 @@ * Subroutine: grab_old_color_vertex * Purpose: Check to see if position is close to an existing hash mark. * If so, set active markers. * Returns: 1 if a vertex was grabbed, else 0 */ -static int grab_old_color_vertex ( x, y, col ) - int x, y; - struct colgRec *col; +static int grab_old_color_vertex ( int x, int y, struct colgRec * col ) { int i, match; XRectangle *hash; hash = col->hash; @@ -149,18 +147,17 @@ /* * Subroutine: install_new_color_vertex * Purpose: Given hash position, install a new vertex, and make active */ -static void install_new_color_vertex ( x, y, col ) - int x, y; /* i: position of ULcorner of new hash mark */ - struct colgRec *col; /* i: color info structure for one color */ +static void install_new_color_vertex ( int x, int y, struct colgRec * col ) + /* i: position of ULcorner of new hash mark */ + /* i: color info structure for one color */ { double intensity, cell_level; int match; int select_best_hash_position(); - static void add_color_vertex(), add_color_vertex_hash(); col->active_hash = select_best_hash_position(x, y, col->hash, col->hash_cnt, &match, cgraph.vertical); col->active_vertex = col->active_hash + col->hash_0; if( match >= 0 ) { @@ -195,15 +192,14 @@ /* * Subroutine: add_color_vertex * Purpose: Install new vertex in a color subtableRec. */ -static void add_color_vertex ( table, index, new_cell_level, new_intensity ) - struct subtableRec *table; /* i/o: table structure for one color */ - int index; /* i: index of new vertex */ - double new_cell_level; /* i: cell_level and intensity of new vertex */ - double new_intensity; +static void add_color_vertex ( struct subtableRec * table, int index, double new_cell_level, double new_intensity ) + /* i/o: table structure for one color */ + /* i: index of new vertex */ + /* i: cell_level and intensity of new vertex */ { register int i, j; int count = table->vertex_cnt; double *cell_level = table->cell_level; double *base_level = table->base_level; @@ -224,14 +220,11 @@ /* * Subroutine: add_color_vertex_hash * Purpose: Add a new hash mark */ -static void add_color_vertex_hash ( col, index, x, y ) - struct colgRec *col; - int index; - int x, y; +static void add_color_vertex_hash ( struct colgRec * col, int index, int x, int y ) { register int i, j; XRectangle *hash; int hash_cnt; @@ -249,15 +242,12 @@ /* * Subroutine: drop_color_vertex * Purpose: Delete a color table vertex if one is under the mouse position * Returns: 1 if vertex was dropped, else 0 */ -static int drop_color_vertex ( col, x, y ) - struct colgRec *col; - int x, y; +static int drop_color_vertex ( struct colgRec * col, int x,int y ) { - static int grab_old_color_vertex(); /* hash mark positions are upper left corner of hash box */ x -= HASH_RAY; y -= HASH_RAY; if( grab_old_color_vertex(x, y, col) ) { diff -u5 -r saoimage-1.35.1/grphinit.c saoimage-1.35.2/grphinit.c --- saoimage-1.35.1/grphinit.c 1990-04-20 16:40:44.000000000 +0200 +++ saoimage-1.35.2/grphinit.c 2012-10-30 15:21:32.188286820 +0100 @@ -24,18 +24,22 @@ * {1} Jay Travisano (STScI) VMS,IMTOOL changes 10 Nov 1989 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* free */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/cgraph.h" extern struct cgraphRec cgraph; extern struct colbarRec colorbar; +static void init_main_colorbar ( ) ; +static void set_colorbar_params ( struct colbarRec * bar, int width, int height ) ; +static void set_colorbar_image ( struct colbarRec * bar, int vertical ) ; /* flag to set color graph background black, else white */ int black_graph_background = 0; #if VMS && IMTOOL extern void XZ_ast(); @@ -46,11 +50,10 @@ * Subroutine: init_colorbox * Purpose: Handle program init-time color bar and graph initialization */ void init_colorbox ( ) { - static void init_main_colorbar(); cgraph.ncolors = color.ncolors; cgraph.red.table = &color.ctable.red; cgraph.green.table = &color.ctable.green; cgraph.blue.table = &color.ctable.blue; @@ -69,11 +72,10 @@ * Xlib calls: XCreateSimpleWindow(), XMapSubwindows() */ static void init_main_colorbar ( ) { char *calloc_errchk(); - static void set_colorbar_image(), set_colorbar_params(); colorbar.display = colorbox.display; colorbar.ref_width = colorbox.width; colorbar.ref_height = colorbox.height; colorbar.image = &colorbox.image; @@ -93,11 +95,10 @@ * Purpose: Adjust color bar size params and/or color data if needed */ void adjust_main_colorbar ( ) { char *calloc_errchk(); - static void set_colorbar_image(), set_colorbar_params(); if( (colorbox.width != colorbar.ref_width) || (colorbox.height != colorbar.ref_height) ) { set_colorbar_params(&colorbar, colorbox.xwidth, colorbox.yheight); /* set flag in case somebody wants to coordinate */ @@ -115,11 +116,10 @@ */ void init_graph_colorbar ( ) { Window create_cgraph_box(); char *calloc_errchk(); - static void set_colorbar_image(), set_colorbar_params(); cgraph.bar.display = graphbox.display; cgraph.bar.ref_width = graphbox.width; cgraph.bar.ref_height = graphbox.height; cgraph.bar.image = &graphbox.image; @@ -151,11 +151,10 @@ */ void adjust_graph_colorbar ( ) { int resize = 0; char *calloc_errchk(); - static void set_colorbar_image(), set_colorbar_params(); if( cgraph.vertical ) { if( graphbox.height != cgraph.bar.ref_height ) { set_colorbar_params(&cgraph.bar, cgraph.barlabel.width - 5, cgraph.graph.height); @@ -198,13 +197,11 @@ bar->bytes_per_bit_line); if( disp ) draw_colorbar(graph); } -static void set_colorbar_params ( bar, width, height ) - struct colbarRec *bar; - int width, height; +static void set_colorbar_params ( struct colbarRec * bar, int width, int height ) { int data_sz; char *calloc_errchk(); bar->width = width; @@ -224,13 +221,11 @@ /* * Subroutine: set_colorbar_image * Purpose: Set the color bar for display of current color set */ -static void set_colorbar_image ( bar, vertical ) - struct colbarRec *bar; - int vertical; +static void set_colorbar_image ( struct colbarRec * bar, int vertical ) { void fill_colorbar(), make_halftone_colorbar(); cgraph.disp = &(color.gcset.disp); cgraph.menu = &(color.gcset.menu); @@ -280,11 +275,11 @@ cgraph.graph.width = graphbox.xwidth; cgraph.graph.height = graphbox.yheight - cgraph.barlabel.height; graph_x = graphbox.xzero - BDRWDTH; } /* server call placed as soon as possible to reduce delay */ - if( cgraph.graph.ID == NULL ) { + if( cgraph.graph.ID == 0 ) { cgraph.graph.display = graphbox.display; /* black used to show where cgraph lines overlap (white if black bkgd) */ if( black_graph_background ) { bkgd = color.hard.true_black; cgraph.black = &(color.gcset.white); diff -u5 -r saoimage-1.35.1/grphmove.c saoimage-1.35.2/grphmove.c --- saoimage-1.35.1/grphmove.c 1990-04-20 16:37:26.000000000 +0200 +++ saoimage-1.35.2/grphmove.c 2012-10-30 15:22:38.995667895 +0100 @@ -18,10 +18,11 @@ #include /* X window manager stuff */ #include "hfiles/color.h" /* color structs */ #include "hfiles/cgraph.h" extern struct cgraphRec cgraph; +static void move_color_vertex ( struct colgRec * col, int x, int y, double new_cell_level, double new_intensity ) ; /* * Subroutine: move_cgraph_vertices * Purpose: Change values (and position) of designated vertices in * response to mouse movement @@ -29,11 +30,10 @@ void move_cgraph_vertices ( x, y ) int x, y; { double cell_level, intensity; int hash_x, hash_y; - static void move_color_vertex(); /* clip against limits */ if( x < cgraph.graph.xzero ) x = cgraph.graph.xzero; else if( x > cgraph.graph.xmax ) @@ -71,15 +71,11 @@ /* * Subroutine: move_color_vertex * Purpose: Move one ccolor graph vertex */ -static void move_color_vertex ( col, x, y, new_cell_level, new_intensity ) - struct colgRec *col; - int x, y; - double new_cell_level; - double new_intensity; +static void move_color_vertex ( struct colgRec * col, int x, int y, double new_cell_level, double new_intensity ) { int active_hash; XRectangle *hash; active_hash = col->active_hash; diff -u5 -r saoimage-1.35.1/grpholap.c saoimage-1.35.2/grpholap.c --- saoimage-1.35.1/grpholap.c 1990-04-20 16:36:00.000000000 +0200 +++ saoimage-1.35.2/grpholap.c 2012-10-30 15:23:05.638819577 +0100 @@ -21,10 +21,11 @@ #include /* X window manager stuff */ #include "hfiles/color.h" /* color structs */ #include "hfiles/cgraph.h" /* color graph structs */ extern struct cgraphRec cgraph; +static void mark_hashmark_overlap ( ) ; /* * Subroutine: mark_colorline_overlap * Purpose: Make line representing more than one color black (or white) */ @@ -32,11 +33,10 @@ { int i, j; int x, y; int x1, y1; XSegment line[256]; - static void mark_hashmark_overlap(); j = 0; if( cgraph.vertical ) { /* if vertical */ x1 = -1; diff -u5 -r saoimage-1.35.1/grphtext.c saoimage-1.35.2/grphtext.c --- saoimage-1.35.1/grphtext.c 1990-04-20 16:39:37.000000000 +0200 +++ saoimage-1.35.2/grphtext.c 2012-10-30 15:25:07.307510287 +0100 @@ -25,10 +25,11 @@ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/cgraph.h" extern struct cgraphRec cgraph; +static void init_colorbar_label ( ) ; /* * Subroutine: init_color_graph_label * Purpose: Set labeling pieces according to the graph window size * Xlib calls: XMoveWindow(), XResizeWindow(), XMapWindow() @@ -38,30 +39,29 @@ int new = 0; int move = 0; int resize = 0; Window create_cgraph_box(); void init_color_graph_label(); - static void init_colorbar_label(); if( cgraph.graphlabel.active == 0 ) return; if( cgraph.vertical ) { - if( (cgraph.graphlabel.gamma_ID != NULL) && + if( (cgraph.graphlabel.gamma_ID != 0) && (cgraph.graphlabel.width != graphbox.width) ) resize = 1; cgraph.graphlabel.width = graphbox.width - cgraph.barlabel.width; /* place boxes together (side-by-side) and centered */ if( graphbox.width >= cgraph.graphlabel.four_limit ) { cgraph.graphlabel.geq_x = 2 + ((graphbox.width - cgraph.graphlabel.four_limit) / 2); cgraph.graphlabel.red_x = cgraph.graphlabel.geq_x + cgraph.graphlabel.geq_width + 3; - if( (cgraph.graphlabel.gamma_ID != NULL) && + if( (cgraph.graphlabel.gamma_ID != 0) && (cgraph.graphlabel.geq_active == 0) ) { /* prior state existed without use of geq window */ move = 1; - if( cgraph.graphlabel.geq_ID == NULL ) { + if( cgraph.graphlabel.geq_ID == 0 ) { cgraph.graphlabel.geq_ID = create_cgraph_box(cgraph.graphlabel.geq_x, cgraph.graphlabel.geq_y, cgraph.graphlabel.geq_width, cgraph.graphlabel.geq_height, graphbox.display, @@ -89,34 +89,34 @@ cgraph.graphlabel.green_x + cgraph.graphlabel.box_width + 3; /* offset "min" and "max" from bottom, offset "max" from right */ cgraph.graphlabel.min_y = graphbox.height - cgraph.graphlabel.minmax_yoff; cgraph.graphlabel.max_y = cgraph.graphlabel.min_y; cgraph.graphlabel.max_x = graphbox.width - cgraph.graphlabel.minmax_xoff; - if( cgraph.graphlabel.gamma_ID == NULL ) { + if( cgraph.graphlabel.gamma_ID == 0 ) { cgraph.graphlabel.gamma_ID = create_cgraph_box(cgraph.barlabel.width, 0, cgraph.graphlabel.width, cgraph.graphlabel.height, graphbox.display, graphbox.ID, -1, NorthGravity); cgraph.graphlabel.minmax_ID = graphbox.ID; new = 1; } } else { - if( (cgraph.graphlabel.gamma_ID != NULL) && + if( (cgraph.graphlabel.gamma_ID != 0) && (cgraph.graphlabel.height != graphbox.height) ) resize = 1; cgraph.graphlabel.height = graphbox.height; /* place boxes together (one_above-the-other) and centered */ if( cgraph.graphlabel.height >= cgraph.graphlabel.four_limit ) { cgraph.graphlabel.geq_y = (1 + cgraph.graphlabel.height - cgraph.graphlabel.four_limit) / 2; cgraph.graphlabel.red_y = cgraph.graphlabel.geq_y + cgraph.graphlabel.box_height + 3; - if( (cgraph.graphlabel.gamma_ID != NULL) && + if( (cgraph.graphlabel.gamma_ID != 0) && (cgraph.graphlabel.geq_active == 0) ) { /* prior state existed without use of geq window */ move = 1; - if( cgraph.graphlabel.geq_ID == NULL ) + if( cgraph.graphlabel.geq_ID == 0 ) cgraph.graphlabel.geq_ID = create_cgraph_box(cgraph.graphlabel.geq_x, cgraph.graphlabel.geq_y, cgraph.graphlabel.geq_width, cgraph.graphlabel.geq_height, graphbox.display, @@ -141,11 +141,11 @@ cgraph.graphlabel.red_y + cgraph.graphlabel.box_height + 3; cgraph.graphlabel.blue_y = cgraph.graphlabel.green_y + cgraph.graphlabel.box_height + 3; /* offset "min" from bottom */ cgraph.graphlabel.min_y = graphbox.height - cgraph.graphlabel.minmax_yoff; - if( cgraph.graphlabel.gamma_ID == NULL ) { + if( cgraph.graphlabel.gamma_ID == 0 ) { cgraph.graphlabel.gamma_ID = create_cgraph_box((int)graphbox.width - cgraph.graphlabel.width, 0, cgraph.graphlabel.width, cgraph.graphlabel.height, graphbox.display, graphbox.ID, -1, EastGravity); cgraph.graphlabel.minmax_ID = graphbox.ID; @@ -200,11 +200,11 @@ * Xlib calls: XResizeWindow() */ static void init_colorbar_label ( ) { Window create_cgraph_box(); - if( (cgraph.graphlabel.active == 0) || (cgraph.barlabel.max_ID != NULL) ) + if( (cgraph.graphlabel.active == 0) || (cgraph.barlabel.max_ID != 0) ) return; if( cgraph.vertical ) { cgraph.barlabel.max_ID = create_cgraph_box(0, 0, cgraph.barlabel.width, cgraph.barlabel.height, graphbox.display, graphbox.ID, -1, NorthWestGravity); diff -u5 -r saoimage-1.35.1/hfiles/color.h saoimage-1.35.2/hfiles/color.h --- saoimage-1.35.1/hfiles/color.h 1992-10-10 01:33:16.000000000 +0100 +++ saoimage-1.35.2/hfiles/color.h 2012-10-30 14:21:41.932465148 +0100 @@ -141,11 +141,11 @@ int color_tableID; /* id of predefined colorset */ int control_mode; /* ContBias, ThreshSat, gamma */ int control_mode_ext; /* R_G_B, RGB (separate, combined) */ int colors_alloced; /* flag that colors were alloc'ed */ int old_mode; /* previous mode (when new change) */ - int image_plane_mask; /* mask for image planes only */ + long image_plane_mask; /* mask for image planes only */ unsigned long overlay_mask; /* mask with bit for overlay cursor */ struct scalemodeRec scale; /* parameters for image scaling modes */ struct colmapRec map; /* describe which colormap to use */ struct cellspecRec cells; /* request for cells */ struct palletteRec hard; /* read-only basic colors */ diff -u5 -r saoimage-1.35.1/histdist.c saoimage-1.35.2/histdist.c --- saoimage-1.35.1/histdist.c 1998-07-28 20:56:45.000000000 +0200 +++ saoimage-1.35.2/histdist.c 2012-10-30 15:27:52.381442366 +0100 @@ -16,10 +16,13 @@ * {n} -- -- */ #include #include "hfiles/histeq.h" /* define SubrangeLink */ +static int excess_zgroup ( SubrangeLink * subrange, int * excess, int * range, int average ) ; +static int range_zgroup (SubrangeLink * subrange, int * excess, int * range, int average) ; +static int excess_nzgroup ( SubrangeLink * subrange, int * excess, int average ) ; /* * Subroutine: distribute_levels * Purpose: Distribute the levels among histogram sub-groups * Returns: number of groups with no assigned color levels @@ -37,11 +40,10 @@ int max_z_excess, max_nz_excess, max_z_range; SubrangeLink *subrange; #ifdef DEBUG int census = 0; #endif - static int excess_zgroup(), excess_nzgroup(), range_zgroup(); /* if all one group (no strong peaks), allocation is simple */ if( linklist->next == 0 ) { linklist->color_levels = ncolor; return( 0 ); @@ -151,14 +153,11 @@ /* * Subroutine: excess_zgroup * Purpose: Find subrange with zero allotted levels and specified excess. * Assign it one level */ -static int excess_zgroup ( subrange, excess, range, average ) - SubrangeLink *subrange; - int *excess, *range; - int average; +static int excess_zgroup ( SubrangeLink * subrange, int * excess, int * range, int average ) { int max_excess, looking; max_excess = -32700; looking = 1; @@ -189,14 +188,11 @@ /* * Subroutine: range_zgroup * Purpose: Find group with zero allotted levels and specified range. * Assign it one level. */ -static int range_zgroup (subrange, excess, range, average) - SubrangeLink *subrange; - int *excess, *range; - int average; +static int range_zgroup (SubrangeLink * subrange, int * excess, int * range, int average) { int max_range, looking; max_range = 0; looking = 1; @@ -227,14 +223,11 @@ /* * Subroutine: excess_nzgroup * Purpose: Find group with non-zero allotted levels and specified * excess value. Assign it one additional level. */ -static int excess_nzgroup ( subrange, excess, average ) - SubrangeLink *subrange; - int *excess; - int average; +static int excess_nzgroup ( SubrangeLink * subrange, int * excess, int average ) { int looking, max_excess; looking = 1; max_excess = -32767; diff -u5 -r saoimage-1.35.1/histeql.c saoimage-1.35.2/histeql.c --- saoimage-1.35.1/histeql.c 1990-04-20 16:59:27.000000000 +0200 +++ saoimage-1.35.2/histeql.c 2012-10-30 15:29:45.196076287 +0100 @@ -15,10 +15,14 @@ * {n} -- -- */ #include #include "hfiles/histeq.h" /* define SubrangeLink */ +static int count_nonzero_histogram_entries ( int * histogram, int pmin, int pmax ) ; +static int rescan_histogram ( SubrangeLink * subrange, int * histogram, + int * pixel_area, int * map_levels, int * average_area ) ; +static void unmark_peak_links ( SubrangeLink * subrange, int nlevels ) ; /* * Subroutine: histogram_equalize * Purpose: Create a scaling map which equalizes image cells per * output level optimization accounts for large cell counts @@ -40,12 +44,10 @@ int nz_entries; /* l: non-zero entries in histogram */ int empties; /* l: subranges with no alloted levels */ char *calloc_errchk(); int distribute_levels(); void generate_scalemap(), scan_histogram_for_peaks(), resolve_zeroes(); - static int count_nonzero_histogram_entries(), rescan_histogram(); - static void unmark_peak_links(); /* initialize link list */ linklist = (SubrangeLink *)calloc_errchk(10, sizeof(int), "HElink"); linklist->next = 0; linklist->low = pmin; @@ -91,17 +93,12 @@ * Purpose: Repeat scanning for large count levels as saturation level * is modified. Repeats until all large count levels are * marked and residual is stable * Returns: 1 if a range was modified, 0 if nothing was changed */ -static int rescan_histogram ( subrange, histogram, - pixel_area, map_levels, average_area ) - SubrangeLink *subrange; - int *histogram; - int *pixel_area; - int *map_levels; - int *average_area; +static int rescan_histogram ( SubrangeLink * subrange, int * histogram, + int * pixel_area, int * map_levels, int * average_area ) { int process; void scan_histogram_for_peaks(); process = 0; @@ -122,13 +119,11 @@ * Subroutine: unmark_peak_links * Purpose: Make singularity links non_uniquely marked (range > 0) and * check count against reference * Called by: histogram_equalize() above */ -static void unmark_peak_links ( subrange, nlevels ) - SubrangeLink *subrange; - int nlevels; +static void unmark_peak_links ( SubrangeLink * subrange, int nlevels ) { #ifdef DEBUG int levels = 0; #endif @@ -155,14 +150,11 @@ /* * Subroutine: count_nonzero_histogram_entries * Called by: histogram_equalize() in HistEqual.c */ -static int count_nonzero_histogram_entries ( histogram, pmin, pmax ) - register int *histogram; - int pmin; - register int pmax; +static int count_nonzero_histogram_entries ( int * histogram, int pmin, int pmax ) { register int i, npix; npix = 0; for( i = pmin; i <= pmax; i++ ) { diff -u5 -r saoimage-1.35.1/histlist.c saoimage-1.35.2/histlist.c --- saoimage-1.35.1/histlist.c 1991-06-22 00:58:44.000000000 +0200 +++ saoimage-1.35.2/histlist.c 2012-10-30 15:31:02.195507600 +0100 @@ -22,10 +22,15 @@ #define MAXITERATIONS 1000 /* --jrw */ #ifdef DEBUG #define HDEBUG #endif +static int equalize_simply ( int * histogram, SubrangeList * histlist, + int level, int average_area, int low_entry, int high_entry, + int color_levels, int * shrink_level, int * stretch_level, + int * end_area, int * min_area, int * max_area, + int * min_stretch, int * max_shrink ) ; /* * Subroutine: make_equalized_list * Purpose: Distributing levels for a subrange section of the histogram */ @@ -45,11 +50,10 @@ int end_error; /* deviation from ideal of last level */ int best_levels_over; /* levels from an equalize worth remembering */ int best_levels_under; int best_average_over = 0; /* average_area used to get best_levels */ int best_average_under = 0; - static int equalize_simply(); #ifdef JIGGLE static void adjust_list(); #endif /* else allocation distribution must first be determined */ @@ -221,23 +225,15 @@ /* * Subroutine: equalize_simply * Purpose: Make a list to describe map using basic allocation method * Note: Allocate levels from "level" to "color_levels" */ -static int equalize_simply ( histogram, histlist, - level, average_area, low_entry, high_entry, - color_levels, shrink_level, stretch_level, - end_area, min_area, max_area, - min_stretch, max_shrink ) - int *histogram; - SubrangeList *histlist; - int level, average_area; - int low_entry, high_entry; - int color_levels; - int *shrink_level, *stretch_level; - int *end_area, *min_area, *max_area; - int *min_stretch, *max_shrink; +static int equalize_simply ( int * histogram, SubrangeList * histlist, + int level, int average_area, int low_entry, int high_entry, + int color_levels, int * shrink_level, int * stretch_level, + int * end_area, int * min_area, int * max_area, + int * min_stretch, int * max_shrink ) { int entry, neighbor_entry; int area, old_area; int err_low, err_high; int init_next; diff -u5 -r saoimage-1.35.1/histmap.c saoimage-1.35.2/histmap.c --- saoimage-1.35.1/histmap.c 1990-04-20 17:00:13.000000000 +0200 +++ saoimage-1.35.2/histmap.c 2012-10-30 15:36:02.733181205 +0100 @@ -13,12 +13,21 @@ * Modified: {0} Michael VanHilst initial version 30 May 1989 * {n} -- -- */ #include +#include #include "hfiles/histeq.h" /* define SubrangeLink, List */ +static void make_subrange_scalemap ( int * histogram, SubrangeLink * subrange, unsigned char * scalemap, int baselevel, unsigned long * pixels ) ; +static void make_gapped_list ( int * histogram, SubrangeList * list, int low, int high, int levels ) ; +static void list_to_map ( unsigned char * scalemap, SubrangeList * histlist, int baselevel, int levels, unsigned long * pixels ) ; +static int + first_shortlist_pass ( int * histogram, SubrangeList * list, int low_entry, int high_entry, int levels, + int * max_range, int * range_j ) ; +static void add_level_to_short_list ( SubrangeList * list, int top, int * max_range, int * range_j ) ; + /* * Subroutine: generate_scalemap * Purpose: Make scalemap, applying standard histgoram equalization * one subrange group at a time * Note: Value range was broken into groups with an assigned number @@ -34,11 +43,10 @@ unsigned char *scalemap; /* i: scalemap (for signed indexing) */ unsigned long *pixels; /* i: map to hardware entries */ { int baselevel; SubrangeLink *trash; - static void make_subrange_scalemap(); baselevel = 0; while( subrange != 0 ) { make_subrange_scalemap(hist, subrange, scalemap, baselevel, pixels); if( subrange->color_levels > 0 ) @@ -53,23 +61,19 @@ * Subroutine: make_subrange_scalemap * Purpose: Make a section of scale map using histgroup link as guide * Called by: make_HE_scalemap() in HistEqual.c */ static void - make_subrange_scalemap ( histogram, subrange, scalemap, baselevel, pixels ) - int *histogram; - SubrangeLink *subrange; - unsigned char *scalemap; /* scalemap (for signed indexing) */ - int baselevel; - unsigned long *pixels; /* i: map to hardware entries */ + make_subrange_scalemap ( int * histogram, SubrangeLink * subrange, unsigned char * scalemap, int baselevel, unsigned long * pixels ) + /* scalemap (for signed indexing) */ + /* i: map to hardware entries */ { int i, color_levels; SubrangeList *list; unsigned char dispval; char *calloc_errchk(); void make_equalized_list(); - static void make_gapped_list(), list_to_map(); /* if only one level, make map section */ if( subrange->color_levels <= 1 ) { dispval = pixels[baselevel]; for( i = subrange->low; i <= subrange->high; i++ ) { @@ -106,15 +110,13 @@ /* * Subroutine: list_to_map * Purpose: Make section of map as defined by list * Called by: make_subrange_scalemap() above */ -static void list_to_map ( scalemap, histlist, baselevel, levels, pixels ) - unsigned char *scalemap; /* scalemap (for signed indexing) */ - SubrangeList *histlist; - int baselevel, levels; - unsigned long *pixels; /* i: map to hardware entries */ +static void list_to_map ( unsigned char * scalemap, SubrangeList * histlist, int baselevel, int levels, unsigned long * pixels ) + /* scalemap (for signed indexing) */ + /* i: map to hardware entries */ { int i, level; int first, last, imageval; unsigned char dispval; @@ -133,19 +135,14 @@ /* * Subroutine: make_gapped_list * Purpose: Allocate levels for a histogram subrange. Special process * for situation when more levels than actually used values. */ -static void make_gapped_list ( histogram, list, low, high, levels ) - int *histogram; - SubrangeList *list; - int low, high, levels; +static void make_gapped_list ( int * histogram, SubrangeList * list, int low, int high, int levels ) { int range_j, max_range; int levels_used; - static int first_shortlist_pass(); - static void add_level_to_short_list(); levels_used = first_shortlist_pass(histogram, list, low, high, levels, &max_range, &range_j); while( levels_used < levels ) { @@ -159,16 +156,12 @@ * Purpose: Make a list to describe map allocation using special * allocation method. Fill the list with each entry ending * at the next actually used value. */ static int - first_shortlist_pass ( histogram, list, low_entry, high_entry, levels, - max_range, range_j ) - int *histogram; - SubrangeList *list; - int low_entry, high_entry, levels; - int *range_j, *max_range; + first_shortlist_pass ( int * histogram, SubrangeList * list, int low_entry, int high_entry, int levels, + int * max_range, int * range_j ) { int i, area, level; /* initialize parameters (index starts at 0) */ level = 0; @@ -207,14 +200,11 @@ } /* * Subroutine: add_level_to_short_list */ -static void add_level_to_short_list ( list, top, max_range, range_j ) - SubrangeList *list; - int top; - int *max_range, *range_j; +static void add_level_to_short_list ( SubrangeList * list, int top, int * max_range, int * range_j ) { int i, j, mark; mark = *range_j; *max_range = -1; diff -u5 -r saoimage-1.35.1/histscan.c saoimage-1.35.2/histscan.c --- saoimage-1.35.1/histscan.c 1990-04-20 17:00:36.000000000 +0200 +++ saoimage-1.35.2/histscan.c 2012-10-30 15:37:27.406650125 +0100 @@ -13,10 +13,13 @@ * Modified: {0} Michael VanHilst initial version 30 May 1989 * {n} -- -- */ #include "hfiles/histeq.h" +static SubrangeLink *get_new_subrange_record ( SubrangeLink * old_link ) ; +static void fill_subrange_record ( SubrangeLink * link, int low, int high, int range, int nz_entries, + int pixel_area, int max_entry ) ; /* * Subroutine: scan_histogram_for_peaks * Purpose: Scan the image histogram picking out large cell count values * make sub-groups of the histogram between the large count levels @@ -34,12 +37,10 @@ int scan_start; /* l: histogram entry after last peak */ int pixel_count; /* l: number of pixels at histogram entry */ int sr_nzentries; /* l: number of non-zero entries in subrange */ int sr_pixel_area; /* l: number of pixels in current subrange */ int sr_max_peak; /* l: highest peak within current subrange */ - static SubrangeLink *get_new_subrange_record(); - static void fill_subrange_record(); /* set initial pixel_count values */ sr_pixel_area = 0; sr_nzentries = 0; sr_max_peak = 0; @@ -96,12 +97,11 @@ /* * Subroutine: get_new_subrange_record * Purpose: Create a new link in histogram link list, after one given * Returns: Pointer to new subrange link */ -static SubrangeLink *get_new_subrange_record ( old_link ) - SubrangeLink *old_link; +static SubrangeLink *get_new_subrange_record ( SubrangeLink * old_link ) { SubrangeLink *new_link; char *calloc_errchk(); /* create new record for histogram link list */ @@ -116,18 +116,17 @@ /* * Subroutine: fill_subrange_record * Purpose: Set parameters in subrange link list record */ -static void fill_subrange_record ( link, low, high, range, nz_entries, - pixel_area, max_entry ) - SubrangeLink *link; - int low, high; /* i: first and last index in histogram */ - int range; /* i: span of histogram entries */ - int nz_entries; /* i: non-zero entries in range */ - int pixel_area; /* i: sum of histogram entry values (pixels) */ - int max_entry; /* i: highest histogram entry value */ +static void fill_subrange_record ( SubrangeLink * link, int low, int high, int range, int nz_entries, + int pixel_area, int max_entry ) + /* i: first and last index in histogram */ + /* i: span of histogram entries */ + /* i: non-zero entries in range */ + /* i: sum of histogram entry values (pixels) */ + /* i: highest histogram entry value */ { link->low = low; link->high = high; link->range = range; link->nz_entries = nz_entries; diff -u5 -r saoimage-1.35.1/histzero.c saoimage-1.35.2/histzero.c --- saoimage-1.35.1/histzero.c 1990-04-20 17:01:03.000000000 +0200 +++ saoimage-1.35.2/histzero.c 2012-10-30 15:38:15.365915243 +0100 @@ -13,11 +13,13 @@ * Modified: {0} Michael VanHilst initial version 30 May 1989 * {n} -- -- */ #include +#include #include "hfiles/histeq.h" /* define SubrangeLink */ +static void merge_links ( SubrangeLink * subrange ) ; /* * Subroutine: resolve_zeroes * Purpose: Combine groups with zero alloted levels with adjoining groups * Note: Adjoining groups are large count single level groups @@ -27,11 +29,10 @@ SubrangeLink *PriorLink; int zeroes; { SubrangeLink *ThisLink, *NextLink; int a_count, b_count, z1count, z2count; - static void merge_links(); /* if very first entry is a zero allocated link */ if( PriorLink->color_levels == 0 ) { /* merge this and next */ merge_links(PriorLink); @@ -95,12 +96,11 @@ /* * Subroutine: merge_links * Purpose: Combine two links of histogram group list */ -static void merge_links ( subrange ) - SubrangeLink *subrange; +static void merge_links ( SubrangeLink * subrange ) { SubrangeLink *lostlink; lostlink = subrange->next; subrange->next = lostlink->next; diff -u5 -r saoimage-1.35.1/imgcheck.c saoimage-1.35.2/imgcheck.c --- saoimage-1.35.1/imgcheck.c 2001-03-12 22:31:30.000000000 +0100 +++ saoimage-1.35.2/imgcheck.c 2012-10-30 15:40:11.122558029 +0100 @@ -22,10 +22,11 @@ * {n} -- -- */ #include /* stderr, NULL, etc. */ #include /* define sqrt */ +#include /* define strstr */ #include #include /* define stat */ #ifndef VMS #ifdef SYSV @@ -38,11 +39,13 @@ #endif #include "hfiles/constant.h" /* define codes */ #include "hfiles/image.h" #include "hfiles/cmdparse.h" /* define parse status bits */ +static long size_imagefile ( struct imageRec * img, int headersize, int *rawsize ) ; +static int check_array ( struct imageRec * img ) ; /* * Subroutine: check_image * Purpose: Do some consistency checks on image type and size * Returns: 0 if no errors found, else -1 */ @@ -50,11 +53,10 @@ struct imageRec *img; int got_status; { int len; char *ext, *mwcs, cext; - static int check_array(); extern int isfits(); ext = NULL; mwcs = NULL; @@ -146,19 +148,17 @@ /* * Subroutine: check_array * Purpose: Check array size vs file size etc * Returns: 0 if size determined and/or OK, else -1 */ -static int check_array ( img ) - struct imageRec *img; +static int check_array ( struct imageRec * img ) { long fsize; long arrsize; float posdim; /* possible dimension */ int headersize; /* size in bytes of header */ int rawsize; - static long size_imagefile(); /* get header size */ headersize = img->headersize; /* get file size */ fsize = size_imagefile(img, headersize, &rawsize); @@ -228,14 +228,13 @@ /* * Subroutine: size_imagefile * Purpose: return size of file adjusted for header and storage type */ -static long size_imagefile ( img, headersize, rawsize ) - struct imageRec *img; - int headersize; /* given size of file header area */ - int *rawsize; /* raw file size in bytes */ +static long size_imagefile ( struct imageRec * img, int headersize, int *rawsize ) + /* given size of file header area */ + /* raw file size in bytes */ { struct stat buf; int fsize; /* get the file length in bytes */ diff -u5 -r saoimage-1.35.1/imgflip.c saoimage-1.35.2/imgflip.c --- saoimage-1.35.1/imgflip.c 1991-01-08 02:11:30.000000000 +0100 +++ saoimage-1.35.2/imgflip.c 2012-10-30 15:41:07.555885208 +0100 @@ -16,10 +16,12 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 8 December 1988 * {n} -- -- */ +#include +#include /* Subroutine: xflip_buf * Purpose: Flip buf to make Y coordinates run in opposite direction * (upside down) */ diff -u5 -r saoimage-1.35.1/imglogo.c saoimage-1.35.2/imglogo.c --- saoimage-1.35.1/imglogo.c 1990-04-26 18:31:48.000000000 +0200 +++ saoimage-1.35.2/imglogo.c 2012-10-30 15:42:05.790221945 +0100 @@ -42,15 +42,11 @@ /* * Subroutine: make_logo * Purpose: decode run-length encoded saoimage logo into short buffer */ -static void make_logo ( logo, logo_len, buf, buf_width ) - register unsigned char *logo; - int logo_len; - short *buf; - int buf_width; +static void make_logo ( unsigned char * logo, int logo_len, short * buf, int buf_width ) { int i, j, val, cnt; register int x; int run, line; register short *ob; @@ -376,11 +372,10 @@ short *shortbuf; int bufwd, bufht; { register short *bufpt, *bufend; register short bkgd; - static void make_logo(); /* fill buffer with background color */ bufpt = shortbuf; bufend = bufpt + (bufwd * bufht); bkgd = BKGD; diff -u5 -r saoimage-1.35.1/imgnew.c saoimage-1.35.2/imgnew.c --- saoimage-1.35.1/imgnew.c 1998-10-15 01:01:58.000000000 +0200 +++ saoimage-1.35.2/imgnew.c 2012-10-30 20:16:57.614065115 +0100 @@ -24,18 +24,18 @@ * {8} Doug Mink added region title with image 14 Oct 1998 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* strlen, strcat, strcpy, rindex */ +#include /* free */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else #include /* strlen, strcat, strcpy, rindex */ -#define strchr index -#define strrchr rindex #endif #else #include /* strlen, strcat, strcpy, strrchr */ #endif @@ -45,25 +45,25 @@ #include "hfiles/constant.h" /* constants and codes */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ extern struct windowRec desktop; +static void load_mainbuf ( int clear ) ; /* Subroutine: new_display * Purpose: Create all image coordinate parameters from the beginning * and take care of all that might be affected */ -void new_display ( dispnow, clear, load, scale ) - int dispnow; /* i: put-display-in-window-now flag */ - int clear; /* i: clear img buf before reading flag */ - int load; /* i: load-the-buffer flag */ - int scale; /* i: make-new-scalemap flag (must have load) */ +void new_display ( int dispnow, int clear, int load, int scale ) + /* i: put-display-in-window-now flag */ + /* i: clear img buf before reading flag */ + /* i: load-the-buffer flag */ + /* i: make-new-scalemap flag (must have load) */ { void set_disptran(), new_pancursor(), new_scalemap(); void combine_transform(), set_edges(), set_dispoff(), set_magnifier(); void adjust_cursor_coords(), map_dispbox(), disp_dispbox(); - static void load_mainbuf(); /* Set disp to img and disp to file transforms */ set_disptran(&coord); /* If the buffer needs new contents, fill it */ if( load || coord.buferror ) { @@ -93,12 +93,11 @@ /* Subroutine: load_mainbuf * Purpose: Set buf related coords and load image data into main buffer */ -static void load_mainbuf ( clear ) - int clear; +static void load_mainbuf ( int clear ) { int zoom; void set_buftran(), set_fbuftran(), load_image(), show_filename(); /* Select appropriate buffer contents in image field and file coords */ diff -u5 -r saoimage-1.35.1/imgrot.c saoimage-1.35.2/imgrot.c --- saoimage-1.35.1/imgrot.c 1991-01-07 21:50:59.000000000 +0100 +++ saoimage-1.35.2/imgrot.c 2012-10-30 16:58:52.811013425 +0100 @@ -14,10 +14,13 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 3 December 1988 * {n} -- -- */ +#include +#include + /* * Subroutine: cwturn_buf * Purpose: Rotate a square buffer 90 degrees clockwise */ void cwturn_buf ( buf, bufdim ) diff -u5 -r saoimage-1.35.1/imgtrans.c saoimage-1.35.2/imgtrans.c --- saoimage-1.35.1/imgtrans.c 1990-04-20 17:13:46.000000000 +0200 +++ saoimage-1.35.2/imgtrans.c 2012-10-30 15:45:10.015281708 +0100 @@ -14,12 +14,15 @@ * Modified: {0} Michael VanHilst initial version 8 December 1988 * {n} -- -- */ #include /* define stderr */ +#include /* define bcopy */ #include "hfiles/define.h" /* define MIN, MAX, etc. */ +static void square_buf ( short * buf, int width, int height, int left ) ; +static void unsquare_buf ( short * buf, int width, int height, int left ) ; /* * Subroutine: rotate_buf * Purpose: Rotate a buffer as indicated by the code * Parameter: rotcode * 0-3 = rotate clockwise by code * 90 degrees @@ -34,11 +37,10 @@ int buf_squared, buf_doubled; { int maxdim; void xflip_buf(), yflip_buf(), zflip_buf(), cwturn_buf(), ccwturn_buf(); void transfer_buf(); - static void square_buf(), unsquare_buf(); if( flip ) rotcode += 4; if( rotcode & 1 ) { if( buf_doubled ) { @@ -101,14 +103,11 @@ * Exception: Assumes that height of rectangle is greater than width * Parameter: left * left = 1 will put reactangle on left with lines padded out * left = 0 will put rectangle on right with padded in front of lines */ -static void square_buf ( buf, width, height, left ) - short *buf; - int width, height; - int left; +static void square_buf ( short * buf, int width, int height, int left ) { short *rectline, *sqline; int bytes; /* make buf square with lines filled to end */ @@ -130,14 +129,11 @@ * Purpose: Make rectangular data in square buffer occupy rectangle at top * Exception: Assumes output height is greater than width * left = 1 moves data which is on left side of square * left = 0 moves data which is on right side of square */ -static void unsquare_buf ( buf, width, height, left ) - short *buf; - int width, height; - int left; +static void unsquare_buf ( short * buf, int width, int height, int left ) { short *rectline, *sqline; int bytes; int i; diff -u5 -r saoimage-1.35.1/imhfile.c saoimage-1.35.2/imhfile.c --- saoimage-1.35.1/imhfile.c 2003-11-03 21:48:06.000000000 +0100 +++ saoimage-1.35.2/imhfile.c 2012-10-30 16:55:38.359924637 +0100 @@ -1002,11 +1002,10 @@ /* Write data to IRAF pixel file */ nbw = write (fd, image, nbimage); close (fd); - free (pixname); return (nbw); } /* Put filename and header path together */ diff -u5 -r saoimage-1.35.1/irafcrd.c saoimage-1.35.2/irafcrd.c --- saoimage-1.35.1/irafcrd.c 1990-04-20 17:16:02.000000000 +0200 +++ saoimage-1.35.2/irafcrd.c 2012-10-30 15:47:23.889046821 +0100 @@ -37,10 +37,14 @@ #include /* get X types and constants */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main SAOimage parameter structures */ +static int parse_iraf_subsection ( char * s, int * xoff, int * yoff, int * block ) ; +static char *fn_substr ( char * s, char * p ) ; +static void get_subsection_offsets ( char * s, int * xoff, int * yoff, int is_qp ) ; + /* * Subroutine: guess_true_file_coords * Purpose: Parse wcs filename string for the user's "rect" subsection. * If found and parsed, compute new transform for file coord. * Returns: 1 if subsection found and parsed successfully, else 0 @@ -49,11 +53,10 @@ char *title; { int xoff, yoff, block; float fblock; Transform imgtoaux; - static int parse_iraf_subsection(); void set_trans_speed(), combine_transform(), clear_coord_area(); if( parse_iraf_subsection(title, &xoff, &yoff, &block) == 0 ) { if( coord.imtool_aux ) clear_coord_area(); @@ -90,19 +93,17 @@ /* * Subroutine: parse_iraf_subsection * Purpose: Parse for subsection and blocking from the image name * Returns: 1 if subsection or blocking was used, else 0 */ -static int parse_iraf_subsection ( s, xoff, yoff, block ) - char *s; /* i: file name */ - int *xoff; /* o: x offset */ - int *yoff; /* o: y offset */ - int *block; /* o: block */ +static int parse_iraf_subsection ( char * s, int * xoff, int * yoff, int * block ) + /* i: file name */ + /* o: x offset */ + /* o: y offset */ + /* o: block */ { char *t, *u; /* temp char pointers */ - static char *fn_substr(); /* look for a substr */ - static void get_subsection_offsets(); /* seed the default values */ *xoff = 1; *yoff = 1; *block=1; @@ -137,19 +138,16 @@ /* * Subroutine: get_subsection_offsets * Purpose: parse subsection syntax for x and y offsets of subsection */ -static void get_subsection_offsets ( s, xoff, yoff, is_qp ) - char *s; - int *xoff, *yoff; - int is_qp; /* i: file is qp (uses () around subsection) */ +static void get_subsection_offsets ( char * s, int * xoff, int * yoff, int is_qp ) + /* i: file is qp (uses () around subsection) */ { int x1, x2; int y1, y2; char *sy, *s2, *st; - static char *fn_substr(); /* if not qp, grab the initial x offset right after the '[' */ sy = fn_substr(s, ","); if( is_qp ) st = strchr(s, ')'); @@ -191,13 +189,13 @@ * Subroutine: fn_substr * Purpose: Find the next instance of a string in another string * Note: This routine is a bit different in that it ignores spaces * in checking and returns a pointer after the substring */ -static char *fn_substr ( s, p ) - char *s; /* i: string to be searched */ - char *p; /* i: pattern sought in s */ +static char *fn_substr ( char * s, char * p ) + /* i: string to be searched */ + /* i: pattern sought in s */ { char *sl; /* pointer to the local part of s */ char *tp; /* local pointer in p */ char *sp; /* local pointer in s */ diff -u5 -r saoimage-1.35.1/irafdisp.c saoimage-1.35.2/irafdisp.c --- saoimage-1.35.1/irafdisp.c 1992-10-10 01:31:32.000000000 +0100 +++ saoimage-1.35.2/irafdisp.c 2012-10-30 15:52:06.838669257 +0100 @@ -22,10 +22,11 @@ */ #ifdef IMTOOL #include /* stderr, FILE, NULL, etc. */ +#include /* bcopy */ #include /* get X types and constants */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main SAOimage parameter structures */ diff -u5 -r saoimage-1.35.1/irafenv.c saoimage-1.35.2/irafenv.c --- saoimage-1.35.1/irafenv.c 1990-04-20 17:18:13.000000000 +0200 +++ saoimage-1.35.2/irafenv.c 2012-10-30 17:01:55.534034881 +0100 @@ -20,10 +20,11 @@ * {n} -- -- */ #include #include /* define FILE, stderr, fopen(), fclose() */ +#include #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else diff -u5 -r saoimage-1.35.1/irafimtl.c saoimage-1.35.2/irafimtl.c --- saoimage-1.35.1/irafimtl.c 1998-02-25 20:52:37.000000000 +0100 +++ saoimage-1.35.2/irafimtl.c 2012-10-30 15:53:20.947093103 +0100 @@ -24,10 +24,12 @@ */ #ifdef IMTOOL #include /* stderr, FILE, NULL, etc. */ +#include /* bzero */ +#include /* strncpy */ #include /* get X types and constants */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main ximage parameter structures */ @@ -40,10 +42,11 @@ static int imtool_rows=512; static int packet_cols=512; static int wcs_piped=0; /* l: set if wcs info sent through pipe */ static char wcsbuf[SZ_WCSBUF]; +static int get_frame_no ( int mask ) ; /* * Subroutine: imtool_response * Purpose: Read imtool messages from iraf (return 1 if pipe trouble) */ void imtool_response ( port, imhead, ndatabytes ) @@ -58,11 +61,10 @@ int imtool_input(), write_connection(), update_wcs(), read_connection(); void imtool_newimage(), map_dispbox(), disp_dispbox(); void set_curpos_to_iraf_trigger(), set_cursor_from_iraf(), imtool_output(); void set_imtool_scale(), set_cursor_to_iraf(), disp_subpiece(); void map_panbox(), disp_panbox(), send_curpos_to_iraf(), flush_connection(); - static int get_frame_no(); switch( imhead->subunit & 077 ) { case FEEDBACK: /* The IIS feedback unit is used to clear the screen */ bzero(buffer.filebuf, buffer.filebuf_sz); @@ -197,11 +199,10 @@ int cols, rows; int get_fbconfig(), update_wcs(); void set_disptran(), combine_transform(), set_edges(), set_dispoff(); void adjust_cursor_coords(), set_magnifier(), disp_subpiece(), set_tdisp(); void set_imtool_scale(), imtool_reinit(), new_pancursor(); - static int get_frame_no(); /* set size and frame */ if( is_wcs ) fbconfig = (imhead->t & 077) + 1; else @@ -249,12 +250,11 @@ /* * Subroutine: get_frame_no * Purpose: Figure out the integer frame number for its mask */ -static int get_frame_no ( mask ) - int mask; +static int get_frame_no ( int mask ) { int bit, bitmask; mask = mask & 07777; bit = 0; diff -u5 -r saoimage-1.35.1/irafio.c saoimage-1.35.2/irafio.c --- saoimage-1.35.1/irafio.c 1992-10-12 18:17:50.000000000 +0100 +++ saoimage-1.35.2/irafio.c 2012-10-30 15:54:50.087601279 +0100 @@ -25,10 +25,11 @@ * for the prototype, convenient since the high level software is written for * the IIS." - explanation by Doug Tody */ #include /* stderr, FILE, NULL, etc. */ +#include /* strlen, */ #ifndef VMS #ifdef SYSV #include #else @@ -41,10 +42,13 @@ #include /* X window stuff */ #include "hfiles/control.h" /* define struct connectRec */ #include "hfiles/imtool.h" /* define struct imtoolRec, codes */ extern struct controlRec control; +static int compact_short_to_byte ( short * ints, unsigned char * bts, int cnt ) ; +static void expand_byte_to_short ( unsigned char * bts, short * ints, int cnt ) ; + /* * Subroutine: open_imtool_connection * Purpose: open the connection for IRAF */ void open_imtool_connection () @@ -114,11 +118,10 @@ int nleft; int bytes; int buferr = 0; char fifobuf[SZ_FIFOBUF + 4]; int write_connection(); - static int compact_short_to_byte(); ndatabytes = -(int)imhead->thingct; x = imhead->x & 077777; y = imhead->y & 077777; offset = (y * width) + x; @@ -169,11 +172,10 @@ int x, y; int nvals, nleft; int got, try, gotten; short *obuf; int read_connection(); - static void expand_byte_to_short(); /* get data count and packing type */ ndatavals = -(int)imhead->thingct; if( !(imhead->tid & PACKED) ) { ndatabytes = ndatavals * 2; @@ -223,26 +225,20 @@ /* * Subroutine: expand_byte_to_short * Purpose: Unpack byte data for use as shorts */ -static void expand_byte_to_short ( bts, ints, cnt ) - register unsigned char *bts; - register short *ints; - register int cnt; +static void expand_byte_to_short ( unsigned char * bts, short * ints, int cnt ) { while (cnt-- > 0) { *ints = *bts; ints++; bts++; } } -static int compact_short_to_byte ( ints, bts, cnt ) - register short *ints; - register unsigned char *bts; - register int cnt; +static int compact_short_to_byte ( short * ints, unsigned char * bts, int cnt ) { int buferr = 0; while( cnt-- > 0 ) { if( *ints > 255 ) { *bts = 255; diff -u5 -r saoimage-1.35.1/irafpipe.c saoimage-1.35.2/irafpipe.c --- saoimage-1.35.1/irafpipe.c 1998-02-25 20:52:26.000000000 +0100 +++ saoimage-1.35.2/irafpipe.c 2012-10-30 15:55:31.113834643 +0100 @@ -27,10 +27,12 @@ #include /* stderr, FILE, NULL, etc. */ #include /* get X types and constants */ #include "hfiles/control.h" /* struct connectRec */ #include "hfiles/imtool.h" /* struct imtoolRec, codes */ +static int check_packet_sum ( char * packet, int size, int * byteswap, int errmsg, int die ) ; + /* * Subroutine: read_imtool_packet() * Purpose: event handler for packet input from iraf */ void read_imtool_packet( port ) @@ -46,11 +48,10 @@ #ifdef DEBUG int pkt; /* l: make packet code discrete variable */ #endif int read_connection(); void imtool_response(), swap_bytes(); - static int check_packet_sum(); /* read the header */ bytes = read_connection(port, (char *)&imhead, sizeof(struct imtoolRec)); /* check size of read */ if( bytes < sizeof(struct imtoolRec) ) { @@ -125,14 +126,11 @@ /* * Subroutine: check_packet_sum * Purpose: Check packet sum against checksum (and verify byteswap) * Returns: 1 */ -static int check_packet_sum ( packet, size, byteswap, errmsg, die ) - char *packet; - int size; - int *byteswap, errmsg, die; +static int check_packet_sum ( char * packet, int size, int * byteswap, int errmsg, int die ) { int i, sum, second_try=0; register short *p; void swap_bytes(), exit_errmsg(); diff -u5 -r saoimage-1.35.1/mainbffr.c saoimage-1.35.2/mainbffr.c --- saoimage-1.35.1/mainbffr.c 1996-01-02 20:25:54.000000000 +0100 +++ saoimage-1.35.2/mainbffr.c 2012-10-30 20:19:36.343965558 +0100 @@ -22,10 +22,11 @@ * {2} Doug Mink add initial zoom factor 2 Jan 1996 * {n} -- -- */ #include /* get stderr, NULL, etc */ +#include /* free */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/define.h" /* define MIN, MAX, etc. */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ diff -u5 -r saoimage-1.35.1/maininit.c saoimage-1.35.2/maininit.c --- saoimage-1.35.1/maininit.c 2003-12-02 00:21:35.000000000 +0100 +++ saoimage-1.35.2/maininit.c 2012-10-30 20:16:33.013925716 +0100 @@ -16,10 +16,12 @@ * express or implied warranty. * Modified: {see end of file} */ #include /* stderr, FILE, NULL, etc. */ +#include /* exit */ +#include /* strcpy */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else @@ -60,10 +62,13 @@ #include "defs/graphbox.def" #include "defs/panbox.def" #include "defs/btnbox.def" #include "defs/desktop.def" #include "defs/cursor.def" +static void init_params ( int argc, char ** argv ) ; +static void init_server ( char * displayname, struct windowRec * desktop, struct colorRec * color ) ; +static void init_packages ( int argc, char ** argv ) ; /* declare uninitialized structs */ struct WorldCoor *wcs; /* WCS data structure */ struct bufferRec buffer; struct coordRec coord; @@ -78,11 +83,10 @@ */ main(argc, argv) int argc; char **argv; { - static void init_params(), init_packages(); void crash_on_error(), control_event_loop(); void say_goodbye(); #ifdef DEBUG /* install special error handler to force crash so we can trace problem */ @@ -139,17 +143,14 @@ /* * Subroutine: init_params * Purpose: Initialize parameters in the records * Note: Resource or default file not yet used */ -static void init_params ( argc, argv ) - int argc; - char **argv; +static void init_params ( int argc, char ** argv ) { char *name; /* l: both flag for init and return display name */ int parse_stat; - static void init_server(); int parse_cmdline(), check_image(); void say_goodbye(), init_connections(); name = NULL; img.fsmin = 0; @@ -167,13 +168,11 @@ /* * Subroutine: init_packages * Purpose: Initialize all of the subroutine packages and windows */ -static void init_packages ( argc, argv ) - int argc; - char **argv; +static void init_packages ( int argc, char ** argv ) { GC gc; int init_image(); GC set_gc_with_background(); void init_windows1(), init_windows2(), init_panbox_coords(), disp_dispbox(); @@ -260,14 +259,11 @@ /* * Subroutine: init_server * Purpose: Open connection with chosen or default display server */ -static void init_server ( displayname, desktop, color ) - char *displayname; - struct windowRec *desktop; - struct colorRec *color; +static void init_server ( char * displayname, struct windowRec * desktop, struct colorRec * color ) { Display *dt_display; int dt_screen; char errmsg[SZ_FNAME]; void exit_errmsg(); diff -u5 -r saoimage-1.35.1/mainkey.c saoimage-1.35.2/mainkey.c --- saoimage-1.35.1/mainkey.c 2003-09-25 00:38:25.000000000 +0200 +++ saoimage-1.35.2/mainkey.c 2012-10-30 16:02:21.985153560 +0100 @@ -14,10 +14,11 @@ * software for any purpose. It is provided "as is" without * express or implied warranty. */ #include +#include #include /* X window stuff */ #include /* X window manager stuff */ #include #include #include "hfiles/constant.h" /* Define codes */ @@ -26,21 +27,19 @@ #define MAX_MAPPED_STRING_LENGTH 16 #define MetaMask Mod1Mask -#ifdef ANSIC /* Exported declarations must be centralized before ANSI C can be used */ void grab_keys_for_textcursor( int state); void set_iraf_key_trigger( int state); void key_response(); void set_zoom (double zoom_factor, int *direction, double xzoom, double yzoom); -#else -void set_zoom (); -#endif +static int new_image ( ) ; +static void PrintFITSHead (char *header) ; static int textcursor = 0; /* Subroutine: grab_keys_for_textcursor * Purpose: Direct all key input to the text cursor editor @@ -108,11 +107,10 @@ void disp_dispbox(), raise_windows(), get_new_cmd(), print_table(); void ascii_region(), textcursor_keyentry(); void print_center(), print_cursor(); void move_pointer(); void get_cursor_pos(); - static void PrintFITSHead(); void toggle_region_visibility(), toggle_region_labeling(); double xbuf, ybuf, xfile, yfile; double newxpos, newypos, distance; char sysout0[16]; char wcstr[32]; @@ -714,18 +712,12 @@ new_panbox(1); disp_panbox(); return( 1 ); } -#ifdef ANSIC -static void -PrintFITSHead (char *header) -#else -static void -PrintFITSHead (header) - char *header; /* Image FITS header */ -#endif +static void PrintFITSHead (char *header) + /* Image FITS header */ { char line[80], *iline, *endhead; int i, nblank; endhead = ksearch (header, "END") + 80; diff -u5 -r saoimage-1.35.1/makefile.linux saoimage-1.35.2/makefile.linux --- saoimage-1.35.1/makefile.linux 2003-04-01 19:37:27.000000000 +0200 +++ saoimage-1.35.2/makefile.linux 2012-10-30 20:20:01.002105492 +0100 @@ -81,12 +81,12 @@ #MFLAGS = -DLSB -DSUN -DPSCRIPT -DQUIT -DMIRIAD MFLAGS = -DLSB -DPSCRIPT -DQUIT -DMIRIAD # OFLAGS: compiler optimization/debug options. -#OFLAGS = -g -DDEBUG -OFLAGS = -O +# OFLAGS = -g -DDEBUG -DLONG64 +OFLAGS = -O -DLONG64 # ADFLAGS: architecture-dependent floating point flags, etc. ADFLAGS = diff -u5 -r saoimage-1.35.1/mgfyctrl.c saoimage-1.35.2/mgfyctrl.c --- saoimage-1.35.1/mgfyctrl.c 1999-05-06 21:47:12.000000000 +0200 +++ saoimage-1.35.2/mgfyctrl.c 2012-10-30 16:04:13.500777801 +0100 @@ -36,10 +36,13 @@ #include "hfiles/constant.h" /* codes */ #include "hfiles/magnify.h" /* magnifier quick access structure */ extern struct windowRec desktop; extern struct magRec magset; +static void label_file_coords ( double bufX, double bufY ) ; +static void draw_proportional_number ( char * string, int first_num, int x, int width, GC gc ) ; +static void label_file_coords_proportional ( double bufX, double bufY ) ; #define VAL_SZ 10 /* * Subroutine: magnify_disp * Purpose: Magnify location of a dispbox event @@ -48,11 +51,10 @@ void magnify_disp ( event, view, text ) XEvent *event; /* i: XEvent for location of mouse */ int view, text; { void draw_magnifier(); - static void label_file_coords(), label_file_coords_proportional(); /* get only the most recent mouse moved event */ XSync(dispbox.display, 0); while( XCheckWindowEvent(dispbox.display, dispbox.ID, PointerMotionMask, event) ); @@ -130,21 +132,19 @@ /* * Subroutine: label_file_coords * Purpose: Show pointer coordinates and image value in display window * Xlib calls: XDrawImageString() */ -static void label_file_coords ( bufX, bufY ) - double bufX, bufY; +static void label_file_coords ( double bufX, double bufY ) { int val; static char string[48], cstring[64]; int lstr = 48; int lwcs, lpix; float fileX, fileY; GC gc, set_edit_gc(); void d_transform(); - static void draw_proportional_coord(); static int lwcs0 = 0; static int lpix0 = 0; int i; int iswcs(); @@ -287,19 +287,17 @@ * Purpose: Show pointer coordinates and image value in display window * Special handling for proporitonal fonts is good for the coords, * but has not been refined for the val section. * Xlib call: XDrawImageString() */ -static void label_file_coords_proportional ( bufX, bufY ) - double bufX, bufY; +static void label_file_coords_proportional ( double bufX, double bufY ) { int val; static char string[48]; float fileX, fileY; GC gc, set_edit_gc(); void d_transform(); - static void draw_proportional_number(); gc = set_edit_gc(magset.text.font, magset.text.foreground, magset.text.background); d_transform(&coord.buftofile, bufX, bufY, &fileX, &fileY); sprintf(string, " %6.1f ", fileX); @@ -338,16 +336,13 @@ /* * Subroutine: draw_proportional_coord * Purpose: Draw proportional text to cover area and place decimal point */ -static void draw_proportional_number ( string, first_num, x, width, gc ) - char *string; - int first_num; /* i: where number begins (after leading spaces) */ - int x; - int width; /* i: pixel width to fill with label */ - GC gc; +static void draw_proportional_number ( char * string, int first_num, int x, int width, GC gc ) + /* i: where number begins (after leading spaces) */ + /* i: pixel width to fill with label */ { int size, count, offset; int letter, leading, not_done; leading = 1; diff -u5 -r saoimage-1.35.1/mgfydraw.c saoimage-1.35.2/mgfydraw.c --- saoimage-1.35.1/mgfydraw.c 1995-05-04 20:45:43.000000000 +0200 +++ saoimage-1.35.2/mgfydraw.c 2012-10-30 16:04:44.908953264 +0100 @@ -16,10 +16,11 @@ * {2} MVH same fix as 1, for bitmap display 21 Jun 1991 * {3} Doug Mink cast valbuf to short for comp 4 May 1995 * {n} -- -- */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/color.h" /* define GCspec */ #include "hfiles/magnify.h" /* magnifier quick access structure */ diff -u5 -r saoimage-1.35.1/mgfyinit.c saoimage-1.35.2/mgfyinit.c --- saoimage-1.35.1/mgfyinit.c 1990-04-20 17:58:11.000000000 +0200 +++ saoimage-1.35.2/mgfyinit.c 2012-10-30 16:58:20.801834356 +0100 @@ -17,10 +17,12 @@ * express or implied warranty. * Modified: {0} Michael VanHilst initial version 6 June 1989 * {n} -- -- */ +#include /* bzero */ +#include /* free */ #include /* stderr, NULL, etc. */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/define.h" /* define MAX, etc. */ #include "hfiles/struct.h" /* declare structure types */ diff -u5 -r saoimage-1.35.1/mgfytabl.c saoimage-1.35.2/mgfytabl.c --- saoimage-1.35.1/mgfytabl.c 1998-07-09 18:28:28.000000000 +0200 +++ saoimage-1.35.2/mgfytabl.c 2012-10-30 16:07:57.264024540 +0100 @@ -22,10 +22,16 @@ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ +static int get_key_buf_coords ( XKeyEvent * xkey, int * bufX, int * bufY ) ; +static void output_column_labels ( int xarray[], int cols, int col_width, int filex ) ; +static void output_pixval_table ( int xarray[], int yarray[], int cols, int rows, int col_width, + int bufx, int bufy, int filex, int filey ) ; +static int set_table_params ( int bufx, int bufy, int xdim, int ydim, int * xarray, int * yarray ) ; + /* * Subroutine: print_table * Purpose: Print out the values of memory image given the event * coordinates * Note: Uses event coords in control struct (control.event.xkey) @@ -37,12 +43,10 @@ int xarray[16]; int yarray[16]; int table_size; int col_width; int rot; - static int get_key_buf_coords(), set_table_params(); - static void output_column_labels(), output_pixval_table(); /* determine the buffer coordinates of the event */ if( get_key_buf_coords(&control.event.xkey, &bufx, &bufy) == 0 ) { (void)printf("SORRY: portion of image not in buffer.\n"); return; @@ -89,13 +93,11 @@ * Subroutine: get_key_buf_coords * Purpose: Determine the buffer coordinates of the pixel identified * with a key event. * Returns: 1 if the pixel is in the image data buffer, else 0. */ -static int get_key_buf_coords ( xkey, bufX, bufY ) - XKeyEvent *xkey; - int *bufX, *bufY; +static int get_key_buf_coords ( XKeyEvent * xkey, int * bufX, int * bufY ) { float x, y; void i_transform(), d_transform(); /* translate event to buffer coordinates */ @@ -117,15 +119,15 @@ /* * Subroutine: output_column_labels * Purpose: Print a line of column indexes and underline it. */ -static void output_column_labels ( xarray, cols, col_width, filex ) - int xarray[]; /* array of column labels */ - int cols; /* number of cols */ - int col_width; /* width of each column */ - int filex; /* given coord to be highlighted */ +static void output_column_labels ( int xarray[], int cols, int col_width, int filex ) + /* array of column labels */ + /* number of cols */ + /* width of each column */ + /* given coord to be highlighted */ { int i; char format[32]; /* space down and start next line over from row labels */ @@ -154,17 +156,17 @@ * Subroutine: output_pixval_table * Purpose: Print a table of pixel values * Note: Uses VT100 escape sequence for reverse video (seems to work) * Note: Uses global image and buffer structures */ -static void output_pixval_table ( xarray, yarray, cols, rows, col_width, - bufx, bufy, filex, filey ) - int xarray[], yarray[]; /* array of labels */ - int cols, rows; /* dimensions of table */ - int col_width; /* width of each column in output line */ - int bufx, bufy; /* buffer coord of upper left in table */ - int filex, filey; /* label vals of highlighted pixel */ +static void output_pixval_table ( int xarray[], int yarray[], int cols, int rows, int col_width, + int bufx, int bufy, int filex, int filey ) + /* array of labels */ + /* dimensions of table */ + /* width of each column in output line */ + /* buffer coord of upper left in table */ + /* label vals of highlighted pixel */ { double dval; int ival; int clip; int i, j; @@ -206,14 +208,11 @@ * Subroutine: set_table_params * Purpose: Put pixval table parameters in the x and y arrays * 0 to (dim-1) has file coords, * _array[dim]: main file coord, _array[dim+1]: starting buf coord */ -static int set_table_params ( bufx, bufy, xdim, ydim, xarray, yarray ) - int bufx, bufy; - int xdim, ydim; - int *xarray, *yarray; +static int set_table_params ( int bufx, int bufy, int xdim, int ydim, int * xarray, int * yarray ) { float x0, x1, x2, y0, y1, y2; int xinc, yinc; int fx0, fx1, fx2, fy0, fy1, fy2; int bufx0, bufy0, bufoff; diff -u5 -r saoimage-1.35.1/pancopy.c saoimage-1.35.2/pancopy.c --- saoimage-1.35.1/pancopy.c 1996-02-26 22:09:39.000000000 +0100 +++ saoimage-1.35.2/pancopy.c 2012-10-30 16:08:21.723160358 +0100 @@ -18,10 +18,11 @@ * Modified: {0} Michael VanHilst initial version 3 December 1988 * {n} -- -- */ #include /* define stderr, NULL, etc. */ +#include /* define bzero */ #include "hfiles/define.h" /* define MIN, MAX, etc. */ /* * Subroutine: copy_buf_replicate * Purpose: Copy data from main buffer to pan buffer, zooming UP by diff -u5 -r saoimage-1.35.1/pancrsr.c saoimage-1.35.2/pancrsr.c --- saoimage-1.35.1/pancrsr.c 1990-05-02 08:49:17.000000000 +0200 +++ saoimage-1.35.2/pancrsr.c 2012-10-30 16:09:04.497397695 +0100 @@ -19,10 +19,11 @@ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/define.h" /* define MIN */ +static void set_pancursor ( Coordsys * pan, int left_x, int right_x, int top_y, int low_y ) ; static int pancur_x, pancur_y; static unsigned int pancur_width, pancur_height; static int pancur_present = 0; @@ -49,11 +50,10 @@ int track; { float panX1, panX2, panY1, panY2; GC gc, set_gc(); void disp_window(), i_transform(); - static void set_pancursor(); if( pancur_present ) { /* erase the old box if it was visible */ if( (color.cursor_overlay) || track ) { gc = set_gc(&color.gcset.undraw); @@ -83,13 +83,11 @@ /* * Subroutine: set_pancursor * Purpose: Set points in a panbox cursor */ -static void set_pancursor ( pan, left_x, right_x, top_y, low_y ) - Coordsys *pan; - int left_x, right_x, top_y, low_y; +static void set_pancursor ( Coordsys * pan, int left_x, int right_x, int top_y, int low_y ) { /* limit pan cursor to the panbox dimensions */ if( left_x < pan->X1i ) pancur_x = pan->X1i; else diff -u5 -r saoimage-1.35.1/panel/menuclr.h saoimage-1.35.2/panel/menuclr.h --- saoimage-1.35.1/panel/menuclr.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menuclr.h 2012-10-30 20:09:25.761505042 +0100 @@ -395,7 +395,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &ColorA_geo, ColorA, 0); + &ColorA_geo, ColorA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menucmap.h saoimage-1.35.2/panel/menucmap.h --- saoimage-1.35.1/panel/menucmap.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menucmap.h 2012-10-30 20:09:31.737538940 +0100 @@ -368,7 +368,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &CmapA_geo, CmapA, 0); + &CmapA_geo, CmapA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menucsr.h saoimage-1.35.2/panel/menucsr.h --- saoimage-1.35.1/panel/menucsr.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menucsr.h 2012-10-30 20:00:59.930645286 +0100 @@ -465,18 +465,13 @@ static ButtonSpec CursorB[] = { { &CursorB11_look, &CursorB11_feel } }; static BoxGeometry CursorB_geo = { 0, 1, 1, 1, 8.000000, 1.000000, 0.875000, 0.000000, 0, 1 }; -void MakeCursorPanel ( box, parent, gc, visual, background ) - BoxParent *parent; - ButtonBox box[2]; - GC gc; - Visual *visual; - unsigned long background; +void MakeCursorPanel ( ButtonBox box[2], BoxParent * parent, GC gc, Visual * visual, unsigned long background ) { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &CursorA_geo, CursorA, 0); + &CursorA_geo, CursorA, NULL); box[1] = MakeButtonBox(&parent[1], gc, visual, background, - &CursorB_geo, CursorB, 0); + &CursorB_geo, CursorB, NULL); JoinMenus (box[0], box[1]); } diff -u5 -r saoimage-1.35.1/panel/menuetc.h saoimage-1.35.2/panel/menuetc.h --- saoimage-1.35.1/panel/menuetc.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menuetc.h 2012-10-30 20:09:40.570588879 +0100 @@ -375,7 +375,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &EtcA_geo, EtcA, 0); + &EtcA_geo, EtcA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menumain.h saoimage-1.35.2/panel/menumain.h --- saoimage-1.35.1/panel/menumain.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menumain.h 2012-10-30 20:12:53.071678944 +0100 @@ -249,15 +249,10 @@ { &MainA4_look, &MainA4_feel }, { &MainA5_look, &MainA5_feel } }; static BoxGeometry MainA_geo = { 0, 5, 5, 1, 5.000000, 1.000000, 0.000000, 0.000000, 0, 1 }; -void MakeMainPanel ( box, parent, gc, visual, background ) - BoxParent *parent; - ButtonBox box[1]; - GC gc; - Visual *visual; - unsigned long background; +void MakeMainPanel ( ButtonBox box[1], BoxParent * parent, GC gc, Visual * visual, unsigned long background ) { box[0] = MakeButtonBox(&parent[0], gc, visual, background, - &MainA_geo, MainA, 0); + &MainA_geo, MainA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menumono.h saoimage-1.35.2/panel/menumono.h --- saoimage-1.35.1/panel/menumono.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menumono.h 2012-10-30 20:09:49.079636996 +0100 @@ -218,7 +218,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[3], gc, visual, background, - &MonoA_geo, MonoA, 0); + &MonoA_geo, MonoA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menupan.h saoimage-1.35.2/panel/menupan.h --- saoimage-1.35.1/panel/menupan.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menupan.h 2012-10-30 20:09:52.579656834 +0100 @@ -312,7 +312,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &PanA_geo, PanA, 0); + &PanA_geo, PanA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menurgn.h saoimage-1.35.2/panel/menurgn.h --- saoimage-1.35.1/panel/menurgn.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menurgn.h 2012-10-30 20:09:57.013681907 +0100 @@ -379,7 +379,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[2], gc, visual, background, - &RegionA_geo, RegionA, 0); + &RegionA_geo, RegionA, NULL); } diff -u5 -r saoimage-1.35.1/panel/menuscl.h saoimage-1.35.2/panel/menuscl.h --- saoimage-1.35.1/panel/menuscl.h 1996-10-30 21:57:17.000000000 +0100 +++ saoimage-1.35.2/panel/menuscl.h 2012-10-30 20:10:04.605724958 +0100 @@ -322,7 +322,7 @@ GC gc; Visual *visual; unsigned long background; { box[0] = MakeButtonBox(&parent[1], gc, visual, background, - &ScaleA_geo, ScaleA, 0); + &ScaleA_geo, ScaleA, NULL); } diff -u5 -r saoimage-1.35.1/panimage.c saoimage-1.35.2/panimage.c --- saoimage-1.35.1/panimage.c 1990-04-20 18:17:38.000000000 +0200 +++ saoimage-1.35.2/panimage.c 2012-10-30 16:09:37.605581238 +0100 @@ -24,10 +24,11 @@ #include "hfiles/define.h" /* define MIN, MAX, DONT_CARE, etc. */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/scale.h" /* define scaling constants */ +static void map_panbuf ( ) ; /* * Subroutine: disp_panbox * Purpose: Redraw the panbox window display * Xlib calls: XSync() */ @@ -45,11 +46,10 @@ * Subroutine: map_panbox * Purpose: Fill the panbox display buffer, mapping from its short buffer */ void map_panbox ( ) { - static void map_panbuf(); #ifdef SUMBLOCK static void map_adj_panbuf(); #endif void panimage_halftone(); diff -u5 -r saoimage-1.35.1/prntcent.c saoimage-1.35.2/prntcent.c --- saoimage-1.35.1/prntcent.c 1999-08-21 00:18:40.000000000 +0200 +++ saoimage-1.35.2/prntcent.c 2012-10-30 16:37:55.110933865 +0100 @@ -26,10 +26,17 @@ #include #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ +static int +set_center_param ( int bufx, int bufy, int xdim, int ydim, + int * xbuf, int * ybuf, int * xfile, int * yfile) ; +static int +get_key_buf_coord ( XKeyEvent * xkey, int * bufX, int * bufY ) ; +static void +comp_center (double * a,int npts,double * coff,double * err) ; /* * Subroutine: print_center * Purpose: Finds weighted file coordinate center around given pixel * Currently uses 9x9 array @@ -57,13 +64,10 @@ int nval; int get_pixel_val(); int xfile, yfile; char string[64]; int lstr = 48; - static int set_center_param(); - static int get_key_buf_coord(); - static void comp_center (); void d_trans(); int iswcs(); *xc = 0.0; *yc = 0.0; @@ -142,13 +146,11 @@ * Purpose: Determine the buffer coordinates of the pixel identified * with a key event. * Returns: 1 if the pixel is in the image data buffer, else 0. */ static int -get_key_buf_coord ( xkey, bufX, bufY ) - XKeyEvent *xkey; - int *bufX, *bufY; +get_key_buf_coord ( XKeyEvent * xkey, int * bufX, int * bufY ) { float x, y; void i_transform(), d_transform(); /* translate event to buffer coordinates */ @@ -173,16 +175,12 @@ * Purpose: Put pixval table parameters in the x and y arrays * 0 to (dim-1) has file coords, * _array[dim]: main file coord, _array[dim+1]: starting buf coord */ static int -set_center_param ( bufx, bufy, xdim, ydim, - xbuf, ybuf, xfile, yfile) - int bufx, bufy; - int xdim, ydim; - int *xbuf, *ybuf; - int *xfile, *yfile; +set_center_param ( int bufx, int bufy, int xdim, int ydim, + int * xbuf, int * ybuf, int * xfile, int * yfile) { float x0, x1, x2, y0, y1, y2; /* int xinc, yinc; */ int fx0, fx1, fx2, fy0, fy1, fy2; int bufx0, bufy0, bufoff; @@ -256,16 +254,15 @@ /* Compute the center and estimate its error given the marginal distribution and the number of points. */ static void -comp_center (a,npts,coff,err) - -double *a; /* array */ -int npts; /* number of points */ -double *coff; /* center value */ -double *err; /* center error */ +comp_center (double * a,int npts,double * coff,double * err) +/* array */ +/* number of points */ +/* center value */ +/* center error */ { int i, npos; double val, sumi, sumix, sumix2, di, derr; /* Initialize */ diff -u5 -r saoimage-1.35.1/prntcurs.c saoimage-1.35.2/prntcurs.c --- saoimage-1.35.1/prntcurs.c 2002-01-16 23:54:18.000000000 +0100 +++ saoimage-1.35.2/prntcurs.c 2012-10-30 16:35:47.328209176 +0100 @@ -25,20 +25,21 @@ #include /* X window manager stuff */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main SAOimage parameter structures */ #include "hfiles/constant.h" /* codes */ +static void print_file_value ( double bufX, double bufY, double fileX, double fileY ) ; + /* * Subroutine: print_cursor * Purpose: print location of a dispbox event */ void print_cursor ( event ) XEvent *event; /* XEvent for location of mouse */ { double bufx, bufy, filex, filey; void get_cursor_pos(); - static void print_file_value(); (void)get_cursor_pos (event, &bufx, &bufy, &filex, &filey ); (void)print_file_value ( bufx, bufy, filex, filey ); } @@ -69,14 +70,11 @@ /* * Subroutine: print_file_value * Purpose: Print pointer coordinates and image value */ -static void print_file_value ( bufX, bufY, fileX, fileY ) - - double bufX, bufY; - double fileX, fileY; +static void print_file_value ( double bufX, double bufY, double fileX, double fileY ) { int val; static char vstring[48], string[32], cstring[48]; void d_trans(); int lstr = 32; diff -u5 -r saoimage-1.35.1/readarr.c saoimage-1.35.2/readarr.c --- saoimage-1.35.1/readarr.c 1999-02-23 15:05:41.000000000 +0100 +++ saoimage-1.35.2/readarr.c 2012-10-30 20:18:02.849435104 +0100 @@ -16,14 +16,16 @@ * {2} Peter Teuben fixed bug "-skip 0 -plane N" 23 Feb 1999 * {n} -- -- */ #include /* define stderr */ +#include /* define exit */ #include /* needed for control.h */ #include "hfiles/constant.h" /* define data type codes */ #include "hfiles/control.h" /* define IOP codes */ #include "hfiles/image.h" +static int read_data ( int fd, struct imageRec * img, char * databuf ) ; /* * Subroutine: read_array * Purpose: Read array data from a file * Note: Assumes file was tested benignly, exits here if trouble @@ -38,11 +40,10 @@ int X, Y; /* starting point in image file (no support) */ int block; /* blocking factor (not yet supported */ int verbose; /* whether to print explanatory messages */ { int vals; - static int read_data(); int image_start; int open_disk(), lseek_disk(); void close_disk(); void say_goodbye(), scale_data_u1(), scale_data_i2(), scale_data_u2(); void scale_data_i4(), scale_data_r4(), scale_data_r8(); @@ -117,14 +118,11 @@ /* * Subroutine: read_data * Purpose: Read in the array data * UNIX calls: read */ -static int read_data ( fd, img, databuf ) - int fd; - struct imageRec *img; - char *databuf; +static int read_data ( int fd, struct imageRec * img, char * databuf ) { int vals, nbytes; int read_disk(); /* find size of image */ diff -u5 -r saoimage-1.35.1/readfith.c saoimage-1.35.2/readfith.c --- saoimage-1.35.1/readfith.c 1998-09-29 17:40:06.000000000 +0200 +++ saoimage-1.35.2/readfith.c 2012-10-30 16:12:40.529592666 +0100 @@ -39,10 +39,14 @@ #include /* X window manager stuff */ #include "hfiles/define.h" /* define MIN, MAX, etc. */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structure */ +static int get_keyint ( char * header, char * keyword, int length, int report_error) ; +static int get_keyfloat ( char * header, char * keyword, int length, float * val, int report_error) ; +static void fix_exponent ( char * line, int count ) ; + /* * Subroutine: read_fitsheader * Purpose: Find important FITS parameters in FITS header * Returns: 1 if success, else 0 */ @@ -53,11 +57,10 @@ int *naxis; int *naxes; float *scale; float *bias; { - static int get_keyint(), get_keyfloat(); struct WorldCoor *wcsinit(); char *header0; header0 = header; /* first card is assumed to be SIMPLE = T, so skip it */ @@ -105,15 +108,15 @@ /* * Subroutine: get_keyint * Purpose: Return the int value in the data field for a given FITS * header keyword. If key not found, return 0. */ -static int get_keyint ( header, keyword, length, report_error) - char *header; /* buffer start */ - char *keyword; /* keyword to match */ - int length; /* if zero, search up to "END" keyword */ - int report_error; /* if > 0, fatal if key not found */ +static int get_keyint ( char * header, char * keyword, int length, int report_error) + /* buffer start */ + /* keyword to match */ + /* if zero, search up to "END" keyword */ + /* if > 0, fatal if key not found */ { int key_not_end, val; int i; void no_fitscomment(); @@ -142,20 +145,19 @@ /* * Subroutine: get_keyfloat * Purpose: Return the float value in the data field for a given FITS * header keyword. If key not found, return 0. */ -static int get_keyfloat ( header, keyword, length, val, report_error) - char *header; /* buffer start */ - char *keyword; /* keyword to match */ - int length; /* if zero, search up to "END" keyword */ - float *val; /* float to recieve value if found */ - int report_error; /* if > 0, fatal if key not found */ +static int get_keyfloat ( char * header, char * keyword, int length, float * val, int report_error) + /* buffer start */ + /* keyword to match */ + /* if zero, search up to "END" keyword */ + /* float to recieve value if found */ + /* if > 0, fatal if key not found */ { int key_not_end; int i; - static void fix_exponent(); void no_fitscomment(); key_not_end = (strncmp(keyword, "END ", 8) != 0); for( i=0; i /* define stderr, NULL, etc. */ +#include /* define stderr, NULL, etc. */ +#include /* define stderr, NULL, etc. */ #ifndef VMS #ifdef SYSV #include #else diff -u5 -r saoimage-1.35.1/readint.c saoimage-1.35.2/readint.c --- saoimage-1.35.1/readint.c 1998-07-09 19:12:27.000000000 +0200 +++ saoimage-1.35.2/readint.c 2012-10-30 20:21:40.538664374 +0100 @@ -26,10 +26,11 @@ * {6} Doug Mink (SAO) set min and max separately 2 Oct 1996 * {6} Doug Mink (SAO) declare bswap4() 9 Jul 1998 * {n} -- -- */ +#include /* printf */ #include /* needed for ntohl (net to host long) */ #ifndef VMS #include /* needed for ntohl (net to host long) */ #endif #include "hfiles/scale.h" /* define SCALEWIDTH, etc. */ diff -u5 -r saoimage-1.35.1/rgnanli.c saoimage-1.35.2/rgnanli.c --- saoimage-1.35.1/rgnanli.c 1990-04-20 18:25:03.000000000 +0200 +++ saoimage-1.35.2/rgnanli.c 2012-10-30 16:14:29.420192752 +0100 @@ -20,10 +20,12 @@ #include /* stderr, sscanf, NULL */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/cursor.h" /* cursorRec */ +static int expand_radii ( float * radius, int i, int maxcnt, int cnt ) ; +static char *got_nequal ( char * line ) ; /* * Subroutine: fit_annuli_edge * Purpose: If annuli edge matches previous edge, free redundancy * Note: By saoimage convention, base cursor record of annuli is @@ -93,12 +95,10 @@ char *line; /* i: string with first radius as next token */ float *radius; /* o: buffer for float radius vals */ int maxcnt; /* i: size of radius buffer */ { int i, cnt; - static int expand_radii(); - static char *got_nequal(); char *next_token(); i = 0; /* while there are tokens, look at the next one */ while( (line != 0) && (i < maxcnt) ) { @@ -126,15 +126,15 @@ * Subroutine: expand_radii * Purpose: Given an n=cnt, install cnt radii in list between last * two radii * Returns: Total number of radii in radius buffer */ -static int expand_radii ( radius, i, maxcnt, cnt ) - float *radius; /* i/o: array list of radii */ - int i; /* i: current array size */ - int maxcnt; /* i: maximum allowed size */ - int cnt; /* i: number of bands to divide last interval */ +static int expand_radii ( float * radius, int i, int maxcnt, int cnt ) + /* i/o: array list of radii */ + /* i: current array size */ + /* i: maximum allowed size */ + /* i: number of bands to divide last interval */ { double first, last, inc; /* last radius will be placed at end of new listing */ i--; @@ -161,12 +161,11 @@ * Subroutine: got_nequal * Purpose: Determine is line has tokens of form n= or n = * Returns: Ptr to char after '=', else NULL * Note: The n of n= can be any non-space char(s) except '=' */ -static char *got_nequal ( line ) - char *line; +static char *got_nequal ( char * line ) { int i = 0; /* check for premature end */ if( (line[i] == '\0') || (line[i] == '\n') ) return( NULL ); diff -u5 -r saoimage-1.35.1/rgndraw.c saoimage-1.35.2/rgndraw.c --- saoimage-1.35.1/rgndraw.c 1998-11-30 22:46:40.000000000 +0100 +++ saoimage-1.35.2/rgndraw.c 2012-10-30 16:18:07.928392778 +0100 @@ -18,10 +18,11 @@ * software for any purpose. It is provided "as is" without * express or implied warranty. */ #include /* define stderr, NULL */ +#include /* define strlen*/ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else @@ -38,10 +39,17 @@ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #define REGION_MAIN #include "hfiles/region.h" /* regdrawRec region drawing parameters */ +static GC set_region_gc ( struct cursorRec * region ) ; +static void draw_region_label ( char * string, int cnt, GC gc, int x, int y ) ; +static void draw_region ( struct cursorRec * region, GC gc ) ; +static void label_annuli ( struct cursorRec * region, GC gc ) ; +static void label_region ( struct cursorRec * region, GC gc ) ; +static int mark_include ( char * string, int exclude ) ; + struct regdrawRec rgdraw; /* * Subroutine: init_region_draw */ @@ -117,12 +125,10 @@ */ void disp_region ( region ) struct cursorRec *region; { GC gc; - static GC set_region_gc(); - static void label_annuli(), label_region(), draw_region(); if( rgdraw.visible && (region != NULL) ) { gc = set_region_gc(region); draw_region(region, gc); if( rgdraw.label ) { @@ -170,12 +176,11 @@ /* * Subroutine: set_region_gc * Purpose: Set up the gc with only as much detail as needed */ -static GC set_region_gc ( region ) - struct cursorRec *region; +static GC set_region_gc ( struct cursorRec * region ) { GC gc, set_edit_gc(), set_text_gc(), set_gc(); if( rgdraw.label ) { if( rgdraw.filled_label ) @@ -191,15 +196,11 @@ /* * Subroutine: draw_region_label * Xlib calls: XDrawImageString(), XDrawString() */ -static void draw_region_label ( string, cnt, gc, x, y ) - char *string; - int cnt; - GC gc; - int x, y; +static void draw_region_label ( char * string, int cnt, GC gc, int x, int y ) { if( (x > 0) && (x <= (dispbox.width - rgdraw.fontstruct->max_bounds.rbearing)) && (y >= rgdraw.fontstruct->max_bounds.ascent) && (y <= (dispbox.height - rgdraw.fontstruct->max_bounds.descent)) ) { @@ -213,15 +214,12 @@ /* * Subroutine: draw_region * Purpose: Draw one saved cursor region outline or point index * Note: gc is already set, hence NULL GCspec in draw calls */ -static void draw_region ( region, gc ) - struct cursorRec *region; - GC gc; +static void draw_region ( struct cursorRec * region, GC gc ) { - static void draw_region_label(); void draw_annuli(), draw_cursor(); if( region->type != COP_Point ) { if( region->annuli ) /* if there are annuli, draw them (GC is already set) */ @@ -244,16 +242,13 @@ } /* * Subroutine: label_annuli */ -static void label_annuli ( region, gc ) - struct cursorRec *region; - GC gc; +static void label_annuli ( struct cursorRec * region, GC gc ) { struct cursorRec *annulus; - static void label_region(); /* apply label to outer annulus */ annulus = region; while( annulus->next_annulus != NULL ) annulus = annulus->next_annulus; @@ -266,21 +261,17 @@ /* * Subroutine: label_region * Purpose: Draw one region's label line and text for center and edge * Xlib calls: XDrawLine() */ -static void label_region ( region, gc ) - struct cursorRec *region; - GC gc; +static void label_region ( struct cursorRec * region, GC gc ) { int x0, y0, x1, y1, yt; char center_string[16]; char edge_string[132]; int len; int exclude; - static int mark_include(); - static void draw_region_label(); /* if label not requested or don't know how to label or will another part */ if( (!rgdraw.label) || (region->type == COP_Polygon) ) return; @@ -369,13 +360,11 @@ /* * Subroutine: mark_include * Purpose: Add include symbol to string */ -static int mark_include ( string, exclude ) - char *string; - int exclude; +static int mark_include ( char * string, int exclude ) { int len; len = strlen(string); if( exclude > 0 ) { diff -u5 -r saoimage-1.35.1/rgndrop.c saoimage-1.35.2/rgndrop.c --- saoimage-1.35.1/rgndrop.c 1990-04-20 18:31:38.000000000 +0200 +++ saoimage-1.35.2/rgndrop.c 2012-10-30 16:20:06.351041001 +0100 @@ -25,10 +25,14 @@ #include "hfiles/cursor.h" /* define cursor parameter structures */ #include "hfiles/define.h" /* define SQR, SMALL_NUMBER */ extern struct cursorRec *cycle_region; +static int pointer_is_inside_region ( int x, int y, struct cursorRec * region ) ; +static int closer_to_center ( struct cursorRec * challenger, struct cursorRec * champ, int x, int y ) ; +static int pointer_is_inside_polygon ( double x, double y, PolyPoint * polypt, int poly_cnt ) ; + /* * Subroutine: unsave_region * Purpose: Remove and discard region from region list */ void unsave_region ( cursor, dead_meat ) @@ -68,12 +72,10 @@ struct cursorRec *cursor; int x, y; int point_only; { struct cursorRec *region, *chosen; - static int pointer_is_inside_region(); - static int closer_to_center(); chosen = NULL; region = cursor->next_region; /* erase smallest region which encloses the mouse */ while( region != NULL ) { @@ -93,13 +95,11 @@ } /* * Subroutine: closer_to_center */ -static int closer_to_center ( challenger, champ, x, y ) - struct cursorRec *challenger, *champ; - int x, y; +static int closer_to_center ( struct cursorRec * challenger, struct cursorRec * champ, int x, int y ) { double X, Y, Xn, Yn; X = (double)x + 0.5 - champ->win.X; Y = (double)y + 0.5 - champ->win.Y; @@ -113,17 +113,14 @@ /* * Subroutine: is_inside_region * Purpose: Determine if mouse is within a region */ -static int pointer_is_inside_region ( x, y, region ) - int x, y; - struct cursorRec *region; +static int pointer_is_inside_region ( int x, int y, struct cursorRec * region ) { double rayX, rayY, ray; int inside; - static int pointer_is_inside_polygon(); if( region->type == COP_Polygon ) return( pointer_is_inside_polygon((double)x, (double)y, region->poly, region->poly_cnt) ); rayX = (double)x + 0.5 - region->win.X; @@ -166,14 +163,11 @@ /* * Subroutine: pointer_is_inside_polygon * Purpose: Determine if mouse is within a polygon */ -static int pointer_is_inside_polygon ( x, y, polypt, poly_cnt ) - double x, y; - PolyPoint *polypt; - int poly_cnt; +static int pointer_is_inside_polygon ( double x, double y, PolyPoint * polypt, int poly_cnt ) { double yi, yj, xi, xj; int i, j, crossings; crossings = 0; diff -u5 -r saoimage-1.35.1/rgnmake.c saoimage-1.35.2/rgnmake.c --- saoimage-1.35.1/rgnmake.c 1998-10-19 20:48:24.000000000 +0200 +++ saoimage-1.35.2/rgnmake.c 2012-10-30 16:21:11.477396887 +0100 @@ -18,16 +18,16 @@ * {3} Doug Mink Support for text labels of cursors 13 Oct 1998 * {4} Doug Mink Add four new cursor types 19 Oct 1998 * {n} -- -- */ +#include /* strlen, strcat, strcpy, strrchr */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else #include /* strlen, strcat, strcpy, rindex */ -#define strchr index #endif #else #include /* strlen, strcat, strcpy, strrchr */ #endif diff -u5 -r saoimage-1.35.1/rgnread.c saoimage-1.35.2/rgnread.c --- saoimage-1.35.1/rgnread.c 1998-10-14 21:03:09.000000000 +0200 +++ saoimage-1.35.2/rgnread.c 2012-10-30 16:54:54.584679255 +0100 @@ -18,10 +18,12 @@ * {3} Doug Mink, SAO add subroutine to return title 14 Oct 1998 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include /* stderr, NULL, etc. */ +#include /* free */ #include /* toupper, isalpha, etc. */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ diff -u5 -r saoimage-1.35.1/rgntoken.c saoimage-1.35.2/rgntoken.c --- saoimage-1.35.1/rgntoken.c 1998-10-19 20:53:16.000000000 +0200 +++ saoimage-1.35.2/rgntoken.c 2012-10-30 16:56:42.738285322 +0100 @@ -17,10 +17,11 @@ * Modified: {0} Michael VanHilst initial version 9 August 1989 * {1} Doug Mink add 4 new shapes 19 October 1998 * {n} -- -- */ +#include /* bzero */ #include /* stderr, NULL, etc. */ #include /* toupper, isalpha, etc. */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* define codes */ diff -u5 -r saoimage-1.35.1/rgnwpros.c saoimage-1.35.2/rgnwpros.c --- saoimage-1.35.1/rgnwpros.c 1991-01-09 04:57:30.000000000 +0100 +++ saoimage-1.35.2/rgnwpros.c 2012-10-30 16:25:40.879864854 +0100 @@ -17,10 +17,11 @@ * {3} MVH if center, point are int, write as int 22 Feb 1990 * {n} -- -- */ #include /* stderr, NULL, etc. */ +#include #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else @@ -37,21 +38,28 @@ #include "hfiles/cursor.h" /* define cursor parameter structures */ #include "hfiles/define.h" /* define PI */ #define DEG(r) ((360.0 / TWO_PI) * (r)) #define RAD(d) ((TWO_PI / 360.0) * (d)) +static void cat_annulus ( struct cursorRec * region, char * line ) ; +static void cat_shape ( struct cursorRec * region, char *line ) ; +static void cat_polypts ( struct cursorRec * region, char *line ) ; +static void cat_cen ( struct cursorRec * region, char *line ) ; +static void cat_params ( struct cursorRec * region, char * line, int count ) ; +static void cat_pt ( double x, double y, char * line, int comma ) ; +static void write_annuli ( struct cursorRec * region, char * line, FILE * fd ) ; +static struct cursorRec *cat_annular ( struct cursorRec * region, char * line ) ; /* * Subroutine: write_region_pros * Purpose: Write ROSAT PROS style region description to file * Method: Recurse first to start writing from end of link list */ void write_region_pros ( fd, region ) FILE *fd; struct cursorRec *region; { - static void cat_annulus(), write_annuli(), cat_shape(); /* Check for pointer before doing anything */ if( region == NULL ) return; /* Recurse for higher regions so as to reverse order */ @@ -82,17 +90,14 @@ /* Subroutine: cat_shape * Purpose: Put simple PROS description of given cursor in line buffer */ -static void cat_shape ( region, line ) - struct cursorRec *region; - char *line; +static void cat_shape ( struct cursorRec * region, char *line ) { int params; void write_text_region(); - static void cat_polypts(), cat_cen(), cat_params(); switch( region->type ) { case COP_Box: (void)strcat(line, "BOX("); if( region->rot.angle == 0.0 ) @@ -146,14 +151,12 @@ /* Subroutine: cat_params * Purpose: Add appropriate number of cursor shape parameters to * line buffer */ -static void cat_params ( region, line, count ) - struct cursorRec *region; - char *line; - int count; /* i: number of shape parameters wanted */ +static void cat_params ( struct cursorRec * region, char * line, int count ) + /* i: number of shape parameters wanted */ { char params[32]; switch( count ) { case 1: sprintf(params, ",%.2f", region->file.Xdim); @@ -182,13 +185,11 @@ /* * Subroutine: cat_cen * Purpose: Add center coordinates to line buffer */ -static void cat_cen ( region, line ) - struct cursorRec *region; - char *line; +static void cat_cen ( struct cursorRec * region, char *line ) { int ix, iy; char center[20]; ix = (int)region->file.X; @@ -203,16 +204,13 @@ /* * Subroutine: cat_polypts * Purpose: Add list of point coordinates to line buffer (for polygon) */ -static void cat_polypts ( region, line ) - struct cursorRec *region; - char *line; +static void cat_polypts ( struct cursorRec * region, char *line ) { int i; - static void cat_pt(); cat_pt((double)region->poly[0].fileX, (double)region->poly[0].fileY, line, 0); for( i=1; ipoly_cnt; i++ ) { cat_pt((double)region->poly[i].fileX, (double)region->poly[i].fileY, @@ -222,14 +220,11 @@ /* * Subroutine: cat_pt * Purpose: Add given coordinates in parentheses to line buffer */ -static void cat_pt ( x, y, line, comma ) - double x, y; - char *line; - int comma; +static void cat_pt ( double x, double y, char * line, int comma ) { int ix, iy; char point[20]; ix = (int)x; @@ -252,16 +247,13 @@ /* * Subroutine: cat_annulus * Purpose: Put a PROS style description of circular annuli on the * line buffer */ -static void cat_annulus ( region, line ) - struct cursorRec *region; - char *line; +static void cat_annulus ( struct cursorRec * region, char * line ) { char radius[16]; - static void cat_cen(); (void)strcat(line, "ANNULUS("); cat_cen(region, line); /* first region is not one of the annuli */ while( (region = region->next_annulus) != NULL ) { @@ -273,18 +265,13 @@ /* * Subroutine: write_annuli * Purpose: Write PROS type description to produce annuli of given shapes */ -static void write_annuli ( region, line, fd ) - struct cursorRec *region; - char *line; - FILE *fd; +static void write_annuli ( struct cursorRec * region, char * line, FILE * fd ) { struct cursorRec *annulus; - static struct cursorRec *cat_annular(); - static void cat_shape(); /* annuli start with next_annulus (base region is not one of them) */ if( (annulus = region->next_annulus) != NULL ) { /* first line is the inner ring */ cat_shape(annulus, line); @@ -307,15 +294,12 @@ /* * Subroutine: cat_annular * Purpose: Add outer shape anded with not of inner shape to make * an annular ring */ -static struct cursorRec *cat_annular ( region, line ) - struct cursorRec *region; - char *line; +static struct cursorRec *cat_annular ( struct cursorRec * region, char * line ) { - static void cat_shape(); if( region->next_annulus != NULL ) { if( region->exclude_region ) line[0] = '-'; else diff -u5 -r saoimage-1.35.1/rgnwrite.c saoimage-1.35.2/rgnwrite.c --- saoimage-1.35.1/rgnwrite.c 1995-09-09 00:29:19.000000000 +0200 +++ saoimage-1.35.2/rgnwrite.c 2012-10-30 19:11:37.826789361 +0100 @@ -20,10 +20,11 @@ * {4} Doug Mink fix time() declaration for VMS 8 Sep 1995 * {n} -- -- */ #include /* stderr, NULL, FILE, etc. */ +#include /* stderr, NULL, FILE, etc. */ #ifndef VMS #ifdef SYSV #include /* strlen, strcat, strcpy, strrchr */ #else @@ -52,10 +53,13 @@ char *ProsName = "saoimage.reg"; EditStruct *region_edit; +static void write_region_imtool ( FILE * fd, struct cursorRec * region, struct imageRec * image ); +static void set_time_string ( char * time_string ) ; + /* * Subroutine: write_regions * Purpose: Write region info to a file */ void write_regions ( cursor, image, output_type ) @@ -64,11 +68,10 @@ int output_type; /* i: SOP_Imtool or SOP_PROS */ { FILE *fd; static int last_output_type = 0; char fname[SZ_FNAME]; - static void write_region_imtool(); int open_output_file(); EditStruct *init_edit_popup(); void set_path_iraf(), write_region_pros(), load_edit_struct(), timestamp(); /* return if there is nothing to write */ @@ -124,14 +127,11 @@ /* * Subroutine: write_region_imtool * Purpose: Write region info in imtool's format (iraf "list") * Note: Output is a list of ascii pairs giving only center coords */ -static void write_region_imtool ( fd, region, image ) - FILE *fd; - struct cursorRec *region; - struct imageRec *image; +static void write_region_imtool ( FILE * fd, struct cursorRec * region, struct imageRec * image ) { if( region != NULL ) { /* recurse first to reverse order of regions */ if( region->next_region != NULL ) write_region_imtool(fd, region->next_region, image); @@ -150,11 +150,10 @@ FILE *fd; char *imagename; { char line[SZ_LINE]; int len; - static void set_time_string(); /* timestamp the first entry in the output file. */ set_time_string (line); /* get rid of any trailing new line */ len = MAX(0, (int)strlen(line) - 1); @@ -171,26 +170,16 @@ /* * Subroutine: set_time_string (time) * Purpose: Print the time in the passed string * UNIX calls: time(), asctime(), localtime() */ -static void set_time_string ( time_string ) - char *time_string; +static void set_time_string ( char * time_string ) { long timeofday; # /* I don't know where this should be defined, it's not in */ /* it's a time_t which is defined as a long in */ -#ifdef LONG64 - int time(); -#else -#ifndef VMS - long time(); -#else - time_t time(); -#endif -#endif timeofday = time((long *)0); /* note asctime(localtime()) can be replaced by ctime() in newer OS's */ (void)strcpy(time_string, asctime(localtime(&timeofday))); } diff -u5 -r saoimage-1.35.1/sclctrl.c saoimage-1.35.2/sclctrl.c --- saoimage-1.35.1/sclctrl.c 1996-10-10 17:55:57.000000000 +0200 +++ saoimage-1.35.2/sclctrl.c 2012-10-30 16:30:05.720301956 +0100 @@ -17,30 +17,24 @@ * {2} MVH use full area for small image histogram 19 June 1991 * {n} -- -- */ #include /* get stderr */ +#include /* bzero */ #include /* X window stuff */ #include /* X window manager stuff */ #include "hfiles/constant.h" /* define codes */ #include "hfiles/define.h" /* define MIN, MAX, DONT_CARE, etc. */ #include "hfiles/struct.h" /* declare structure types */ #include "hfiles/extern.h" /* extern main parameter structures */ #include "hfiles/scale.h" /* define scaling constants */ -#ifdef ANSIC static void new_histogram(); static void get_histlims ( int *histogram, int *pmin, int *pmax ); static int get_histogram_total ( int *histogram, int pmin, int pmax ); static void make_histogram ( short *shortbuf, int *histogram, int ncols, - int x, y, width, height, int *area ); -#else -static void new_histogram(); -static void get_histlims(); -static int get_histogram_total(); -static void make_histogram(); -#endif + int x, int y, int width, int height, int *area ); /* * Subroutine: select_scalemap * Purpose: Respond to input from the scale menu (mostly rescaling) */ @@ -76,11 +70,10 @@ static double cmdMax = 0.0; static int min_given = 0; /* stored values to detect change */ static int max_given = 0; static int imtool_200 = 0; static int init = 1; /* identify first time called */ - static void new_histogram(); void make_scalemap(), color_logo(); #ifdef IMTOOL void set_imtool_colors(); #endif diff -u5 -r saoimage-1.35.1/sclmap.c saoimage-1.35.2/sclmap.c --- saoimage-1.35.1/sclmap.c 1994-10-25 16:25:02.000000000 +0100 +++ saoimage-1.35.2/sclmap.c 2012-10-30 16:32:08.119964303 +0100 @@ -27,10 +27,15 @@ #include "hfiles/scale.h" /* define scaling constants */ #ifndef SUN #define expm1(a) (exp(a)-1) #endif +static void linear_scale ( int image_min, int image_max ) ; +static void wrap_scale ( int image_min, int image_max ) ; +static void sqrt_scale ( int image_min, int image_max ) ; +static void log_scale ( int image_min, int image_max ) ; +static void get_histogram_range ( int * histogram, int * imin, int * imax) ; /* * Subroutine: make_scalemap * Purpose: Make scale map according to type selected * Note: Map goes from image value to hardware value (through ideal @@ -38,11 +43,10 @@ */ void make_scalemap ( image_min, image_max ) int image_min, image_max; /* i: range of mapping for image data input */ { void histogram_equalize(); - static void linear_scale(), wrap_scale(), sqrt_scale(), log_scale(); /* note the range of data for which mapping is to be calculated */ if( image_max == image_min ) ++image_max; if( image_max < image_min ) { @@ -103,12 +107,12 @@ /* * Subroutine: linear_scale * Purpose: Distribute color levels in the map evenly */ -static void linear_scale ( image_min, image_max ) - int image_min, image_max; /* i: limits of values in display */ +static void linear_scale ( int image_min, int image_max ) + /* i: limits of values in display */ { double scale; double upper_bound; int maxcolor; int level; @@ -116,11 +120,10 @@ unsigned long *pixels; /* l: ideal byte to hardare byte map */ register unsigned char *lookup; /* l: scalemap base (signed offsets) */ register int imageval; register int pixval; register int imagelim; - static void get_histogram_range(); range_min = image_min; range_max = image_max; if (buffer.cmdMax <= buffer.cmdMin && !img.imtool_200) { get_histogram_range (buffer.histogram, &range_min, &range_max); @@ -157,12 +160,12 @@ /* * Subroutine: wrap_scale * Purpose: Create the image map with a repeating linear scale * Note: Levels below image_min are not mapped */ -static void wrap_scale ( image_min, image_max ) - int image_min, image_max; /* i: limits of values in display */ +static void wrap_scale ( int image_min, int image_max ) + /* i: limits of values in display */ { double scale; double range; int maxcolor; int level; @@ -207,12 +210,12 @@ * Purpose: Distribute color levels in the map by a root or power function. * Method: (level / maxlevel) ranges from 0 to 1. Raise to a power. * Result curves from 0 to 1. Map result directly back to * pixel value. */ -static void sqrt_scale ( image_min, image_max ) - int image_min, image_max; /* i: limits of values in display */ +static void sqrt_scale ( int image_min, int image_max ) + /* i: limits of values in display */ { double range; double power; double ncolors; int maxcolor; @@ -252,12 +255,12 @@ /* * Subroutine: log_scale * Purpose: Distribute color levels in the map by a logorithmic or * exponential curve (powers of e). */ -static void log_scale ( image_min, image_max ) - int image_min, image_max; /* i: limits of values in display */ +static void log_scale ( int image_min, int image_max ) + /* i: limits of values in display */ { double scale; double expo; double ncolors; int maxcolor; @@ -307,14 +310,13 @@ /* * Subroutine: get_histogram_range * Purpose: Find a range from the peak of the pixel value distribution */ -static void get_histogram_range ( histogram, imin, imax) - int *histogram; - int *imin; /* minimum pixel value */ - int *imax; /* maximum pixel value */ +static void get_histogram_range ( int * histogram, int * imin, int * imax) + /* minimum pixel value */ + /* maximum pixel value */ { register int *hist; register int vmin; register int i; register int minhist, maxhist; diff -u5 -r saoimage-1.35.1/wcssubs/distort.c saoimage-1.35.2/wcssubs/distort.c --- saoimage-1.35.1/wcssubs/distort.c 2003-11-18 17:45:23.000000000 +0100 +++ saoimage-1.35.2/wcssubs/distort.c 2012-10-30 17:39:31.776202834 +0100 @@ -34,10 +34,12 @@ * Subroutine: foc2pix (wcs, u, v, x, y) focal plane coordinates -> pixel coordinates * Subroutine: setdistcode (wcs,ctype) sets distortion code from CTYPEi * Subroutine: getdistcode (wcs) returns distortion code string for CTYPEi */ +#include +#include #include #include #include "wcs.h" void diff -u5 -r saoimage-1.35.1/wcssubs/fitsfile.c saoimage-1.35.2/wcssubs/fitsfile.c --- saoimage-1.35.1/wcssubs/fitsfile.c 2003-11-18 17:38:47.000000000 +0100 +++ saoimage-1.35.2/wcssubs/fitsfile.c 2012-10-30 16:38:35.886164911 +0100 @@ -898,11 +898,10 @@ /* Make sure this is really a FITS table file header */ temp[0] = 0; hgets (header,"XTENSION",16,temp); if (strncmp (temp, "TABLE", 5) != 0) { snprintf (fitserrmsg,79, "FITSRTHEAD: Not a FITS table file\n"); - free (temp); return (-1); } /* Get table size from FITS header */ *nchar = 0; diff -u5 -r saoimage-1.35.1/wcssubs/imhfile.c saoimage-1.35.2/wcssubs/imhfile.c --- saoimage-1.35.1/wcssubs/imhfile.c 2003-11-03 21:48:06.000000000 +0100 +++ saoimage-1.35.2/wcssubs/imhfile.c 2012-10-30 16:55:38.359924637 +0100 @@ -1002,11 +1002,10 @@ /* Write data to IRAF pixel file */ nbw = write (fd, image, nbimage); close (fd); - free (pixname); return (nbw); } /* Put filename and header path together */ diff -u5 -r saoimage-1.35.1/wcssubs-3.5.1/distort.c saoimage-1.35.2/wcssubs-3.5.1/distort.c --- saoimage-1.35.1/wcssubs-3.5.1/distort.c 2003-11-18 17:45:23.000000000 +0100 +++ saoimage-1.35.2/wcssubs-3.5.1/distort.c 2012-10-30 17:39:31.776202834 +0100 @@ -34,10 +34,12 @@ * Subroutine: foc2pix (wcs, u, v, x, y) focal plane coordinates -> pixel coordinates * Subroutine: setdistcode (wcs,ctype) sets distortion code from CTYPEi * Subroutine: getdistcode (wcs) returns distortion code string for CTYPEi */ +#include +#include #include #include #include "wcs.h" void diff -u5 -r saoimage-1.35.1/wcssubs-3.5.1/fitsfile.c saoimage-1.35.2/wcssubs-3.5.1/fitsfile.c --- saoimage-1.35.1/wcssubs-3.5.1/fitsfile.c 2003-11-18 17:38:47.000000000 +0100 +++ saoimage-1.35.2/wcssubs-3.5.1/fitsfile.c 2012-10-30 16:38:35.886164911 +0100 @@ -898,11 +898,10 @@ /* Make sure this is really a FITS table file header */ temp[0] = 0; hgets (header,"XTENSION",16,temp); if (strncmp (temp, "TABLE", 5) != 0) { snprintf (fitserrmsg,79, "FITSRTHEAD: Not a FITS table file\n"); - free (temp); return (-1); } /* Get table size from FITS header */ *nchar = 0; diff -u5 -r saoimage-1.35.1/wcssubs-3.5.1/imhfile.c saoimage-1.35.2/wcssubs-3.5.1/imhfile.c --- saoimage-1.35.1/wcssubs-3.5.1/imhfile.c 2003-11-03 21:48:06.000000000 +0100 +++ saoimage-1.35.2/wcssubs-3.5.1/imhfile.c 2012-10-30 16:55:38.359924637 +0100 @@ -1002,11 +1002,10 @@ /* Write data to IRAF pixel file */ nbw = write (fd, image, nbimage); close (fd); - free (pixname); return (nbw); } /* Put filename and header path together */ diff -u5 -r saoimage-1.35.1/wndwconf.c saoimage-1.35.2/wndwconf.c --- saoimage-1.35.1/wndwconf.c 1995-01-21 01:27:13.000000000 +0100 +++ saoimage-1.35.2/wndwconf.c 2012-10-30 16:32:32.754103481 +0100 @@ -44,10 +44,11 @@ extern int screen_width, screen_height; /* screen dimensions in WndwInit.c */ static int geo_flag = 0; /* flag & vals from XParseGeometry */ static int geo_x, geo_y; static unsigned int geo_width, geo_height; +static void set_parsed_geometry ( ) ; /* * Subroutine: init_desktop * Purpose: Select the SAOimage window area. * PostState: Windows size hints altered or set @@ -55,11 +56,10 @@ * Method: The size can be given or set to norm. If given but less * than min (i.e. 0,0) it becomes the minimum configuration. */ void init_desktop ( ) { - static void set_parsed_geometry(); desktop.hints.min_width = (2 * desktop.xzero) + (2 * dispbox.bdrwidth) + dispbox.hints.min_width; desktop.hints.max_width = (2 * desktop.xzero) + (2 * dispbox.bdrwidth) + dispbox.hints.width; diff -u5 -r saoimage-1.35.1/wndwinit.c saoimage-1.35.2/wndwinit.c --- saoimage-1.35.1/wndwinit.c 2001-12-15 00:19:23.000000000 +0100 +++ saoimage-1.35.2/wndwinit.c 2012-10-30 20:18:34.407614130 +0100 @@ -34,10 +34,14 @@ #include "hfiles/define.h" /* YES, NO, MIN, MAX and more */ #include "hfiles/struct.h" /* all struct record types */ #include "hfiles/extern.h" /* major declared structs */ extern struct windowRec desktop; +static void init_window_basics ( int border_pixel ) ; +static void set_border_color ( char * color_name ) ; +static void set_window_basics ( struct windowRec * window, Window parent, int border_pixel, int background, + XImage * template ) ; /* Root window info used by many routines */ Window root; int screen_width, screen_height; int border_color = -1; @@ -55,11 +59,10 @@ */ void init_windows1 ( argc, argv ) int argc; /* i: command line arg count param */ char **argv; /* i: command line args */ { - static void set_window_basics(); void init_desktop(), create_window(); /* set display screen parameters for all to see */ root = DefaultRootWindow(desktop.display); screen_width = DisplayWidth(desktop.display, desktop.screen); @@ -81,11 +84,10 @@ * Uses: configure_windows() in WndwConfig.c * Uses: get_window_dimensions(), create_window() in WndwCreate.c */ void init_windows2 ( ) { - static void init_window_basics(), set_border_color(); void get_window_dimensions(), configure_windowgroup(), create_window(); /* install runtime environment parameters for all windows */ if( border_color_name != NULL ) set_border_color(border_color_name); @@ -173,19 +175,17 @@ /* * Subroutine: init_window_basics, set_window_basics * Purpose: Set the runtime environment parameters */ -static void init_window_basics ( border_pixel ) - int border_pixel; +static void init_window_basics ( int border_pixel ) { XImage *ximage; - static void set_window_basics(); ximage = XCreateImage(desktop.display, color.visual, color.screen_depth, dispbox.image.format, 0, malloc(4), 2, 2, - dispbox.image.bitmap_pad, (unsigned)2); + dispbox.image.bitmap_pad, (unsigned)0); set_window_basics(&dispbox, desktop.ID, border_pixel, (int)desktop.attrs.background_pixel, ximage); set_window_basics(&panbox, desktop.ID, border_pixel, (int)desktop.attrs.background_pixel, ximage); set_window_basics(&magnibox, desktop.ID, border_pixel, @@ -196,17 +196,12 @@ (int)desktop.attrs.background_pixel, ximage); set_window_basics(&graphbox, root, (int)desktop.attrs.border_pixel, (int)desktop.attrs.background_pixel, ximage); (void)XDestroyImage(ximage); } -static void set_window_basics ( window, parent, border_pixel, background, - template ) - struct windowRec *window; - Window parent; - int border_pixel; - int background; - XImage *template; +static void set_window_basics ( struct windowRec * window, Window parent, int border_pixel, int background, + XImage * template ) { window->display = color.display; window->screen = color.screen; window->parent = parent; window->depth = color.screen_depth; @@ -236,12 +231,11 @@ } /* * Subroutine: set_border_color */ -static void set_border_color ( color_name ) - char *color_name; +static void set_border_color ( char * color_name ) { XColor colordef, ideal; /* set up default border color for all windows */ if( color_name != NULL ) { diff -u5 -r saoimage-1.35.1/wndwmaus.c saoimage-1.35.2/wndwmaus.c --- saoimage-1.35.1/wndwmaus.c 2001-12-19 23:06:46.000000000 +0100 +++ saoimage-1.35.2/wndwmaus.c 2012-10-30 16:35:11.611006415 +0100 @@ -42,10 +42,12 @@ #include "hfiles/struct.h" /* all struct record types */ #include "hfiles/extern.h" /* major declared structs */ #include "defs/mouse.def" /* bitmaps for mouse cursors */ extern Window root; +static Cursor make_mouse_cursor ( Display * display, char * bits, char * mask_bits, + unsigned int width, unsigned int height, unsigned int x_hot, unsigned int y_hot ) ; static Cursor pancursor; static Cursor cursorcursor; static Cursor colorcursor; static Cursor shuttlecursor; @@ -63,11 +65,10 @@ */ void init_mousepointers ( dispdisplay, auxdisplay ) Display *dispdisplay; /* i: display for the dispbox */ Display *auxdisplay; /* i: display for the auxiliary windows */ { - static Cursor make_mouse_cursor(); /* create special btnbox cursor for button menu window */ btnbox.attrs.cursor = make_mouse_cursor(auxdisplay, button_bits, button_mask_bits, button_width, button_height, @@ -148,16 +149,12 @@ * Xlib calls: DefaultScreen, DefaultRootWindow, DefaultColormap * Xlib calls: BlackPixel, WhitePixel, XQueryColors() * Xlib calls: XCreateBitmapFromData(), XCreatePixmapCursor(), XFreePixmap() * Note: Uses black and white of display's root window's color map */ -static Cursor make_mouse_cursor ( display, bits, mask_bits, - width, height, x_hot, y_hot ) - Display *display; - char *bits, *mask_bits; - unsigned int width, height; - unsigned int x_hot, y_hot; +static Cursor make_mouse_cursor ( Display * display, char * bits, char * mask_bits, + unsigned int width, unsigned int height, unsigned int x_hot, unsigned int y_hot ) { static XColor foreback[256]; static Display *display_base = NULL; Cursor cursor; Pixmap source, mask;