diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2011-10-31 12:54:00 -0700 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2011-11-01 19:08:23 +0100 |
commit | e11835e2995d130890ca9f45cb3e304f2ea3a6a9 (patch) | |
tree | cfc5345e9d98b231de0699714771a5d7f54c6ce1 /payloads/libpayload/curses/PDCurses-3.4/x11 | |
parent | dd6906328904309e4d93e4bcb04a6cfa3646f29d (diff) | |
download | coreboot-e11835e2995d130890ca9f45cb3e304f2ea3a6a9.tar.xz |
libpayload: remove trailing whitespace and run dos2unix
Change-Id: Iffed3602456f5306711c65f06c873c58d4086e11
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/363
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads/libpayload/curses/PDCurses-3.4/x11')
12 files changed, 168 insertions, 168 deletions
diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c index 48ea38fd6c..e77d2c78ce 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBox.c @@ -34,19 +34,19 @@ * * ************************************************************************/ -static XtResource resources[] = +static XtResource resources[] = { { XtNhSpace, XtCHSpace, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.h_space), + XtOffset(ScrollBoxWidget, scrollBox.h_space), XtRImmediate, (XtPointer)4 }, { XtNvSpace, XtCVSpace, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.v_space), + XtOffset(ScrollBoxWidget, scrollBox.v_space), XtRImmediate, (XtPointer)4 }, { XtNheightInc, XtCHeightInc, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.increment_height), + XtOffset(ScrollBoxWidget, scrollBox.increment_height), XtRImmediate, (XtPointer)13 }, { XtNwidthInc, XtCWidthInc, XtRDimension, sizeof(Dimension), - XtOffset(ScrollBoxWidget, scrollBox.increment_width), + XtOffset(ScrollBoxWidget, scrollBox.increment_width), XtRImmediate, (XtPointer)7 }, }; @@ -123,7 +123,7 @@ WidgetClass scrollBoxWidgetClass = (WidgetClass)&scrollBoxClassRec; * * ************************************************************************/ -/* Do a layout, either actually assigning positions, or just +/* Do a layout, either actually assigning positions, or just calculating size. */ static void DoLayout(Widget w, Boolean doit) @@ -141,16 +141,16 @@ static void DoLayout(Widget w, Boolean doit) XtAppError(XtWidgetToApplicationContext(w), "ScrollBox: must manage exactly three widgets."); - for (i = 0; i < sbw->composite.num_children; i++) + for (i = 0; i < sbw->composite.num_children; i++) { child = sbw->composite.children[i]; - if (!XtIsManaged(child)) + if (!XtIsManaged(child)) XtAppError(XtWidgetToApplicationContext(w), "ScrollBox: all three widgets must be managed."); } - /* Child one is the main window, two is the vertical scrollbar, + /* Child one is the main window, two is the vertical scrollbar, and three is the horizontal scrollbar. */ wmain = sbw->composite.children[0]; @@ -176,11 +176,11 @@ static void DoLayout(Widget w, Boolean doit) sbw->scrollBox.increment_height) + sbw->scrollBox.increment_height; - vx = wmain->core.x + mw + sbw->scrollBox.h_space + - wmain->core.border_width + vscroll->core.border_width; + vx = wmain->core.x + mw + sbw->scrollBox.h_space + + wmain->core.border_width + vscroll->core.border_width; - hy = wmain->core.y + mh + sbw->scrollBox.v_space + - wmain->core.border_width + hscroll->core.border_width; + hy = wmain->core.y + mh + sbw->scrollBox.v_space + + wmain->core.border_width + hscroll->core.border_width; vh = mh; /* scrollbars are always same length as main window */ hw = mw; @@ -230,12 +230,12 @@ static void RefigureLocations(Widget w) } /* Calculate preferred size. We can't just use the current sizes - of the children, because that calculation would always end up with - our current size. Could query each child, and use that size to - recalculate a size for us, then if it ends up being larger than width - and height passed in, accept bounding box. However, we know our - children and they don't have any particular preferred geometry, - except the bigger the better. Therefore, if the parent suggested a + of the children, because that calculation would always end up with + our current size. Could query each child, and use that size to + recalculate a size for us, then if it ends up being larger than width + and height passed in, accept bounding box. However, we know our + children and they don't have any particular preferred geometry, + except the bigger the better. Therefore, if the parent suggested a size, we'll take it. */ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, @@ -253,9 +253,9 @@ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, /* if proposed size is large enough, accept it. Otherwise, suggest our arbitrary initial size. */ - if (request->request_mode & CWHeight) + if (request->request_mode & CWHeight) { - if (request->height < INITIAL_HEIGHT) + if (request->height < INITIAL_HEIGHT) { result = XtGeometryAlmost; reply_return->height = INITIAL_HEIGHT; @@ -265,9 +265,9 @@ static XtGeometryResult QueryGeometry(Widget w, XtWidgetGeometry *request, result = XtGeometryYes; } - if (request->request_mode & CWWidth) + if (request->request_mode & CWWidth) { - if (request->width < INITIAL_WIDTH) + if (request->width < INITIAL_WIDTH) { result = XtGeometryAlmost; reply_return->width = INITIAL_WIDTH; @@ -305,7 +305,7 @@ static void Initialize(Widget request, Widget new, } -static Boolean SetValues(Widget current, Widget request, Widget new, +static Boolean SetValues(Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args) { ScrollBoxWidget sbwcurrent = (ScrollBoxWidget)current; diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h index 069666da2f..44551386bc 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ScrollBoxP.h @@ -15,9 +15,9 @@ $Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $ */ -/* +/* * scrollBoxP.h - Private definitions for scrollBox widget - * + * */ #ifndef _XORAscrollBoxP_h diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h b/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h index 12b85fa133..e8f7d4079c 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/compose.h @@ -2,7 +2,7 @@ /* $Id: compose.h,v 1.3 2008/07/14 04:24:52 wmcbrine Exp $ */ -/* Tables and variables for the built-in compose key system. This file +/* Tables and variables for the built-in compose key system. This file is not included when PDCurses is built with XIM support. */ #define MAX_COMPOSE_CHARS 14 diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h b/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h index 42571180b2..e4b74e3ab4 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/ncurses_cfg.h @@ -2,9 +2,9 @@ * * This file is only used with the ncurses test programs. * - * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build - * it), or edit ncurses_testdir appropriately in the Makefile. Configure - * and build PDCurses for X11. (Sorry, other ports won't work yet.) + * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build + * it), or edit ncurses_testdir appropriately in the Makefile. Configure + * and build PDCurses for X11. (Sorry, other ports won't work yet.) * Change to this directory, and: * * "make ncurses_tests" to start. @@ -40,7 +40,7 @@ # define USE_WIDEC_SUPPORT 1 #endif -/* Fool ncurses.c so it gives us all the tests, and doesn't redefine +/* Fool ncurses.c so it gives us all the tests, and doesn't redefine ACS_ chars */ diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c index 1a3ce92a2d..bba080f3a2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcclip.c @@ -17,14 +17,14 @@ RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $") int PDC_clearclipboard(void); Description: - PDC_getclipboard() gets the textual contents of the system's - clipboard. This function returns the contents of the clipboard - in the contents argument. It is the responsibilitiy of the + PDC_getclipboard() gets the textual contents of the system's + clipboard. This function returns the contents of the clipboard + in the contents argument. It is the responsibilitiy of the caller to free the memory returned, via PDC_freeclipboard(). - The length of the clipboard contents is returned in the length + The length of the clipboard contents is returned in the length argument. - PDC_setclipboard copies the supplied text into the system's + PDC_setclipboard copies the supplied text into the system's clipboard, emptying the clipboard prior to the copy. PDC_clearclipboard() clears the internal clipboard. @@ -32,7 +32,7 @@ RCSID("$Id: pdcclip.c,v 1.35 2008/07/14 04:24:52 wmcbrine Exp $") Return Values: indicator of success/failure of call. PDC_CLIP_SUCCESS the call was successful - PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for + PDC_CLIP_MEMORY_ERROR unable to allocate sufficient memory for the clipboard contents PDC_CLIP_EMPTY the clipboard contains no text PDC_CLIP_ACCESS_ERROR no clipboard support diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c index 3700edb558..a22e944e81 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcdisp.c @@ -51,8 +51,8 @@ chtype acs_map[128] = 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, # else - A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), - A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25), + A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), + A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), A(29), A(30), 0xb7, # endif diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c index 30c37a87c1..2f85ba062d 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdckbd.c @@ -12,7 +12,7 @@ RCSID("$Id: pdckbd.c,v 1.62 2008/07/14 04:24:52 wmcbrine Exp $") unsigned long PDC_get_input_fd(void); Description: - PDC_get_input_fd() returns the file descriptor that PDCurses + PDC_get_input_fd() returns the file descriptor that PDCurses reads its input from. It can be used for select(). Portability X/Open BSD SYS V @@ -32,7 +32,7 @@ bool PDC_check_key(void) FD_ZERO(&xc_readfds); FD_SET(xc_key_sock, &xc_readfds); - if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, + if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, NULL, &socket_timeout)) < 0) XCursesExitCursesProcess(3, "child - exiting from " "PDC_check_key select failed"); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c index 07b1a042ce..b84b1c63c2 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcscrn.c @@ -71,7 +71,7 @@ int PDC_resize_screen(int nlines, int ncols) XCursesCOLS = SP->cols; PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d SP->lines %d " - "SP->cols %d\n", XCLOGMSG, shmid_Xcurscr, + "SP->cols %d\n", XCLOGMSG, shmid_Xcurscr, shmkey_Xcurscr, SP->lines, SP->cols)); Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c index 395060e867..bdcc856c00 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcsetsc.c @@ -18,9 +18,9 @@ RCSID("$Id: pdcsetsc.c,v 1.33 2008/07/14 04:24:52 wmcbrine Exp $") PDC_set_blink() toggles whether the A_BLINK attribute sets an actual blink mode (TRUE), or sets the background color to high intensity (FALSE). The default is platform-dependent (FALSE in - most cases). It returns OK if it could set the state to match - the given parameter, ERR otherwise. Current platforms also - adjust the value of COLORS according to this function -- 16 for + most cases). It returns OK if it could set the state to match + the given parameter, ERR otherwise. Current platforms also + adjust the value of COLORS according to this function -- 16 for FALSE, and 8 for TRUE. PDC_set_title() sets the title of the window in which the curses diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c index 1e8d0d163c..370cedb0a7 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.c @@ -99,7 +99,7 @@ int XC_read_socket(int sock_num, void *buf, int len) SP->resized = FALSE; memcpy(buf, &rc, sizeof(int)); - + return 0; } @@ -178,7 +178,7 @@ static int _setup_curses(void) if (wait_value != CURSES_CHILD) return ERR; - /* Set LINES and COLS now so that the size of the shared memory + /* Set LINES and COLS now so that the size of the shared memory segment can be allocated */ if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700)) < 0) @@ -226,13 +226,13 @@ int XCursesInitscr(int argc, char *argv[]) XC_LOG(("XCursesInitscr() - called\n")); shmkeySP = getpid(); - + if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_display_sockets) < 0) { fprintf(stderr, "ERROR: cannot create display socketpair\n"); return ERR; } - + if (socketpair(AF_UNIX, SOCK_STREAM, 0, xc_key_sockets) < 0) { fprintf(stderr, "ERROR: cannot create key socketpair\n"); diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h index 0b66c8809e..dc7b9aea34 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/pdcx11.h @@ -178,10 +178,10 @@ void XC_say(const char *msg); enum { - CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION, - CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR, - CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, - CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR, + CURSES_CLEAR_SELECTION, CURSES_DISPLAY_CURSOR, CURSES_SET_SELECTION, + CURSES_GET_SELECTION, CURSES_TITLE, CURSES_REFRESH_SCROLLBAR, + CURSES_RESIZE, CURSES_BELL, CURSES_CONTINUE, CURSES_CURSOR, + CURSES_CHILD, CURSES_REFRESH, CURSES_GET_COLOR, CURSES_SET_COLOR, CURSES_EXIT }; diff --git a/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c b/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c index 97d44985e5..69c3199b54 100644 --- a/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c +++ b/payloads/libpayload/curses/PDCurses-3.4/x11/x11.c @@ -377,8 +377,8 @@ static XrmOptionDescRec options[] = CCOLOR(Black), CCOLOR(Red), CCOLOR(Green), CCOLOR(Yellow), CCOLOR(Blue), CCOLOR(Magenta), CCOLOR(Cyan), CCOLOR(White), - CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen), - CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta), + CCOLOR(BoldBlack), CCOLOR(BoldRed), CCOLOR(BoldGreen), + CCOLOR(BoldYellow), CCOLOR(BoldBlue), CCOLOR(BoldMagenta), CCOLOR(BoldCyan), CCOLOR(BoldWhite) }; @@ -533,7 +533,7 @@ RETSIGTYPE XCursesSigwinchHandler(int signo) PDC_LOG(("%s:XCursesSigwinchHandler() - called: SIGNO: %d\n", XCLOGMSG, signo)); - /* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de + /* Patch by: Georg Fuchs, georg.fuchs@rz.uni-regensburg.de 02-Feb-1999 */ SP->resized += 1; @@ -545,13 +545,13 @@ RETSIGTYPE XCursesSigwinchHandler(int signo) #endif } -/* Convert character positions x and y to pixel positions, stored in +/* Convert character positions x and y to pixel positions, stored in xpos and ypos */ static void _make_xy(int x, int y, int *xpos, int *ypos) { *xpos = (x * font_width) + xc_app_data.borderWidth; - *ypos = xc_app_data.normalFont->ascent + (y * font_height) + + *ypos = xc_app_data.normalFont->ascent + (y * font_height) + xc_app_data.borderWidth; } @@ -953,7 +953,7 @@ static void _refresh_screen(void) start_col = (int)*(Xcurscr + XCURSCR_START_OFF + row); _display_text((const chtype *)(Xcurscr + XCURSCR_Y_OFF(row) + - (start_col * sizeof(chtype))), row, start_col, + (start_col * sizeof(chtype))), row, start_col, num_cols, FALSE); *(Xcurscr + XCURSCR_LENGTH_OFF + row) = 0; @@ -992,8 +992,8 @@ static void _handle_nonmaskable(Widget w, XtPointer client_data, XEvent *event, { XC_LOG(("ClientMessage received\n")); - /* This code used to include handling of WM_SAVE_YOURSELF, but - it resulted in continual failure of THE on my Toshiba laptop. + /* This code used to include handling of WM_SAVE_YOURSELF, but + it resulted in continual failure of THE on my Toshiba laptop. Removed on 3-3-2001. Now only exits on WM_DELETE_WINDOW. */ if ((Atom)client_event->data.s[0] == wm_atom[0]) @@ -1028,12 +1028,12 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, if (event->type == KeyRelease) { - /* The keysym value was set by a previous call to this function + /* The keysym value was set by a previous call to this function with a KeyPress event (or reset by the mouse event handler) */ if (SP->return_key_modifiers && #ifndef PDC_XIM - keysym != compose_key && + keysym != compose_key && #endif IsModifierKey(keysym)) { @@ -1086,7 +1086,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, #ifndef PDC_XIM - /* Check if the key just pressed is the user-specified compose + /* Check if the key just pressed is the user-specified compose key; if it is, set the compose state and exit. */ if (keysym == compose_key) @@ -1105,16 +1105,16 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, SP->visibility = save_visibility; _make_xy(SP->curscol, SP->cursrow, &xpos, &ypos); - ch = (chtype *)(Xcurscr + XCURSCR_Y_OFF(SP->cursrow) + + ch = (chtype *)(Xcurscr + XCURSCR_Y_OFF(SP->cursrow) + (SP->curscol * sizeof(chtype))); _set_cursor_color(ch, &fore, &back); XSetForeground(XCURSESDISPLAY, rect_cursor_gc, colors[back]); - XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, - xpos + 1, ypos - font_height + - xc_app_data.normalFont->descent + 1, + XDrawRectangle(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, + xpos + 1, ypos - font_height + + xc_app_data.normalFont->descent + 1, font_width - 2, font_height - 2); compose_state = STATE_COMPOSE; @@ -1138,7 +1138,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, key = buffer[0]; compose_index = -1; - + for (i = 0; i < (int)strlen(compose_chars); i++) if (compose_chars[i] == key) { @@ -1193,7 +1193,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, compose_state = STATE_NORMAL; compose_index = 0; - + _redraw_cursor(); return; @@ -1294,7 +1294,7 @@ static void XCursesKeyPress(Widget w, XEvent *event, String *params, } } - /* After all that, send the key back to the application if is + /* After all that, send the key back to the application if is NOT zero. */ if (key) @@ -1316,7 +1316,7 @@ static void XCursesHandleString(Widget w, XEvent *event, String *params, ptr = (unsigned char *)*params; if (ptr[0] == '0' && ptr[1] == 'x' && ptr[2] != '\0') - { + { unsigned char c; unsigned long total = 0; @@ -1376,7 +1376,7 @@ static void _paste_utf8(Widget w, XtPointer event, Atom *selection, Atom *type, if (!*type || !*length) { - XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string, + XtGetSelectionValue(w, XA_PRIMARY, XA_STRING, _paste_string, event, ((XButtonEvent *)event)->time); return; } @@ -1421,14 +1421,14 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target, if (*target == XA_TARGETS(XtDisplay(topLevel))) { - XSelectionRequestEvent *req = XtGetSelectionRequest(w, + XSelectionRequestEvent *req = XtGetSelectionRequest(w, *selection, (XtRequestId)NULL); Atom *targetP; XPointer std_targets; unsigned long std_length; - XmuConvertStandardSelection(topLevel, req->time, selection, + XmuConvertStandardSelection(topLevel, req->time, selection, target, type_return, &std_targets, &std_length, format_return); @@ -1475,7 +1475,7 @@ static Boolean _convert_proc(Widget w, Atom *selection, Atom *target, return True; } else - return XmuConvertStandardSelection(topLevel, CurrentTime, + return XmuConvertStandardSelection(topLevel, CurrentTime, selection, target, type_return, (XPointer*)value_return, length_return, format_return); } @@ -1544,7 +1544,7 @@ static void _selection_off(void) _display_screen(); - selection_start_x = selection_start_y = selection_end_x = + selection_start_x = selection_start_y = selection_end_x = selection_end_y = 0; mouse_selection = FALSE; @@ -1560,8 +1560,8 @@ static void _selection_on(int x, int y) static void _selection_extend(int x, int y) { - int temp, current_start, current_end, current_start_x, - current_end_x, current_start_y, current_end_y, new_start, + int temp, current_start, current_end, current_start_x, + current_end_x, current_start_y, current_end_y, new_start, new_end, new_start_x, new_end_x, new_start_y, new_end_y; XC_LOG(("_selection_extend() - called\n")); @@ -1591,7 +1591,7 @@ static void _selection_extend(int x, int y) current_start_y = selection_start_y; } - /* Now we have the current selection as a linear expression. + /* Now we have the current selection as a linear expression. Convert the new position to a linear expression. */ selection_end_x = x; @@ -1621,25 +1621,25 @@ static void _selection_extend(int x, int y) } if (new_end > current_end) - _show_selection(current_end_x, current_end_y, new_end_x, + _show_selection(current_end_x, current_end_y, new_end_x, new_end_y, TRUE); else if (new_end < current_end) - _show_selection(new_end_x, new_end_y, current_end_x, + _show_selection(new_end_x, new_end_y, current_end_x, current_end_y, FALSE); else if (new_start < current_start) - _show_selection(new_start_x, new_start_y, current_start_x, + _show_selection(new_start_x, new_start_y, current_start_x, current_start_y, TRUE); else if (new_start > current_start) - _show_selection(current_start_x, current_start_y, + _show_selection(current_start_x, current_start_y, new_start_x, new_start_y, FALSE); else - _show_selection(current_start_x, current_start_y, + _show_selection(current_start_x, current_start_y, new_start_x, new_start_y, TRUE); } static void _selection_set(void) { - int i, j, start, end, start_x, end_x, start_y, end_y, num_cols, + int i, j, start, end, start_x, end_x, start_y, end_y, num_cols, start_col, row, num_chars, ch, last_nonblank, length, newlen; chtype *ptr = NULL; @@ -1766,7 +1766,7 @@ static void _display_cursor(int old_row, int old_x, int new_row, int new_x) PDC_LOG(("%s:_display_cursor() - draw char at row: %d col %d\n", XCLOGMSG, old_row, old_x)); - /* if the cursor position is outside the boundary of the screen, + /* if the cursor position is outside the boundary of the screen, ignore the request */ if (old_row >= XCursesLINES || old_x >= COLS || @@ -1799,7 +1799,7 @@ static void _display_cursor(int old_row, int old_x, int new_row, int new_x) for (i = 1; i <= SP->visibility; i++) XDrawLine(XCURSESDISPLAY, XCURSESWIN, rect_cursor_gc, xpos + i, ypos - xc_app_data.normalFont->ascent, - xpos + i, ypos - xc_app_data.normalFont->ascent + + xpos + i, ypos - xc_app_data.normalFont->ascent + font_height - 1); } else @@ -1869,7 +1869,7 @@ static void _handle_enter_leave(Widget w, XtPointer client_data, window_entered = FALSE; - /* Display the cursor so it stays on while the window is + /* Display the cursor so it stays on while the window is not current */ _redraw_cursor(); @@ -1972,7 +1972,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, memset(&Mouse_status, 0, sizeof(Mouse_status)); - Mouse_status.changes = (button_no == 5) ? + Mouse_status.changes = (button_no == 5) ? PDC_MOUSE_WHEEL_DOWN : PDC_MOUSE_WHEEL_UP; MOUSE_X_POS = MOUSE_Y_POS = -1; @@ -2022,7 +2022,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, case MotionNotify: MOUSE_LOG(("\nMotionNotify: y: %d x: %d Width: %d " - "Height: %d\n", event->xbutton.y, event->xbutton.x, + "Height: %d\n", event->xbutton.y, event->xbutton.x, font_width, font_height)); MOUSE_X_POS = (event->xbutton.x - xc_app_data.borderWidth) / @@ -2039,12 +2039,12 @@ static void XCursesButton(Widget w, XEvent *event, String *params, else _selection_off(); - /* Throw away mouse movements if they are in the same character - position as the last mouse event, or if we are currently in + /* Throw away mouse movements if they are in the same character + position as the last mouse event, or if we are currently in the middle of a double click event. */ if ((MOUSE_X_POS == save_mouse_status.x && - MOUSE_Y_POS == save_mouse_status.y) || + MOUSE_Y_POS == save_mouse_status.y) || save_mouse_status.button[button_no - 1] == BUTTON_DOUBLE_CLICKED) { send_key = FALSE; @@ -2070,7 +2070,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, if (!handle_real_release) { if ((event->xbutton.time - last_button_press_time) < - SP->mouse_wait && + SP->mouse_wait && (event->xbutton.time != last_button_press_time)) { /* The "real" release was shorter than usleep() time; @@ -2086,7 +2086,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, { send_key = FALSE; - if (XtOwnSelection(topLevel, XA_PRIMARY, + if (XtOwnSelection(topLevel, XA_PRIMARY, event->xbutton.time, _convert_proc, _lose_ownership, NULL) == False) _selection_off(); @@ -2102,8 +2102,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params, } else { - /* Button release longer than usleep() time; - therefore generate a press and wait for the real + /* Button release longer than usleep() time; + therefore generate a press and wait for the real release to occur later. */ MOUSE_LOG(("Generated Release at: %ld - " @@ -2138,8 +2138,8 @@ static void XCursesButton(Widget w, XEvent *event, String *params, { send_key = FALSE; - if (XtOwnSelection(topLevel, XA_PRIMARY, - event->xbutton.time, _convert_proc, + if (XtOwnSelection(topLevel, XA_PRIMARY, + event->xbutton.time, _convert_proc, _lose_ownership, NULL) == False) _selection_off(); @@ -2174,7 +2174,7 @@ static void XCursesButton(Widget w, XEvent *event, String *params, BUTTON_STATUS(button_no), Mouse_status.changes)); MOUSE_LOG(("Send: %d Button1: %x Button2: %x Button3: %x %d %d\n", - send_key, BUTTON_STATUS(1), BUTTON_STATUS(2), + send_key, BUTTON_STATUS(1), BUTTON_STATUS(2), BUTTON_STATUS(3), XCursesLINES, XCursesCOLS)); if (!send_key || MOUSE_X_POS < 0 || MOUSE_X_POS >= XCursesCOLS || @@ -2252,7 +2252,7 @@ static void _thumb_up_down(Widget w, XtPointer client_data, double viewport_y = (double)SP->sb_viewport_y; int cur_y = SP->sb_cur_y; - /* If the size of the viewport is > overall area simply return, + /* If the size of the viewport is > overall area simply return, as no scrolling is permitted. */ if (SP->sb_viewport_y >= SP->sb_total_y) @@ -2285,7 +2285,7 @@ static void _thumb_left_right(Widget w, XtPointer client_data, XawScrollbarSetThumb(w, (double)(cur_x / total_x), (double)(viewport_x / total_x)); - + _send_key_to_curses(KEY_SR, NULL, TRUE); } @@ -2340,7 +2340,7 @@ static void _exit_process(int rc, int sig, char *msg) static void _resize(void) { - short save_atrtab[PDC_COLOR_PAIRS * 2]; + short save_atrtab[PDC_COLOR_PAIRS * 2]; after_first_curses_request = FALSE; @@ -2369,11 +2369,11 @@ static void _resize(void) if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) - { + { perror("Cannot allocate shared memory for curscr"); _exit_process(4, SIGKILL, "exiting from _process_curses_requests"); - } + } Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); memset(Xcurscr, 0, SP->XcurscrSize); @@ -2385,7 +2385,7 @@ static void _resize(void) static void _set_title(void) { - char title[1024]; /* big enough for window title */ + char title[1024]; /* big enough for window title */ int pos; if ((XC_read_socket(xc_display_sock, &pos, sizeof(int)) < 0) || @@ -2452,7 +2452,7 @@ static void _get_selection(Widget w, XtPointer data, Atom *selection, } else { - /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then + /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then contents */ if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) < 0) @@ -2515,12 +2515,12 @@ static void _get_selection_utf8(Widget w, XtPointer data, Atom *selection, wcontents[i] = 0; len = i; - /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then + /* Here all is OK, send PDC_CLIP_SUCCESS, then length, then contents */ if (XC_write_display_socket_int(PDC_CLIP_SUCCESS) >= 0) if (XC_write_display_socket_int(len) >= 0) - if (XC_write_socket(xc_display_sock, + if (XC_write_socket(xc_display_sock, wcontents, len * sizeof(wchar_t)) >= 0) { free(wcontents); @@ -2598,40 +2598,40 @@ static void _resume_curses(void) /* The curses process sent us a message */ static void _process_curses_requests(XtPointer client_data, int *fid, - XtInputId *id) -{ + XtInputId *id) +{ struct timeval socket_timeout = {0}; int s; int old_row, new_row; int old_x, new_x; int pos, num_cols; - char buf[12]; /* big enough for 2 integers */ + char buf[12]; /* big enough for 2 integers */ XC_LOG(("_process_curses_requests() - called\n")); - if (!received_map_notify) - return; + if (!received_map_notify) + return; - FD_ZERO(&xc_readfds); - FD_SET(xc_display_sock, &xc_readfds); + FD_ZERO(&xc_readfds); + FD_SET(xc_display_sock, &xc_readfds); - if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, + if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, NULL, &socket_timeout)) < 0) _exit_process(2, SIGKILL, "exiting from _process_curses_requests" " - select failed"); - if (!s) /* no requests pending - should never happen! */ - return; + if (!s) /* no requests pending - should never happen! */ + return; - if (FD_ISSET(xc_display_sock, &xc_readfds)) - { + if (FD_ISSET(xc_display_sock, &xc_readfds)) + { /* read first integer to determine total message has been received */ XC_LOG(("_process_curses_requests() - before XC_read_socket()\n")); - if (XC_read_socket(xc_display_sock, &num_cols, sizeof(int)) < 0) + if (XC_read_socket(xc_display_sock, &num_cols, sizeof(int)) < 0) _exit_process(3, SIGKILL, "exiting from _process_curses_requests" " - first read"); @@ -2639,8 +2639,8 @@ static void _process_curses_requests(XtPointer client_data, int *fid, after_first_curses_request = TRUE; - switch(num_cols) - { + switch(num_cols) + { case CURSES_EXIT: /* request from curses to stop */ XC_LOG(("CURSES_EXIT received from child\n")); _exit_process(0, 0, "XCursesProcess requested to exit by child"); @@ -2651,11 +2651,11 @@ static void _process_curses_requests(XtPointer client_data, int *fid, XBell(XCURSESDISPLAY, 50); break; - /* request from curses to confirm completion of display */ + /* request from curses to confirm completion of display */ case CURSES_REFRESH: XC_LOG(("CURSES_REFRESH received from child\n")); - _refresh_screen(); + _refresh_screen(); _resume_curses(); break; @@ -2670,7 +2670,7 @@ static void _process_curses_requests(XtPointer client_data, int *fid, _exit_process(5, SIGKILL, "exiting from CURSES_CURSOR " "_process_curses_requests"); - memcpy(&pos, buf, sizeof(int)); + memcpy(&pos, buf, sizeof(int)); old_row = pos & 0xFF; old_x = pos >> 8; @@ -2690,9 +2690,9 @@ static void _process_curses_requests(XtPointer client_data, int *fid, cursor will stay solid. */ if (window_entered) - { - if (visible_cursor) - { + { + if (visible_cursor) + { /* Cursor currently ON, turn it off */ int save_visibility = SP->visibility; @@ -2701,16 +2701,16 @@ static void _process_curses_requests(XtPointer client_data, int *fid, SP->visibility = save_visibility; visible_cursor = FALSE; } - else - { - /* Cursor currently OFF, turn it on */ + else + { + /* Cursor currently OFF, turn it on */ _redraw_cursor(); visible_cursor = TRUE; - } - } + } + } - break; + break; case CURSES_TITLE: XC_LOG(("CURSES_TITLE received from child\n")); @@ -2720,8 +2720,8 @@ static void _process_curses_requests(XtPointer client_data, int *fid, case CURSES_RESIZE: XC_LOG(("CURSES_RESIZE received from child\n")); _resize(); - _resume_curses(); - break; + _resume_curses(); + break; case CURSES_GET_SELECTION: XC_LOG(("CURSES_GET_SELECTION received from child\n")); @@ -2762,13 +2762,13 @@ static void _process_curses_requests(XtPointer client_data, int *fid, _resume_curses(); break; - default: + default: PDC_LOG(("%s:Unknown request %d\n", XCLOGMSG, num_cols)); - } - } -} + } + } +} -static void _handle_structure_notify(Widget w, XtPointer client_data, +static void _handle_structure_notify(Widget w, XtPointer client_data, XEvent *event, Boolean *unused) { XC_LOG(("_handle_structure_notify() - called\n")); @@ -2922,10 +2922,10 @@ int XCursesSetupX(int argc, char *argv[]) /* Check application resource values here */ - font_width = xc_app_data.normalFont->max_bounds.rbearing - + font_width = xc_app_data.normalFont->max_bounds.rbearing - xc_app_data.normalFont->min_bounds.lbearing; - font_height = xc_app_data.normalFont->max_bounds.ascent + + font_height = xc_app_data.normalFont->max_bounds.ascent + xc_app_data.normalFont->max_bounds.descent; font_ascent = xc_app_data.normalFont->max_bounds.ascent; @@ -2938,7 +2938,7 @@ int XCursesSetupX(int argc, char *argv[]) xc_app_data.italicFont->max_bounds.rbearing - xc_app_data.italicFont->min_bounds.lbearing || font_height != - xc_app_data.italicFont->max_bounds.ascent + + xc_app_data.italicFont->max_bounds.ascent + xc_app_data.italicFont->max_bounds.descent; /* Calculate size of display window */ @@ -2978,28 +2978,28 @@ int XCursesSetupX(int argc, char *argv[]) if (xc_app_data.scrollbarWidth && sb_started) { - scrollBox = XtVaCreateManagedWidget(program_name, - scrollBoxWidgetClass, topLevel, XtNwidth, - window_width + xc_app_data.scrollbarWidth, + scrollBox = XtVaCreateManagedWidget(program_name, + scrollBoxWidgetClass, topLevel, XtNwidth, + window_width + xc_app_data.scrollbarWidth, XtNheight, window_height + xc_app_data.scrollbarWidth, XtNwidthInc, font_width, XtNheightInc, font_height, NULL); - drawing = XtVaCreateManagedWidget(program_name, - boxWidgetClass, scrollBox, XtNwidth, - window_width, XtNheight, window_height, XtNwidthInc, + drawing = XtVaCreateManagedWidget(program_name, + boxWidgetClass, scrollBox, XtNwidth, + window_width, XtNheight, window_height, XtNwidthInc, font_width, XtNheightInc, font_height, NULL); - scrollVert = XtVaCreateManagedWidget("scrollVert", - scrollbarWidgetClass, scrollBox, XtNorientation, - XtorientVertical, XtNheight, window_height, XtNwidth, + scrollVert = XtVaCreateManagedWidget("scrollVert", + scrollbarWidgetClass, scrollBox, XtNorientation, + XtorientVertical, XtNheight, window_height, XtNwidth, xc_app_data.scrollbarWidth, NULL); XtAddCallback(scrollVert, XtNscrollProc, _scroll_up_down, drawing); XtAddCallback(scrollVert, XtNjumpProc, _thumb_up_down, drawing); - scrollHoriz = XtVaCreateManagedWidget("scrollHoriz", - scrollbarWidgetClass, scrollBox, XtNorientation, - XtorientHorizontal, XtNwidth, window_width, XtNheight, + scrollHoriz = XtVaCreateManagedWidget("scrollHoriz", + scrollbarWidgetClass, scrollBox, XtNorientation, + XtorientHorizontal, XtNwidth, window_width, XtNheight, xc_app_data.scrollbarWidth, NULL); XtAddCallback(scrollHoriz, XtNscrollProc, _scroll_left_right, drawing); @@ -3036,7 +3036,7 @@ int XCursesSetupX(int argc, char *argv[]) LINES = XCursesLINES; COLS = XCursesCOLS; - if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, + if ((shmidSP = shmget(shmkeySP, sizeof(SCREEN) + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) { perror("Cannot allocate shared memory for SCREEN"); @@ -3055,7 +3055,7 @@ int XCursesSetupX(int argc, char *argv[]) PDC_LOG(("%s:SHM size for curscr %d\n", XCLOGMSG, SP->XcurscrSize)); - if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + + if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, SP->XcurscrSize + XCURSESSHMMIN, 0700 | IPC_CREAT)) < 0) { perror("Cannot allocate shared memory for curscr"); @@ -3066,7 +3066,7 @@ int XCursesSetupX(int argc, char *argv[]) } Xcurscr = (unsigned char *)shmat(shmid_Xcurscr, 0, 0); - memset(Xcurscr, 0, SP->XcurscrSize); + memset(Xcurscr, 0, SP->XcurscrSize); xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF); PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d LINES %d COLS %d\n", @@ -3075,16 +3075,16 @@ int XCursesSetupX(int argc, char *argv[]) /* Add Event handlers to the drawing widget */ XtAddEventHandler(drawing, ExposureMask, False, _handle_expose, NULL); - XtAddEventHandler(drawing, StructureNotifyMask, False, + XtAddEventHandler(drawing, StructureNotifyMask, False, _handle_structure_notify, NULL); XtAddEventHandler(drawing, EnterWindowMask | LeaveWindowMask, False, _handle_enter_leave, NULL); XtAddEventHandler(topLevel, 0, True, _handle_nonmaskable, NULL); - /* Add input handler from xc_display_sock (requests from curses + /* Add input handler from xc_display_sock (requests from curses program) */ - XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask, + XtAppAddInput(app_context, xc_display_sock, (XtPointer)XtInputReadMask, _process_curses_requests, NULL); /* If there is a cursorBlink resource, start the Timeout event */ @@ -3093,8 +3093,8 @@ int XCursesSetupX(int argc, char *argv[]) XtAppAddTimeOut(app_context, xc_app_data.cursorBlinkRate, _blink_cursor, NULL); - /* Leave telling the curses process that it can start to here so - that when the curses process makes a request, the Xcurses + /* Leave telling the curses process that it can start to here so + that when the curses process makes a request, the Xcurses process can service the request. */ XC_write_display_socket_int(CURSES_CHILD); @@ -3114,7 +3114,7 @@ int XCursesSetupX(int argc, char *argv[]) _get_gc(&normal_gc, xc_app_data.normalFont, COLOR_WHITE, COLOR_BLACK); - _get_gc(&italic_gc, italic_font_valid ? xc_app_data.italicFont : + _get_gc(&italic_gc, italic_font_valid ? xc_app_data.italicFont : xc_app_data.normalFont, COLOR_WHITE, COLOR_BLACK); _get_gc(&block_cursor_gc, xc_app_data.normalFont, |