Mostly missing headers, explicit parentheses and new prototypes.
Some Caveats:
* I haven't compile-tested the SVR4 getpty file, it might need another tweak
* There were operator precedence bugs in TermPrimCursor.c and TermPrimRender.c
(^ vs. !=). This might change behaviour, but at least I haven't experienced
any crashes ...
* This adds a little more dependencies for include ordering, but unless we
want to play the "headers that include headers that include headers..." game,
this is unavoidable.
This reverts commit 8a8619bfa8.
More work will need to be done to use tirpc on 64bit systems. It
works 'accidentally' on 32b systems. The issue is that tirpc
includes *must* be used, and there is some work required to properly
support this (like proper include paths, proper definition of XDR,
etc).
So for now, we revert this until that work can be completed and tested,
otherwise 64b linux builds are likely to have problems.
Currently, mp_rpc_server.C tries 538 million ports to acquire an
available transient rpcbind port number. This is bad when rpcbind is
running in secure mode (and you are not using tirpc) - Xsession will
'hang' at the dthello (blue) screen filling up your error logs with
RPC errors.
Now, just try +- 50 (for a total of 100 ports) before bailing. The
dthello 'blue screen of death' is the most common problem in starting
CDE when rpcbind isn't set up properly. This should at least not
cause the appearance of a 'hang'.
This adds a basic library and support to dtsession and dtlogin to
support Xinerama/Twinview, where multimple monitors are used to make
up an X11 screen.
The main goal here is to draw dialogs and such centered on a monitor,
rather than spread out over multiple monitors.
Might need to add sorting - as on my test system, what I would
consider monitor 0, appears to actually be monitor 1. So a sort might
need to be added to sort the screens according to increasing x and y
offsets so it make sense to a user.
Also, this library is built statically and not documented. Maybe it
could be 'filled' out and refactored/redesigned in the futre if need
be and suppoerted.
It is enabled via a define, CDE_USEXINERAMA in site.def. It's a very
simple lib, so I do not expect any issues with the BSD's - it should
build and work fine, assuming your X server has the XINERAMA
extension, which I think pretty much all of them do at this point.
On OpenBSD, the 'S' option to malloc(3) enables guard pages (among other
things). This loop could have triggered this trap when reading beyond the
buffer. Also, the whole "while(*ip)" construct was based on the assumption that
the memory after the string is always zero-filled.
This reverts commit 44e384aedb.
This code is actually needed. If svcfd_create() is not available, it
should be fixed only for those systems that it affects.
This has the effect of not performing a tt call each time in
ResolveLocalPathName() if we're on the local host anyway. Drastically reduces
dtfile startup time.
Use Adobe Helvetica as the sans serif user
interface font (among others, dtlogin, front
panel buttons, menu titles) instead of Lucida.
While there, move X Consortium comment back
to the top.
This change applies only to FreeBSD.
libDtHelp is unable to read SDL help files
with -ftree-store-ccp optimization which
is enabled by -O2 on gcc 4.2.1.
GifUtils.c and decompress.c didn't work
properly with -ftree-store-ccp enabled.
GifUtils.c was repaired by fixing
those warnings:
GifUtils.c: In function 'create_pixmap':
GifUtils.c:1093: warning: return makes integer from pointer without a cast
GifUtils.c:1110: warning: return makes integer from pointer without a cast
GifUtils.c:1215: warning: return makes integer from pointer without a cast
GifUtils.c: In function 'gif_to_pixmap':
GifUtils.c:1242: warning: return makes integer from pointer without a cast
decompress.c didn't generate warnings, but the
only effect of the -ftree-store-cpp was to introduce
this change:
addq $1, %rax
movq %rax, (%rbx)
.L90:
- cmpl $157, %edx
+ cmpl $-99, %edx
jne .L86
movl 8(%rbx), %eax
subl $1, %eax
Which corresponds to this source code:
bufioI.h
57 #define BufFileGet(f) ((f)->left-- ? *(f)->bufp++ : (*(f)->io) (f))
42 int (*io)(/* BufFilePtr f */);
decompress.c
53 #ifdef NO_UCHAR
54 typedef char char_type;
55 #else
56 typedef unsigned char char_type;
57 #endif /* UCHAR */
58
59 static char_type magic_header[] = { "\037\235" }; /* 1F 9D */
131 if ((BufFileGet(f) != (magic_header[0] & 0xFF)) ||
132 (BufFileGet(f) != (magic_header[1] & 0xFF)))
133 {
134 return 0;
135 }
BufFileGet() returns (int), so the (unsigned char) constants
got promoted to (int) with sign extension; therefore constant
157 decimal (0x9D) became -99 decimal, sign extended
(0xffffff9D), and the comparison was always false.
Tested using:
$ gcc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
Running on:
FreeBSD 10.0-CURRENT (r240948M)
built Wed Sep 26 23:33:08 CEST 2012
dtcreate crashed on 64-bit system when clicking
"Find Set.." button.
Crash happens in libXm:
new_w=0x805db4300, args=0x7fffffffb430, num_args=0x7fffffffb3dc)
at Form.c:1955
$1 = {att = {{type = 4 '\004', w = 0x805db3700, percent = 0, offset = 0,
value = 0, tempValue = 0}, {type = 1 '\001', w = 0x0, percent = 0,
offset = 10, value = 0, tempValue = 0}, {type = 3 '\003',
w = 0x805db3700, percent = 0, offset = 0, value = 0, tempValue = 0}, {
type = 3 '\003', w = 0x800000000, percent = 0, offset = 10, value = 0,
tempValue = 0}}, next_sibling = 0x0, sorted = 0 '\0',
resizable = 1 '\001', preferred_width = 0, preferred_height = 0}
(...)
at icon_selection_dialog.c:1768
1767 /* Creation of icon_scrolled_win */
1768 icon_scrolled_win = XtVaCreateManagedWidget( "icon_scrolled_win",
1769 xmScrolledWindowWidgetClass,
1770 icon_selection_dialog,
1771 XmNscrollingPolicy, XmAUTOMATIC,
1772 /* XmNnavigationType, XmTAB_GROUP, */
1773 XmNx, 282,
1774 XmNy, 84,
1775 XmNscrollBarDisplayPolicy, XmAS_NEEDED,
1776 XmNrightOffset, 10,
1777 XmNrightAttachment, XmATTACH_FORM,
1778 XmNtopOffset, 0,
1779 XmNtopWidget, icon_container_label,
1780 XmNtopAttachment, XmATTACH_WIDGET,
1781 XmNleftOffset, 0,
1782 XmNleftWidget, icon_container_label,
1783 XmNleftAttachment, XmATTACH_OPPOSITE_WIDGET,
1784 XmNbottomOffset, 10,
1785 XmNbottomWidget, XmATTACH_NONE,
1786 XmNbottomAttachment, XmATTACH_WIDGET,
1787 NULL );
What happens here is that ConstraintInitialize receives
four constraints, the last one is this:
{ type = 3 '\003', /* XmATTACH_WIDGET */
w = 0x800000000, /* malformed XmATTACH_NONE ???
percent = 0,
offset = 10, /* specified as XmNbottomOffset */
value = 0,
tempValue = 0}
XmATTACH_* values are defined in <Xm/Xm.h> as follows:
505 enum{ XmATTACH_NONE, XmATTACH_FORM,
506 XmATTACH_OPPOSITE_FORM, XmATTACH_WIDGET,
507 XmATTACH_OPPOSITE_WIDGET, XmATTACH_POSITION,
508 XmATTACH_SELF
509 } ;
What is not clear to why XmATTACH_NONE - which should be (int)0 -
becomes 0x800000000 - looks like a 64 bit bug somewhere.
Providing a long value on None (0L) as in this change fixes the
problem.
I understand is that it possible to use such an "empty" widget
is to create additional space at the bottom of the newly created
"icon_scrolled_win".
What needs to be clarified - shouldn't be such an (int) value be
automatically promoted to (long) (or XtArgVal, XtPointer, ...)
and preserve the value 0? Lots of parameters seem to be
passed as ints (for example dimensions) and they do not
appear to cause any trouble.
XmPrivate must be generated manually. For this you work, you must
have a freshly compiled openmotif tree, and MLIBSRC must be pointing
to it.
Otherwise, it's possible during the includes phase for an attempt to
be made to regenerate this file, which will fail on the vast majority
of systems out there.
So, to regenerate,
cd include/Xm
rm XmPrivate.h
make XmPrivate.h
- Fix missing prototypes
- Fix some 64-bit related problems (XtVaGetValues)
- Fix crash on dtcreate startup in create_applicationShell1()
- Add XmeFlushIconFileCache() prototype from <Xm/IconFileP.h>
When applying a patch, "git am" strips
trailing whitespace, although they are
present in the git formatted-patch.
This way the committed file will be
slightly different than the file re-generated
by extractprototype.h
It shouldn't hurt, but next run of
extractprototype.h will add trailing spaces
again and the resulting diff on XmPrivate.h
will include more changes than actually
needed.
This may break some viscious circle after
applying the patch, so enabling regeneration
on LinuxArchitecture again.
This patch does not add XmeFlushIconFileCache()
needed by dtcreate.
__rpc_xdr is no longer available on FreeBSD 10.
(XDR is typedef'd as "struct XDR" and not "struct __rpc_xdr").
By the way, why did we ever need this? Probably
it should be removed. Leaving for __OpenBSD__ for now.