diff options
Diffstat (limited to 'lib/libXt/src')
-rw-r--r-- | lib/libXt/src/ActionHook.c | 2 | ||||
-rw-r--r-- | lib/libXt/src/Alloc.c | 2 | ||||
-rw-r--r-- | lib/libXt/src/Converters.c | 18 | ||||
-rw-r--r-- | lib/libXt/src/Event.c | 8 | ||||
-rw-r--r-- | lib/libXt/src/Initialize.c | 8 | ||||
-rw-r--r-- | lib/libXt/src/Intrinsic.c | 6 | ||||
-rw-r--r-- | lib/libXt/src/Makefile.am | 10 | ||||
-rw-r--r-- | lib/libXt/src/Makefile.in | 69 | ||||
-rw-r--r-- | lib/libXt/src/NextEvent.c | 25 | ||||
-rw-r--r-- | lib/libXt/src/PopupCB.c | 8 | ||||
-rw-r--r-- | lib/libXt/src/Resources.c | 59 | ||||
-rw-r--r-- | lib/libXt/src/Selection.c | 5 | ||||
-rw-r--r-- | lib/libXt/src/SetSens.c | 4 | ||||
-rw-r--r-- | lib/libXt/src/TMaction.c | 2 | ||||
-rw-r--r-- | lib/libXt/src/TMparse.c | 6 | ||||
-rw-r--r-- | lib/libXt/src/VarCreate.c | 26 | ||||
-rw-r--r-- | lib/libXt/src/Varargs.c | 4 | ||||
-rw-r--r-- | lib/libXt/src/Vendor.c | 14 | ||||
-rw-r--r-- | lib/libXt/src/sharedlib.c | 6 |
19 files changed, 169 insertions, 113 deletions
diff --git a/lib/libXt/src/ActionHook.c b/lib/libXt/src/ActionHook.c index efa898ed0..b03a116ff 100644 --- a/lib/libXt/src/ActionHook.c +++ b/lib/libXt/src/ActionHook.c @@ -70,7 +70,7 @@ in this Software without prior written authorization from The Open Group. */ -/* +/* * Contains XtAppAddActionHook, XtRemoveActionHook */ diff --git a/lib/libXt/src/Alloc.c b/lib/libXt/src/Alloc.c index be643a822..c523d8167 100644 --- a/lib/libXt/src/Alloc.c +++ b/lib/libXt/src/Alloc.c @@ -524,7 +524,7 @@ void _XtPrintMemory(char * filename) if (filename == NULL) f = stderr; - else + else f = fopen(filename, "w"); LOCK_PROCESS; fprintf(f, "total size: %d\n", ActiveXtMemory); diff --git a/lib/libXt/src/Converters.c b/lib/libXt/src/Converters.c index 6574ce05b..76498028f 100644 --- a/lib/libXt/src/Converters.c +++ b/lib/libXt/src/Converters.c @@ -257,7 +257,7 @@ void XtStringConversionWarning( params,&num_params); } -static int CompareISOLatin1(char *, char *); +static int CompareISOLatin1(const char *, const char *); static Boolean IsInteger( @@ -1379,11 +1379,12 @@ void LowerCase(register char *source, register *dest) } #endif -static int CompareISOLatin1 (char *first, char *second) +static int CompareISOLatin1 (const char *first, const char *second) { - register unsigned char *ap, *bp; + register const unsigned char *ap, *bp; - for (ap = (unsigned char *) first, bp = (unsigned char *) second; + for (ap = (const unsigned char *) first, + bp = (const unsigned char *) second; *ap && *bp; ap++, bp++) { register unsigned char a, b; @@ -1410,11 +1411,10 @@ static int CompareISOLatin1 (char *first, char *second) return (((int) *bp) - ((int) *ap)); } -static void CopyISOLatin1Lowered(char *dst, char *src) +static void CopyISOLatin1Lowered(char *dst, const char *src) { - unsigned char *dest, *source; - - dest = (unsigned char *) dst; source = (unsigned char *) src; + unsigned char *dest = (unsigned char *) dst; + const unsigned char *source = (const unsigned char *) src; for ( ; *source; source++, dest++) { if (*source >= XK_A && *source <= XK_Z) @@ -1735,7 +1735,7 @@ Boolean XtCvtStringToGravity ( { static struct _namepair { XrmQuark quark; - char *name; + const char *name; int gravity; } names[] = { { NULLQUARK, "forget", ForgetGravity }, diff --git a/lib/libXt/src/Event.c b/lib/libXt/src/Event.c index 7be598787..11823d6e2 100644 --- a/lib/libXt/src/Event.c +++ b/lib/libXt/src/Event.c @@ -1549,15 +1549,9 @@ void XtMainLoop(void) void XtAppMainLoop( XtAppContext app) { - XEvent event; - LOCK_APP(app); do { - XtAppNextEvent(app, &event); -#ifdef XTHREADS - /* assert(app == XtDisplayToApplicationContext(event.xany.display)); */ -#endif - XtDispatchEvent(&event); + XtAppProcessEvent(app, XtIMAll); } while(app->exit_flag == FALSE); UNLOCK_APP(app); } diff --git a/lib/libXt/src/Initialize.c b/lib/libXt/src/Initialize.c index e9543dab1..9783debf5 100644 --- a/lib/libXt/src/Initialize.c +++ b/lib/libXt/src/Initialize.c @@ -417,9 +417,9 @@ static void CombineUserDefaults( XrmDatabase *pdb) { #ifdef __MINGW32__ - char *slashDotXdefaults = "/Xdefaults"; + const char *slashDotXdefaults = "/Xdefaults"; #else - char *slashDotXdefaults = "/.Xdefaults"; + const char *slashDotXdefaults = "/.Xdefaults"; #endif char *dpy_defaults = XResourceManagerString(dpy); @@ -559,9 +559,9 @@ XrmDatabase XtScreenDatabase( if (!(filename = getenv("XENVIRONMENT"))) { int len; #ifdef __MINGW32__ - char *slashDotXdefaultsDash = "/Xdefaults-"; + const char *slashDotXdefaultsDash = "/Xdefaults-"; #else - char *slashDotXdefaultsDash = "/.Xdefaults-"; + const char *slashDotXdefaultsDash = "/.Xdefaults-"; #endif (void) GetRootDirName(filename = filenamebuf, diff --git a/lib/libXt/src/Intrinsic.c b/lib/libXt/src/Intrinsic.c index 684bda252..3df035873 100644 --- a/lib/libXt/src/Intrinsic.c +++ b/lib/libXt/src/Intrinsic.c @@ -1321,7 +1321,7 @@ static void FillInLangSubs( * The exact value should be documented in the implementation * notes for any Xt implementation. */ -static char *implementation_default_path(void) +static const char *implementation_default_path(void) { #if defined(WIN32) static char xfilesearchpath[] = ""; @@ -1368,8 +1368,8 @@ String XtResolvePathname( XtFilePredicate predicate) { XtPerDisplay pd; - static char *defaultPath = NULL; - char *impl_default = implementation_default_path(); + static const char *defaultPath = NULL; + const char *impl_default = implementation_default_path(); int idef_len = strlen(impl_default); char *massagedPath; int bytesAllocd, bytesLeft; diff --git a/lib/libXt/src/Makefile.am b/lib/libXt/src/Makefile.am index 2b39ec541..cf54a5c54 100644 --- a/lib/libXt/src/Makefile.am +++ b/lib/libXt/src/Makefile.am @@ -77,16 +77,16 @@ libXt_la_LIBADD = @XT_LIBS@ libXt_la_LDFLAGS = -version-number 6:0:0 -no-undefined # -# The util directory contains a program that builds some of the sources. +# The util directory contains a program that builds some of the sources. # The input to this program is given in files. Unfortunately those input # files refers to things like -# +# # util/foo -# +# # so the generating program must be run from the top directory. -# +# -BUILT_SOURCE = StringDefs.c +BUILT_SOURCE = StringDefs.c BUILT_HEADER = $(top_builddir)/include/X11/StringDefs.h $(top_builddir)/include/X11/Shell.h BUILT_FILES = $(BUILT_SOURCE) $(BUILT_HEADER) diff --git a/lib/libXt/src/Makefile.in b/lib/libXt/src/Makefile.in index 6ca235a8b..90bf32959 100644 --- a/lib/libXt/src/Makefile.in +++ b/lib/libXt/src/Makefile.in @@ -40,7 +40,9 @@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(install_sh) -d @@ -99,6 +101,7 @@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ @@ -108,32 +111,50 @@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_SPECS_FALSE = @ENABLE_SPECS_FALSE@ +ENABLE_SPECS_TRUE = @ENABLE_SPECS_TRUE@ +ENABLE_UNIT_TESTS_FALSE = @ENABLE_UNIT_TESTS_FALSE@ +ENABLE_UNIT_TESTS_TRUE = @ENABLE_UNIT_TESTS_TRUE@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FOP = @FOP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ +HAVE_FOP_FALSE = @HAVE_FOP_FALSE@ +HAVE_FOP_TRUE = @HAVE_FOP_TRUE@ +HAVE_GLIB_FALSE = @HAVE_GLIB_FALSE@ +HAVE_GLIB_TRUE = @HAVE_GLIB_TRUE@ +HAVE_PERL_FALSE = @HAVE_PERL_FALSE@ +HAVE_PERL_TRUE = @HAVE_PERL_TRUE@ +HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@ +HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@ +HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@ +HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@ +HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@ +HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@ +HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@ +HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ LIBOBJS = @LIBOBJS@ @@ -141,18 +162,25 @@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ +MALLOC_DEBUG_ENV = @MALLOC_DEBUG_ENV@ MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -160,28 +188,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ +RAWCPP = @RAWCPP@ +RAWCPPFLAGS = @RAWCPPFLAGS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRINGSABIOPTIONS = @STRINGSABIOPTIONS@ STRIP = @STRIP@ +STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ VERSION = @VERSION@ XFILESEARCHPATHDEFAULT = @XFILESEARCHPATHDEFAULT@ XMALLOC_ZERO_CFLAGS = @XMALLOC_ZERO_CFLAGS@ +XMLTO = @XMLTO@ +XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XORG_SGML_PATH = @XORG_SGML_PATH@ +XSLTPROC = @XSLTPROC@ +XSL_STYLESHEET = @XSL_STYLESHEET@ XTMALLOC_ZERO_CFLAGS = @XTMALLOC_ZERO_CFLAGS@ XT_CFLAGS = @XT_CFLAGS@ XT_LIBS = @XT_LIBS@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -296,15 +331,15 @@ libXt_la_LIBADD = @XT_LIBS@ libXt_la_LDFLAGS = -version-number 6:0:0 -no-undefined # -# The util directory contains a program that builds some of the sources. +# The util directory contains a program that builds some of the sources. # The input to this program is given in files. Unfortunately those input # files refers to things like -# +# # util/foo -# +# # so the generating program must be run from the top directory. -# -BUILT_SOURCE = StringDefs.c +# +BUILT_SOURCE = StringDefs.c BUILT_HEADER = $(top_builddir)/include/X11/StringDefs.h $(top_builddir)/include/X11/Shell.h BUILT_FILES = $(BUILT_SOURCE) $(BUILT_HEADER) STRING_LIST = $(top_srcdir)/util/string.list diff --git a/lib/libXt/src/NextEvent.c b/lib/libXt/src/NextEvent.c index 181d20e87..c8c9dd526 100644 --- a/lib/libXt/src/NextEvent.c +++ b/lib/libXt/src/NextEvent.c @@ -356,7 +356,21 @@ static int IoWait ( return Select (wf->nfds, &wf->rmask, &wf->wmask, &wf->emask, wt->wait_time_ptr); #else - return poll (wf->fdlist, wf->fdlistlen, wt->poll_wait); + int ret = poll (wf->fdlist, wf->fdlistlen, wt->poll_wait); + /* If poll() returns an event we didn't expect, such as POLLNVAL, treat + * it as if it failed. */ + if(ret >= 0) { + nfds_t i; + for (i=0; i < wf->fdlistlen; i++) { + struct pollfd *fd = &wf->fdlist[i]; + if (fd->revents & ~fd->events) { + ret = -1; + errno = EIO; + break; + } + } + } + return ret; #endif } @@ -731,7 +745,14 @@ WaitLoop: #endif return dpy_no; } - goto WaitLoop; + if (block) + goto WaitLoop; + else { +#ifdef USE_POLL + XtStackFree ((XtPointer) wf.fdlist, fdlist); +#endif + return -1; + } } #define IeCallProc(ptr) \ diff --git a/lib/libXt/src/PopupCB.c b/lib/libXt/src/PopupCB.c index dece66b1f..38cba2624 100644 --- a/lib/libXt/src/PopupCB.c +++ b/lib/libXt/src/PopupCB.c @@ -27,13 +27,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL diff --git a/lib/libXt/src/Resources.c b/lib/libXt/src/Resources.c index dc0f563cc..1d2871c46 100644 --- a/lib/libXt/src/Resources.c +++ b/lib/libXt/src/Resources.c @@ -233,7 +233,7 @@ static Cardinal CountTreeDepth( { Cardinal count; - for (count = 1; w != NULL; w = (Widget) w->core.parent) + for (count = 1; w != NULL; w = (Widget) w->core.parent) count++; return count; @@ -371,7 +371,7 @@ void _XtDependencies( new_res = (XrmResourceList *) __XtMalloc(new_num_res*sizeof(XrmResourceList)); if (super_num_res > 0) XtMemmove(new_res, super_res, super_num_res * sizeof(XrmResourceList)); - + /* Put pointers to class resource entries into new_res */ new_next = super_num_res; for (i = 0; i < class_num_res; i++) { @@ -449,7 +449,7 @@ void _XtConstraintResDependencies( - + XrmResourceList* _XtCreateIndirectionTable ( XtResourceList resources, Cardinal num_resources) @@ -559,11 +559,11 @@ static XtCacheRef *GetResources( i++, typed_arg++) { register XrmRepresentation argType; argName = quark_args[i]; - argType = (typed_arg->type == NULL) ? NULLQUARK + argType = (typed_arg->type == NULL) ? NULLQUARK : XrmStringToRepresentation(typed_arg->type); if (argName == QinitialResourcesPersistent) { persistent_resources = (Boolean)typed_arg->value; - found_persistence = True; + found_persistence = True; break; } for (j = 0, res = table; j < num_resources; j++, res++) { @@ -579,7 +579,7 @@ static XtCacheRef *GetResources( } found[j] = TRUE; break; - } + } } } } @@ -596,7 +596,7 @@ static XtCacheRef *GetResources( sizeof(XrmHashTable) * (searchListSize *= 2)); } - + if (persistent_resources) cache_base = NULL; else @@ -702,14 +702,14 @@ static XtCacheRef *GetResources( register XtTypedArg* arg = typed_args + typed[j] - 1; /* - * This resource value has been specified as a typed arg and - * has to be converted. Typed arg conversions are done here + * This resource value has been specified as a typed arg and + * has to be converted. Typed arg conversions are done here * to correctly interpose them with normal resource conversions. */ XrmQuark from_type; XrmValue from_val, to_val; Boolean converted; - + from_type = StringToQuark(arg->type); from_val.size = arg->size; if ((from_type == QString) || ((unsigned) arg->size > sizeof(XtArgVal))) @@ -847,22 +847,23 @@ static XtCacheRef *GetResources( } } UNLOCK_PROCESS; + } + } + for (res = table, j = 0; j < num_resources; j++, res++) { + if (!found[j] && typed[j]) { + /* + * This resource value was specified as a typed arg. + * However, the default value is being used here since + * type type conversion failed, so we compress the list. + */ + register XtTypedArg* arg = typed_args + typed[j] - 1; + register int i; - if (typed[j]) { - /* - * This resource value was specified as a typed arg. - * However, the default value is being used here since - * type type conversion failed, so we compress the list. - */ - register XtTypedArg* arg = typed_args + typed[j] - 1; - register int i; - - for (i = num_typed_args - typed[j]; i > 0; i--, arg++) { - *arg = *(arg+1); - } - num_typed_args--; + for (i = num_typed_args - typed[j]; i > 0; i--, arg++) { + *arg = *(arg+1); } - } + num_typed_args--; + } } if (tm_hack) widget->core.tm.current_state = NULL; @@ -965,7 +966,7 @@ XtCacheRef *_XtGetResources( /* Get names, classes for widget and ancestors */ GetNamesAndClasses(w, names, classes); - + /* Compile arg list into quarks */ CacheArgs(args, num_args, typed_args, *num_typed_args, quark_cache, XtNumber(quark_cache), &quark_args); @@ -1002,7 +1003,7 @@ void _XtGetSubresources ( const char* name, /* name of subobject */ const char* class, /* class of subobject */ XtResourceList resources, /* resource list for subobject */ - Cardinal num_resources, + Cardinal num_resources, ArgList args, /* arg list to override resources */ Cardinal num_args, XtTypedArgList typed_args, @@ -1043,7 +1044,7 @@ void _XtGetSubresources ( if (((int) resources->resource_offset) >= 0) { XrmCompileResourceListEphem(resources, num_resources); } - table = _XtCreateIndirectionTable(resources, num_resources); + table = _XtCreateIndirectionTable(resources, num_resources); Resrc = GetResources(w, (char*)base, names, classes, table, num_resources, quark_args, args, num_args, typed_args, &ntyped_args, False); @@ -1061,7 +1062,7 @@ void XtGetSubresources ( _Xconst char* name, /* name of subobject */ _Xconst char* class, /* class of subobject */ XtResourceList resources, /* resource list for subobject */ - Cardinal num_resources, + Cardinal num_resources, ArgList args, /* arg list to override resources */ Cardinal num_args) { @@ -1118,7 +1119,7 @@ void _XtGetApplicationResources ( } /* Compile arg list into quarks */ - CacheArgs(args, num_args, typed_args, num_typed_args, quark_cache, + CacheArgs(args, num_args, typed_args, num_typed_args, quark_cache, XtNumber(quark_cache), &quark_args); /* Compile resource list if needed */ if (((int) resources->resource_offset) >= 0) { diff --git a/lib/libXt/src/Selection.c b/lib/libXt/src/Selection.c index 101ea6aaa..f35cb440c 100644 --- a/lib/libXt/src/Selection.c +++ b/lib/libXt/src/Selection.c @@ -237,6 +237,7 @@ static void FreeSelectionProperty( Atom prop) { SelectionProp p; + int propCount; PropList sarray; if (prop == None) return; LOCK_PROCESS; @@ -247,7 +248,9 @@ static void FreeSelectionProperty( "internal error: no selection property context for display", (String *)NULL, (Cardinal *)NULL ); UNLOCK_PROCESS; - for (p = sarray->list; p; p++) + for (p = sarray->list, propCount=sarray->propCount; + propCount; + p++, propCount--) if (p->prop == prop) { p->avail = TRUE; return; diff --git a/lib/libXt/src/SetSens.c b/lib/libXt/src/SetSens.c index fd7777c53..85443a591 100644 --- a/lib/libXt/src/SetSens.c +++ b/lib/libXt/src/SetSens.c @@ -94,7 +94,7 @@ static void SetAncestorSensitive( /* If widget's sensitive is TRUE, propagate new ancestor_sensitive to children's ancestor_sensitive; else do nothing as children's ancestor_sensitive is already FALSE */ - + if (widget->core.sensitive && XtIsComposite(widget)) { children = ((CompositeWidget) widget)->composite.children; for (i=0; i < ((CompositeWidget)widget)->composite.num_children; i++) { @@ -125,7 +125,7 @@ void XtSetSensitive( /* If widget's ancestor_sensitive is TRUE, propagate new sensitive to children's ancestor_sensitive; else do nothing as children's ancestor_sensitive is already FALSE */ - + if (widget->core.ancestor_sensitive && XtIsComposite (widget)) { children = ((CompositeWidget) widget)->composite.children; for (i = 0; i < ((CompositeWidget)widget)->composite.num_children; i++){ diff --git a/lib/libXt/src/TMaction.c b/lib/libXt/src/TMaction.c index bbf1e340a..7af75ada0 100644 --- a/lib/libXt/src/TMaction.c +++ b/lib/libXt/src/TMaction.c @@ -70,7 +70,7 @@ in this Software without prior written authorization from The Open Group. */ -/* TMaction.c -- maintains the state table of actions for the translation +/* TMaction.c -- maintains the state table of actions for the translation * manager. */ diff --git a/lib/libXt/src/TMparse.c b/lib/libXt/src/TMparse.c index 5fddb8230..d2336448b 100644 --- a/lib/libXt/src/TMparse.c +++ b/lib/libXt/src/TMparse.c @@ -113,14 +113,14 @@ typedef TMShortCard Value; typedef void (*ModifierProc)(Value, LateBindingsPtr*, Boolean, Value*); typedef struct _ModifierRec { - char* name; + const char *name; XrmQuark signature; ModifierProc modifierParseProc; Value value; } ModifierRec, *ModifierKeys; typedef struct _EventKey { - char *event; + const char *event; XrmQuark signature; EventType eventType; ParseProc parseDetail; @@ -128,7 +128,7 @@ typedef struct _EventKey { }EventKey, *EventKeys; typedef struct { - char *name; + const char *name; XrmQuark signature; Value value; } NameValueRec, *NameValueTable; diff --git a/lib/libXt/src/VarCreate.c b/lib/libXt/src/VarCreate.c index 9821fc124..0fba379bb 100644 --- a/lib/libXt/src/VarCreate.c +++ b/lib/libXt/src/VarCreate.c @@ -76,12 +76,12 @@ _XtVaCreateWidget( _XtVaToTypedArgList(var, count, &typed_args, &num_args); - widget = _XtCreateWidget(name, widget_class, parent, (ArgList)NULL, + widget = _XtCreateWidget(name, widget_class, parent, (ArgList)NULL, (Cardinal)0, typed_args, num_args); if (typed_args != NULL) { XtFree((XtPointer)typed_args); - } + } return widget; } @@ -168,7 +168,7 @@ XtVaAppCreateShell( if (typed_args != NULL) { XtFree((XtPointer)typed_args); } - + va_end(var); UNLOCK_APP(app); return widget; @@ -239,7 +239,7 @@ XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resource va_list var; ArgList args; Cardinal num_args; - int total_count, typed_count; + int total_count, typed_count; va_start(var, num_resources); _XtCountVaList(var, &total_count, &typed_count); @@ -256,7 +256,7 @@ XtVaSetSubvalues(XtPointer base, XtResourceList resources, Cardinal num_resource if (num_args != 0) { XtFree((XtPointer)args); - } + } va_end(var); } @@ -282,7 +282,7 @@ _XtVaOpenApplication( XtTypedArgList typed_args; XtToolkitInitialize(); /* cannot be moved into _XtAppInit */ - + dpy = _XtAppInit(&app_con, (String)application_class, options, num_options, argc_in_out, &argv_in_out, fallback_resources); @@ -301,8 +301,8 @@ _XtVaOpenApplication( typed_args[count].size = 0; } count++; - typed_args = (XtTypedArgList) - XtRealloc((char *) typed_args, + typed_args = (XtTypedArgList) + XtRealloc((char *) typed_args, (unsigned) (count + 1) * sizeof(XtTypedArg)); } typed_args[count].name = NULL; @@ -310,14 +310,14 @@ _XtVaOpenApplication( va_end (var_args); root = - XtVaAppCreateShell( NULL, application_class, + XtVaAppCreateShell( NULL, application_class, widget_class, dpy, XtNscreen, (XtArgVal)DefaultScreenOfDisplay(dpy), XtNargc, (XtArgVal)saved_argc, XtNargv, (XtArgVal)argv_in_out, XtVaNestedList, (XtVarArgsList)typed_args, NULL ); - + if (app_context_return != NULL) *app_context_return = app_con; @@ -346,7 +346,7 @@ _XtVaAppInitialize( #if !((defined(SUNSHLIB) || defined(AIXSHLIB)) && defined(SHAREDCODE)) /* - * If not used as a shared library, we still need a front end to + * If not used as a shared library, we still need a front end to * _XtVaOpenApplication and to _XtVaAppInitialize. */ @@ -364,7 +364,7 @@ XtVaOpenApplication( { 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); @@ -383,7 +383,7 @@ XtVaAppInitialize( { 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/lib/libXt/src/Varargs.c b/lib/libXt/src/Varargs.c index 6c9f9ee5f..b33e287d8 100644 --- a/lib/libXt/src/Varargs.c +++ b/lib/libXt/src/Varargs.c @@ -234,6 +234,8 @@ TypedArgToArg( else { if (to_val.size == sizeof(long)) arg_return->value = (XtArgVal) *(long *)to_val.addr; + else if (to_val.size == sizeof(int)) + arg_return->value = (XtArgVal) *(int *)to_val.addr; else if (to_val.size == sizeof(short)) arg_return->value = (XtArgVal) *(short *)to_val.addr; else if (to_val.size == sizeof(char)) @@ -500,7 +502,7 @@ _XtVaToTypedArgList( args[count].size = va_arg(var, int); ++count; } else if (strcmp(attr, XtVaNestedList) == 0) { - count += NestedArgtoTypedArg(&args[count], + count += NestedArgtoTypedArg(&args[count], va_arg(var, XtTypedArgList)); } else { args[count].name = attr; diff --git a/lib/libXt/src/Vendor.c b/lib/libXt/src/Vendor.c index e4fd24fa5..26767b75d 100644 --- a/lib/libXt/src/Vendor.c +++ b/lib/libXt/src/Vendor.c @@ -27,13 +27,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. +software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL @@ -110,7 +110,7 @@ externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = { /* class_part_initialize*/ NULL, /* Class init'ed ? */ FALSE, /* initialize */ NULL, - /* initialize_notify */ NULL, + /* initialize_notify */ NULL, /* realize */ XtInheritRealize, /* actions */ NULL, /* num_actions */ 0, @@ -125,8 +125,8 @@ externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = { /* resize */ XtInheritResize, /* expose */ NULL, /* set_values */ NULL, - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, /* get_values_hook */ NULL, /* accept_focus */ NULL, /* intrinsics version */ XtVersion, diff --git a/lib/libXt/src/sharedlib.c b/lib/libXt/src/sharedlib.c index 1322d8c85..7aefc2336 100644 --- a/lib/libXt/src/sharedlib.c +++ b/lib/libXt/src/sharedlib.c @@ -81,7 +81,7 @@ void XtToolkitInitialize() _XtToolkitInitialize(); } -Widget +Widget XtInitialize( _Xconst char* name, _Xconst char* classname, @@ -110,7 +110,7 @@ XtAppInitialize( extern Widget _XtAppInitialize(); VENDORINIT return _XtAppInitialize (app_context_return, application_class, options, - num_options, argc_in_out, argv_in_out, + num_options, argc_in_out, argv_in_out, fallback_resources, args_in, num_args_in); } @@ -151,7 +151,7 @@ XtOpenApplication( extern Widget _XtOpenApplication(); VENDORINIT return _XtOpenApplication (app_context_return, application_class, options, - num_options, argc_in_out, argv_in_out, + num_options, argc_in_out, argv_in_out, fallback_resources, widget_class, args_in, num_args_in); } |