summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:42 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:42 +0000
commita6bdd56c5b098599942e4091ae7e2af2d4631b44 (patch)
treee0a23167aca0fb1127f4cd78edf458b633b31eac /src
parent6a13c9e08bb042c81ae904c44a38a50d785c824e (diff)
merge XFree86 4.3.0.1 to -CURRENT
Diffstat (limited to 'src')
-rw-r--r--src/ActionHook.c9
-rw-r--r--src/Alloc.c6
-rw-r--r--src/Callback.c17
-rw-r--r--src/Composite.c7
-rw-r--r--src/Constraint.c3
-rw-r--r--src/Convert.c29
-rw-r--r--src/Converters.c65
-rw-r--r--src/Create.c122
-rw-r--r--src/Destroy.c6
-rw-r--r--src/Display.c81
-rw-r--r--src/Error.c4
-rw-r--r--src/Event.c26
-rw-r--r--src/EventUtil.c2
-rw-r--r--src/GCManager.c15
-rw-r--r--src/Geometry.c80
-rw-r--r--src/GetResList.c23
-rw-r--r--src/GetValues.c36
-rw-r--r--src/HookObj.c12
-rw-r--r--src/Hooks.c18
-rw-r--r--src/Initialize.c133
-rw-r--r--src/Intrinsic.c159
-rw-r--r--src/Keyboard.c3
-rw-r--r--src/Manage.c37
-rw-r--r--src/NextEvent.c96
-rw-r--r--src/Object.c14
-rw-r--r--src/RectObj.c3
-rw-r--r--src/ResConfig.c9
-rw-r--r--src/Resources.c12
-rw-r--r--src/Selection.c5
-rw-r--r--src/SetSens.c7
-rw-r--r--src/SetValues.c42
-rw-r--r--src/Shell.c41
-rw-r--r--src/TMaction.c5
-rw-r--r--src/TMgrab.c17
-rw-r--r--src/TMkey.c19
-rw-r--r--src/TMparse.c48
-rw-r--r--src/TMprint.c3
-rw-r--r--src/TMstate.c23
-rw-r--r--src/Threads.c11
-rw-r--r--src/VarCreate.c171
-rw-r--r--src/VarGet.c55
-rw-r--r--src/Varargs.c80
-rw-r--r--src/Vendor.c19
-rw-r--r--src/sharedlib.c37
44 files changed, 737 insertions, 873 deletions
diff --git a/src/ActionHook.c b/src/ActionHook.c
index 54f8562..04322ef 100644
--- a/src/ActionHook.c
+++ b/src/ActionHook.c
@@ -60,6 +60,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/ActionHook.c,v 1.3 2001/12/14 19:56:05 dawes Exp $ */
/*
* Contains XtAppAddActionHook, XtRemoveActionHook
@@ -69,10 +70,10 @@ in this Software without prior written authorization from The Open Group.
/*ARGSUSED*/
-static void FreeActionHookList( widget, closure, call_data )
- Widget widget; /* unused (and invalid) */
- XtPointer closure; /* ActionHook* */
- XtPointer call_data; /* unused */
+static void FreeActionHookList(
+ Widget widget, /* unused (and invalid) */
+ XtPointer closure, /* ActionHook* */
+ XtPointer call_data) /* unused */
{
ActionHook list = *(ActionHook*)closure;
while (list != NULL) {
diff --git a/src/Alloc.c b/src/Alloc.c
index 16d922d..80fadfb 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Alloc.c,v 1.9 2001/12/14 19:56:07 dawes Exp $ */
/*
* X Toolkit Memory Allocation Routines
@@ -66,13 +67,10 @@ in this Software without prior written authorization from The Open Group.
*/
#include "IntrinsicI.h"
+#include "InitialI.h"
#undef _XBCOPYFUNC
-#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
-#else
-char *malloc(), *realloc(), *calloc();
-#endif
#define Xmalloc(size) malloc((size))
#define Xrealloc(ptr, size) realloc((ptr), (size))
diff --git a/src/Callback.c b/src/Callback.c
index 26213a9..84129a2 100644
--- a/src/Callback.c
+++ b/src/Callback.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Callback.c,v 1.8 2001/12/14 19:56:08 dawes Exp $ */
#include "IntrinsicI.h"
@@ -70,9 +71,9 @@ static String XtNxtCallCallback = "xtCallCallback";
/* However it doesn't contain a final NULL record */
#define ToList(p) ((XtCallbackList) ((p)+1))
-static InternalCallbackList* FetchInternalList(widget, name)
- Widget widget;
- String name;
+static InternalCallbackList* FetchInternalList(
+ Widget widget,
+ _Xconst char *name)
{
XrmQuark quark;
int n;
@@ -84,7 +85,7 @@ static InternalCallbackList* FetchInternalList(widget, name)
offsets = (CallbackTable)
widget->core.widget_class->core_class.callback_private;
- for (n = (int) *(offsets++); --n >= 0; offsets++)
+ for (n = (int)(long) *(offsets++); --n >= 0; offsets++)
if (quark == (*offsets)->xrm_name) {
retval = (InternalCallbackList *)
((char *) widget - (*offsets)->xrm_offset - 1);
@@ -190,10 +191,10 @@ void XtAddCallback(widget, name, callback, closure)
} /* XtAddCallback */
/* ARGSUSED */
-static void AddCallbacks(widget, callbacks, newcallbacks)
- Widget widget;
- InternalCallbackList *callbacks;
- XtCallbackList newcallbacks;
+static void AddCallbacks(
+ Widget widget,
+ InternalCallbackList *callbacks,
+ XtCallbackList newcallbacks)
{
register InternalCallbackList icl;
register int i, j;
diff --git a/src/Composite.c b/src/Composite.c
index 6d3ea64..c3612cc 100644
--- a/src/Composite.c
+++ b/src/Composite.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Composite.c,v 1.6 2001/12/14 19:56:08 dawes Exp $ */
#define COMPOSITE
#include "IntrinsicI.h"
@@ -167,7 +168,7 @@ static void CompositeClassPartInitialize(widgetClass)
WidgetClass widgetClass;
{
register CompositePartPtr wcPtr;
- register CompositePartPtr superPtr;
+ register CompositePartPtr superPtr = NULL;
wcPtr = (CompositePartPtr)
&(((CompositeWidgetClass)widgetClass)->composite_class);
@@ -176,10 +177,6 @@ static void CompositeClassPartInitialize(widgetClass)
/* don't compute possible bogus pointer */
superPtr = (CompositePartPtr)&(((CompositeWidgetClass)widgetClass
->core_class.superclass)->composite_class);
-#ifdef lint
- else
- superPtr = NULL;
-#endif
/* We don't need to check for null super since we'll get to composite
eventually, and it had better define them! */
diff --git a/src/Constraint.c b/src/Constraint.c
index 90b62bd..3f1d3d5 100644
--- a/src/Constraint.c
+++ b/src/Constraint.c
@@ -58,12 +58,13 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Constraint.c,v 1.3 2001/12/14 19:56:09 dawes Exp $ */
#define CONSTRAINT
#include "IntrinsicI.h"
#include "StringDefs.h"
-static void ConstraintPartInitialize();
+static void ConstraintPartInitialize(WidgetClass wc);
externaldef(constraintclassrec) ConstraintClassRec constraintClassRec = {
{ /******* CorePart *******/
/* superclass */ (WidgetClass) &compositeClassRec,
diff --git a/src/Convert.c b/src/Convert.c
index 08d461f..544eb80 100644
--- a/src/Convert.c
+++ b/src/Convert.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Convert.c,v 3.7 2001/12/14 19:56:09 dawes Exp $ */
/*
@@ -61,6 +62,7 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include "StringDefs.h"
+#include "Intrinsic.h"
/* Conversion procedure hash table */
@@ -610,12 +612,8 @@ static void ComputeArgs(widget, convert_args, num_args, args)
break;
case XtBaseOffset:
-#if defined(CRAY1) && !defined(__STDC__)
args[i].addr =
- (XPointer)((int)widget + (int)convert_args[i].address_id);
-#else
- args[i].addr = (XPointer)((char *)widget + (int)convert_args[i].address_id);
-#endif
+ (XPointer)((char *)widget + (long)convert_args[i].address_id);
break;
case XtWidgetBaseOffset:
@@ -626,13 +624,8 @@ static void ComputeArgs(widget, convert_args, num_args, args)
ancestor = _XtWindowedAncestor(widget);
}
-#if defined(CRAY1) && !defined(__STDC__)
- args[i].addr =
- (XPointer)((int)ancestor + (int)convert_args[i].address_id);
-#else
args[i].addr =
- (XPointer)((char *)ancestor + (int)convert_args[i].address_id);
-#endif
+ (XPointer)((char *)ancestor + (long)convert_args[i].address_id);
break;
case XtImmediate:
@@ -648,25 +641,21 @@ static void ComputeArgs(widget, convert_args, num_args, args)
/* Convert in place for next usage */
convert_args[i].address_mode = XtResourceQuark;
convert_args[i].address_id =
- (XtPointer)XrmStringToQuark((String)convert_args[i].address_id);
+ (XtPointer)(long)XrmStringToQuark((String)convert_args[i].address_id);
/* Fall through */
case XtResourceQuark:
if (! ResourceQuarkToOffset(widget->core.widget_class,
- (XrmQuark) convert_args[i].address_id, &offset)) {
+ (XrmQuark)(long) convert_args[i].address_id, &offset)) {
params[0]=
- XrmQuarkToString((XrmQuark) convert_args[i].address_id);
+ XrmQuarkToString((XrmQuark)(long) convert_args[i].address_id);
XtAppWarningMsg(XtWidgetToApplicationContext(widget),
"invalidResourceName","computeArgs",XtCXtToolkitError,
"Cannot find resource name %s as argument to conversion",
params,&num_params);
offset = 0;
}
-#if defined(CRAY1) && !defined(__STDC__)
- args[i].addr = (XPointer)((int)widget + offset);
-#else
args[i].addr = (XPointer)((char *)widget + offset);
-#endif
break;
default:
params[0] = XtName(widget);
@@ -693,7 +682,7 @@ void XtDirectConvert(converter, args, num_args, from, to)
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((int)(converter) >> 2) + from->size + *((char *) from->addr);
+ hash = ((long) converter >> 2) + from->size + *((char *) from->addr);
if (from->size > 1) hash += ((char *) from->addr)[1];
for (p = cacheHashTable[hash & CACHEHASHMASK]; p; p = p->next) {
@@ -791,7 +780,7 @@ CallConverter(dpy, converter,
LOCK_PROCESS;
/* Try to find cache entry for conversion */
- hash = ((int)(converter) >> 2) + from->size + *((char *) from->addr);
+ hash = ((long)(converter) >> 2) + from->size + *((char *) from->addr);
if (from->size > 1) hash += ((char *) from->addr)[1];
if (cP->cache_type != XtCacheNone) {
diff --git a/src/Converters.c b/src/Converters.c
index deaed4a..95a88e0 100644
--- a/src/Converters.c
+++ b/src/Converters.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Converters.c,v 3.13 2002/06/03 20:59:19 dawes Exp $ */
/*
@@ -71,19 +72,17 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xlocale.h>
#include <errno.h> /* for StringToDirectoryString */
-#ifdef X_NOT_STDC_ENV
-extern int errno;
-#endif
-
-#ifdef __STDC__
-#define Const const
+#ifdef __UNIXOS2__
+#define IsNewline(str) ((str) == '\n' || (str) == '\r')
+#define IsWhitespace(str) ((str)== ' ' || (str) == '\t' || (str) == '\r')
#else
-#define Const /**/
+#define IsNewline(str) ((str) == '\n')
+#define IsWhitespace(str) ((str)== ' ' || (str) == '\t')
#endif
-static Const String XtNwrongParameters = "wrongParameters";
-static Const String XtNconversionError = "conversionError";
-static Const String XtNmissingCharsetList = "missingCharsetList";
+static const String XtNwrongParameters = "wrongParameters";
+static const String XtNconversionError = "conversionError";
+static const String XtNmissingCharsetList = "missingCharsetList";
/* Representation types */
@@ -112,7 +111,11 @@ static XrmQuark XtQGravity;
static XrmQuark XtQInt;
static XrmQuark XtQPixel;
static XrmQuark XtQPosition;
+#ifdef __UNIXOS2__
+XrmQuark _XtQString = 0;
+#else
XrmQuark _XtQString;
+#endif
void _XtConvertInitialize()
{
@@ -267,7 +270,11 @@ static Boolean IsInteger(string, value)
int val = 0;
char ch;
/* skip leading whitespace */
+#ifndef __UNIXOS2__
while ((ch = *string) == ' ' || ch == '\t') string++;
+#else
+ while ((ch = *string) == ' ' || ch == '\t' || ch == '\r') string++;
+#endif
while ((ch = *string++)) {
if (ch >= '0' && ch <= '9') {
val *= 10;
@@ -275,11 +282,11 @@ static Boolean IsInteger(string, value)
foundDigit = True;
continue;
}
- if (ch == ' ' || ch == '\t') {
+ if (IsWhitespace(ch)) {
if (!foundDigit) return False;
/* make sure only trailing whitespace */
while ((ch = *string++)) {
- if (ch != ' ' && ch != '\t')
+ if (!IsWhitespace(ch))
return False;
}
break;
@@ -421,7 +428,7 @@ Boolean XtCvtStringToBool(dpy, args, num_args, fromVal, toVal, closure_ret)
return False;
}
-XtConvertArgRec Const colorConvertArgs[] = {
+XtConvertArgRec const colorConvertArgs[] = {
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)},
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
@@ -554,7 +561,7 @@ static void FreePixel(app, toVal, closure, args, num_args)
/* no longer used by Xt, but it's in the spec */
-XtConvertArgRec Const screenConvertArg[] = {
+XtConvertArgRec const screenConvertArg[] = {
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)}
};
@@ -576,7 +583,7 @@ static void FetchDisplayArg(widget, size, value)
value->addr = (XPointer)&DisplayOfScreen(XtScreenOfObject(widget));
}
-static XtConvertArgRec Const displayConvertArg[] = {
+static XtConvertArgRec const displayConvertArg[] = {
{XtProcedureArg, (XtPointer)FetchDisplayArg, 0},
};
@@ -590,8 +597,8 @@ Boolean XtCvtStringToCursor(dpy, args, num_args, fromVal, toVal, closure_ret)
XtPointer *closure_ret;
{
- static Const struct _CursorName {
- Const char *name;
+ static const struct _CursorName {
+ const char *name;
unsigned int shape;
} cursor_names[] = {
{"X_cursor", XC_X_cursor},
@@ -672,7 +679,7 @@ Boolean XtCvtStringToCursor(dpy, args, num_args, fromVal, toVal, closure_ret)
{"watch", XC_watch},
{"xterm", XC_xterm},
};
- Const struct _CursorName *nP;
+ const struct _CursorName *nP;
char *name = (char *)fromVal->addr;
register int i;
@@ -814,9 +821,11 @@ Boolean XtCvtStringToFloat(dpy, args, num_args, fromVal, toVal, closure_ret)
int ret;
float f, nan;
+#ifndef ISC /* On ISC this generates a core dump :-( at least with gs */
/* depending on the system this may or may not do anything useful */
(void) sscanf ("NaNS", "%g",
toVal->addr != NULL ? (float*) toVal->addr : &nan);
+#endif
if (*num_args != 0)
XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
@@ -894,13 +903,13 @@ Boolean XtCvtStringToFont(dpy, args, num_args, fromVal, toVal, closure_ret)
}
}
/* Should really do XListFonts, but most servers support this */
- f = XLoadFont(display, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1");
+ f = XLoadFont(display, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-*");
if (f != 0)
goto Done;
XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
"noFont","cvtStringToFont",XtCXtToolkitError,
- "Unable to load any usable ISO8859-1 font",
+ "Unable to load any usable ISO8859 font",
(String *) NULL, (Cardinal *)NULL);
return False;
@@ -1026,7 +1035,7 @@ Boolean XtCvtStringToFontSet(dpy, args, num_args, fromVal, toVal, closure_ret)
}
/* Should really do XListFonts, but most servers support this */
- f = XCreateFontSet(display, "-*-*-*-R-*-*-*-120-*-*-*-*",
+ f = XCreateFontSet(display, "-*-*-*-R-*-*-*-120-*-*-*-*,*",
&missing_charset_list, &missing_charset_count, &def_string);
/* Free any returned missing charset list */
@@ -1083,7 +1092,7 @@ static void FetchLocaleArg(widget, size, value )
value->addr = (XPointer)&locale;
}
-static XtConvertArgRec Const localeDisplayConvertArgs[] = {
+static XtConvertArgRec const localeDisplayConvertArgs[] = {
{XtProcedureArg, (XtPointer)FetchDisplayArg, 0},
{XtProcedureArg, (XtPointer)FetchLocaleArg, 0},
};
@@ -1153,13 +1162,13 @@ XtCvtStringToFontStruct(dpy, args, num_args, fromVal, toVal, closure_ret)
}
}
/* Should really do XListFonts, but most servers support this */
- f = XLoadQueryFont(display, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-1");
+ f = XLoadQueryFont(display, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-*");
if (f != NULL)
goto Done;
XtAppWarningMsg(XtDisplayToApplicationContext(dpy),
"noFont","cvtStringToFontStruct",XtCXtToolkitError,
- "Unable to load any usable ISO8859-1 font",
+ "Unable to load any usable ISO8859 font",
(String *) NULL, (Cardinal *)NULL);
return False;
@@ -1451,7 +1460,7 @@ XtCvtStringToInitialState(dpy, args, num_args, fromVal, toVal, closure_ret)
return False;
}
-static XtConvertArgRec Const visualConvertArgs[] = {
+static XtConvertArgRec const visualConvertArgs[] = {
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)},
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.depth),
@@ -1653,7 +1662,7 @@ Boolean XtCvtStringToCommandArgArray(dpy, args, num_args, fromVal, toVal,
while (*src != '\0') {
/* skip whitespace */
- while (*src == ' ' || *src == '\t' || *src == '\n')
+ while (IsWhitespace(*src) || IsNewline(*src))
src++;
/* test for end of string */
if (*src == '\0')
@@ -1662,9 +1671,9 @@ Boolean XtCvtStringToCommandArgArray(dpy, args, num_args, fromVal, toVal,
/* start new token */
tokens++;
start = src;
- while (*src != '\0' && *src != ' ' && *src != '\t' && *src != '\n') {
+ while (*src != '\0' && !IsWhitespace(*src) && !IsNewline(*src)) {
if (*src == '\\' &&
- (*(src+1) == ' ' || *(src+1) == '\t' || *(src+1) == '\n')) {
+ (IsWhitespace(*(src+1)) || IsNewline(*(src+1)))) {
len = src - start;
if (len) {
/* copy preceeding part of token */
diff --git a/src/Create.c b/src/Create.c
index 212ebd8..a172e52 100644
--- a/src/Create.c
+++ b/src/Create.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Create.c,v 3.10 2002/12/17 04:50:58 dawes Exp $ */
/*
@@ -62,6 +63,7 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include "VarargsI.h"
#include "ShellP.h"
+#include "CreateI.h"
#ifndef X_NO_RESOURCE_CONFIGURATION_MANAGEMENT
#include "ResConfigP.h"
#endif
@@ -71,8 +73,7 @@ static String XtNxtCreateWidget = "xtCreateWidget";
static String XtNxtCreatePopupShell = "xtCreatePopupShell";
static void
-CallClassPartInit(ancestor, wc)
- WidgetClass ancestor, wc;
+CallClassPartInit(WidgetClass ancestor, WidgetClass wc)
{
if (ancestor->core_class.superclass != NULL) {
CallClassPartInit(ancestor->core_class.superclass, wc);
@@ -192,12 +193,12 @@ XtInitializeWidgetClass(wc)
}
static void
-CallInitialize (class, req_widget, new_widget, args, num_args)
- WidgetClass class;
- Widget req_widget;
- Widget new_widget;
- ArgList args;
- Cardinal num_args;
+CallInitialize (
+ WidgetClass class,
+ Widget req_widget,
+ Widget new_widget,
+ ArgList args,
+ Cardinal num_args)
{
WidgetClass superclass;
XtInitProc initialize;
@@ -221,11 +222,12 @@ CallInitialize (class, req_widget, new_widget, args, num_args)
}
static void
-CallConstraintInitialize (class, req_widget, new_widget, args, num_args)
- ConstraintWidgetClass class;
- Widget req_widget, new_widget;
- ArgList args;
- Cardinal num_args;
+CallConstraintInitialize (
+ ConstraintWidgetClass class,
+ Widget req_widget,
+ Widget new_widget,
+ ArgList args,
+ Cardinal num_args)
{
WidgetClass superclass;
XtInitProc initialize;
@@ -244,16 +246,15 @@ CallConstraintInitialize (class, req_widget, new_widget, args, num_args)
}
static Widget
-xtWidgetAlloc(widget_class, parent_constraint_class, parent, name,
- args, num_args, typed_args, num_typed_args)
- WidgetClass widget_class;
- ConstraintWidgetClass parent_constraint_class;
- Widget parent;
- String name;
- ArgList args; /* must be NULL if typed_args is non-NULL */
- Cardinal num_args;
- XtTypedArgList typed_args; /* must be NULL if args is non-NULL */
- Cardinal num_typed_args;
+xtWidgetAlloc(
+ WidgetClass widget_class,
+ ConstraintWidgetClass parent_constraint_class,
+ Widget parent,
+ String name,
+ ArgList args, /* must be NULL if typed_args is non-NULL */
+ Cardinal num_args,
+ XtTypedArgList typed_args, /* must be NULL if args is non-NULL */
+ Cardinal num_typed_args)
{
Widget widget;
Cardinal wsize, csize = 0;
@@ -290,6 +291,7 @@ xtWidgetAlloc(widget_class, parent_constraint_class, parent, name,
}
}
widget = (Widget) __XtMalloc((unsigned)(wsize + csize));
+ bzero(widget, wsize + csize);
widget->core.constraints =
(csize ? (XtPointer)((char *)widget + wsize) : NULL);
}
@@ -303,8 +305,8 @@ xtWidgetAlloc(widget_class, parent_constraint_class, parent, name,
}
static void
-CompileCallbacks(widget)
- Widget widget;
+CompileCallbacks(
+ Widget widget)
{
CallbackTable offsets;
InternalCallbackList* cl;
@@ -314,7 +316,7 @@ CompileCallbacks(widget)
offsets = (CallbackTable)
widget->core.widget_class->core_class.callback_private;
- for (i = (int) *(offsets++); --i >= 0; offsets++) {
+ for (i = (int)(long) *(offsets++); --i >= 0; offsets++) {
cl = (InternalCallbackList *)
((char *) widget - (*offsets)->xrm_offset - 1);
if (*cl)
@@ -324,26 +326,25 @@ CompileCallbacks(widget)
}
static Widget
-xtCreate(name, class, widget_class, parent, default_screen,
- args, num_args, typed_args, num_typed_args, parent_constraint_class,
- post_proc)
- char *name, *class;
- WidgetClass widget_class;
- Widget parent;
- Screen* default_screen; /* undefined when creating a nonwidget */
- ArgList args; /* must be NULL if typed_args is non-NULL */
- Cardinal num_args;
- XtTypedArgList typed_args; /* must be NULL if args is non-NULL */
- Cardinal num_typed_args;
- ConstraintWidgetClass parent_constraint_class;
+xtCreate(
+ char *name,
+ char *class,
+ WidgetClass widget_class,
+ Widget parent,
+ Screen* default_screen, /* undefined when creating a nonwidget */
+ ArgList args, /* must be NULL if typed_args is non-NULL */
+ Cardinal num_args,
+ XtTypedArgList typed_args, /* must be NULL if args is non-NULL */
+ Cardinal num_typed_args,
+ ConstraintWidgetClass parent_constraint_class,
/* NULL if not a subclass of Constraint or if child is popup shell */
- XtWidgetProc post_proc;
+ XtWidgetProc post_proc)
{
/* need to use strictest alignment rules possible in next two decls. */
double widget_cache[100];
double constraint_cache[20];
Widget req_widget;
- XtPointer req_constraints;
+ XtPointer req_constraints = NULL;
Cardinal wsize, csize;
Widget widget;
XtCacheRef *cache_refs;
@@ -413,7 +414,9 @@ xtCreate(name, class, widget_class, parent, default_screen,
} else req_widget->core.constraints = NULL;
CallConstraintInitialize(parent_constraint_class, req_widget, widget,
args, num_args);
- if (csize) XtStackFree(req_constraints, constraint_cache);
+ if (csize) {
+ XtStackFree(req_constraints, constraint_cache);
+ }
}
XtStackFree((XtPointer)req_widget, widget_cache);
if (post_proc != (XtWidgetProc) NULL) {
@@ -454,8 +457,7 @@ xtCreate(name, class, widget_class, parent, default_screen,
}
static void
-widgetPostProc(w)
- Widget w;
+widgetPostProc(Widget w)
{
XtWidgetProc insert_child;
Widget parent = XtParent(w);
@@ -481,15 +483,14 @@ widgetPostProc(w)
}
Widget
-_XtCreateWidget(name, widget_class, parent,
- args, num_args, typed_args, num_typed_args)
- String name;
- WidgetClass widget_class;
- Widget parent;
- ArgList args;
- Cardinal num_args;
- XtTypedArgList typed_args;
- Cardinal num_typed_args;
+_XtCreateWidget(
+ String name,
+ WidgetClass widget_class,
+ Widget parent,
+ ArgList args,
+ Cardinal num_args,
+ XtTypedArgList typed_args,
+ Cardinal num_typed_args)
{
register Widget widget;
ConstraintWidgetClass cwc;
@@ -585,7 +586,7 @@ XtCreateWidget(name, widget_class, parent, args, num_args)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- retval = _XtCreateWidget(name, widget_class, parent, args, num_args,
+ retval = _XtCreateWidget((String)name, widget_class, parent, args, num_args,
(XtTypedArgList)NULL, (Cardinal)0);
UNLOCK_APP(app);
return retval;
@@ -616,16 +617,15 @@ XtCreateManagedWidget(name, widget_class, parent, args, num_args)
LOCK_APP(app);
XtCheckSubclass(parent, compositeWidgetClass, "in XtCreateManagedWidget");
- widget = _XtCreateWidget(name, widget_class, parent, args, num_args,
- (XtTypedArgList)NULL, (Cardinal) 0);
+ widget = _XtCreateWidget((String)name, widget_class, parent, args,
+ num_args, (XtTypedArgList)NULL, (Cardinal) 0);
XtManageChild(widget);
UNLOCK_APP(app);
return widget;
}
static void
-popupPostProc(w)
- Widget w;
+popupPostProc(Widget w)
{
Widget parent = XtParent(w);
@@ -696,8 +696,8 @@ XtCreatePopupShell(name, widget_class, parent, args, num_args)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- retval = _XtCreatePopupShell(name, widget_class, parent, args, num_args,
- (XtTypedArgList)NULL, (Cardinal)0);
+ retval = _XtCreatePopupShell((String)name, widget_class, parent, args,
+ num_args, (XtTypedArgList)NULL, (Cardinal)0);
UNLOCK_APP(app);
return retval;
}
@@ -760,8 +760,8 @@ XtAppCreateShell(name, class, widget_class, display, args, num_args)
DPY_TO_APPCON(display);
LOCK_APP(app);
- retval = _XtAppCreateShell(name, class, widget_class, display, args,
- num_args, (XtTypedArgList)NULL, (Cardinal)0);
+ retval = _XtAppCreateShell((String)name, (String)class, widget_class,
+ display, args, num_args, (XtTypedArgList)NULL, (Cardinal)0);
UNLOCK_APP(app);
return retval;
}
diff --git a/src/Destroy.c b/src/Destroy.c
index aed7cc7..bc81e1f 100644
--- a/src/Destroy.c
+++ b/src/Destroy.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Destroy.c,v 1.3 2001/12/14 19:56:11 dawes Exp $ */
#include "IntrinsicI.h"
@@ -188,7 +189,7 @@ static Boolean IsDescendant(widget, root)
static void XtPhase2Destroy (widget)
register Widget widget;
{
- Display *display;
+ Display *display = NULL;
Window window;
Widget parent;
XtAppContext app = XtWidgetToApplicationContext(widget);
@@ -244,9 +245,6 @@ static void XtPhase2Destroy (widget)
*/
if (XtIsShell(widget) || !XtIsWidget(widget)) {
window = 0;
-#ifdef lint
- display = 0;
-#endif
}
else {
display = XtDisplay(widget);
diff --git a/src/Display.c b/src/Display.c
index a0f1ba0..d5f8157 100644
--- a/src/Display.c
+++ b/src/Display.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Display.c,v 3.15 2002/09/18 01:25:01 dawes Exp $ */
/*
@@ -64,11 +65,7 @@ in this Software without prior written authorization from The Open Group.
#include "ResConfigP.h"
#endif
-#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
-#else
-extern char* getenv();
-#endif
#ifdef XTHREADS
void (*_XtProcessLock)() = NULL;
@@ -78,10 +75,6 @@ void (*_XtInitAppLock)() = NULL;
static String XtNnoPerDisplay = "noPerDisplay";
-extern void _XtHeapInit();
-extern void _XtHeapFree();
-extern XrmDatabase _XtPreparseCommandLine();
-
ProcessContext _XtGetProcessContext()
{
static ProcessContextRec processContextRec = {
@@ -139,8 +132,6 @@ static void XtDeleteFromAppContext(d, app)
{
register int i;
- LOCK_APP(app);
-
for (i = 0; i < app->count; i++) if (app->list[i] == d) break;
if (i < app->count) {
@@ -149,45 +140,14 @@ static void XtDeleteFromAppContext(d, app)
app->count--;
}
app->rebuild_fdlist = TRUE;
-
#ifndef USE_POLL
-
- {
- int display;
- int source;
-
- /*
- * Search through list[] for largest connection number
- */
-
- app->fds.nfds = 0;
-
- for (display = 0; display < app->count; display++) {
- if ((ConnectionNumber(app->list[display]) + 1) > app->fds.nfds) {
- app->fds.nfds = ConnectionNumber(app->list[display]) + 1;
- }
- }
-
- /*
- * Search through input_list[] for largest input source, i.e.
- * file descriptor
- */
-
- for (source = (app->input_max - 1); ((source >= 0) && ((source + 1) > app->fds.nfds)); source--) {
- if (app->input_list[source] != (InputEvent *) NULL) {
- app->fds.nfds = (source + 1);
- break;
- }
- }
- }
-
+ if ((ConnectionNumber(d) + 1) == app->fds.nfds)
+ app->fds.nfds--;
+ else /* Unnecessary, just to be fool-proof */
+ FD_CLR(ConnectionNumber(d), &app->fds.rmask);
#else
-
app->fds.nfds--;
-
#endif
-
- UNLOCK_APP(app);
}
static XtPerDisplay NewPerDisplay(dpy)
@@ -210,7 +170,6 @@ static XtPerDisplay InitPerDisplay(dpy, app, name, classname)
String name;
String classname;
{
- extern void _XtAllocTMContext();
XtPerDisplay pd;
AddToAppContext(dpy, app);
@@ -301,10 +260,11 @@ Display *XtOpenDisplay(app, displayName, applName, className,
LOCK_APP(app);
LOCK_PROCESS;
/* parse the command line for name, display, and/or language */
- db = _XtPreparseCommandLine(urlist, num_urs, *argc, argv, &applName,
- (displayName ? NULL : &displayName),
- (app->process->globalLangProcRec.proc ?
- &language : NULL));
+ db = _XtPreparseCommandLine(urlist, num_urs, *argc, argv,
+ (String *)&applName,
+ (String *)(displayName ? NULL : &displayName),
+ (app->process->globalLangProcRec.proc ?
+ &language : NULL));
UNLOCK_PROCESS;
d = XOpenDisplay(displayName);
@@ -315,6 +275,14 @@ Display *XtOpenDisplay(app, displayName, applName, className,
#else
char *ptr = strrchr(argv[0], '/');
#endif
+#ifdef __UNIXOS2__
+ char *dot_ptr,*ptr2;
+ ptr2 = strrchr(argv[0],'\\');
+ if (ptr2 > ptr) ptr = ptr2;
+ dot_ptr = strrchr(argv[0],'.');
+ if (dot_ptr && (dot_ptr > ptr)) *dot_ptr='\0';
+#endif /* This will remove the .exe suffix under OS/2 */
+
if (ptr) applName = ++ptr;
else applName = argv[0];
} else
@@ -620,11 +588,8 @@ PerDisplayTablePtr _XtperDisplayList = NULL;
XtPerDisplay _XtSortPerDisplayList(dpy)
Display *dpy;
{
- register PerDisplayTablePtr pd, opd;
+ register PerDisplayTablePtr pd, opd = NULL;
-#ifdef lint
- opd = NULL;
-#endif
LOCK_PROCESS;
for (pd = _XtperDisplayList;
pd != NULL && pd->dpy != dpy;
@@ -662,13 +627,10 @@ static void CloseDisplay(dpy)
Display *dpy;
{
register XtPerDisplay xtpd;
- register PerDisplayTablePtr pd, opd;
+ register PerDisplayTablePtr pd, opd = NULL;
XrmDatabase db;
int i;
-#ifdef lint
- opd = NULL;
-#endif
XtDestroyWidget(XtHooksOfDisplay(dpy));
LOCK_PROCESS;
@@ -690,7 +652,6 @@ static void CloseDisplay(dpy)
xtpd = &(pd->perDpy);
if (xtpd != NULL) {
- extern void _XtGClistFree();
if (xtpd->destroy_callbacks != NULL) {
XtCallCallbackList((Widget) NULL,
(XtCallbackList)xtpd->destroy_callbacks,
@@ -861,6 +822,6 @@ void XtGetDisplays(app_context, dpy_return, num_dpy_return)
*num_dpy_return = app_context->count;
*dpy_return = (Display**)__XtMalloc(app_context->count * sizeof(Display*));
for (ii = 0; ii < app_context->count; ii++)
- *dpy_return[ii] = app_context->list[ii];
+ (*dpy_return)[ii] = app_context->list[ii];
UNLOCK_APP(app_context);
}
diff --git a/src/Error.c b/src/Error.c
index 27186d6..5dc5224 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Error.c,v 3.12 2001/12/14 19:56:11 dawes Exp $ */
/*
@@ -61,6 +62,7 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include <stdio.h>
+#include <stdlib.h>
/* The error handlers in the application context aren't used since we can't
come up with a uniform way of using them. If you can, define
@@ -281,7 +283,7 @@ in this environment. You may get a more descriptive message by running the\n\
program as a non-root user or by removing the suid bit on the executable.");
(*fn)(buffer); /* if *fn is an ErrorHandler it should exit */
}
- }
+ }
#endif
else {
/*
diff --git a/src/Event.c b/src/Event.c
index 47d1e43..fa08dd0 100644
--- a/src/Event.c
+++ b/src/Event.c
@@ -58,17 +58,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Event.c,v 3.10 2001/12/14 19:56:11 dawes Exp $ */
#include "IntrinsicI.h"
#include "Shell.h"
#include "StringDefs.h"
-#ifdef __STDC__
-#define Const const
-#else
-#define Const /**/
-#endif
-
typedef struct _XtEventRecExt {
int type;
XtPointer select_data[1]; /* actual dimension is [mask] */
@@ -269,7 +264,7 @@ AddEventHandler(widget, select_data, type, has_type_specifier, other, proc,
XtListPosition position;
{
register XtEventRec *p, **pp;
- EventMask oldMask, eventMask;
+ EventMask oldMask = 0, eventMask = 0;
if (!has_type_specifier) {
eventMask = *(EventMask*)select_data & ~NonMaskableMask;
@@ -583,7 +578,7 @@ typedef struct _WWTable {
WWPair pairs; /* bogus entries */
} *WWTable;
-static Const WidgetRec WWfake; /* placeholder for deletions */
+static const WidgetRec WWfake; /* placeholder for deletions */
#define WWHASH(tab,win) ((win) & tab->mask)
#define WWREHASHVAL(tab,win) ((((win) % tab->rehash) + 2) | 1)
@@ -1239,7 +1234,7 @@ char * arg;
return(FALSE);
}
-static EventMask Const masks[] = {
+static EventMask const masks[] = {
0, /* Error, should never see */
0, /* Reply, should never see */
KeyPressMask, /* KeyPress */
@@ -1314,11 +1309,12 @@ static Widget LookupSpringLoaded(grabList)
XtGrabList gl;
for (gl = grabList; gl != NULL; gl = gl->next) {
- if (gl->spring_loaded)
+ if (gl->spring_loaded) {
if (XtIsSensitive(gl->widget))
return gl->widget;
else
return NULL;
+ }
if (gl->exclusive) break;
}
return NULL;
@@ -1338,10 +1334,10 @@ static Boolean DispatchEvent(event, widget)
if (nextEvent.type == LeaveNotify &&
event->xcrossing.window == nextEvent.xcrossing.window &&
nextEvent.xcrossing.mode == NotifyNormal &&
- (event->xcrossing.detail != NotifyInferior &&
- nextEvent.xcrossing.detail != NotifyInferior ||
- event->xcrossing.detail == NotifyInferior &&
- nextEvent.xcrossing.detail == NotifyInferior)) {
+ ((event->xcrossing.detail != NotifyInferior &&
+ nextEvent.xcrossing.detail != NotifyInferior) ||
+ (event->xcrossing.detail == NotifyInferior &&
+ nextEvent.xcrossing.detail == NotifyInferior))) {
/* skip the enter/leave pair */
XNextEvent(event->xcrossing.display, &nextEvent);
return False;
@@ -1432,8 +1428,6 @@ Boolean _XtDefaultDispatcher(event)
EventMask mask = _XtConvertTypeToMask(event->type);
Widget dspWidget;
Boolean was_filtered = False;
- extern Widget _XtFindRemapWidget();
- extern void _XtUngrabBadGrabs();
dspWidget = _XtFindRemapWidget(event, widget, mask, pdi);
diff --git a/src/EventUtil.c b/src/EventUtil.c
index 54bdfc0..d14f952 100644
--- a/src/EventUtil.c
+++ b/src/EventUtil.c
@@ -59,10 +59,12 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/EventUtil.c,v 1.6 2001/12/14 19:56:13 dawes Exp $ */
#include "IntrinsicI.h"
#include "PassivGraI.h"
#include "StringDefs.h"
+#include "EventI.h"
static XContext perWidgetInputContext = 0;
diff --git a/src/GCManager.c b/src/GCManager.c
index e80c758..5cd2b25 100644
--- a/src/GCManager.c
+++ b/src/GCManager.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/GCManager.c,v 1.6 2001/12/14 19:56:14 dawes Exp $ */
#include "IntrinsicI.h"
@@ -89,13 +90,13 @@ typedef struct _GCrec {
GCClipXOrigin | GCClipYOrigin | GCDashOffset | \
GCArcMode)
-static Bool Matches(dpy, ptr, valueMask, v, readOnlyMask, dynamicMask)
- Display *dpy;
- GCptr ptr;
- register XtGCMask valueMask;
- register XGCValues *v;
- XtGCMask readOnlyMask;
- XtGCMask dynamicMask;
+static Bool Matches(
+ Display *dpy,
+ GCptr ptr,
+ register XtGCMask valueMask,
+ register XGCValues *v,
+ XtGCMask readOnlyMask,
+ XtGCMask dynamicMask)
{
XGCValues gcv;
register XtGCMask checkMask;
diff --git a/src/Geometry.c b/src/Geometry.c
index 1d901eb..d07f1e1 100644
--- a/src/Geometry.c
+++ b/src/Geometry.c
@@ -58,13 +58,15 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Geometry.c,v 1.12 2001/12/14 19:56:15 dawes Exp $ */
#include "IntrinsicI.h"
#include "ShellP.h"
+#include "ShellI.h"
-static void ClearRectObjAreas(r, old)
- RectObj r;
- XWindowChanges* old;
+static void ClearRectObjAreas(
+ RectObj r,
+ XWindowChanges* old)
{
Widget pw = _XtWindowedAncestor((Widget)r);
int bw2;
@@ -99,7 +101,7 @@ _XtMakeGeometryRequest (widget, request, reply, clear_rect_obj)
Boolean * clear_rect_obj;
{
XtWidgetGeometry junk;
- XtGeometryHandler manager;
+ XtGeometryHandler manager = (XtGeometryHandler) NULL;
XtGeometryResult returnCode;
Widget parent = widget->core.parent;
Boolean managed, parentRealized, rgm = False;
@@ -156,32 +158,52 @@ _XtMakeGeometryRequest (widget, request, reply, clear_rect_obj)
"non-shell has no parent in XtMakeGeometryRequest",
(String *)NULL, (Cardinal *)NULL);
- /*
- * This shouldn't ever happen, we only test for this to pass VSW5.
- * Normally managing the widget will catch this, but VSW5 does
- * some really screwy stuff to get here.
- */
- if (!XtIsComposite(parent))
+ managed = XtIsManaged(widget);
+ parentRealized = XtIsRealized(parent);
+ if (XtIsComposite(parent))
+ {
+ LOCK_PROCESS;
+ manager = ((CompositeWidgetClass) (parent->core.widget_class))
+ ->composite_class.geometry_manager;
+ UNLOCK_PROCESS;
+ }
+ }
+
+#if 0
+ /*
+ * The Xt spec says that these conditions must generate
+ * error messages (not warnings), but many Xt applications
+ * and toolkits (including parts of Xaw, Motif and Netscape)
+ * depend on the previous Xt behaviour. Thus, these tests
+ * should probably remain disabled.
+ */
+ if (parentRealized && managed) {
+ if (parent && !XtIsComposite(parent))
+ {
+ /*
+ * This shouldn't ever happen, we only test for this to pass
+ * VSW5. Normally managing the widget will catch this, but VSW5
+ * does some really screwy stuff to get here.
+ */
XtAppErrorMsg(XtWidgetToApplicationContext(widget),
"invalidParent", "xtMakeGeometryRequest",
XtCXtToolkitError,
"XtMakeGeometryRequest - parent not composite",
(String *)NULL, (Cardinal *)NULL);
-
- managed = XtIsManaged(widget);
- parentRealized = XtIsRealized(parent);
- LOCK_PROCESS;
- manager = ((CompositeWidgetClass) (parent->core.widget_class))
- ->composite_class.geometry_manager;
- UNLOCK_PROCESS;
- }
-
- if (managed && manager == (XtGeometryHandler) NULL) {
- XtErrorMsg("invalidGeometryManager","xtMakeGeometryRequest",
- XtCXtToolkitError,
- "XtMakeGeometryRequest - parent has no geometry manager",
- (String *)NULL, (Cardinal *)NULL);
+ }
+ else if (manager == (XtGeometryHandler) NULL)
+ {
+ XtAppErrorMsg(XtWidgetToApplicationContext(widget),
+ "invalidGeometryManager","xtMakeGeometryRequest",
+ XtCXtToolkitError,
+ "XtMakeGeometryRequest - parent has no geometry manager",
+ (String *)NULL, (Cardinal *)NULL);
+ }
}
+#else
+ if (!manager)
+ managed = False;
+#endif
if (widget->core.being_destroyed) {
CALLGEOTAT(_XtGeoTab(-1));
@@ -392,11 +414,12 @@ _XtMakeGeometryRequest (widget, request, reply, clear_rect_obj)
if (req.changeMask & CWStackMode) {
req.changes.stack_mode = request->stack_mode;
CALLGEOTAT(_XtGeoTrace(widget,"stack_mode changing\n"));
- if (req.changeMask & CWSibling)
+ if (req.changeMask & CWSibling) {
if (XtIsWidget(request->sibling))
req.changes.sibling = XtWindow(request->sibling);
else
req.changeMask &= ~(CWStackMode | CWSibling);
+ }
}
#ifdef XT_GEO_TATTLER
@@ -514,16 +537,18 @@ XtMakeResizeRequest (widget, width, height, replyWidth, replyHeight)
} else {
r = _XtMakeGeometryRequest(widget, &request, &reply, &junk);
}
- if (replyWidth != NULL)
+ if (replyWidth != NULL) {
if (r == XtGeometryAlmost && reply.request_mode & CWWidth)
*replyWidth = reply.width;
else
*replyWidth = width;
- if (replyHeight != NULL)
+ }
+ if (replyHeight != NULL) {
if (r == XtGeometryAlmost && reply.request_mode & CWHeight)
*replyHeight = reply.height;
else
*replyHeight = height;
+ }
UNLOCK_APP(app);
return ((r == XtGeometryDone) ? XtGeometryYes : r);
} /* XtMakeResizeRequest */
@@ -727,7 +752,6 @@ void XtTranslateCoords(w, x, y, rootx, rooty)
(String *)NULL, (Cardinal *)NULL);
else {
Position x, y;
- extern void _XtShellGetCoordinates();
_XtShellGetCoordinates( w, &x, &y );
*rootx += x + w->core.border_width;
*rooty += y + w->core.border_width;
diff --git a/src/GetResList.c b/src/GetResList.c
index 7def21e..7b60b33 100644
--- a/src/GetResList.c
+++ b/src/GetResList.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/GetResList.c,v 3.6 2001/12/14 19:56:16 dawes Exp $ */
/*
@@ -60,11 +61,14 @@ in this Software without prior written authorization from The Open Group.
*/
#include "IntrinsicI.h"
+#include "Intrinsic.h"
/*
* XtGetResourceList(), XtGetConstraintResourceList()
*/
+#define TOXRMQUARK(p) ((XrmQuark)(long)(p)) /* avoid LP64 warnings */
+
void XtGetResourceList(widget_class, resources, num_resources)
WidgetClass widget_class;
XtResourceList *resources;
@@ -95,17 +99,17 @@ void XtGetResourceList(widget_class, resources, num_resources)
for (i = 0; i < widget_class->core_class.num_resources; i++) {
if (list[i] != NULL) {
dlist[dest].resource_name = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_name);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_name));
dlist[dest].resource_class = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_class);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_class));
dlist[dest].resource_type = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_type);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_type));
dlist[dest].resource_size = list[i]->resource_size;
/* trust that resource_offset isn't that big */
dlist[dest].resource_offset = (Cardinal)
-((int)(list[i]->resource_offset + 1));
dlist[dest].default_type = (String)
- XrmQuarkToString((XrmQuark) list[i]->default_type);
+ XrmQuarkToString(TOXRMQUARK(list[i]->default_type));
dlist[dest].default_addr = list[i]->default_addr;
dest++;
}
@@ -115,8 +119,7 @@ void XtGetResourceList(widget_class, resources, num_resources)
}
-static Boolean ClassIsSubclassOf(class, superclass)
- WidgetClass class, superclass;
+static Boolean ClassIsSubclassOf(WidgetClass class, WidgetClass superclass)
{
for (; class != NULL; class = class->core_class.superclass) {
if (class == superclass) return True;
@@ -167,17 +170,17 @@ void XtGetConstraintResourceList(widget_class, resources, num_resources)
for (i = 0; i < class->constraint_class.num_resources; i++) {
if (list[i] != NULL) {
dlist[dest].resource_name = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_name);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_name));
dlist[dest].resource_class = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_class);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_class));
dlist[dest].resource_type = (String)
- XrmQuarkToString((XrmQuark) list[i]->resource_type);
+ XrmQuarkToString(TOXRMQUARK(list[i]->resource_type));
dlist[dest].resource_size = list[i]->resource_size;
/* trust that resource_offset isn't that big */
dlist[dest].resource_offset = (Cardinal)
-((int)(list[i]->resource_offset + 1));
dlist[dest].default_type = (String)
- XrmQuarkToString((XrmQuark) list[i]->default_type);
+ XrmQuarkToString(TOXRMQUARK(list[i]->default_type));
dlist[dest].default_addr = list[i]->default_addr;
dest++;
}
diff --git a/src/GetValues.c b/src/GetValues.c
index 19131f7..0434500 100644
--- a/src/GetValues.c
+++ b/src/GetValues.c
@@ -59,19 +59,17 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/GetValues.c,v 1.3 2001/12/14 19:56:16 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
-extern void _XtCopyToArg();
-extern XrmResourceList* _XtCreateIndirectionTable();
-
-static int GetValues(base, res, num_resources, args, num_args)
- char* base; /* Base address to fetch values from */
- XrmResourceList* res; /* The current resource values. */
- register Cardinal num_resources; /* number of items in resources */
- ArgList args; /* The resource values requested */
- Cardinal num_args; /* number of items in arg list */
+static int GetValues(
+ char* base, /* Base address to fetch values from */
+ XrmResourceList* res, /* The current resource values. */
+ register Cardinal num_resources, /* number of items in resources */
+ ArgList args, /* The resource values requested */
+ Cardinal num_args) /* number of items in arg list */
{
register ArgList arg;
register int i;
@@ -122,11 +120,11 @@ static int GetValues(base, res, num_resources, args, num_args)
return translation_arg_num;
} /* GetValues */
-static void CallGetValuesHook(widget_class, w, args, num_args)
- WidgetClass widget_class;
- Widget w;
- ArgList args;
- Cardinal num_args;
+static void CallGetValuesHook(
+ WidgetClass widget_class,
+ Widget w,
+ ArgList args,
+ Cardinal num_args)
{
WidgetClass superclass;
XtArgsProc get_values_hook;
@@ -146,11 +144,11 @@ static void CallGetValuesHook(widget_class, w, args, num_args)
-static void CallConstraintGetValuesHook(widget_class, w, args, num_args)
- WidgetClass widget_class;
- Widget w;
- ArgList args;
- Cardinal num_args;
+static void CallConstraintGetValuesHook(
+ WidgetClass widget_class,
+ Widget w,
+ ArgList args,
+ Cardinal num_args)
{
ConstraintClassExtension ext;
diff --git a/src/HookObj.c b/src/HookObj.c
index fa95c0c..881e55f 100644
--- a/src/HookObj.c
+++ b/src/HookObj.c
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/HookObj.c,v 1.3 2001/12/14 19:56:17 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
@@ -56,7 +57,9 @@ static XtResource resources[] = {
XtOffsetOf(HookObjRec, hooks.num_shells), XtRImmediate, (XtPointer) 0 }
};
-static void GetValuesHook(), Initialize();
+static void GetValuesHook(Widget widget, ArgList args, Cardinal *num_args);
+static void Initialize(Widget req, Widget new, ArgList args,
+ Cardinal *num_args);
externaldef(hookobjclassrec) HookObjClassRec hookObjClassRec = {
{ /* Object Class Part */
@@ -101,9 +104,10 @@ externaldef(hookobjclassrec) HookObjClassRec hookObjClassRec = {
externaldef(hookObjectClass) WidgetClass hookObjectClass =
(WidgetClass)&hookObjClassRec;
-static void FreeShellList(w, closure, call_data)
- Widget w;
- XtPointer closure, call_data;
+static void FreeShellList(
+ Widget w,
+ XtPointer closure,
+ XtPointer call_data)
{
HookObject h = (HookObject)w;
if (h->hooks.shells != NULL)
diff --git a/src/Hooks.c b/src/Hooks.c
index 5878d61..ad4cc19 100644
--- a/src/Hooks.c
+++ b/src/Hooks.c
@@ -25,15 +25,17 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Hooks.c,v 1.3 2001/12/14 19:56:18 dawes Exp $ */
/*LINTLIBRARY*/
#include "IntrinsicI.h"
+#include "CreateI.h"
-static void FreeBlockHookList( widget, closure, call_data )
- Widget widget; /* unused (and invalid) */
- XtPointer closure; /* ActionHook* */
- XtPointer call_data; /* unused */
+static void FreeBlockHookList(
+ Widget widget, /* unused (and invalid) */
+ XtPointer closure, /* ActionHook* */
+ XtPointer call_data) /* unused */
{
BlockHook list = *(BlockHook*)closure;
while (list != NULL) {
@@ -88,9 +90,10 @@ void XtRemoveBlockHook( id )
UNLOCK_APP(app);
}
-static void DeleteShellFromHookObj(shell, closure, call_data)
- Widget shell;
- XtPointer closure, call_data;
+static void DeleteShellFromHookObj(
+ Widget shell,
+ XtPointer closure,
+ XtPointer call_data)
{
/* app_con is locked when this function is called */
int ii, jj;
@@ -147,7 +150,6 @@ Boolean _XtIsHookObject(widget)
Widget XtHooksOfDisplay(dpy)
Display* dpy;
{
- extern Widget _XtCreateHookObj();
Widget retval;
XtPerDisplay pd;
DPY_TO_APPCON(dpy);
diff --git a/src/Initialize.c b/src/Initialize.c
index 74e9c0b..6c2a300 100644
--- a/src/Initialize.c
+++ b/src/Initialize.c
@@ -1,4 +1,4 @@
-/* $Xorg: Initialize.c,v 1.9 2001/03/19 14:27:27 coskrey Exp $ */
+/* $Xorg: Initialize.c,v 1.8 2001/02/09 02:03:55 xorgcvs Exp $ */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Initialize.c,v 3.20 2002/04/10 16:20:07 tsi Exp $ */
/*
@@ -76,19 +77,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xos_r.h>
#endif
-#ifdef __STDC__
-#define Const const
-#else
-#define Const /**/
-#endif
-
-#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
-#else
-extern char *getenv();
-#endif
-
-extern void _XtConvertInitialize();
#if (defined(SUNSHLIB) || defined(AIXSHLIB)) && defined(SHAREDCODE)
/*
@@ -126,7 +115,7 @@ extern void _XtConvertInitialize();
policy, which the toolkit avoids but I hate differing programs at this level.
*/
-static XrmOptionDescRec Const opTable[] = {
+static XrmOptionDescRec const opTable[] = {
{"+rv", "*reverseVideo", XrmoptionNoArg, (XtPointer) "off"},
{"+synchronous","*synchronous", XrmoptionNoArg, (XtPointer) "off"},
{"-background", "*background", XrmoptionSepArg, (XtPointer) NULL},
@@ -159,13 +148,12 @@ static XrmOptionDescRec Const opTable[] = {
* GetHostname - emulates gethostname() on non-bsd systems.
*/
-static void GetHostname (buf, maxlen)
- char *buf;
- int maxlen;
+static void GetHostname (
+ char *buf,
+ int maxlen)
{
- int len;
-
#ifdef USE_UNAME
+ int len;
struct utsname name;
if (maxlen <= 0 || buf == NULL)
@@ -206,7 +194,6 @@ void _XtInherit()
void XtToolkitInitialize()
{
- extern void _XtResourceListInitialize();
static Boolean initialized = False;
LOCK_PROCESS;
@@ -224,6 +211,12 @@ void XtToolkitInitialize()
_XtConvertInitialize();
_XtEventInitialize();
_XtTranslateInitialize();
+
+ /* Some apps rely on old (broken) XtAppPeekEvent behavior */
+ if(getenv("XTAPPPEEKEVENT_SKIPTIMER"))
+ XtAppPeekEvent_SkipTimer = True;
+ else
+ XtAppPeekEvent_SkipTimer = False;
}
@@ -240,7 +233,9 @@ String _XtGetUserName(dest, len)
} else
*dest = '\0';
#else
+#ifdef X_NEEDS_PWPARAMS
_Xgetpwparams pwparams;
+#endif
struct passwd *pw;
char* ptr;
@@ -259,9 +254,9 @@ String _XtGetUserName(dest, len)
}
-static String GetRootDirName(dest, len)
- String dest;
- int len;
+static String GetRootDirName(
+ String dest,
+ int len)
{
#ifdef WIN32
register char *ptr1;
@@ -282,7 +277,9 @@ static String GetRootDirName(dest, len)
else
*dest = '\0';
#else
+#ifdef X_NEEDS_PWPARAMS
_Xgetpwparams pwparams;
+#endif
struct passwd *pw;
static char *ptr;
@@ -307,9 +304,9 @@ static String GetRootDirName(dest, len)
return dest;
}
-static void CombineAppUserDefaults(dpy, pdb)
- Display *dpy;
- XrmDatabase *pdb;
+static void CombineAppUserDefaults(
+ Display *dpy,
+ XrmDatabase *pdb)
{
char* filename;
char* path;
@@ -347,9 +344,9 @@ static void CombineAppUserDefaults(dpy, pdb)
if (deallocate) DEALLOCATE_LOCAL(path);
}
-static void CombineUserDefaults(dpy, pdb)
- Display *dpy;
- XrmDatabase *pdb;
+static void CombineUserDefaults(
+ Display *dpy,
+ XrmDatabase *pdb)
{
char *slashDotXdefaults = "/.Xdefaults";
char *dpy_defaults = XResourceManagerString(dpy);
@@ -366,20 +363,19 @@ static void CombineUserDefaults(dpy, pdb)
}
/*ARGSUSED*/
-static Bool StoreDBEntry(db, bindings, quarks, type, value, data)
- XrmDatabase *db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation *type;
- XrmValuePtr value;
- XPointer data;
+static Bool StoreDBEntry(
+ XrmDatabase *db,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation *type,
+ XrmValuePtr value,
+ XPointer data)
{
XrmQPutResource((XrmDatabase *)data, bindings, quarks, *type, value);
return False;
}
-static XrmDatabase CopyDB(db)
- XrmDatabase db;
+static XrmDatabase CopyDB(XrmDatabase db)
{
XrmDatabase copy = NULL;
XrmQuark empty = NULLQUARK;
@@ -390,10 +386,10 @@ static XrmDatabase CopyDB(db)
}
/*ARGSUSED*/
-static String _XtDefaultLanguageProc(dpy, xnl, closure)
- Display *dpy; /* unused */
- String xnl;
- XtPointer closure; /* unused */
+static String _XtDefaultLanguageProc(
+ Display *dpy, /* unused */
+ String xnl,
+ XtPointer closure) /* unused */
{
if (! setlocale(LC_ALL, xnl))
XtWarning("locale not supported by C library, locale unchanged");
@@ -566,14 +562,17 @@ XrmDatabase XtScreenDatabase(screen)
* Caller is responsible for freeing the returned option table.
*/
-static void _MergeOptionTables(src1, num_src1, src2, num_src2, dst, num_dst)
- XrmOptionDescRec *src1, *src2;
- Cardinal num_src1, num_src2;
- XrmOptionDescRec **dst;
- Cardinal *num_dst;
+static void _MergeOptionTables(
+ const XrmOptionDescRec *src1,
+ Cardinal num_src1,
+ const XrmOptionDescRec *src2,
+ Cardinal num_src2,
+ XrmOptionDescRec **dst,
+ Cardinal *num_dst)
{
XrmOptionDescRec *table, *endP;
- register XrmOptionDescRec *opt1, *opt2, *whereP, *dstP;
+ register XrmOptionDescRec *opt1, *whereP, *dstP;
+ const register XrmOptionDescRec *opt2;
int i1, i2, dst_len, order;
Boolean found;
enum {Check, NotSorted, IsSorted} sort_order = Check;
@@ -636,11 +635,13 @@ static void _MergeOptionTables(src1, num_src1, src2, num_src2, dst, num_dst)
/* NOTE: name, class, and type must be permanent strings */
-static Boolean _GetResource(dpy, list, name, class, type, value)
- Display *dpy;
- XrmSearchList list;
- String name, class, type;
- XrmValue* value;
+static Boolean _GetResource(
+ Display *dpy,
+ XrmSearchList list,
+ String name,
+ String class,
+ String type,
+ XrmValue* value)
{
XrmRepresentation db_type;
XrmValue db_value;
@@ -721,9 +722,9 @@ XrmDatabase _XtPreparseCommandLine(urlist, num_urs, argc, argv, applName,
}
-static void GetLanguage(dpy, pd)
- Display *dpy;
- XtPerDisplay pd;
+static void GetLanguage(
+ Display *dpy,
+ XtPerDisplay pd)
{
XrmRepresentation type;
XrmValue value;
@@ -757,20 +758,20 @@ static void GetLanguage(dpy, pd)
UNLOCK_PROCESS;
}
-static void ProcessInternalConnection (client_data, fd, id)
- XtPointer client_data;
- int* fd;
- XtInputId* id;
+static void ProcessInternalConnection (
+ XtPointer client_data,
+ int* fd,
+ XtInputId* id)
{
XProcessInternalConnection ((Display *) client_data, *fd);
}
-static void ConnectionWatch (dpy, client_data, fd, opening, watch_data)
- Display* dpy;
- XPointer client_data;
- int fd;
- Bool opening;
- XPointer* watch_data;
+static void ConnectionWatch (
+ Display* dpy,
+ XPointer client_data,
+ int fd,
+ Bool opening,
+ XPointer* watch_data)
{
XtInputId* iptr;
XtAppContext app = XtDisplayToApplicationContext(dpy);
diff --git a/src/Intrinsic.c b/src/Intrinsic.c
index 71e5ab4..2629775 100644
--- a/src/Intrinsic.c
+++ b/src/Intrinsic.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Intrinsic.c,v 3.22 2003/01/12 03:55:46 tsi Exp $ */
/*
@@ -70,11 +71,7 @@ in this Software without prior written authorization from The Open Group.
#include <sys/stat.h>
#endif /* VMS */
-#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
-#else
-extern char *getenv();
-#endif
String XtCXtToolkitError = "XtToolkitError";
@@ -582,7 +579,7 @@ static Widget SearchChildren(root, names, bindings, matchproc,
NameMatchProc matchproc;
int in_depth, *out_depth, *found_depth;
{
- Widget w1, w2;
+ Widget w1 = 0, w2;
int d1, d2;
if (XtIsComposite(root)) {
@@ -868,7 +865,7 @@ Boolean XtIsObject(object)
return True;
}
-#if defined(WIN32) || defined(__EMX__)
+#if defined(WIN32)
static int access_file (path, pathbuf, len_pathbuf, pathret)
char* path;
char* pathbuf;
@@ -906,7 +903,7 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
/* try the places set in the environment */
drive = getenv ("_XBASEDRIVE");
-#ifdef __EMX__
+#ifdef __UNIXOS2__
if (!drive)
drive = getenv ("X11ROOT");
#endif
@@ -921,7 +918,7 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret)
return 1;
}
-#ifndef __EMX__
+#ifndef __UNIXOS2__
/* one last place to look */
drive = getenv ("HOMEDRIVE");
if (drive) {
@@ -965,7 +962,7 @@ static Boolean TestFile(path)
#ifndef VMS
int ret = 0;
struct stat status;
-#if defined(WIN32) || defined(__EMX__) /* || defined(OS2) */
+#if defined(WIN32)
char buf[MAX_PATH];
char* bufp;
int len;
@@ -983,7 +980,7 @@ static Boolean TestFile(path)
#else
(status.st_mode & S_IFDIR) == 0); /* not a directory */
#endif /* X_NOT_POSIX else */
-#if defined(WIN32) || defined(__EMX__) /* || defined(OS2) */
+#if defined(WIN32)
XtStackFree ((XtPointer)bufp, buf);
#endif
return ret;
@@ -1122,16 +1119,24 @@ String XtFindFile(path, substitutions, num_substitutions, predicate)
continue;
}
if (*colon == ':')
+#ifdef __UNIXOS2__
+ if (colon > (path+1))
+#endif
break;
}
len = colon - path;
if (Resolve(path, len, substitutions, num_substitutions,
buf, '/')) {
if (firstTime || strcmp(buf1,buf2) != 0) {
+#ifdef __UNIXOS2__
+ {
+ char *bufx = (char*)__XOS2RedirRoot(buf);
+ strcpy(buf,bufx);
+ }
+#endif
#ifdef XNL_DEBUG
printf("Testing file %s\n", buf);
#endif /* XNL_DEBUG */
-
/* Check out the file */
if ((*predicate) (buf)) {
/* We've found it, return it */
@@ -1171,85 +1176,97 @@ static char *ExtractLocaleName(lang)
String lang;
{
-#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32)
-#ifdef hpux
+#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32) || defined(__UNIXOS2__) || defined (linux)
+# ifdef hpux
/*
* We need to discriminated between HPUX 9 and HPUX 10. The equivalent
* code in Xlib in SetLocale.c does include locale.h via X11/Xlocale.h.
*/
-#include <locale.h>
-#ifndef _LastCategory
-/* HPUX 9 and earlier */
-#define SKIPCOUNT 2
-#define STARTCHAR ':'
-#define ENDCHAR ';'
-#else
-/* HPUX 10 */
-#define ENDCHAR ' '
-#endif
-#else
-#ifdef ultrix
-#define SKIPCOUNT 2
-#define STARTCHAR '\001'
-#define ENDCHAR '\001'
-#else
-#ifdef WIN32
-#define SKIPCOUNT 1
-#define STARTCHAR '='
-#define ENDCHAR ';'
-#define WHITEFILL
-#else
-#if defined(__osf__) || (defined(AIXV3) && !defined(AIXV4))
-#define STARTCHAR ' '
-#define ENDCHAR ' '
-#else
-#if !defined(sun) || defined(SVR4)
-#define STARTCHAR '/'
-#endif
-#define ENDCHAR '/'
-#endif
-#endif
-#endif
-#endif
+# include <locale.h>
+# ifndef _LastCategory
+ /* HPUX 9 and earlier */
+# define SKIPCOUNT 2
+# define STARTCHAR ':'
+# define ENDCHAR ';'
+# else
+ /* HPUX 10 */
+# define ENDCHAR ' '
+# endif
+# else
+# ifdef ultrix
+# define SKIPCOUNT 2
+# define STARTCHAR '\001'
+# define ENDCHAR '\001'
+# else
+# if defined(WIN32) || defined(__UNIXOS2__)
+# define SKIPCOUNT 1
+# define STARTCHAR '='
+# define ENDCHAR ';'
+# define WHITEFILL
+# else
+# if defined(__osf__) || (defined(AIXV3) && !defined(AIXV4))
+# define STARTCHAR ' '
+# define ENDCHAR ' '
+# else
+# if defined(linux)
+# define STARTSTR "LC_CTYPE="
+# define ENDCHAR ';'
+# else
+# if !defined(sun) || defined(SVR4)
+# define STARTCHAR '/'
+# define ENDCHAR '/'
+# endif
+# endif
+# endif
+# endif
+# endif
+# endif
char *start;
char *end;
int len;
-#ifdef SKIPCOUNT
+# ifdef SKIPCOUNT
int n;
-#endif
+# endif
static char* buf = NULL;
start = lang;
-#ifdef SKIPCOUNT
+# ifdef SKIPCOUNT
for (n = SKIPCOUNT;
--n >= 0 && start && (start = strchr (start, STARTCHAR));
start++)
;
if (!start)
start = lang;
-#endif
-#ifdef STARTCHAR
- if (start && (start = strchr (start, STARTCHAR))) {
- start++;
-#endif
- if (end = strchr (start, ENDCHAR)) {
+# endif
+# ifdef STARTCHAR
+ if (start && (start = strchr (start, STARTCHAR)))
+# elif defined (STARTSTR)
+ if (start && (start = strstr (start,STARTSTR)))
+# endif
+ {
+# ifdef STARTCHAR
+ start++;
+# elif defined (STARTSTR)
+ start += strlen(STARTSTR);
+# endif
+
+ if ((end = strchr (start, ENDCHAR))) {
len = end - start;
if (buf != NULL) XtFree (buf);
buf = XtMalloc (len + 1);
if (buf == NULL) return NULL;
strncpy(buf, start, len);
*(buf + len) = '\0';
-#ifdef WHITEFILL
+# ifdef WHITEFILL
for (start = buf; start = strchr(start, ' '); )
*start++ = '-';
-#endif
+# endif
return buf;
- }
-#ifdef STARTCHAR
+ } else /* if no ENDCHAR is found we are at the end of the line */
+ return start;
}
-#endif
-#ifdef WHITEFILL
+# ifdef WHITEFILL
if (strchr(lang, ' ')) {
if (buf != NULL) XtFree (buf);
else buf = XtMalloc (strlen (lang) + 1);
@@ -1259,10 +1276,10 @@ static char *ExtractLocaleName(lang)
*start++ = '-';
return buf;
}
-#endif
-#undef STARTCHAR
-#undef ENDCHAR
-#undef WHITEFILL
+# endif
+# undef STARTCHAR
+# undef ENDCHAR
+# undef WHITEFILL
#endif
return lang;
@@ -1337,7 +1354,7 @@ static char *implementation_default_path(void)
static char *implementation_default_path()
#endif
{
-#ifdef WIN32
+#if defined(WIN32) || defined(__UNIXOS2__)
/* if you know how to pass % thru the compiler let me know */
static char xfilesearchpath[] = XFILESEARCHPATHDEFAULT;
static Bool fixed;
@@ -1619,19 +1636,13 @@ int direction ;
void
-#if NeedVarargsPrototypes
_XtGeoTrace (Widget widget, ...)
-#else
-_XtGeoTrace (widget, va_alist)
-Widget widget;
-va_dcl
-#endif
{
va_list args;
char *fmt;
int i ;
if (IsTattled(widget)) {
- Va_start(args, widget);
+ va_start(args, widget);
fmt = va_arg(args, char *);
for (i=0; i<n_tab; i++) printf(" ");
(void) vprintf(fmt, args);
diff --git a/src/Keyboard.c b/src/Keyboard.c
index 5f1e84e..0bfdf96 100644
--- a/src/Keyboard.c
+++ b/src/Keyboard.c
@@ -59,13 +59,14 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Keyboard.c,v 3.4 2001/12/14 19:56:26 dawes Exp $ */
#include "IntrinsicI.h"
#include "PassivGraI.h"
+#include "EventI.h"
#define _GetWindowedAncestor(w) (XtIsWidget(w) ? w : _XtWindowedAncestor(w))
-extern void _XtFillAncestorList();
extern void _XtSendFocusEvent();
/* InActiveSubtree cache of the current focus source and its ancestors */
diff --git a/src/Manage.c b/src/Manage.c
index 98ad68e..03c1472 100644
--- a/src/Manage.c
+++ b/src/Manage.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Manage.c,v 3.8 2001/12/14 19:56:26 dawes Exp $ */
/*
@@ -66,18 +67,18 @@ static String XtNxtUnmanageChildren = "xtUnmanageChildren";
static String XtNxtManageChildren = "xtManageChildren";
static String XtNxtChangeManagedSet = "xtChangeManagedSet";
-static void UnmanageChildren(children, num_children, parent, num_unique_children, call_change_managed, caller_func)
- WidgetList children;
- Cardinal num_children;
- Widget parent;
- Cardinal* num_unique_children;
- Boolean call_change_managed;
- String caller_func;
+static void UnmanageChildren(
+ WidgetList children,
+ Cardinal num_children,
+ Widget parent,
+ Cardinal* num_unique_children,
+ Boolean call_change_managed,
+ String caller_func)
{
Widget child;
Cardinal i;
- XtWidgetProc change_managed;
- Bool parent_realized;
+ XtWidgetProc change_managed = NULL;
+ Bool parent_realized = False;
*num_unique_children = 0;
@@ -189,20 +190,20 @@ void XtUnmanageChild(child)
} /* XtUnmanageChild */
-static void ManageChildren(children, num_children, parent, call_change_managed, caller_func)
- WidgetList children;
- Cardinal num_children;
- Widget parent;
- Boolean call_change_managed;
- String caller_func;
+static void ManageChildren(
+ WidgetList children,
+ Cardinal num_children,
+ Widget parent,
+ Boolean call_change_managed,
+ String caller_func)
{
#define MAXCHILDREN 100
Widget child;
Cardinal num_unique_children, i;
- XtWidgetProc change_managed;
+ XtWidgetProc change_managed = NULL;
WidgetList unique_children;
Widget cache[MAXCHILDREN];
- Bool parent_realized;
+ Bool parent_realized = False;
if (XtIsComposite((Widget) parent)) {
LOCK_PROCESS;
@@ -368,7 +369,7 @@ void XtSetMappedWhenManaged(widget, mapped_when_managed)
call_data.type = XtHsetMappedWhenManaged;
call_data.widget = widget;
- call_data.event_data = (XtPointer) mapped_when_managed;
+ call_data.event_data = (XtPointer) (unsigned long) mapped_when_managed;
XtCallCallbackList(hookobj,
((HookObject)hookobj)->hooks.changehook_callbacks,
(XtPointer)&call_data);
diff --git a/src/NextEvent.c b/src/NextEvent.c
index 0e6c45f..098bd16 100644
--- a/src/NextEvent.c
+++ b/src/NextEvent.c
@@ -1,4 +1,4 @@
-/* $Xorg: NextEvent.c,v 1.11 2001/03/19 14:27:27 coskrey Exp $ */
+/* $Xorg: NextEvent.c,v 1.8 2001/02/09 02:03:55 xorgcvs Exp $ */
/***********************************************************
Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/*
-Copyright 1987, 1988, 1994, 1998 The Open Group
+Copyright 1987, 1988, 1994, 1998, 2001 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
@@ -58,12 +58,14 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/NextEvent.c,v 3.26 2002/06/04 21:55:42 dawes Exp $ */
#include "IntrinsicI.h"
#include <stdio.h>
#include <errno.h>
-#ifdef X_NOT_STDC_ENV
-extern int errno;
+
+#ifdef __UNIXOS2__
+#include <sys/time.h>
#endif
static TimerEventRec* freeTimerRecs;
@@ -163,7 +165,7 @@ typedef struct {
static struct timeval zero_time = { 0 , 0};
#ifndef USE_POLL
-static fd_set zero_fd = { 0 };
+static fd_set zero_fd;
#else
#define X_BLOCK -1
#define X_DONT_BLOCK 0
@@ -334,6 +336,7 @@ static void AdjustTimes (app, block, howlong, ignoreTimers, wt)
#endif
}
+
static int IoWait (wt, wf)
wait_times_ptr_t wt;
wait_fds_ptr_t wf;
@@ -346,6 +349,7 @@ static int IoWait (wt, wf)
#endif
}
+
static void FindInputs (app, wf, nfds, ignoreEvents, ignoreInputs, dpy_no, found_input)
XtAppContext app;
wait_fds_ptr_t wf;
@@ -421,8 +425,16 @@ static void FindInputs (app, wf, nfds, ignoreEvents, ignoreInputs, dpy_no, found
if (condition) {
for (ep = app->input_list[ii]; ep; ep = ep->ie_next)
if (condition & ep->ie_condition) {
- ep->ie_oq = app->outstandingQueue;
- app->outstandingQueue = ep;
+ /* make sure this input isn't already marked outstanding */
+ InputEvent *oq;
+ for (oq = app->outstandingQueue; oq; oq = oq->ie_oq)
+ if (oq == ep)
+ break;
+ if (!oq)
+ {
+ ep->ie_oq = app->outstandingQueue;
+ app->outstandingQueue = ep;
+ }
}
*found_input = True;
}
@@ -468,8 +480,16 @@ ENDILOOP: ;
*found_input = True;
for (ep = app->input_list[fdlp->fd]; ep; ep = ep->ie_next)
if (condition & ep->ie_condition) {
- ep->ie_oq = app->outstandingQueue;
- app->outstandingQueue = ep;
+ InputEvent *oq;
+ /* make sure this input isn't already marked outstanding */
+ for (oq = app->outstandingQueue; oq; oq = oq->ie_oq)
+ if (oq == ep)
+ break;
+ if (!oq)
+ {
+ ep->ie_oq = app->outstandingQueue;
+ app->outstandingQueue = ep;
+ }
}
}
}
@@ -1071,45 +1091,10 @@ void XtRemoveInput( id )
if (found) {
app->input_count--;
- if (app->input_list[source] == NULL)
-
#ifdef USE_POLL
-
+ if (app->input_list[source] == NULL)
app->fds.nfds--;
-
-#else
-
- {
- int display;
- int source;
-
- /*
- * Search through list[] for largest connection number
- */
-
- app->fds.nfds = 0;
-
- for (display = 0; display < app->count; display++) {
- if ((ConnectionNumber(app->list[display]) + 1) > app->fds.nfds) {
- app->fds.nfds = ConnectionNumber(app->list[display]) + 1;
- }
- }
-
- /*
- * Search through input_list[] for largest input source, i.e.
- * file descriptor
- */
-
- for (source = (app->input_max - 1); ((source >= 0) && ((source +1) > app->fds.nfds)); source--) {
- if (app->input_list[source] != (InputEvent *) NULL) {
- app->fds.nfds = (source + 1);
- break;
- }
- }
- }
-
#endif
-
app->rebuild_fdlist = TRUE;
} else
XtAppWarningMsg(app, "invalidProcedure","inputHandler",
@@ -1545,6 +1530,8 @@ Boolean XtPeekEvent(event)
return XtAppPeekEvent(_XtDefaultAppContext(), event);
}
+Boolean XtAppPeekEvent_SkipTimer;
+
Boolean XtAppPeekEvent(app, event)
XtAppContext app;
XEvent *event;
@@ -1594,7 +1581,7 @@ Boolean XtAppPeekEvent(app, event)
* Check to see why a -1 was returned, if a timer expired,
* call it and block some more
*/
- if (app->timerQueue != NULL) { /* timer */
+ if ((app->timerQueue != NULL) && ! XtAppPeekEvent_SkipTimer) { /* timer */
struct timeval cur_time;
Bool did_timer = False;
@@ -1604,10 +1591,11 @@ Boolean XtAppPeekEvent(app, event)
TimerEventRec *te_ptr = app->timerQueue;
app->timerQueue = app->timerQueue->te_next;
te_ptr->te_next = NULL;
- if (te_ptr->te_proc != NULL)
+ if (te_ptr->te_proc != NULL) {
TeCallProc(te_ptr);
+ did_timer = True;
+ }
LOCK_PROCESS;
- did_timer = True;
te_ptr->te_next = freeTimerRecs;
freeTimerRecs = te_ptr;
UNLOCK_PROCESS;
@@ -1623,15 +1611,23 @@ Boolean XtAppPeekEvent(app, event)
continue; /* keep blocking */
}
}
+ /*
+ * spec is vague here; we'll assume signals also return FALSE,
+ * of course to determine whether a signal is pending requires
+ * walking the signalQueue looking for se_notice flags which
+ * this code doesn't do.
+ */
+#if 0
if (app->signalQueue != NULL) { /* signal */
- /* spec is vague here; we'll assume signals also return FALSE */
event->xany.type = 0;
event->xany.display = NULL;
event->xany.window = 0;
UNLOCK_APP(app);
return FALSE;
}
- else { /* input */
+ else
+#endif
+ { /* input */
event->xany.type = 0;
event->xany.display = NULL;
event->xany.window = 0;
diff --git a/src/Object.c b/src/Object.c
index 29d9066..fc12be5 100644
--- a/src/Object.c
+++ b/src/Object.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Object.c,v 1.6 2001/12/14 19:56:26 dawes Exp $ */
#define OBJECT
#include "IntrinsicI.h"
@@ -143,7 +144,7 @@ static void ConstructCallbackOffsets(widgetClass)
superTable = (CallbackTable)
((ObjectClass) objectClass->object_class.superclass)->
object_class.callback_private;
- tableSize = (int) superTable[0];
+ tableSize = (int)(long) superTable[0];
} else {
superTable = (CallbackTable) NULL;
tableSize = 0;
@@ -163,10 +164,10 @@ static void ConstructCallbackOffsets(widgetClass)
newTable = (CallbackTable)
__XtMalloc(sizeof(XrmResource *) * (tableSize + 1));
- newTable[0] = (XrmResource *) tableSize;
+ newTable[0] = (XrmResource *)(long) tableSize;
if (superTable)
- tableSize -= (int) superTable[0];
+ tableSize -= (int)(long) superTable[0];
resourceList = (XrmResourceList) objectClass->object_class.resources;
for (i=1; tableSize > 0; resourceList++)
if (resourceList->xrm_type == QCallback) {
@@ -175,7 +176,8 @@ static void ConstructCallbackOffsets(widgetClass)
}
if (superTable)
- for (tableSize = (int) *superTable++; --tableSize >= 0; superTable++)
+ for (tableSize = (int)(long) *superTable++;
+ --tableSize >= 0; superTable++)
newTable[i++] = *superTable;
objectClass->object_class.callback_private = (XtPointer) newTable;
@@ -252,7 +254,7 @@ static Boolean ObjectSetValues(old, request, widget, args, num_args)
/* Compile any callback lists into internal form */
offsets = (CallbackTable) XtClass(widget)->core_class.callback_private;
- for (i= (int) *(offsets++); --i >= 0; offsets++) {
+ for (i= (int)(long) *(offsets++); --i >= 0; offsets++) {
ol = (InternalCallbackList *)
((char *) old - (*offsets)->xrm_offset - 1);
nl = (InternalCallbackList *)
@@ -281,7 +283,7 @@ static void ObjectDestroy (widget)
offsets = (CallbackTable)
widget->core.widget_class->core_class.callback_private;
- for (i = (int) *(offsets++); --i >= 0; offsets++) {
+ for (i = (int)(long) *(offsets++); --i >= 0; offsets++) {
cl = *(InternalCallbackList *)
((char *) widget - (*offsets)->xrm_offset - 1);
if (cl) XtFree((char *) cl);
diff --git a/src/RectObj.c b/src/RectObj.c
index 6d4708f..bd7d5c5 100644
--- a/src/RectObj.c
+++ b/src/RectObj.c
@@ -46,10 +46,13 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/RectObj.c,v 1.3 2001/12/14 19:56:27 dawes Exp $ */
#define RECTOBJ
#include "IntrinsicI.h"
#include "StringDefs.h"
+#include "CreateI.h"
+
/******************************************************************
*
* Rectangle Object Resources
diff --git a/src/ResConfig.c b/src/ResConfig.c
index 68ccbb7..e9ac7ae 100644
--- a/src/ResConfig.c
+++ b/src/ResConfig.c
@@ -52,6 +52,7 @@ dealings in this Software without prior written authorization from the IBM
Corporation.
******************************************************************/
+/* $XFree86: xc/lib/Xt/ResConfig.c,v 3.8 2001/12/14 19:56:28 dawes Exp $ */
#include "Intrinsic.h"
#include "IntrinsicI.h"
@@ -61,10 +62,8 @@ Corporation.
#include "StringDefs.h"
#include "ResConfigP.h"
#include <X11/Xatom.h>
-
-#ifdef DEBUG
#include <stdio.h>
-#endif
+#include <stdlib.h>
#define MAX_BUFFER 512
@@ -700,7 +699,7 @@ _search_widget_tree (w, resource, value)
{
Widget parent = w;
char *last_part;
- char *remainder;
+ char *remainder = NULL;
char last_token;
char *indx, *copy;
char *loose, *tight;
@@ -992,7 +991,7 @@ _XtResourceConfigurationEH (w, client_data, event)
* resource and value fields.
*/
if (data) {
- resource_len = Strtoul (data, &data_ptr, 10);
+ resource_len = Strtoul ((void *)data, &data_ptr, 10);
data_ptr++;
data_ptr[resource_len] = '\0';
diff --git a/src/Resources.c b/src/Resources.c
index 20a56c0..d8e5d40 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -59,6 +59,8 @@ in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Resources.c,v 1.9 2001/12/14 19:56:28 dawes Exp $ */
+
/*LINTLIBRARY*/
#include "IntrinsicI.h"
#include "VarargsI.h"
@@ -370,12 +372,8 @@ void _XtCompileResourceList(resources, num_resources)
xrmres->xrm_name = PSToQ(resources->resource_name);
xrmres->xrm_class = PSToQ(resources->resource_class);
xrmres->xrm_type = PSToQ(resources->resource_type);
-#if defined(CRAY1) && !defined(__STDC__)
- xrmres->xrm_offset = -(resources->resource_offset * sizeof(long) + 1);
-#else
xrmres->xrm_offset = (Cardinal)
(-(int)resources->resource_offset - 1);
-#endif
xrmres->xrm_default_type = PSToQ(resources->default_type);
}
#undef PSToQ
@@ -395,12 +393,8 @@ static void XrmCompileResourceListEphem(resources, num_resources)
xrmres->xrm_name = StringToName(resources->resource_name);
xrmres->xrm_class = StringToClass(resources->resource_class);
xrmres->xrm_type = StringToQuark(resources->resource_type);
-#if defined(CRAY1) && !defined(__STDC__)
- xrmres->xrm_offset = -(resources->resource_offset * sizeof(long) + 1);
-#else
xrmres->xrm_offset = (Cardinal)
(-(int)resources->resource_offset - 1);
-#endif
xrmres->xrm_default_type = StringToQuark(resources->default_type);
}
#undef xrmres
@@ -413,7 +407,7 @@ static void BadSize(size, name)
String params[2];
Cardinal num_params = 2;
- params[0] = (String) size;
+ params[0] = (String)(long) size;
params[1] = XrmQuarkToString(name);
XtWarningMsg("invalidSizeOverride", "xtDependencies", XtCXtToolkitError,
"Representation size %d must match superclass's to override %s",
diff --git a/src/Selection.c b/src/Selection.c
index 846b1bd..0a5cd9d 100644
--- a/src/Selection.c
+++ b/src/Selection.c
@@ -58,11 +58,13 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Selection.c,v 3.9 2001/12/14 19:56:29 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
#include "SelectionI.h"
#include <X11/Xatom.h>
+#include <stdio.h>
void _XtSetDefaultSelectionTimeout(timeout)
unsigned long *timeout;
@@ -614,13 +616,14 @@ Boolean *cont;
XtRemoveTimeOut(req->timeout);
#endif
if (req->allSent) {
- if (ctx->notify)
+ if (ctx->notify) {
if (ctx->incremental) {
(*(XtSelectionDoneIncrProc)ctx->notify)
(ctx->widget, &ctx->selection, &req->target,
(XtRequestId*)&req, ctx->owner_closure);
}
else (*ctx->notify)(ctx->widget, &ctx->selection, &req->target);
+ }
RemoveHandler(req, (EventMask)PropertyChangeMask,
HandlePropertyGone, closure);
XtFree((char*)req);
diff --git a/src/SetSens.c b/src/SetSens.c
index 3a5e95e..96940cd 100644
--- a/src/SetSens.c
+++ b/src/SetSens.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/SetSens.c,v 1.3 2001/12/14 19:56:29 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
@@ -66,9 +67,9 @@ in this Software without prior written authorization from The Open Group.
* XtSetSensitive()
*/
-static void SetAncestorSensitive(widget, ancestor_sensitive)
- register Widget widget;
- Boolean ancestor_sensitive;
+static void SetAncestorSensitive(
+ register Widget widget,
+ Boolean ancestor_sensitive)
{
Arg args[1];
register Cardinal i;
diff --git a/src/SetValues.c b/src/SetValues.c
index e7f0c2e..7465aff 100644
--- a/src/SetValues.c
+++ b/src/SetValues.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/SetValues.c,v 1.3 2001/12/14 19:56:30 dawes Exp $ */
#include "IntrinsicI.h"
@@ -66,15 +67,12 @@ in this Software without prior written authorization from The Open Group.
*/
-extern void _XtCopyFromArg();
-extern XrmResourceList* _XtCreateIndirectionTable();
-
-static void SetValues(base, res, num_resources, args, num_args)
- char* base; /* Base address to write values to */
- XrmResourceList* res; /* The current resource values. */
- register Cardinal num_resources; /* number of items in resources */
- ArgList args; /* The resource values to set */
- Cardinal num_args; /* number of items in arg list */
+static void SetValues(
+ char* base, /* Base address to write values to */
+ XrmResourceList* res, /* The current resource values. */
+ register Cardinal num_resources, /* number of items in resources */
+ ArgList args, /* The resource values to set */
+ Cardinal num_args) /* number of items in arg list */
{
register ArgList arg;
register int i;
@@ -97,11 +95,13 @@ static void SetValues(base, res, num_resources, args, num_args)
}
} /* SetValues */
-static Boolean CallSetValues (class, current, request, new, args, num_args)
- WidgetClass class;
- Widget current, request, new;
- ArgList args;
- Cardinal num_args;
+static Boolean CallSetValues (
+ WidgetClass class,
+ Widget current,
+ Widget request,
+ Widget new,
+ ArgList args,
+ Cardinal num_args)
{
Boolean redisplay = FALSE;
WidgetClass superclass;
@@ -130,11 +130,13 @@ static Boolean CallSetValues (class, current, request, new, args, num_args)
}
static Boolean
-CallConstraintSetValues (class, current, request, new, args, num_args)
- ConstraintWidgetClass class;
- Widget current, request, new;
- ArgList args;
- Cardinal num_args;
+CallConstraintSetValues (
+ ConstraintWidgetClass class,
+ Widget current,
+ Widget request,
+ Widget new,
+ ArgList args,
+ Cardinal num_args)
{
Boolean redisplay = FALSE;
XtSetValuesFunc set_values;
@@ -189,7 +191,7 @@ void XtSetValues(w, args, num_args)
XtGeometryResult result;
XtWidgetGeometry geoReq, geoReply;
WidgetClass wc;
- ConstraintWidgetClass cwc;
+ ConstraintWidgetClass cwc = 0;
Boolean hasConstraints;
XtAlmostProc set_values_almost;
XtAppContext app = XtWidgetToApplicationContext(w);
diff --git a/src/Shell.c b/src/Shell.c
index cf9a3df..8c600d9 100644
--- a/src/Shell.c
+++ b/src/Shell.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Shell.c,v 3.15 2001/12/14 19:56:30 dawes Exp $ */
/*
@@ -69,12 +70,14 @@ in this Software without prior written authorization from The Open Group.
#include "StringDefs.h"
#include "Shell.h"
#include "ShellP.h"
+#include "ShellI.h"
#include "Vendor.h"
#include "VendorP.h"
#include <X11/Xatom.h>
#include <X11/Xlocale.h>
#include <X11/ICE/ICElib.h>
#include <stdio.h>
+#include <stdlib.h>
#ifdef EDITRES
#include <X11/Xmu/Editres.h>
@@ -682,8 +685,10 @@ externaldef(applicationshellwidgetclass) WidgetClass applicationShellWidgetClass
static XtResource sessionResources[]=
{
+#ifndef XT_NO_SM
{XtNconnection, XtCConnection, XtRSmcConn, sizeof(SmcConn),
Offset(session.connection), XtRSmcConn, (XtPointer) NULL},
+#endif
{XtNsessionID, XtCSessionID, XtRString, sizeof(String),
Offset(session.session_id), XtRString, (XtPointer) NULL},
{XtNrestartCommand, XtCRestartCommand, XtRCommandArgArray, sizeof(String*),
@@ -1085,8 +1090,6 @@ static void ApplicationInitialize(req, new, args, num_args)
#define XtRestartStyleHintMask (1L<<7)
#define XtShutdownCommandMask (1L<<8)
-extern char *getenv();
-
static void JoinSession();
static void SetSessionProperties();
static void StopManagingSession();
@@ -1113,6 +1116,7 @@ static void SessionInitialize(req, new, args, num_args)
ArgList args; /* unused */
Cardinal *num_args; /* unused */
{
+#ifndef XT_NO_SM
SessionShellWidget w = (SessionShellWidget)new;
if (w->session.session_id) w->session.session_id =
@@ -1144,6 +1148,7 @@ static void SessionInitialize(req, new, args, num_args)
if (w->session.connection)
SetSessionProperties(w, True, 0L, 0L);
+#endif /* !XT_NO_SM */
}
static void Resize(w)
@@ -1511,6 +1516,7 @@ static void _popup_set_prop(w)
"WM_CLIENT_LEADER", False),
XA_WINDOW, 32, PropModeReplace,
(unsigned char *)(&(p->core.window)), 1);
+#ifndef XT_NO_SM
if (p == (Widget) w) {
for ( ; p->core.parent != NULL; p = p->core.parent);
if (XtIsSubclass(p, sessionShellWidgetClass)) {
@@ -1526,6 +1532,7 @@ static void _popup_set_prop(w)
}
}
}
+#endif /* !XT_NO_SM */
if (wmshell->wm.window_role)
XChangeProperty(XtDisplay((Widget)w), XtWindow((Widget)w),
@@ -1696,6 +1703,7 @@ static void ApplicationDestroy(wid)
static void SessionDestroy(wid)
Widget wid;
{
+#ifndef XT_NO_SM
SessionShellWidget w = (SessionShellWidget) wid;
StopManagingSession(w, w->session.connection);
@@ -1708,6 +1716,7 @@ static void SessionDestroy(wid)
FreeStringArray(w->session.environment);
XtFree(w->session.current_dir);
XtFree(w->session.program_path);
+#endif /* !XT_NO_SM */
}
/*
@@ -1925,7 +1934,7 @@ static Bool isMine(dpy, event, arg)
return FALSE;
}
-static _wait_for_response(w, event, request_num)
+static Boolean _wait_for_response(w, event, request_num)
ShellWidget w;
XEvent *event;
unsigned long request_num;
@@ -1977,7 +1986,7 @@ static XtGeometryResult RootGeometryManager(gw, request, reply)
unsigned int mask = request->request_mode;
XEvent event;
Boolean wm;
- register struct _OldXSizeHints *hintp;
+ register struct _OldXSizeHints *hintp = NULL;
int oldx, oldy, oldwidth, oldheight, oldborder_width;
unsigned long request_num;
@@ -2247,13 +2256,14 @@ static Boolean SetValues(old, ref, new, args, num_args)
if (! (ow->shell.client_specified & _XtShellPositionValid)) {
Cardinal n;
- void _XtShellGetCoordinates();
for (n = *num_args; n; n--, args++) {
if (strcmp(XtNx, args->name) == 0) {
- _XtShellGetCoordinates(ow, &ow->core.x, &ow->core.y);
+ _XtShellGetCoordinates((Widget)ow, &ow->core.x,
+ &ow->core.y);
} else if (strcmp(XtNy, args->name) == 0) {
- _XtShellGetCoordinates(ow, &ow->core.x, &ow->core.y);
+ _XtShellGetCoordinates((Widget)ow, &ow->core.x,
+ &ow->core.y);
}
}
}
@@ -2531,6 +2541,7 @@ static Boolean SessionSetValues(current, request, new, args, num_args)
ArgList args;
Cardinal *num_args;
{
+#ifndef XT_NO_SM
SessionShellWidget nw = (SessionShellWidget) new;
SessionShellWidget cw = (SessionShellWidget) current;
unsigned long set_mask = 0L;
@@ -2629,6 +2640,7 @@ static Boolean SessionSetValues(current, request, new, args, num_args)
if ((cw->session.join_session && !nw->session.join_session) ||
(cw->session.connection && !nw->session.connection))
StopManagingSession(nw, nw->session.connection);
+#endif /* !XT_NO_SM */
if (cw->wm.client_leader != nw->wm.client_leader ||
cw->session.session_id != nw->session.session_id) {
@@ -2683,7 +2695,6 @@ static void GetValuesHook(widget, args, num_args)
Cardinal* num_args;
{
ShellWidget w = (ShellWidget) widget;
- extern void _XtCopyToArg();
/* x and y resource values may be invalid after a shell resize */
if (XtIsRealized(widget) &&
@@ -2733,13 +2744,6 @@ static void ApplicationShellInsertChild(widget)
#define XtSessionCheckpoint 0
#define XtSessionInteract 1
-extern String _XtGetUserName(
-#if NeedFunctionPrototypes
- String /* dest_dir */,
- int /* len */
-#endif
-);
-
static void CallSaveCallbacks();
static String *EditCommand();
static Boolean ExamineToken();
@@ -2750,6 +2754,7 @@ static void XtCallDieCallbacks();
static void XtCallSaveCallbacks();
static void XtCallSaveCompleteCallbacks();
+#ifndef XT_NO_SM
static void StopManagingSession(w, connection)
SessionShellWidget w;
SmcConn connection; /* connection to close, if any */
@@ -2834,6 +2839,8 @@ static void JoinSession(w)
}
#undef XT_MSG_LENGTH
+#endif /* !XT_NO_SM */
+
static String * NewStringArray(str)
String *str;
{
@@ -2872,6 +2879,7 @@ static void FreeStringArray(str)
}
+#ifndef XT_NO_SM
static SmProp * CardPack(name, closure)
char *name;
XtPointer closure;
@@ -2999,7 +3007,7 @@ static void SetSessionProperties(w, initialize, set_mask, unset_mask)
user_name = _XtGetUserName(nam_buf, sizeof nam_buf);
if (user_name)
props[num_props++] = ArrayPack(SmUserID, &user_name);
- sprintf(pid, "%d", getpid());
+ sprintf(pid, "%ld", (long)getpid());
props[num_props++] = ArrayPack(SmProcessID, &pidp);
if (num_props) {
@@ -3414,3 +3422,4 @@ static String* EditCommand(str, src1, src2)
return new;
}
+#endif /* !XT_NO_SM */
diff --git a/src/TMaction.c b/src/TMaction.c
index b185f87..a1b7b0a 100644
--- a/src/TMaction.c
+++ b/src/TMaction.c
@@ -59,6 +59,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/TMaction.c,v 3.7 2001/12/14 19:56:30 dawes Exp $ */
/* TMaction.c -- maintains the state table of actions for the translation
* manager.
@@ -592,8 +593,8 @@ void _XtBindActions(widget, tm)
int globalUnbound = 0;
Cardinal i;
TMBindData bindData = (TMBindData)tm->proc_table;
- TMSimpleBindProcs simpleBindProcs;
- TMComplexBindProcs complexBindProcs;
+ TMSimpleBindProcs simpleBindProcs = NULL;
+ TMComplexBindProcs complexBindProcs = NULL;
XtActionProc *newProcs;
Widget bindWidget;
diff --git a/src/TMgrab.c b/src/TMgrab.c
index e2a56e8..9257293 100644
--- a/src/TMgrab.c
+++ b/src/TMgrab.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/TMgrab.c,v 1.3 2001/12/14 19:56:30 dawes Exp $ */
/*LINTLIBRARY*/
#include "IntrinsicI.h"
@@ -72,11 +73,11 @@ typedef struct _GrabActionRec {
static GrabActionRec *grabActionList = NULL;
-static void GrabAllCorrectKeys(widget, typeMatch, modMatch, grabP)
- Widget widget;
- TMTypeMatch typeMatch;
- TMModifierMatch modMatch;
- GrabActionRec* grabP;
+static void GrabAllCorrectKeys(
+ Widget widget,
+ TMTypeMatch typeMatch,
+ TMModifierMatch modMatch,
+ GrabActionRec* grabP)
{
Display *dpy = XtDisplay(widget);
KeyCode *keycodes, *keycodeP;
@@ -156,9 +157,9 @@ typedef struct {
GrabActionRec *grabP;
}DoGrabRec;
-static Boolean DoGrab(state, data)
- StatePtr state;
- XtPointer data;
+static Boolean DoGrab(
+ StatePtr state,
+ XtPointer data)
{
DoGrabRec *doGrabP = (DoGrabRec *)data;
GrabActionRec* grabP = doGrabP->grabP;
diff --git a/src/TMkey.c b/src/TMkey.c
index 92fe81f..3087407 100644
--- a/src/TMkey.c
+++ b/src/TMkey.c
@@ -59,6 +59,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/TMkey.c,v 3.10 2001/12/14 19:56:30 dawes Exp $ */
#define XK_MISCELLANY
#define XK_LATIN1
@@ -68,11 +69,8 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include <X11/keysymdef.h>
-
-#ifdef __STDC__
-#define Const const
-#else
-#define Const /**/
+#ifdef XKB
+#include <X11/XKBlib.h>
#endif
#define FLUSHKEYCACHE(ctx) \
@@ -86,7 +84,7 @@ in this Software without prior written authorization from The Open Group.
*/
#define FM(i) i >> (8 - TMKEYCACHELOG2)
-static Const unsigned char modmix[256] = {
+static const unsigned char modmix[256] = {
FM(0x0f), FM(0x8f), FM(0x4f), FM(0xcf), FM(0x2f), FM(0xaf), FM(0x6f), FM(0xef),
FM(0x1f), FM(0x9f), FM(0x5f), FM(0xdf), FM(0x3f), FM(0xbf), FM(0x7f), FM(0xff),
FM(0x07), FM(0x87), FM(0x47), FM(0xc7), FM(0x27), FM(0xa7), FM(0x67), FM(0xe7),
@@ -219,8 +217,7 @@ void _XtAllocTMContext(pd)
pd->tm_context = ctx;
}
-static unsigned int num_bits(mask)
- unsigned long mask;
+static unsigned int num_bits(unsigned long mask)
{
register unsigned long y;
@@ -601,9 +598,7 @@ void XtTranslateKey(dpy, keycode, modifiers,
}
#else
{
- XkbLookupKeySym(dpy, keycode, modifiers, modifiers_return,
- keysym_return);
- return;
+ XkbLookupKeySym(dpy, keycode, modifiers, modifiers_return, keysym_return);
}
#endif
@@ -692,7 +687,7 @@ void XtKeysymToKeycodeList(dpy, keysym, keycodes_return, keycount_return)
KeySym lsym, usym;
unsigned maxcodes = 0;
unsigned ncodes = 0;
- KeyCode *keycodes, *codeP;
+ KeyCode *keycodes, *codeP = NULL;
DPY_TO_APPCON(dpy);
LOCK_APP(app);
diff --git a/src/TMparse.c b/src/TMparse.c
index 3ec7de6..e758e36 100644
--- a/src/TMparse.c
+++ b/src/TMparse.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/TMparse.c,v 3.9 2002/05/31 18:45:46 dawes Exp $ */
/*
@@ -62,6 +63,7 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include "StringDefs.h"
#include <ctype.h>
+#include <stdlib.h>
#ifndef NOTASCII
#define XK_LATIN1
#endif
@@ -367,9 +369,14 @@ static EventKey events[] = {
};
+#ifndef __UNIXOS2__
+#define IsNewline(str) ((str) == '\n')
+#else
+#define IsNewline(str) ((str) == '\n' || (str) == '\r')
+#endif
#define ScanFor(str, ch) \
- while ((*(str) != (ch)) && (*(str) != '\0') && (*(str) != '\n')) (str)++
+ while ((*(str) != (ch)) && (*(str) != '\0') && !IsNewline(*(str))) (str)++
#define ScanNumeric(str) while ('0' <= *(str) && *(str) <= '9') (str)++
@@ -378,9 +385,13 @@ static EventKey events[] = {
('a' <= *(str) && *(str) <= 'z') || \
('0' <= *(str) && *(str) <= '9')) (str)++
+#ifndef __UNIXOS2__
#define ScanWhitespace(str) \
while (*(str) == ' ' || *(str) == '\t') (str)++
-
+#else
+#define ScanWhitespace(str) \
+ while (*(str) == ' ' || *(str) == '\t' || *(str) == '\r') (str)++
+#endif
static Boolean initialized = FALSE;
static XrmQuark QMeta;
@@ -951,7 +962,7 @@ static String ParseKeySym(str, closure, event,error)
keySymName = keySymNamebuf;
str++;
keySymName[0] = *str;
- if (*str != '\0' && *str != '\n') str++;
+ if (*str != '\0' && !IsNewline(*str)) str++;
keySymName[1] = '\0';
event->event.eventCode = StringToKeySym(keySymName, error);
event->event.eventCodeMask = ~0L;
@@ -971,7 +982,7 @@ static String ParseKeySym(str, closure, event,error)
&& *str != ':'
&& *str != ' '
&& *str != '\t'
- && *str != '\n'
+ && !IsNewline(*str)
&& (*str != '(' || *(str+1) <= '0' || *(str+1) >= '9')
&& *str != '\0') str++;
keySymName = XtStackAlloc (str - start + 1, keySymNamebuf);
@@ -981,6 +992,7 @@ static String ParseKeySym(str, closure, event,error)
event->event.eventCodeMask = ~0L;
}
if (*error) {
+ /* We never get here when keySymName hasn't been allocated */
if (keySymName[0] == '<') {
/* special case for common error */
XtWarningMsg(XtNtranslationParseError, "missingComma",
@@ -1069,7 +1081,7 @@ static String ParseAtom(str, closure, event,error)
&& *str != ':'
&& *str != ' '
&& *str != '\t'
- && *str != '\n'
+ && !IsNewline(*str)
&& *str != '\0') str++;
if (str-start >= 999) {
Syntax( "Atom name must be less than 1000 characters long.", "" );
@@ -1157,7 +1169,7 @@ static String ParseQuotedStringEvent(str, event,error)
str++;
s[0] = *str;
s[1] = '\0';
- if (*str != '\0' && *str != '\n') str++;
+ if (*str != '\0' && !IsNewline(*str)) str++;
event->event.eventType = KeyPress;
event->event.eventCode = StringToKeySym(s, error);
if (*error) return PanicModeRecovery(str);
@@ -1229,7 +1241,7 @@ static void RepeatDownPlus(eventP, reps, actionsP)
ActionPtr **actionsP;
{
EventRec upEventRec;
- register EventPtr event, downEvent, lastDownEvent;
+ register EventPtr event, downEvent, lastDownEvent = NULL;
EventPtr upEvent = &upEventRec;
register int i;
@@ -1335,7 +1347,7 @@ static void RepeatUpPlus(eventP, reps, actionsP)
ActionPtr **actionsP;
{
EventRec upEventRec;
- register EventPtr event, downEvent, lastUpEvent;
+ register EventPtr event, downEvent, lastUpEvent = NULL;
EventPtr upEvent = &upEventRec;
register int i;
@@ -1518,7 +1530,7 @@ static String ParseEventSeq(str, eventSeqP, actionsP,error)
*eventSeqP = NULL;
- while ( *str != '\0' && *str != '\n') {
+ while ( *str != '\0' && !IsNewline(*str)) {
static Event nullEvent =
{0, 0,0L, 0, 0L, 0L,_XtRegularMatch,FALSE};
EventPtr event;
@@ -1527,7 +1539,7 @@ static String ParseEventSeq(str, eventSeqP, actionsP,error)
if (*str == '"') {
str++;
- while (*str != '"' && *str != '\0' && *str != '\n') {
+ while (*str != '"' && *str != '\0' && !IsNewline(*str)) {
event = XtNew(EventRec);
event->event = nullEvent;
event->state = /* (StatePtr) -1 */ NULL;
@@ -1656,7 +1668,7 @@ static String ParseString(str, strP)
&& *str != '\t'
&& *str != ','
&& *str != ')'
- && *str != '\n'
+ && !IsNewline(*str)
&& *str != '\0') str++;
*strP = __XtMalloc((unsigned)(str-start+1));
(void) memmove(*strP, start, str-start);
@@ -1682,7 +1694,7 @@ static String ParseParamSeq(str, paramSeqP, paramNumP)
register Cardinal i;
ScanWhitespace(str);
- while (*str != ')' && *str != '\0' && *str != '\n') {
+ while (*str != ')' && *str != '\0' && !IsNewline(*str)) {
String newStr;
str = ParseString(str, &newStr);
if (newStr != NULL) {
@@ -1759,7 +1771,7 @@ static String ParseActionSeq(parseTree, str, actionsP, error)
ActionPtr *nextActionP = actionsP;
*actionsP = NULL;
- while (*str != '\0' && *str != '\n') {
+ while (*str != '\0' && !IsNewline(*str)) {
register ActionPtr action;
XrmQuark quark;
@@ -1776,7 +1788,7 @@ static String ParseActionSeq(parseTree, str, actionsP, error)
*nextActionP = action;
nextActionP = &action->next;
}
- if (*str == '\n') str++;
+ if (IsNewline(*str)) str++;
ScanWhitespace(str);
return str;
}
@@ -1790,7 +1802,11 @@ static void ShowProduction(currentProduction)
int len;
char *eol, *production, productionbuf[500];
- eol = strchr(currentProduction, '\n');
+#ifdef __UNIXOS2__
+ eol = strchr(currentProduction, '\r');
+ if (!eol) /* try '\n' as well below */
+#endif
+ eol = strchr(currentProduction, '\n');
if (eol) len = eol - currentProduction;
else len = strlen (currentProduction);
production = XtStackAlloc (len + 1, productionbuf);
@@ -1864,7 +1880,7 @@ static String CheckForPoundSign(str, defaultOp, actualOpRtn)
else if (!strcmp(operation,"override"))
opType = XtTableOverride;
ScanWhitespace(str);
- if (*str == '\n') {
+ if (IsNewline(*str)) {
str++;
ScanWhitespace(str);
}
diff --git a/src/TMprint.c b/src/TMprint.c
index 24b0d2e..3b44326 100644
--- a/src/TMprint.c
+++ b/src/TMprint.c
@@ -58,6 +58,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/TMprint.c,v 1.6 2001/12/14 19:56:31 dawes Exp $ */
/*LINTLIBRARY*/
#include "IntrinsicI.h"
@@ -196,7 +197,7 @@ static void PrintCode(sb, mask, code)
if (mask != 0) {
if (mask != (unsigned long)~0L)
(void) sprintf(sb->current, "0x%lx:0x%lx", mask, code);
- else (void) sprintf(sb->current, /*"0x%lx"*/ "%d", code);
+ else (void) sprintf(sb->current, /*"0x%lx"*/ "%d", (unsigned)code);
sb->current += strlen(sb->current);
}
}
diff --git a/src/TMstate.c b/src/TMstate.c
index 8bfb96e..2283e13 100644
--- a/src/TMstate.c
+++ b/src/TMstate.c
@@ -32,6 +32,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/TMstate.c,v 1.8 2001/12/14 19:56:31 dawes Exp $ */
/*
@@ -76,7 +77,11 @@ static StatePtr NewState();
static String XtNtranslationError = "translationError";
+#ifndef __EMX__
TMGlobalRec _XtGlobalTM; /* initialized to zero K&R */
+#else
+TMGlobalRec _XtGlobalTM = {0};
+#endif
#define MatchIncomingEvent(tmEvent, typeMatch, modMatch) \
(typeMatch->eventType == tmEvent->event.eventType && \
@@ -238,7 +243,7 @@ TMShortCard _XtGetTypeIndex(event)
TMShortCard i, j = TM_TYPE_SEGMENT_SIZE;
TMShortCard typeIndex = 0;
TMTypeMatch typeMatch;
- TMTypeMatch segment;
+ TMTypeMatch segment = NULL;
LOCK_PROCESS;
for (i = 0; i < _XtGlobalTM.numTypeMatchSegments; i++) {
@@ -321,7 +326,7 @@ TMShortCard _XtGetModifierIndex(event)
TMShortCard i, j = TM_MOD_SEGMENT_SIZE;
TMShortCard modIndex = 0;
TMModifierMatch modMatch;
- TMModifierMatch segment;
+ TMModifierMatch segment = NULL;
LOCK_PROCESS;
for (i = 0; i < _XtGlobalTM.numModMatchSegments; i++) {
@@ -764,12 +769,12 @@ static void HandleSimpleState(w, tmRecPtr, curEventPtr)
TMSimpleStateTree stateTree;
TMContext *contextPtr = GetContextPtr(tmRecPtr);
TMShortCard i;
- ActionRec *actions;
+ ActionRec *actions = NULL;
Boolean matchExact = False;
Boolean match = False;
StatePtr complexMatchState = NULL;
int currIndex;
- TMShortCard typeIndex, modIndex;
+ TMShortCard typeIndex = 0, modIndex = 0;
int matchTreeIndex = TM_NO_MATCH;
LOCK_PROCESS;
@@ -990,7 +995,7 @@ static void HandleComplexState(w, tmRecPtr, curEventPtr)
{
XtTranslations xlations = tmRecPtr->translations;
TMContext *contextPtr = GetContextPtr(tmRecPtr);
- TMShortCard i, matchTreeIndex;
+ TMShortCard i, matchTreeIndex = 0;
StatePtr matchState = NULL, candState;
TMComplexStateTree *stateTreePtr =
(TMComplexStateTree *)&xlations->stateTreeTbl[0];
@@ -1712,7 +1717,7 @@ static XtTranslations MergeThem(dest, first, second)
UNLOCK_PROCESS;
return NULL;
}
- UNLOCK_PROCESS;
+ UNLOCK_PROCESS;
#ifndef REFCNT_TRANSLATIONS
@@ -1810,7 +1815,7 @@ static XtTranslations MergeTranslations(widget, oldXlations, newXlations,
Widget source;
TMShortCard *numNewRtn;
{
- XtTranslations newTable, xlations;
+ XtTranslations newTable = NULL, xlations;
TMComplexBindProcs bindings;
TMShortCard i, j;
TMStateTree *treePtr;
@@ -1931,10 +1936,10 @@ static Boolean ComposeTranslations(dest, operation, source, newXlations)
{
XtTranslations newTable, oldXlations;
XtTranslations accNewXlations;
- EventMask oldMask;
+ EventMask oldMask = 0;
TMBindData bindData;
TMComplexBindProcs oldBindings = NULL;
- TMShortCard numOldBindings, numNewBindings = 0, numBytes;
+ TMShortCard numOldBindings = 0, numNewBindings = 0, numBytes;
TMComplexBindProcsRec stackBindings[16], *newBindings;
/*
diff --git a/src/Threads.c b/src/Threads.c
index 2fca1fb..ef9a3bb 100644
--- a/src/Threads.c
+++ b/src/Threads.c
@@ -53,6 +53,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Threads.c,v 3.6 2001/12/14 19:56:31 dawes Exp $ */
#include "IntrinsicI.h"
@@ -93,7 +94,7 @@ typedef struct _LockRec {
static LockPtr process_lock = NULL;
static void
-InitProcessLock()
+InitProcessLock(void)
{
if(!process_lock) {
process_lock = XtNew(LockRec);
@@ -109,7 +110,7 @@ InitProcessLock()
}
static void
-ProcessLock()
+ProcessLock(void)
{
#ifdef _XMUTEX_NESTS
xmutex_lock(process_lock->mutex);
@@ -141,7 +142,7 @@ ProcessLock()
}
static void
-ProcessUnlock()
+ProcessUnlock(void)
{
#ifdef _XMUTEX_NESTS
process_lock->level--;
@@ -213,7 +214,9 @@ AppUnlock(app)
app_lock->level--;
xmutex_unlock(app_lock->mutex);
#else
- xthread_t self = xthread_self();
+ xthread_t self;
+
+ self = xthread_self();
xmutex_lock(app_lock->mutex);
assert(xthread_equal(app_lock->holder, self));
if (app_lock->level != 0) {
diff --git a/src/VarCreate.c b/src/VarCreate.c
index 3d9614d..2aed5d4 100644
--- a/src/VarCreate.c
+++ b/src/VarCreate.c
@@ -52,27 +52,25 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/VarCreate.c,v 3.7 2001/12/14 19:56:32 dawes Exp $ */
#include "IntrinsicI.h"
#include "StringDefs.h"
#include "Shell.h"
#include "VarargsI.h"
+#include "CreateI.h"
#if (defined(SUNSHLIB) || defined(AIXSHLIB)) && defined(SHAREDCODE)
#define XtToolkitInitialize _XtToolkitInitialize
#endif /* (SUNSHLIB || AIXSHLIB) && SHAREDCODE */
-extern Widget _XtCreateWidget();
-extern Widget _XtAppCreateShell();
-extern Widget _XtCreatePopupShell();
-
static Widget
-_XtVaCreateWidget(name, widget_class, parent, var, count)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_list var;
- int count;
+_XtVaCreateWidget(
+ String name,
+ WidgetClass widget_class,
+ Widget parent,
+ va_list var,
+ int count)
{
register Widget widget;
XtTypedArgList typed_args = NULL;
@@ -91,21 +89,12 @@ _XtVaCreateWidget(name, widget_class, parent, var, count)
}
-#if NeedVarargsPrototypes
Widget
XtVaCreateWidget(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreateWidget(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -113,33 +102,25 @@ Widget XtVaCreateWidget(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
- widget = _XtVaCreateWidget(name, widget_class, parent, var, total_count);
+ va_start(var,parent);
+ widget = _XtVaCreateWidget((String)name, widget_class, parent, var,
+ total_count);
va_end(var);
UNLOCK_APP(app);
return widget;
}
-#if NeedVarargsPrototypes
Widget
XtVaCreateManagedWidget(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -147,12 +128,13 @@ Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
- widget = _XtVaCreateWidget(name, widget_class, parent, var, total_count);
+ va_start(var,parent);
+ widget = _XtVaCreateWidget((String)name, widget_class, parent, var,
+ total_count);
XtManageChild(widget);
va_end(var);
UNLOCK_APP(app);
@@ -160,7 +142,6 @@ Widget XtVaCreateManagedWidget(name, widget_class, parent, va_alist)
}
-#if NeedVarargsPrototypes
Widget
XtVaAppCreateShell(
_Xconst char* name,
@@ -168,15 +149,6 @@ XtVaAppCreateShell(
WidgetClass widget_class,
Display* display,
...)
-#else
-/*VARARGS4*/
-Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
- String name;
- String class;
- WidgetClass widget_class;
- Display* display;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -186,15 +158,15 @@ Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
DPY_TO_APPCON(display);
LOCK_APP(app);
- Va_start(var,display);
+ va_start(var,display);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,display);
+ va_start(var,display);
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
- widget = _XtAppCreateShell(name, class, widget_class, display,
- (ArgList)NULL, (Cardinal)0, typed_args, num_args);
+ widget = _XtAppCreateShell((String)name, (String)class, widget_class,
+ display, (ArgList)NULL, (Cardinal)0, typed_args, num_args);
if (typed_args != NULL) {
XtFree((XtPointer)typed_args);
}
@@ -205,21 +177,12 @@ Widget XtVaAppCreateShell(name, class, widget_class, display, va_alist)
}
-#if NeedVarargsPrototypes
Widget
XtVaCreatePopupShell(
_Xconst char* name,
WidgetClass widget_class,
Widget parent,
...)
-#else
-/*VARARGS3*/
-Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
- String name;
- WidgetClass widget_class;
- Widget parent;
- va_dcl
-#endif
{
va_list var;
register Widget widget;
@@ -229,14 +192,14 @@ Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
WIDGET_TO_APPCON(parent);
LOCK_APP(app);
- Va_start(var,parent);
+ va_start(var,parent);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,parent);
+ va_start(var,parent);
_XtVaToTypedArgList(var, total_count, &typed_args, &num_args);
- widget = _XtCreatePopupShell(name, widget_class, parent,
+ widget = _XtCreatePopupShell((String)name, widget_class, parent,
(ArgList)NULL, (Cardinal)0, typed_args, num_args);
if (typed_args != NULL) {
XtFree((XtPointer)typed_args);
@@ -247,15 +210,8 @@ Widget XtVaCreatePopupShell(name, widget_class, parent, va_alist)
return widget;
}
-#if NeedVarargsPrototypes
void
XtVaSetValues(Widget widget, ...)
-#else
-/*VARARGS1*/
-void XtVaSetValues(widget, va_alist)
- Widget widget;
- va_dcl
-#endif
{
va_list var;
ArgList args = NULL;
@@ -264,11 +220,11 @@ void XtVaSetValues(widget, va_alist)
WIDGET_TO_APPCON(widget);
LOCK_APP(app);
- Va_start(var,widget);
+ va_start(var,widget);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,widget);
+ va_start(var,widget);
_XtVaToArgList(widget, var, total_count, &args, &num_args);
XtSetValues(widget, args, num_args);
@@ -279,24 +235,15 @@ void XtVaSetValues(widget, va_alist)
}
-#if NeedVarargsPrototypes
void
XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resources, ...)
-#else
-/*VARARGS3*/
-void XtVaSetSubvalues(base, resources, num_resources, va_alist)
- XtPointer base;
- XtResourceList resources;
- Cardinal num_resources;
- va_dcl
-#endif
{
va_list var;
ArgList args;
Cardinal num_args;
int total_count, typed_count;
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
@@ -304,7 +251,7 @@ void XtVaSetSubvalues(base, resources, num_resources, va_alist)
XtWarning("XtVaTypedArg is not valid in XtVaSetSubvalues()\n");
}
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtVaToArgList((Widget)NULL, var, total_count, &args, &num_args);
XtSetSubvalues(base, resources, num_resources, args, num_args);
@@ -316,7 +263,6 @@ void XtVaSetSubvalues(base, resources, num_resources, va_alist)
va_end(var);
}
-#if NeedVarargsPrototypes
Widget
_XtVaOpenApplication(
XtAppContext *app_context_return,
@@ -328,21 +274,6 @@ _XtVaOpenApplication(
String *fallback_resources,
WidgetClass widget_class,
va_list var_args)
-#else
-/*VARARGS8*/
-Widget _XtVaOpenApplication(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, widget_class, var_args)
- XtAppContext *app_context_return;
- char *application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- WidgetClass widget_class;
- va_list var_args;
-#endif
{
XtAppContext app_con;
Display * dpy;
@@ -397,7 +328,6 @@ Widget _XtVaOpenApplication(app_context_return, application_class, options,
return(root);
}
-#if NeedVarargsPrototypes
Widget
_XtVaAppInitialize(
XtAppContext *app_context_return,
@@ -408,20 +338,6 @@ _XtVaAppInitialize(
String *argv_in_out,
String *fallback_resources,
va_list var_args)
-#else
-/*VARARGS7*/
-Widget _XtVaAppInitialize(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, var_args)
- XtAppContext *app_context_return;
- char *application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- va_list var_args;
-#endif
{
return _XtVaOpenApplication(app_context_return, application_class,
options, num_options,
@@ -436,7 +352,6 @@ Widget _XtVaAppInitialize(app_context_return, application_class, options,
* _XtVaOpenApplication and to _XtVaAppInitialize.
*/
-#if NeedVarargsPrototypes
Widget
XtVaOpenApplication(
XtAppContext *app_context_return,
@@ -448,30 +363,15 @@ XtVaOpenApplication(
String *fallback_resources,
WidgetClass widget_class,
...)
-#else
-Widget XtVaOpenApplication(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, widget_class, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- WidgetClass widget_class;
- va_dcl
-#endif
{
va_list var;
- Va_start(var, widget_class);
+ va_start(var, widget_class);
return _XtVaOpenApplication(app_context_return, (String)application_class,
options, num_options, argc_in_out, argv_in_out,
fallback_resources, widget_class, var);
}
-#if NeedVarargsPrototypes
Widget
XtVaAppInitialize(
XtAppContext *app_context_return,
@@ -482,23 +382,10 @@ XtVaAppInitialize(
String *argv_in_out,
String *fallback_resources,
...)
-#else
-Widget XtVaAppInitialize(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- va_dcl
-#endif
{
va_list var;
- Va_start(var, fallback_resources);
+ va_start(var, fallback_resources);
return _XtVaOpenApplication(app_context_return, (String)application_class,
options, num_options, argc_in_out, argv_in_out,
fallback_resources,
diff --git a/src/VarGet.c b/src/VarGet.c
index ef72cad..237b49c 100644
--- a/src/VarGet.c
+++ b/src/VarGet.c
@@ -51,6 +51,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/VarGet.c,v 1.8 2001/12/14 19:56:32 dawes Exp $ */
#include "IntrinsicI.h"
#include "VarargsI.h"
@@ -58,7 +59,6 @@ in this Software without prior written authorization from The Open Group.
static String XtNxtGetTypedArg = "xtGetTypedArg";
-#if NeedVarargsPrototypes
void
XtVaGetSubresources(
Widget widget,
@@ -68,17 +68,6 @@ XtVaGetSubresources(
XtResourceList resources,
Cardinal num_resources,
...)
-#else
-/*VARARGS6*/
-void XtVaGetSubresources(widget, base, name, class, resources, num_resources, va_alist)
- Widget widget;
- XtPointer base;
- String name;
- String class;
- XtResourceList resources;
- Cardinal num_resources;
- va_dcl
-#endif
{
va_list var;
XtTypedArgList args;
@@ -87,11 +76,11 @@ void XtVaGetSubresources(widget, base, name, class, resources, num_resources, va
WIDGET_TO_APPCON(widget);
LOCK_APP(app);
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var, num_resources);
+ va_start(var, num_resources);
_XtVaToTypedArgList(var, total_count, &args, &num_args);
@@ -107,18 +96,8 @@ void XtVaGetSubresources(widget, base, name, class, resources, num_resources, va
}
-#if NeedVarargsPrototypes
void
XtVaGetApplicationResources(Widget widget, XtPointer base, XtResourceList resources, Cardinal num_resources, ...)
-#else
-/*VARARGS4*/
-void XtVaGetApplicationResources(widget, base, resources, num_resources, va_alist)
- Widget widget;
- XtPointer base;
- XtResourceList resources;
- Cardinal num_resources;
- va_dcl
-#endif
{
va_list var;
XtTypedArgList args;
@@ -127,11 +106,11 @@ void XtVaGetApplicationResources(widget, base, resources, num_resources, va_alis
WIDGET_TO_APPCON(widget);
LOCK_APP(app);
- Va_start(var,num_resources);
+ va_start(var,num_resources);
_XtCountVaList(var, &total_count, &typed_count);
va_end(var);
- Va_start(var,num_resources);
+ va_start(var,num_resources);
_XtVaToTypedArgList(var, total_count, &args, &num_args);
@@ -242,15 +221,8 @@ GetNestedArg(widget, avlist, args, resources, num_resources)
return(count);
}
-#if NeedVarargsPrototypes
void
XtVaGetValues(Widget widget, ...)
-#else
-/*VARARGS1*/
-void XtVaGetValues(widget, va_alist)
- Widget widget;
- va_dcl
-#endif
{
va_list var;
String attr;
@@ -262,7 +234,7 @@ void XtVaGetValues(widget, va_alist)
WIDGET_TO_APPCON(widget);
LOCK_APP(app);
- Va_start(var,widget);
+ va_start(var,widget);
_XtCountVaList(var, &total_count, &typed_count);
@@ -273,7 +245,7 @@ void XtVaGetValues(widget, va_alist)
else args = NULL; /* for lint; really unused */
va_end(var);
- Va_start(var,widget);
+ va_start(var,widget);
for(attr = va_arg(var, String), count = 0 ; attr != NULL;
attr = va_arg(var, String)) {
if (strcmp(attr, XtVaTypedArg) == 0) {
@@ -313,24 +285,15 @@ void XtVaGetValues(widget, va_alist)
UNLOCK_APP(app);
}
-#if NeedVarargsPrototypes
void
XtVaGetSubvalues(XtPointer base,XtResourceList resources, Cardinal num_resources, ...)
-#else
-/*VARARGS3*/
-void XtVaGetSubvalues(base, resources, num_resources, va_alist)
- XtPointer base;
- XtResourceList resources;
- Cardinal num_resources;
- va_dcl
-#endif
{
va_list var;
ArgList args;
Cardinal num_args;
int total_count, typed_count;
- Va_start(var,num_resources);
+ va_start(var,num_resources);
_XtCountVaList(var, &total_count, &typed_count);
@@ -339,7 +302,7 @@ void XtVaGetSubvalues(base, resources, num_resources, va_alist)
}
va_end(var);
- Va_start(var,num_resources);
+ va_start(var,num_resources);
_XtVaToArgList((Widget)NULL, var, total_count, &args, &num_args);
va_end(var);
diff --git a/src/Varargs.c b/src/Varargs.c
index e2a0f45..552f72d 100644
--- a/src/Varargs.c
+++ b/src/Varargs.c
@@ -25,6 +25,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/Varargs.c,v 3.10 2001/12/14 19:56:32 dawes Exp $ */
#include "IntrinsicI.h"
#include "VarargsI.h"
@@ -38,10 +39,10 @@ static String XtNxtConvertVarToArgList = "xtConvertVarToArgList";
* attributes that are typed. The list is counted recursively.
*/
static void
-_XtCountNestedList(avlist, total_count, typed_count)
- XtTypedArgList avlist;
- int *total_count;
- int *typed_count;
+_XtCountNestedList(
+ XtTypedArgList avlist,
+ int *total_count,
+ int *typed_count)
{
for (; avlist->name != NULL; avlist++) {
if (strcmp(avlist->name, XtVaNestedList) == 0) {
@@ -82,17 +83,17 @@ _XtCountVaList(var, total_count, typed_count)
for(attr = va_arg(var, String) ; attr != NULL;
attr = va_arg(var, String)) {
if (strcmp(attr, XtVaTypedArg) == 0) {
- va_arg(var, String);
- va_arg(var, String);
- va_arg(var, XtArgVal);
- va_arg(var, int);
+ (void)va_arg(var, String);
+ (void)va_arg(var, String);
+ (void)va_arg(var, XtArgVal);
+ (void)va_arg(var, int);
++(*total_count);
++(*typed_count);
} else if (strcmp(attr, XtVaNestedList) == 0) {
_XtCountNestedList(va_arg(var, XtTypedArgList), total_count,
typed_count);
} else {
- va_arg(var, XtArgVal);
+ (void)va_arg(var, XtArgVal);
++(*total_count);
}
}
@@ -104,16 +105,8 @@ _XtCountVaList(var, total_count, typed_count)
* constructs an attribute-value list of type XtTypedArgList and
* returns the list.
*/
-#if NeedVarargsPrototypes
XtVarArgsList
XtVaCreateArgsList(XtPointer unused, ...)
-#else
-/*ARGSUSED*/
-/*VARARGS1*/
-XtVarArgsList XtVaCreateArgsList(unused, va_alist)
- XtPointer unused;
- va_dcl
-#endif
{
va_list var;
XtTypedArgList avlist;
@@ -125,22 +118,22 @@ XtVarArgsList XtVaCreateArgsList(unused, va_alist)
* Note: The count is required only to allocate enough space to store
* the list. Therefore nested lists are not counted recursively.
*/
- Va_start(var,unused);
+ va_start(var,unused);
for(attr = va_arg(var, String) ; attr != NULL;
attr = va_arg(var, String)) {
++count;
if (strcmp(attr, XtVaTypedArg) == 0) {
- va_arg(var, String);
- va_arg(var, String);
- va_arg(var, XtArgVal);
- va_arg(var, int);
+ (void)va_arg(var, String);
+ (void)va_arg(var, String);
+ (void)va_arg(var, XtArgVal);
+ (void)va_arg(var, int);
} else {
- va_arg(var, XtArgVal);
+ (void)va_arg(var, XtArgVal);
}
}
va_end(var);
- Va_start(var,unused);
+ va_start(var,unused);
avlist = _XtVaCreateTypedArgList(var, count);
va_end(var);
return (XtVarArgsList)avlist;
@@ -190,14 +183,13 @@ XtTypedArgList _XtVaCreateTypedArgList(var, count)
* 1 if the conversion succeeded and 0 if the conversion failed.
*/
static int
-TypedArgToArg(widget, typed_arg, arg_return, resources, num_resources,
- memory_return)
- Widget widget;
- XtTypedArgList typed_arg;
- ArgList arg_return;
- XtResourceList resources;
- Cardinal num_resources;
- ArgList memory_return;
+TypedArgToArg(
+ Widget widget,
+ XtTypedArgList typed_arg,
+ ArgList arg_return,
+ XtResourceList resources,
+ Cardinal num_resources,
+ ArgList memory_return)
{
String to_type = NULL;
XrmValue from_val, to_val;
@@ -279,14 +271,13 @@ TypedArgToArg(widget, typed_arg, arg_return, resources, num_resources,
* an ArgList/count.
*/
static int
-NestedArgtoArg(widget, avlist, args, resources, num_resources,
- memory_return)
- Widget widget;
- XtTypedArgList avlist;
- ArgList args;
- XtResourceList resources;
- Cardinal num_resources;
- ArgList memory_return;
+NestedArgtoArg(
+ Widget widget,
+ XtTypedArgList avlist,
+ ArgList args,
+ XtResourceList resources,
+ Cardinal num_resources,
+ ArgList memory_return)
{
int count = 0;
@@ -356,7 +347,8 @@ _XtFreeArgList(args, total_count, typed_count)
}
-static void GetResources();
+static void GetResources(Widget widget, XtResourceList *res_list,
+ Cardinal *number);
/*
@@ -485,9 +477,9 @@ Cardinal * number;
}
}
-static int NestedArgtoTypedArg(args, avlist)
- XtTypedArgList args;
- XtTypedArgList avlist;
+static int NestedArgtoTypedArg(
+ XtTypedArgList args,
+ XtTypedArgList avlist)
{
int count = 0;
diff --git a/src/Vendor.c b/src/Vendor.c
index 4123ddc..3b282dc 100644
--- a/src/Vendor.c
+++ b/src/Vendor.c
@@ -46,6 +46,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
+/* $XFree86: xc/lib/Xt/Vendor.c,v 1.7 2002/05/31 18:45:46 dawes Exp $ */
/* Make sure all wm properties can make it out of the resource manager */
@@ -63,6 +64,24 @@ SOFTWARE.
*
***************************************************************************/
+#ifdef __UNIXOS2__
+/* to fix the EditRes problem because of wrong linker semantics */
+extern WidgetClass vendorShellWidgetClass;
+unsigned long _DLL_InitTerm(unsigned long mod,unsigned long flag)
+{
+ switch (flag) {
+ case 0: /*called on init*/
+ _CRT_init();
+ vendorShellWidgetClass = (WidgetClass)(&vendorShellClassRec);
+ return 1;
+ case 1: /*called on exit*/
+ return 1;
+ default:
+ return 0;
+ }
+}
+#endif
+
externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = {
{
/* superclass */ (WidgetClass) &wmShellClassRec,
diff --git a/src/sharedlib.c b/src/sharedlib.c
index 55d79c6..5096c44 100644
--- a/src/sharedlib.c
+++ b/src/sharedlib.c
@@ -25,15 +25,17 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/lib/Xt/sharedlib.c,v 3.7 2002/05/31 18:45:46 dawes Exp $ */
#if (defined(SUNSHLIB) || defined(AIXSHLIB)) && !defined(SHAREDCODE)
#include "IntrinsicI.h"
#include "VarargsI.h"
#include "ShellP.h"
#include "VendorP.h"
+#include "CreateI.h"
-#ifdef AIXSHLIB
+#if defined(AIXSHLIB) || defined(__UNIXOS2__)
WidgetClass vendorShellWidgetClass = (WidgetClass) &vendorShellClassRec;
static void _XtVendorInitialize()
@@ -138,7 +140,6 @@ ArgList args_in;
fallback_resources, args_in, num_args_in);
}
-#if NeedVarargsPrototypes
Widget
XtVaAppInitialize(
XtAppContext *app_context_return,
@@ -149,25 +150,12 @@ XtVaAppInitialize(
String *argv_in_out,
String *fallback_resources,
...)
-#else
-Widget XtVaAppInitialize(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- va_dcl
-#endif
{
va_list var;
extern Widget _XtVaAppInitialize();
VENDORINIT
- Va_start(var, fallback_resources);
+ va_start(var, fallback_resources);
return _XtVaAppInitialize(app_context_return, application_class, options,
num_options, argc_in_out, argv_in_out,
fallback_resources, var);
@@ -210,7 +198,6 @@ ArgList args_in;
args_in, num_args_in);
}
-#if NeedVarargsPrototypes
Widget
XtVaOpenApplication(
XtAppContext *app_context_return,
@@ -222,26 +209,12 @@ XtVaOpenApplication(
String *fallback_resources,
WidgetClass widget_class,
...)
-#else
-Widget XtVaOpenApplication(app_context_return, application_class, options,
- num_options, argc_in_out, argv_in_out,
- fallback_resources, widget_class, va_alist)
- XtAppContext *app_context_return;
- String application_class;
- XrmOptionDescList options;
- Cardinal num_options;
- int *argc_in_out;
- String *argv_in_out;
- String *fallback_resources;
- WidgetClass widget_class;
- va_dcl
-#endif
{
va_list var;
extern Widget _XtVaOpenApplication();
VENDORINIT
- Va_start(var, widget_class);
+ va_start(var, widget_class);
return _XtVaOpenApplication(app_context_return, application_class, options,
num_options, argc_in_out, argv_in_out,
fallback_resources, widget_class, var);