From 684e4321fa7e96a61f45dc133816ab92a173a52d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 28 Nov 2021 14:40:19 -0800 Subject: Trim trailing whitespace from lines Signed-off-by: Alan Coopersmith --- Makefile.am | 6 +++--- Written/FilledRects | 6 +++--- Written/Interface | 2 +- Written/Jim | 12 ++++++------ Written/Notes | 6 +++--- Written/Notes2 | 46 +++++++++++++++++++++++----------------------- Written/Outline | 12 ++++++------ Written/Widget | 2 +- choice.c | 16 ++++++++-------- configure.ac | 4 ++-- constants.h | 2 +- dashlist.c | 10 +++++----- getfile.c | 6 +++--- gram.y | 18 +++++++++--------- interpret.c | 16 ++++++++-------- main.c | 16 ++++++++-------- planemask.c | 2 +- record.c | 16 ++++++++-------- testfrac.c | 6 +++--- tests.c | 18 +++++++++--------- text.c | 6 +++--- xgc.h | 2 +- 22 files changed, 115 insertions(+), 115 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4f45449..f2e0b84 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ -# +# # Copyright 2005 Red Hat, Inc. -# +# # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that @@ -10,7 +10,7 @@ # specific, written prior permission. Red Hat makes no # representations about the suitability of this software for any purpose. It # is provided "as is" without express or implied warranty. -# +# # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/Written/FilledRects b/Written/FilledRects index 83cf106..56178c1 100644 --- a/Written/FilledRects +++ b/Written/FilledRects @@ -26,11 +26,11 @@ Things to look for: Otherwise, the speed of a single rectangle should be about equal to its size. -Data: +Data: Pixels per second. Average size of rectangle. -GC fields: +GC fields: function: Tiling: likely to be a lot slower, although for whole words you're just setting it to a certain value, rather than 0. @@ -58,7 +58,7 @@ GC fields: more thought has to be given to what is drawn or not. Software vs. hardware, I suppose. -Possibly +Possibly foreground: similar to plane-mask in its effect, I would think. tile: "nice" width tiles would probably be better. A width which diff --git a/Written/Interface b/Written/Interface index 7b40562..1e8028c 100644 --- a/Written/Interface +++ b/Written/Interface @@ -1,6 +1,6 @@ The command buttons at the top - - Benchmark Options, Graphics Options, etc. + Benchmark Options, Graphics Options, etc. should just bring up the window, not force you to use it. diff --git a/Written/Jim b/Written/Jim index e370cd5..5ab6630 100644 --- a/Written/Jim +++ b/Written/Jim @@ -55,8 +55,8 @@ document. The Graphics Options area would contain the following entries: - Function - one-of { clear, and, andReverse, copy, andInverted, noop, xor, - or, nor, equiv, invert, orReverse, copyInverted, + Function - one-of { clear, and, andReverse, copy, andInverted, noop, xor, + or, nor, equiv, invert, orReverse, copyInverted, orInverted, nand, set } PlaneMask - unsigned value or many-of-n representing bits Foreground - unsigned value in range 0..2^nplanes @@ -158,7 +158,7 @@ sophisticated as what is provided in many UIMS's, it would be nice to keep the application section of the benchmark as separate as possible from the user interface. - test { CopyArea, CopyPlane, PolyPoint, PolyLine, PolySegment, + test { CopyArea, CopyPlane, PolyPoint, PolyLine, PolySegment, PolyRectangle, PolyArc, FillPolygon, PolyFillRect, PolyFillArc, PutImage, GetImage, ImageText8, PolyText8, ImageText16, PolyText16 } @@ -177,7 +177,7 @@ user interface. - specifies the name of the file into which commands are recorded. describe BOOLEAN - - indicates whether or not a description of the test should be + - indicates whether or not a description of the test should be displayed whenever a test is selected (or when this option is specified). @@ -194,11 +194,11 @@ user interface. colormap is being used, the RGB value for this slot may be changed. forecolor COLORNAME - - specifies the RGB value or name of the color to be used for the + - specifies the RGB value or name of the color to be used for the foreground pixel, if settable. backcolor COLORNAME - - specifies the RGB value or name of the color to be used for the + - specifies the RGB value or name of the color to be used for the background pixel, if settable. linewidth NUMBER diff --git a/Written/Notes b/Written/Notes index 971e67a..7c50d0e 100644 --- a/Written/Notes +++ b/Written/Notes @@ -9,7 +9,7 @@ credit to servers for optimizing small ones. Data: Pixels per second. Breaking that down into large and small areas would probably not be useful. - + GC Fields: None. @@ -22,7 +22,7 @@ We probably want to see what happens when the source area is clipped, as that as mentioned specifically in the protocol document. Data: Pixels per second. - + GC Fields: function (*) plane-mask subwindow-mode @@ -64,7 +64,7 @@ Data: Lines per second. Pixels per second (is this valid - do lines that are twice as long take twice as long to draw? Also, is it valid to compare thin lines and fat lines?) - + GC fields: function (*) plane-mask line-width (*) diff --git a/Written/Notes2 b/Written/Notes2 index cf3d99d..9f3b269 100644 --- a/Written/Notes2 +++ b/Written/Notes2 @@ -19,50 +19,50 @@ | | | | | | | | | | | | | | | | | ----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ function |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ plane_mask |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ foreground | | |XX|**|**|**|**|**|**|**|**| |**|**|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ background | | | |**|**|**|**|**|**|**|**| |**|**|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ line_width | | | |XX|XX|XX|XX| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ line_style | | | |XX|XX|XX|XX| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ cap_style | | | |XX|XX| |XX| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ join_style | | | |XX| |XX|XX| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ fill_style | | | |XX|XX|XX|XX|XX|XX|XX| | |XX|XX| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ fill_rule | | | | | | | |XX| | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ arc_mode | | | | | | | | | |XX| | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ tile | | | |**|**|**|**|**|**|**| | |**|**| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ stipple | | | |**|**|**|**|**|**|**| | |**|**| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ ts_x_origin | | | |**|**|**|**|**|**|**| | |**|**| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ ts_y_origin | | | |**|**|**|**|**|**|**| | |**|**| | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ font | | | | | | | | | | | | |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ subwindow_mode |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ exposures |XX| | | | | | | | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ clip_x_origin |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ clip_y_origin |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ clip_mask |XX| |XX|XX|XX|XX|XX|XX|XX|XX|XX| |XX|XX|XX|XX| -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ dash_offset | | | |**|**|**|**| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ dashes | | | |**|**|**|**| | | | | | | | | | -----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ +----------------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ diff --git a/Written/Outline b/Written/Outline index d83f3e5..c0a5c15 100644 --- a/Written/Outline +++ b/Written/Outline @@ -70,7 +70,7 @@ MenuLine contains these Commands: - read from file until EOF Quit - quit - + The toggling command buttons exist in pairs, of which only one is visible at any one point. This makes callbacks/names of buttons easier to implement. @@ -84,7 +84,7 @@ BenchmarkOptions contains: - call disable_gc_choices() with the GC field flags Iterations (text) the number of times to run. - put "iterations <>" in buffer - + --- GraphicsOptions (form) describing graphics options (owned by Toplevel?) @@ -134,9 +134,9 @@ Description (text) describing the current test (owned by Toplevel?) I really need to find out how to use sources and sinks for Text widgets - the documentation does not say how to do it. -Every test will have a block of text associated with it. When a new +Every test will have a block of text associated with it. When a new benchmark is chosen, its associated text will become the source for the -Description widget. Note that we don't have to worry about whether +Description widget. Note that we don't have to worry about whether Description is mapped or not; we're just setting a source. --- @@ -165,9 +165,9 @@ When the user presses Playback, pretty much all we have to do is to 1) change the buffer to the file that he wants, and 2) start reading. The rest should be taken care of the buffer-interpreting module. -RecordingOn changes the output buffer _and_ the input buffer to the +RecordingOn changes the output buffer _and_ the input buffer to the desired file. - + RecordingOff changes them both back to the usual. diff --git a/Written/Widget b/Written/Widget index c653dfd..a603323 100644 --- a/Written/Widget +++ b/Written/Widget @@ -1,5 +1,5 @@ What we need is a widget which presents a collection of buttons. The user -can select only one of them at a time. When one is selected, its +can select only one of them at a time. When one is selected, its foreground and background colors should be reversed and stay that way until another one is selected. Exactly one button can be selected at any one time. diff --git a/choice.c b/choice.c index 77159f1..d770063 100644 --- a/choice.c +++ b/choice.c @@ -52,8 +52,8 @@ create_choice(Widget w, XgcStuff *info) ** toggle widget is selected. */ /* ArgList for the label widget */ - static Arg labelargs[] = { - {XtNborderWidth, (XtArgVal) 0}, + static Arg labelargs[] = { + {XtNborderWidth, (XtArgVal) 0}, {XtNjustify, (XtArgVal) XtJustifyRight}, {XtNvertDistance, (XtArgVal) 4} }; @@ -76,7 +76,7 @@ create_choice(Widget w, XgcStuff *info) /* Allocate space for the widgets and initialize choice */ choice = (ChoiceDesc *) XtMalloc(sizeof(ChoiceDesc)); - choice->widgets = (WidgetList) XtMalloc(sizeof(Widget) * + choice->widgets = (WidgetList) XtMalloc(sizeof(Widget) * info->choice.num_toggles); choice->size = info->choice.num_toggles; choice->label = XtCreateManagedWidget(info->choice.name,labelWidgetClass,w, @@ -97,8 +97,8 @@ create_choice(Widget w, XgcStuff *info) else { toggleargs[4].value = (XtArgVal) choice->widgets[0]; /* are we starting a new row? */ - if (info->choice.columns > 0 && - i > 1 && + if (info->choice.columns > 0 && + i > 1 && (i % (info->choice.columns) == 0)) { toggleargs[0].value = (XtArgVal) choice->label; /* under the appropriate toggle */ @@ -130,15 +130,15 @@ create_choice(Widget w, XgcStuff *info) strcat(text, (info->data)[i].text); strcat(text, "\n"); callbacklist[0].closure = (caddr_t) text; - + /* Create it finally */ - choice->widgets[i] = XtCreateManagedWidget((info->data[i]).name, + choice->widgets[i] = XtCreateManagedWidget((info->data[i]).name, toggleWidgetClass, w, toggleargs, XtNumber(toggleargs)); } - + /* The toggle widgets have all been created; ** now make the all the same width if that's ** what we want to do. */ diff --git a/configure.ac b/configure.ac index 905d925..a16c026 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Copyright 2005 Red Hat, Inc. -dnl +dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that @@ -9,7 +9,7 @@ dnl advertising or publicity pertaining to distribution of the software without dnl specific, written prior permission. Red Hat makes no dnl representations about the suitability of this software for any purpose. It dnl is provided "as is" without express or implied warranty. -dnl +dnl dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR diff --git a/constants.h b/constants.h index 495ff94..acbe32c 100644 --- a/constants.h +++ b/constants.h @@ -21,7 +21,7 @@ #define MAXCHOICES 16 /* Max # of choices for any option */ -#define Black BlackPixel(X.dpy,0) +#define Black BlackPixel(X.dpy,0) #define White WhitePixel(X.dpy,0) #define CopyArea 0 /* different tests */ diff --git a/dashlist.c b/dashlist.c index c172383..5db6179 100644 --- a/dashlist.c +++ b/dashlist.c @@ -136,15 +136,15 @@ change_dashlist(Widget w, caddr_t closure, caddr_t call_data) XtGetValues(w,args,XtNumber(args)); /* modify the dashlist as appropriate. */ - if (on) { - dashlist |= 1<type == ClientMessage && e->xclient.data.l[0] != wm_delete_window) XBell(XtDisplay(w), 0); - else + else quit(); } diff --git a/planemask.c b/planemask.c index b55cf6b..535d6d5 100644 --- a/planemask.c +++ b/planemask.c @@ -20,7 +20,7 @@ static void choose_plane(Widget, caddr_t, caddr_t); -static unsigned long planemask; +static unsigned long planemask; static Widget *pm; /* create_planemask_choice(w) diff --git a/record.c b/record.c index df5d343..605d218 100644 --- a/record.c +++ b/record.c @@ -42,9 +42,9 @@ toggle_recordbutton(Widget w, caddr_t closure, caddr_t call_data) static Arg recordargs[] = { {XtNlabel, (XtArgVal) NULL} }; - + char tmp[20]; /* new label */ - + if (!recording) { start_recording(); } @@ -65,7 +65,7 @@ toggle_recordbutton(Widget w, caddr_t closure, caddr_t call_data) */ static void -start_recording(void) +start_recording(void) { get_filename(done_choosing_filename,cancel_record); } @@ -76,7 +76,7 @@ start_recording(void) */ static void -stop_recording(void) +stop_recording(void) { fclose(recordfile); } @@ -87,7 +87,7 @@ stop_recording(void) */ static void -cancel_record(void) +cancel_record(void) { } @@ -99,7 +99,7 @@ cancel_record(void) */ static void -done_choosing_filename(void) +done_choosing_filename(void) { static Arg recordargs[] = { {XtNlabel, (XtArgVal) NULL}, @@ -138,7 +138,7 @@ print_if_recording(const char *str) ** If we're recording, stop. */ -void +void close_file_if_recording(void) { if (recording) @@ -217,7 +217,7 @@ print_out_gc_values(void) fprintf(recordfile,"planemask %ld\n",X.gcv.plane_mask); fprintf(recordfile,"dashlist %d\n",X.gcv.dashes); fprintf(recordfile,"font %s\n",X.fontname); -} +} /********************************************/ diff --git a/testfrac.c b/testfrac.c index 4df764f..474cc3c 100644 --- a/testfrac.c +++ b/testfrac.c @@ -50,7 +50,7 @@ slider_jump(Widget w, caddr_t data, caddr_t position) ** hits the end of the scrollbar, not the left edge. When the right edge ** is at 1.0, the left edge is at 1.0 - SLIDER_LENGTH. Normalize ** accordingly. */ - + newpercent = oldpercent / (1.0 - SLIDER_LENGTH); /* If the slider's partially out of the scrollbar, move it back in. */ @@ -73,7 +73,7 @@ slider_jump(Widget w, caddr_t data, caddr_t position) /* slider_scroll(w,data,position) ** ------------------------------ -** This function is called when the user does incremental scrolling, +** This function is called when the user does incremental scrolling, ** generally with the left or right button. Right now it just ignores it. */ @@ -144,7 +144,7 @@ create_testfrac_choice(Widget w) {XtNjumpProc, (XtArgVal) NULL}, {XtNscrollProc, (XtArgVal) NULL} }; - + static const char *translationtable = ": Update()"; static XtActionsRec actiontable[] = { diff --git a/tests.c b/tests.c index a85ece0..7c263eb 100644 --- a/tests.c +++ b/tests.c @@ -52,7 +52,7 @@ timer(int flag) switch (flag) { case StartTimer: /* store initial values */ - gettimeofday(&starttime,&tz); + gettimeofday(&starttime,&tz); #if !defined(__UNIXOS2__) && !defined(QNX4) getrusage(RUSAGE_SELF,&startusage); #endif @@ -63,8 +63,8 @@ timer(int flag) getrusage(RUSAGE_SELF,&endusage); #endif - /* all the following line does is use the formula - elapsed time = ending time - starting time, but there are three + /* all the following line does is use the formula + elapsed time = ending time - starting time, but there are three different timers and two different units of time, ack... */ #if !defined(__UNIXOS2__) && !defined(QNX4) @@ -79,15 +79,15 @@ timer(int flag) elapsedtime = (long)( ((long)endtime.tv_sec-(long)starttime.tv_sec)*1000000 +((long)endtime.tv_usec-(long)starttime.tv_usec)); #endif - return(elapsedtime); + return(elapsedtime); - default: + default: fprintf(stderr,"Invalid flag in timer()\n"); return((long) NULL); } #else static time_t starttime; - + switch (flag) { case StartTimer: time(&starttime); @@ -233,7 +233,7 @@ polysegment_test(void) XDrawSegments(X.dpy,X.win,X.gc,segments,num_segments); XSync(X.dpy,0); totaltime = end_timer(); - + snprintf(buf,sizeof buf,"%d segments in %.3f seconds.",num_segments, (double)totaltime/1000000.); show_result(buf); @@ -249,7 +249,7 @@ polypoint_test(void) long totaltime; char buf[80]; int i; - + num_points *= X.percent; points = (XPoint *) malloc(sizeof(XPoint) * num_points); @@ -586,7 +586,7 @@ run_test(void) XClearWindow(X.dpy,X.win); print_if_recording("run\n"); - + switch (X.test) { case CopyArea: copyarea_test(); break; case CopyPlane: copyplane_test(); break; diff --git a/text.c b/text.c index b27d09a..c7b4e13 100644 --- a/text.c +++ b/text.c @@ -98,11 +98,11 @@ create_text_choice(Widget w, int type, int length, int width) /* label uses type to find out what its title is */ label = XtCreateManagedWidget(labels[type],labelWidgetClass,w, labelargs,XtNumber(labelargs)); - + /* text uses type to find out what its string is */ switch (type) { case TForeground: - snprintf(textstrings[type],sizeof textstrings[type], + snprintf(textstrings[type],sizeof textstrings[type], "%d",(int) X.gcv.foreground); snprintf(oldtextstrings[type],sizeof oldtextstrings[type], "%d",(int) X.gcv.foreground); @@ -153,7 +153,7 @@ WriteText(Widget w, XEvent *event, String *params, Cardinal *num_params) } if (strcmp(textstrings[type],oldtextstrings[type])) { strcpy(oldtextstrings[type],textstrings[type]); - snprintf(mbuf,sizeof mbuf,"%s%s\n", + snprintf(mbuf,sizeof mbuf,"%s%s\n", names[type], /* the right first half */ textstrings[type]); /* the right second half */ interpret(mbuf); /* send it off */ diff --git a/xgc.h b/xgc.h index 4df899d..33cf33d 100644 --- a/xgc.h +++ b/xgc.h @@ -36,7 +36,7 @@ typedef struct { char name[40]; /* name as it will appear on the screen */ char text[40]; /* Xgc command it translates to */ } command_data[MAXCHOICES]; -} ChoiceStuff; /* All the info needed to deal with a +} ChoiceStuff; /* All the info needed to deal with a choice widget */ typedef struct { const char *name; -- cgit v1.2.3