Commit Graph

9 Commits

Author SHA1 Message Date
PatR
8c7f89852a formatting for win/X11/dialogs.c 2016-02-10 18:25:20 -08:00
PatR
2bf652dd0f X11_getlin()
Two cosmetic changes for the X11 version of the getlin() routine:
1) Make the text entry box big enough to hold 60 characters before
   sliding the beginning input off the left edge, instead of just 13,
   so that user can see much more of what is being typed;
2) Make the cancel button be a little wider, and the okay button be
   the same width as the cancel button so they look a little nicer.
2016-01-21 23:13:49 -08:00
PatR
a34d327159 bit of X11 reformating
Cleanup up the copyright notice in dialogs.c, and replace some tabs.
2016-01-12 02:20:43 -08:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
97d6fade74 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!
2015-05-09 13:43:16 -04:00
PatR
9de8b03c03 X11 lint suppression
Suppress close to 400 warnings generated by gcc on the win/X11/*.c code,
most due to -Wwrite-strings which makes string literals implicitly have
the 'const' attribute.  (Since modifying a string literal results in
undefined behavior, that is an appropriate check to have enabled, but
it can be troublesome since string literals have type 'char *' and code
that uses them that way is correct provided it avoids modifying them.)

 113  warning: initialization discards qualifiers from pointer target type
 127  warning: assignment discards qualifiers from pointer target type
  29  warning: passing argument discards qualifiers from pointer target type
 109  warning: unused parameter
  12  warning: comparison between signed and unsigned

The nhStr() hack casts to 'char *', explicitly removing 'const', for
situations where it isn't feasible to make code directly honor const.
The vast marjority of uses are for the second parameter to XtSetArg(),
which is a macro that actually performs an assignment with the second
argument rather than passing it in a function.  It takes values like
'XtNtop', which doesn't need to be altered (although in many places I
changed that to nhStr(XtNtop) for uniformity with the surrounding code,
and 'XtNbottom', which does need to have the extra const stripping to
avoid a warning.  Go figure.

The nhUse() hack actually uses its argument in a meaningless way if the
code is compiled with FORCE_ARG_USAGE defined.  When GCC_WARN is defined,
FORCE_ARG_USAGE will be enabled if it hasn't been already.  Example:

 /*ARGUSED*/
 int foo(arg)
   int arg;  /* not used */
 {
+  nhUse(arg);
   return 0;
 }

The extra line will expand to ';' when FORCE_ARG_USAGE is not defined
or too
   nhUse_dummy += (unsigned)arg;
when it is.  I figured direct assignment might lead to a different
warning by some compilers in a situation like
   nhUse(arg);
   nhUse(otherarg);
where the first assignment would be clobbered by the second, and using
bitwise operations or safer '+= (arg != 0)' would most likely generate
more non-useful code.  Some tweaking might turn out to be necessary.
2015-05-06 00:59:15 -07:00
keni
0109f9715b A batch of manual header var additions. 2015-02-26 17:10:11 -05:00
cohrs
320c5e720d X11 pop-up dialog width
- the response field of the pop-up dialog was getting smaller by a few
pixels each time it was used.  This was because the width calculation
was effectively stripping off the margins (4 pixels total) each time.
Don't do that.
2002-03-31 17:11:23 +00:00
jwalz
89005a14e4 *** empty log message *** 2002-01-05 21:06:02 +00:00