Reformat all C files.
I'll push a formatting guide at some point. There may still be outstanding changes, but please feel free to resolve those as you arrive a them. To the best of my knowledge, there is no changes to the actual code content, but the formatter does have the occasional bug. If you run into an issue, please fix it!
This commit is contained in:
+47
-43
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 winval.c $NHDT-Date: 1430899139 2015/05/06 07:58:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.5 $ */
|
||||
/* NetHack 3.6 winval.c $NHDT-Date: 1431192774 2015/05/09 17:32:54 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
|
||||
/* NetHack 3.6 winval.c $Date: 2009/05/06 10:56:06 $ $Revision: 1.4 $ */
|
||||
/* SCCS Id: @(#)winval.c 3.5 1992/3/7 */
|
||||
/* Copyright (c) Dean Luick, 1992 */
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef SYSV
|
||||
#define PRESERVE_NO_SYSV /* X11 include files may define SYSV */
|
||||
#define PRESERVE_NO_SYSV /* X11 include files may define SYSV */
|
||||
#endif
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
@@ -21,59 +21,65 @@
|
||||
#include <X11/Xaw/Cardinals.h>
|
||||
|
||||
#ifdef PRESERVE_NO_SYSV
|
||||
# ifdef SYSV
|
||||
# undef SYSV
|
||||
# endif
|
||||
# undef PRESERVE_NO_SYSV
|
||||
#ifdef SYSV
|
||||
#undef SYSV
|
||||
#endif
|
||||
#undef PRESERVE_NO_SYSV
|
||||
#endif
|
||||
|
||||
#include "hack.h" /* #define for const for non __STDC__ compilers */
|
||||
#include "hack.h" /* #define for const for non __STDC__ compilers */
|
||||
#include "winX.h"
|
||||
|
||||
#define WNAME "name"
|
||||
#define WVALUE "value"
|
||||
|
||||
|
||||
Widget
|
||||
create_value(parent, name_value)
|
||||
Widget parent;
|
||||
const char *name_value;
|
||||
Widget parent;
|
||||
const char *name_value;
|
||||
{
|
||||
Widget form, name;
|
||||
Arg args[8];
|
||||
Cardinal num_args;
|
||||
|
||||
num_args = 0;
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNdefaultDistance), 0); num_args++;
|
||||
form = XtCreateManagedWidget(name_value,
|
||||
formWidgetClass,
|
||||
parent, args, num_args);
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNdefaultDistance), 0);
|
||||
num_args++;
|
||||
form = XtCreateManagedWidget(name_value, formWidgetClass, parent, args,
|
||||
num_args);
|
||||
|
||||
num_args = 0;
|
||||
XtSetArg(args[num_args], XtNjustify, XtJustifyRight); num_args++;
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0); num_args++;
|
||||
XtSetArg(args[num_args], XtNlabel, name_value); num_args++;
|
||||
XtSetArg(args[num_args], XtNinternalHeight, 0); num_args++;
|
||||
name = XtCreateManagedWidget(WNAME,
|
||||
labelWidgetClass,
|
||||
form, args, num_args);
|
||||
XtSetArg(args[num_args], XtNjustify, XtJustifyRight);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], XtNlabel, name_value);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], XtNinternalHeight, 0);
|
||||
num_args++;
|
||||
name =
|
||||
XtCreateManagedWidget(WNAME, labelWidgetClass, form, args, num_args);
|
||||
|
||||
num_args = 0;
|
||||
XtSetArg(args[num_args], XtNjustify, XtJustifyRight); num_args++;
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0); num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNfromHoriz), name); num_args++;
|
||||
XtSetArg(args[num_args], XtNinternalHeight, 0); num_args++;
|
||||
(void) XtCreateManagedWidget(WVALUE,
|
||||
labelWidgetClass,
|
||||
form, args, num_args);
|
||||
XtSetArg(args[num_args], XtNjustify, XtJustifyRight);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], XtNborderWidth, 0);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], nhStr(XtNfromHoriz), name);
|
||||
num_args++;
|
||||
XtSetArg(args[num_args], XtNinternalHeight, 0);
|
||||
num_args++;
|
||||
(void) XtCreateManagedWidget(WVALUE, labelWidgetClass, form, args,
|
||||
num_args);
|
||||
return form;
|
||||
}
|
||||
|
||||
void
|
||||
set_name(w, new_label)
|
||||
Widget w;
|
||||
const char *new_label;
|
||||
Widget w;
|
||||
const char *new_label;
|
||||
{
|
||||
Arg args[1];
|
||||
Widget name;
|
||||
@@ -85,8 +91,8 @@ set_name(w, new_label)
|
||||
|
||||
void
|
||||
set_name_width(w, new_width)
|
||||
Widget w;
|
||||
int new_width;
|
||||
Widget w;
|
||||
int new_width;
|
||||
{
|
||||
Arg args[1];
|
||||
Widget name;
|
||||
@@ -98,7 +104,7 @@ set_name_width(w, new_width)
|
||||
|
||||
int
|
||||
get_name_width(w)
|
||||
Widget w;
|
||||
Widget w;
|
||||
{
|
||||
Arg args[1];
|
||||
Dimension width;
|
||||
@@ -110,11 +116,10 @@ get_name_width(w)
|
||||
return (int) width;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
set_value(w, new_value)
|
||||
Widget w;
|
||||
const char *new_value;
|
||||
Widget w;
|
||||
const char *new_value;
|
||||
{
|
||||
Arg args[1];
|
||||
Widget val;
|
||||
@@ -126,8 +131,8 @@ set_value(w, new_value)
|
||||
|
||||
void
|
||||
set_value_width(w, new_width)
|
||||
Widget w;
|
||||
int new_width;
|
||||
Widget w;
|
||||
int new_width;
|
||||
{
|
||||
Arg args[1];
|
||||
Widget val;
|
||||
@@ -139,7 +144,7 @@ set_value_width(w, new_width)
|
||||
|
||||
int
|
||||
get_value_width(w)
|
||||
Widget w;
|
||||
Widget w;
|
||||
{
|
||||
Arg args[1];
|
||||
Widget val;
|
||||
@@ -155,7 +160,7 @@ get_value_width(w)
|
||||
/* a label widget, unless I can get some init hook in there). */
|
||||
void
|
||||
hilight_value(w)
|
||||
Widget w;
|
||||
Widget w;
|
||||
{
|
||||
swap_fg_bg(XtNameToWidget(w, WVALUE));
|
||||
}
|
||||
@@ -163,7 +168,7 @@ hilight_value(w)
|
||||
/* Swap the foreground and background colors of the given widget */
|
||||
void
|
||||
swap_fg_bg(w)
|
||||
Widget w;
|
||||
Widget w;
|
||||
{
|
||||
Arg args[2];
|
||||
Pixel fg, bg;
|
||||
@@ -176,4 +181,3 @@ swap_fg_bg(w)
|
||||
XtSetArg(args[1], XtNbackground, fg);
|
||||
XtSetValues(w, args, TWO);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user