diff options
author | Walter Harms <wharms@bfs.de> | 2019-04-16 13:20:42 +0200 |
---|---|---|
committer | Walter Harms <wharms@bfs.de> | 2019-04-16 13:20:42 +0200 |
commit | 2b26e9a5473e399c81ae11b98d1f0b38393dbd8c (patch) | |
tree | c62b25afc2ec470d02c9d63545adc213d870b6a3 | |
parent | 4b446ce8b20b1de1488c73e1841dafbd25ca949f (diff) | |
parent | 965bc251c1d8391e672f277686254299627d4e3c (diff) |
Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxt
Conflicts:
man/XtManageChildren.man
149 files changed, 1344 insertions, 1316 deletions
diff --git a/include/X11/Intrinsic.h b/include/X11/Intrinsic.h index 794b820..85afbf1 100644 --- a/include/X11/Intrinsic.h +++ b/include/X11/Intrinsic.h @@ -63,7 +63,16 @@ in this Software without prior written authorization from The Open Group. #define XtSpecificationRelease 6 +/* + * As used in its function interface, the String type of libXt can be readonly. + * But compiling libXt with this feature may require some internal changes, + * e.g., casts and occasionally using a plain "char*". + */ +#ifdef _CONST_X_STRING +typedef const char *String; +#else typedef char *String; +#endif /* We do this in order to get "const" declarations to work right. We * use _XtString instead of String so that C++ applications can diff --git a/include/X11/IntrinsicI.h b/include/X11/IntrinsicI.h index f3193e0..6369aff 100644 --- a/include/X11/IntrinsicI.h +++ b/include/X11/IntrinsicI.h @@ -129,7 +129,7 @@ SOFTWARE. #define XtStackAlloc(size, stack_cache_array) \ ((size) <= sizeof(stack_cache_array) \ ? (XtPointer)(stack_cache_array) \ - : XtMalloc((unsigned)(size))) + : XtMalloc((Cardinal)(size))) #define XtStackFree(pointer, stack_cache_array) \ { if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); } diff --git a/man/XtAddActions.man b/man/XtAddActions.man index 1b0309c..821158f 100644 --- a/man/XtAddActions.man +++ b/man/XtAddActions.man @@ -68,7 +68,7 @@ Specifies the action table to register. .IP \fInum_args\fP 1i Specifies the number of entries in this action table. .SH DESCRIPTION -.BR XtAddActions +.B XtAddActions has been replaced by .BR XtAppAddActions . .SH "SEE ALSO" diff --git a/man/XtAddCallback.man b/man/XtAddCallback.man index dc74c00..c7dd6fb 100644 --- a/man/XtAddCallback.man +++ b/man/XtAddCallback.man @@ -92,26 +92,26 @@ or the client data to match on the registered callback procedures. Specifies the widget. .SH DESCRIPTION The -.BR XtAddCallback +.B XtAddCallback function adds the specified callback procedure to the specified widget's callback list. .LP The -.BR XtAddCallbacks +.B XtAddCallbacks add the specified list of callbacks to the specified widget's callback list. .LP The -.BR XtRemoveCallback +.B XtRemoveCallback function removes a callback only if both the procedure and the client data match. .LP The -.BR XtRemoveCallbacks +.B XtRemoveCallbacks function removes the specified callback procedures from the specified widget's callback list. .LP The -.BR XtRemoveAllCallbacks +.B XtRemoveAllCallbacks function removes all the callback procedures from the specified widget's callback list. .SH "SEE ALSO" diff --git a/man/XtAddEventHandler.man b/man/XtAddEventHandler.man index ec334aa..7905ae9 100644 --- a/man/XtAddEventHandler.man +++ b/man/XtAddEventHandler.man @@ -109,38 +109,38 @@ Specifies when the event handler is to be called relative to other previously registered handlers. .SH DESCRIPTION The -.BR XtAddEventHandler +.B XtAddEventHandler function registers a procedure with the dispatch mechanism that is to be called when an event that matches the mask occurs on the specified widget. If the procedure is already registered with the same client_data, the specified mask is ORed into the existing mask. If the widget is realized, -.BR XtAddEventHandler +.B XtAddEventHandler calls .BR XSelectInput , if necessary. .LP The -.BR XtAddRawEventHandler +.B XtAddRawEventHandler function is similar to -.BR XtAddEventHandler +.B XtAddEventHandler except that it does not affect the widget's mask and never causes an -.BR XSelectInput +.B XSelectInput for its events. Note that the widget might already have those mask bits set because of other nonraw event handlers registered on it. .LP The -.BR XtRemoveRawEventHandler +.B XtRemoveRawEventHandler function stops the specified procedure from receiving the specified events. Because the procedure is a raw event handler, this does not affect the widget's mask and never causes a call on .BR XSelectInput . .LP -.BR XtInsertEventHandler +.B XtInsertEventHandler is identical to -.BR XtAddEventHandler +.B XtAddEventHandler with the additional \fIposition\fP argument. if \fIposition\fP is .BR XtListHead , the event handler is registered to that it will be called before @@ -152,11 +152,11 @@ registered event handlers. If the procedure is already registered with the same \fIclient_data\fP value, the specified mask augments the existing mask and the procedure is repositioned in the list. .LP -.BR XtInsertRawEventHandler +.B XtInsertRawEventHandler is similar to -.BR XtInsertEventHandler +.B XtInsertEventHandler except that it does not modify the widget's event mask and never causes an -.BR XSelectInput +.B XSelectInput for the specified events. If the procedure is already registered with the same \fIclient_data\fP value, the specified mask augments the existing mask and the procedure is repositioned in the list. diff --git a/man/XtAddExposureToRegion.man b/man/XtAddExposureToRegion.man index db3e0b1..4ea15b6 100644 --- a/man/XtAddExposureToRegion.man +++ b/man/XtAddExposureToRegion.man @@ -65,25 +65,25 @@ void XtAddExposureToRegion(XEvent *\fIevent\fP, Region \fIregion\fP); .SH ARGUMENTS .IP \fIevent\fP 1i Specifies a pointer to the -.BR Expose +.B Expose or -.BR GraphicsExpose +.B GraphicsExpose event. .IP \fIregion\fP 1i Specifies the region object (as defined in .BR <X11/Xutil.h> ). .SH DESCRIPTION The -.BR XtAddExposureToRegion +.B XtAddExposureToRegion function computes the union of the rectangle defined by the exposure event and the specified region. Then, it stores the results back in region. If the event argument is not an -.BR Expose +.B Expose or -.BR GraphicsExpose +.B GraphicsExpose event, -.BR XtAddExposureToRegion +.B XtAddExposureToRegion returns without an error and without modifying region. .LP This function is used by the exposure compression mechanism diff --git a/man/XtAddGrab.man b/man/XtAddGrab.man index 987a80b..0d55941 100644 --- a/man/XtAddGrab.man +++ b/man/XtAddGrab.man @@ -76,22 +76,22 @@ a pointer button. Specifies the widget to add to or remove from the modal cascade. .SH DESCRIPTION The -.BR XtAddGrab +.B XtAddGrab function appends the widget (and associated parameters) to the modal cascade and checks that exclusive is -.BR True +.B True if spring_loaded is .BR True . If these are not .BR True , -.BR XtAddGrab +.B XtAddGrab generates an error. .LP The modal cascade is used by -.BR XtDispatchEvent +.B XtDispatchEvent when it tries to dispatch a user event. When at least one modal widget is in the widget cascade, -.BR XtDispatchEvent +.B XtDispatchEvent first determines if the event should be delivered. It starts at the most recent cascade entry and follows the cascade up to and including the most recent cascade entry added with the exclusive parameter @@ -118,7 +118,7 @@ subset of the cascade that has spring_loaded if any such widget exists. .LP The -.BR XtRemoveGrab +.B XtRemoveGrab function removes widgets from the modal cascade starting at the most recent widget up to and including the specified widget. It issues an error if the specified widget is not on the modal cascade. diff --git a/man/XtAddInput.man b/man/XtAddInput.man index fa1d049..6356d55 100644 --- a/man/XtAddInput.man +++ b/man/XtAddInput.man @@ -82,15 +82,15 @@ Specifies the procedure that is to be called when input is available. Specifies the source file descriptor on a UNIX-based system or other operating system dependent device specification. .SH DESCRIPTION -.BR XtAddInput +.B XtAddInput has been replaced by -.BR XtAppAddInput. +.B XtAppAddInput. .LP -.BR XtAddTimeOut +.B XtAddTimeOut has been replaced by -.BR XtAppAddTimeOut. +.B XtAppAddTimeOut. .LP -.BR XtAddWorkProc +.B XtAddWorkProc has been replaced by .BR XtAppAddWorkProc . .SH "SEE ALSO" diff --git a/man/XtAllocateGC.man b/man/XtAllocateGC.man index 0590739..12663aa 100644 --- a/man/XtAllocateGC.man +++ b/man/XtAllocateGC.man @@ -78,7 +78,7 @@ Specifies the fields of the GC that will be modified by the caller. Specifies the fields of the GC that will not be needed by the caller. .SH DESCRIPTION The -.BR XtAllocateGC +.B XtAllocateGC function returns a sharable GC that may be modified by the client. The \fIscreen\fP field of the specified widget or of the nearest widget ancestor of the specified object and the specified \fIdepth\fP @@ -104,15 +104,15 @@ then immediately set to the value in \fIvalues\fP. If a field is set in \fIunused_mask\fP and also in either \fIvalue_mask\fP or \fIdynamic_mask\fP, the specification in \fIunused_mask\fP is ignored. .LP -.BR XtAllocateGC +.B XtAllocateGC tries to minimize the number of unique GCs created by comparing the arguments with those of previous calls and returning an existing GC when there are no conflicts. -.BR XtAllocateGC +.B XtAllocateGC may modify and return an existing GC if it was allocated with a nonzero \fIunused_mask\fP. .SH "SEE ALSO" -.BR XtGetGC +.B XtGetGC .br \fI\*(xT\fP .br diff --git a/man/XtAppAddActionHook.man b/man/XtAppAddActionHook.man index cb6a7c5..cb986f2 100644 --- a/man/XtAppAddActionHook.man +++ b/man/XtAppAddActionHook.man @@ -72,7 +72,7 @@ Specifies the action hook procedure. .IP \fInum_args\fP 1i Specifies the application-specific data to be passed to the action hook. .SH DESCRIPTION -.BR XtAppAddActionHook +.B XtAppAddActionHook adds the specified procedure to the front of a list maintained in the application context. In the future, when an action routine is about to be invoked for any widget in this application context, either through @@ -82,11 +82,11 @@ the action hohok procedures will be called in reverse order of registration jut prior to invoking the action routine. .LP Action hook procedures are removed automatically and the -.BR XtActionHookId +.B XtActionHookId s destroyed when the application context in which they were added is destroyed. .LP -.BR XtRemoveActionHook +.B XtRemoveActionHook removes the specified action hook procedure from the list in which it was registered. .SH "SEE ALSO" diff --git a/man/XtAppAddActions.man b/man/XtAppAddActions.man index 150d7d8..3f75527 100644 --- a/man/XtAppAddActions.man +++ b/man/XtAppAddActions.man @@ -72,7 +72,7 @@ Specifies the action table to register. Specifies the number of entries in this action table. .SH DESCRIPTION The -.BR XtAppAddActions +.B XtAppAddActions function adds the specified action table and registers it with the translation manager. .SH "SEE ALSO" diff --git a/man/XtAppAddBlockHook.man b/man/XtAppAddBlockHook.man index a6e317a..5f0f479 100644 --- a/man/XtAppAddBlockHook.man +++ b/man/XtAppAddBlockHook.man @@ -72,17 +72,17 @@ Specifies the block hook procedure. .IP \fInum_args\fP 1i Specifies the application-specific data to be passed to the block hook. .SH DESCRIPTION -.BR XtAppAddBlockHook +.B XtAppAddBlockHook registers the specified procedure and returns an identifier for it. The hook is called at any time in the future when the Intrinsics are about to block pending some input. .LP Block hook procedures are removed automatically and the -.BR XtBlockHookId +.B XtBlockHookId is destroyed when the application context in which they were added is destroyed. .LP -.BR XtRemoveBlockHook +.B XtRemoveBlockHook removes the specified block hook procedure from the list in which it was registered. .SH "SEE ALSO" diff --git a/man/XtAppAddConverter.man b/man/XtAppAddConverter.man index c1ee893..2bd83cd 100644 --- a/man/XtAppAddConverter.man +++ b/man/XtAppAddConverter.man @@ -82,19 +82,19 @@ Specifies the number of additional arguments to the converter or zero. .IP \fIto_type\fP 1i Specifies the destination type. .SH DESCRIPTION -.BR XtAppAddConverter +.B XtAppAddConverter is equivalent in function to -.BR XtAppSetTypeConverter +.B XtAppSetTypeConverter with \fIcache_type\fP equal to -.BR XtCacheAll +.B XtCacheAll for old-format type converters. It has been superseded by .BR XtAppSetTypeConverter . .LP -.BR XtAddConverter +.B XtAddConverter is equivalent in function to -.BR XtSetTypeConverter +.B XtSetTypeConverter with \fIcache_type\fP equal to -.BR XtCacheAll +.B XtCacheAll for old-format type converters. It has been superseded by .BR XtSetTypeConverter . .SH "SEE ALSO" diff --git a/man/XtAppAddInput.man b/man/XtAppAddInput.man index 89324b3..748c61f 100644 --- a/man/XtAppAddInput.man +++ b/man/XtAppAddInput.man @@ -77,7 +77,7 @@ Specifies the mask that indicates a read, write, or exception condition or some operating system dependent condition. .IP \fIid\fP 1i Specifies the ID returned from the corresponding -.BR XtAppAddInput +.B XtAppAddInput call. .IP \fIproc\fP 1i Specifies the procedure that is to be called when input is available. @@ -86,12 +86,12 @@ Specifies the source file descriptor on a UNIX-based system or other operating system dependent device specification. .SH DESCRIPTION The -.BR XtAppAddInput +.B XtAppAddInput function registers with the \*(xI read routine a new source of events, which is usually file input but can also be file output. Note that file should be loosely interpreted to mean any sink or source of data. -.BR XtAppAddInput +.B XtAppAddInput also specifies the conditions under which the source can generate events. When input is pending on this source, the callback procedure is called. @@ -104,7 +104,7 @@ the condition is some union of and .BR XtInputExceptMask . The -.BR XtRemoveInput +.B XtRemoveInput function causes the \*(xI read routine to stop watching for input from the input source. .SH "SEE ALSO" @@ -117,16 +117,16 @@ XtAppAddTimeOut(__libmansuffix__),XtAppAddSignal(__libmansuffix__) .SH "BUGS" In ANSI C it is necessary to cast the condition to an XtPointer, e.g.: .RS 4 -.br +.ft CW XtAppAddInput(app_context, .RS 4 .br source, .br -.B (XtPointer) -(XtInputReadMask | XtInputWriteMask), +\fB(XtPointer)\fP (XtInputReadMask | XtInputWriteMask), .br proc, .br client_data); +.ft R .RE diff --git a/man/XtAppAddSignal.man b/man/XtAppAddSignal.man index f959839..af64d01 100644 --- a/man/XtAppAddSignal.man +++ b/man/XtAppAddSignal.man @@ -74,48 +74,48 @@ Specifies the argument that is to be passed to the specified procedure when a signal has been raised. .IP \fIid\fP 1i Specifies the ID returned from the corresponding -.BR XtAppAddSignal +.B XtAppAddSignal call. .IP \fIproc\fP 1i Specifies the procedure that is to be called when the signal has been raised. .SH DESCRIPTION The -.BR XtAppAddSignal +.B XtAppAddSignal function initiates a mechanism for handling signals within the context of the Intrinsics. Prior to establishing an operating system dependent signal handler the application may call -.BR XtAppAddSignal +.B XtAppAddSignal and store the returned \fIid\fP in a place accessible to the signal handler. .LP Upon receipt of a signal from the operating system, the application may call -.BR XtNoticeSignal +.B XtNoticeSignal passing the \fIid\fP returned by the call to .BR XtAppAddSignal . .LP -.BR XtNoticeSignal +.B XtNoticeSignal is the only Intrinsics function that can safely be called from a signal handler. If -.BR XtNoticeSignal +.B XtNoticeSignal is called multiple times before the Intrinsics are able to invoke the registered callback, the callback is only called once. Logically the Intrinsics maintain ``pending'' for each registered callback. This flag is initially -.BR False +.B False and is set to -.BR True +.B True by .BR XtNoticeSignal ; the Intrinsics invoke the callback whenever the flag is .BR True , and the flag is set to -.BR False +.B False just before the callback is invoked. .LP The -.BR XtRemoveSignal +.B XtRemoveSignal function is called to remove the specified Intrinsics signal handler. The client should disable the source of the signal before calling .BR XtRemoveSignal . diff --git a/man/XtAppAddTimeOut.man b/man/XtAppAddTimeOut.man index ddfb6b2..e560776 100644 --- a/man/XtAppAddTimeOut.man +++ b/man/XtAppAddTimeOut.man @@ -79,14 +79,14 @@ Specifies the procedure that is to be called when time expires. Specifies the ID for the timeout request to be destroyed. .SH DESCRIPTION The -.BR XtAppAddTimeOut +.B XtAppAddTimeOut function creates a timeout and returns an identifier for it. The timeout value is set to interval. The callback procedure is called when the time interval elapses, and then the timeout is removed. .LP The -.BR XtRemoveTimeOut +.B XtRemoveTimeOut function removes the timeout. Note that timeouts are automatically removed once they trigger. .SH "SEE ALSO" diff --git a/man/XtAppAddWorkProc.man b/man/XtAppAddWorkProc.man index fbd4acf..ae5a755 100644 --- a/man/XtAppAddWorkProc.man +++ b/man/XtAppAddWorkProc.man @@ -77,12 +77,12 @@ Specifies the procedure that is to be called. Specifies which work procedure to remove. .SH DESCRIPTION The -.BR XtAppAddWorkProc +.B XtAppAddWorkProc function adds the specified work procedure for the application identified by app_context. .LP The -.BR XtRemoveWorkProc +.B XtRemoveWorkProc function explicitly removes the specified background work procedure. .SH "SEE ALSO" XtAppNextEvent(__libmansuffix__) diff --git a/man/XtAppCreateShell.man b/man/XtAppCreateShell.man index f1fc6de..526b7cf 100644 --- a/man/XtAppCreateShell.man +++ b/man/XtAppCreateShell.man @@ -85,12 +85,12 @@ Specifies the number of arguments in the argument list. Specifies the variable argument list from which to get the resources. .SH DESCRIPTION The -.BR XtAppCreateShell +.B XtAppCreateShell function saves the specified application name and application class for qualifying all widget resource specifiers. The application name and application class are used as the left-most components in all widget resource names for this application. -.BR XtAppCreateShell +.B XtAppCreateShell should be used to create a new logical application within a program or to create a shell on another display. In the first case, @@ -99,7 +99,7 @@ In the second case, it uses the resource database associated with the other display. .LP Note that the widget returned by -.BR XtAppCreateShell +.B XtAppCreateShell has the \s-1WM_COMMAND\s+1 property set for session managers (see Chapter 4). .SH "SEE ALSO" diff --git a/man/XtAppError.man b/man/XtAppError.man index 55a1145..012128e 100644 --- a/man/XtAppError.man +++ b/man/XtAppError.man @@ -83,21 +83,21 @@ or the nonfatal error procedure, which usually returns. Specifies the message that is to be reported. .SH DESCRIPTION The -.BR XtAppError +.B XtAppError function calls the installed error procedure and passes the specified message. .LP The -.BR XtAppSetErrorHandler +.B XtAppSetErrorHandler function registers the specified procedure, which is called when a fatal error condition occurs. .LP The -.BR XtAppSetWarningHandler +.B XtAppSetWarningHandler registers the specified procedure, which is called when a nonfatal error condition occurs. .LP The -.BR XtAppWarning +.B XtAppWarning function calls the installed nonfatal error procedure and passes the specified message. .SH "SEE ALSO" diff --git a/man/XtAppErrorMsg.man b/man/XtAppErrorMsg.man index 55fd8eb..475fd2f 100644 --- a/man/XtAppErrorMsg.man +++ b/man/XtAppErrorMsg.man @@ -95,22 +95,22 @@ Specifies the number of values in the parameter list. Specifies a pointer to a list of values to be stored in the message. .SH DESCRIPTION The -.BR XtAppErrorMsg +.B XtAppErrorMsg function calls the high-level error handler and passes the specified information. .LP The -.BR XtAppSetErrorMsgHandler +.B XtAppSetErrorMsgHandler function registers the specified procedure, which is called when a fatal error occurs. .LP The -.BR XtAppSetWarningMsgHandler +.B XtAppSetWarningMsgHandler function registers the specified procedure, which is called when a nonfatal error condition occurs. .LP The -.BR XtAppWarningMsg +.B XtAppWarningMsg function calls the high-level error handler and passes the specified information. .SH "SEE ALSO" diff --git a/man/XtAppGetErrorDatabase.man b/man/XtAppGetErrorDatabase.man index 184d7a1..fcc1c1d 100644 --- a/man/XtAppGetErrorDatabase.man +++ b/man/XtAppGetErrorDatabase.man @@ -88,14 +88,14 @@ of the error message. Specifies the size of the buffer in bytes. .SH DESCRIPTION The -.BR XtAppGetErrorDatabase +.B XtAppGetErrorDatabase function returns the address of the error database. The \*(xI do a lazy binding of the error database and do not merge in the database file until the first call to .BR XtAppGetErrorDatbaseText . .LP The -.BR XtAppGetErrorDatabaseText +.B XtAppGetErrorDatabaseText returns the appropriate message from the error database or returns the specified default message if one is not found in the error database. diff --git a/man/XtAppGetSelectionTimeout.man b/man/XtAppGetSelectionTimeout.man index d10dfc1..aabf904 100644 --- a/man/XtAppGetSelectionTimeout.man +++ b/man/XtAppGetSelectionTimeout.man @@ -72,19 +72,19 @@ Specifies the application context. Specifies the selection timeout in milliseconds. .SH DESCRIPTION The -.BR XtAppGetSelectionTimeout +.B XtAppGetSelectionTimeout function returns the current selection timeout value, in milliseconds. The selection timeout is the time within which the two communicating applications must respond to one another. The initial timeout value is set by the -.BR selectionTimeout +.B selectionTimeout application resource, or, if -.BR selectionTimeout +.B selectionTimeout is not specified, it defaults to five seconds. .LP The -.BR XtAppSetSelectionTimeout +.B XtAppSetSelectionTimeout function sets the \*(xI's selection timeout mechanism. Note that most applications should not set the selection timeout. .SH "SEE ALSO" diff --git a/man/XtAppInitialize.man b/man/XtAppInitialize.man index 9de882a..bae2148 100644 --- a/man/XtAppInitialize.man +++ b/man/XtAppInitialize.man @@ -99,35 +99,35 @@ Specifies the variable argument list to override any other resource specification for the created shell widget. .SH DESCRIPTION The -.BR XtAppInitialize +.B XtAppInitialize function calls -.BR XtToolkitInitialize +.B XtToolkitInitialize followed by .BR XtCreateApplicationContext , then calls -.BR XtOpenDisplay +.B XtOpenDisplay with \fIdisplay_string\fP NULL and \fIapplication_name\fP NULL, and finally calls -.BR XtAppCreateShell +.B XtAppCreateShell with \fIapplication_name\fP NULL, \fIwidget_class\fP .BR applicationShellWidgetClass , and the specified \fIargs\fP and \fInum_args\fP and returns the created shell. The modified \fIargc\fP and \fIargv\fP returned by -.BR XtDisplayInitialize +.B XtDisplayInitialize are returned in \fIargc_in_out\fP and \fIargv_in_out\fP. If \fIapp_context_return\fP is not NULL, the created application context is also returned. If the display specified by the command line cannot be opened, an error message is issued and -.BR XtAppInitialize +.B XtAppInitialize terminates the application. If \fIfallback_resources\fP is non-NULL, -.BR XtAppSetFallbackResources +.B XtAppSetFallbackResources is called with the value prior to calling .BR XtOpenDisplay . .LP XtAppInitialize and XtVaAppInitialize have been superceded by -.BR XtOpenApplication +.B XtOpenApplication and -.BR XtVaOpenApplication +.B XtVaOpenApplication respectively. .SH "SEE ALSO" XtOpenApplication(__libmansuffix__), XtVaOpenApplication(__libmansuffix__) diff --git a/man/XtAppLock.man b/man/XtAppLock.man index c426d7f..70c74be 100644 --- a/man/XtAppLock.man +++ b/man/XtAppLock.man @@ -67,10 +67,10 @@ void XtAppUnlock(XtAppContext \fIapp_context\fP); .IP \fIapp_context\fP 1i Specifies the application context. .SH DESCRIPTION -.BR XtAppLock +.B XtAppLock locks the application context including all its related displays and widgets. .LP -.BR XtAppUnlock +.B XtAppUnlock unlocks the application context. .SH "SEE ALSO" .br diff --git a/man/XtAppNextEvent.man b/man/XtAppNextEvent.man index 7b5414e..a2a6bc0 100644 --- a/man/XtAppNextEvent.man +++ b/man/XtAppNextEvent.man @@ -93,11 +93,11 @@ The mask is the bitwise inclusive OR of any combination of and .BR XtIMSignal . As a convenience, the \*(tk defines the symbolic name -.BR XtIMAll +.B XtIMAll to be the bitwise inclusive OR of all event types. .SH DESCRIPTION If the X event queue is empty, -.BR XtAppNextEvent +.B XtAppNextEvent flushes the X output buffers of each Display in the application context and waits for an event while looking at the other input sources, timeout timeout values, and signal handlers and calling any callback procedures @@ -105,21 +105,21 @@ triggered by them. This wait time can be used for background processing (see Section 7.8). .LP If there is an event in the queue, -.BR XtAppPeekEvent +.B XtAppPeekEvent fills in the event and returns a nonzero value. If no X input is on the queue, -.BR XtAppPeekEvent +.B XtAppPeekEvent flushes the output buffer and blocks until input is available (possibly calling some timeout callbacks in the process). If the input is an event, -.BR XtAppPeekEvent +.B XtAppPeekEvent fills in the event and returns a nonzero value. Otherwise, the input is for an alternate input source, and -.BR XtAppPeekEvent +.B XtAppPeekEvent returns zero. .LP The -.BR XtAppPending +.B XtAppPending function returns a nonzero value if there are events pending from the X server, timer pending, or other input sources pending. The value returned is a bit mask that is the OR of @@ -127,24 +127,24 @@ returned is a bit mask that is the OR of .BR XtIMTimer , .BR XtIMAlternateInput , and -.BR XtIMSignal +.B XtIMSignal (see .BR XtAppProcessEvent ). If there are no events pending, -.BR XtAppPending +.B XtAppPending flushes the output buffer and returns zero. .LP The -.BR XtAppProcessEvent +.B XtAppProcessEvent function processes one timer, alternate input, signal source, or X event. If there is nothing of the appropriate type to process, -.BR XtAppProcessEvent +.B XtAppProcessEvent blocks until there is. If there is more than one type of thing available to process, it is undefined which will get processed. Usually, this procedure is not called by client applications (see .BR XtAppMainLoop ). -.BR XtAppProcessEvent +.B XtAppProcessEvent processes timer events by calling any appropriate timer callbacks, alternate input by calling any appropriate alternate input callbacks, signal source by calling any appropriate signal callbacks, and X events @@ -161,41 +161,41 @@ the event is ignored and the dispatcher simply returns. The order in which the handlers are called is undefined. .LP The -.BR XtDispatchEvent +.B XtDispatchEvent function sends those events to the event handler functions that have been previously registered with the dispatch routine. -.BR XtDispatchEvent +.B XtDispatchEvent returns -.BR True +.B True if it dispatched the event to some handler and -.BR False +.B False if it found no handler to dispatch the event to. The most common use of -.BR XtDispatchEvent +.B XtDispatchEvent is to dispatch events acquired with the -.BR XtAppNextEvent +.B XtAppNextEvent procedure. However, it also can be used to dispatch user-constructed events. -.BR XtDispatchEvent +.B XtDispatchEvent also is responsible for implementing the grab semantics for .BR XtAddGrab . .LP The -.BR XtAppMainLoop +.B XtAppMainLoop function first reads the next incoming X event by calling -.BR XtAppNextEvent +.B XtAppNextEvent and then it dispatches the event to the appropriate registered procedure by calling .BR XtDispatchEvent . This constitutes the main loop of \*(tk applications, and, as such, it does not return unless -.BR XtAppSetExitFlag +.B XtAppSetExitFlag is called. Applications are expected to exit in response to some user action. There is nothing special about .BR XtAppMainLoop ; it is simply an loop that calls -.BR XtAppNextEvent +.B XtAppNextEvent and then .BR XtDispatchEvent , until diff --git a/man/XtAppReleaseCacheRefs.man b/man/XtAppReleaseCacheRefs.man index a58b5c2..5fd1945 100644 --- a/man/XtAppReleaseCacheRefs.man +++ b/man/XtAppReleaseCacheRefs.man @@ -68,11 +68,11 @@ Specifies the application context. .IP \fIrefs\fP 1i Specifies the list of cache references to be released. .SH DESCRIPTION -.BR XtAppReleaseCacheRefs +.B XtAppReleaseCacheRefs decrements the reference count for the conversion entries identified by the \fIrefs\fP argument. This argument is a pointer to a NULL-terminated list of -.BR XtCacheRef +.B XtCacheRef values. If any reference count reaches zero, the destructor, if any, will be called and the resource removed from the conversion cache. .SH "SEE ALSO" diff --git a/man/XtAppSetFallbackResources.man b/man/XtAppSetFallbackResources.man index 579d8ea..d412a97 100644 --- a/man/XtAppSetFallbackResources.man +++ b/man/XtAppSetFallbackResources.man @@ -79,11 +79,11 @@ class resource file and if \fIspecification_list\fP is not NULL the resource specification in \fIspecification_list\fP will be merged into the screen resource database in place of the application-specific class resource file. -.BR XtAppSetFallbackResources +.B XtAppSetFallbackResources is not required to copy \fIspecification_list\fP; the caller must ensure that the contents of the list and the strings addressed by the list remain valid until all displays are initialized or until -.BR XtAppSetFallbackResources +.B XtAppSetFallbackResources is called again. The value NULL for \fIspecification_list\fP removes any previous fallback resource specification for the application context. The intended use for fallback resources is to provide a minimal number diff --git a/man/XtAppSetTypeConverter.man b/man/XtAppSetTypeConverter.man index 256bc62..2149205 100644 --- a/man/XtAppSetTypeConverter.man +++ b/man/XtAppSetTypeConverter.man @@ -89,11 +89,11 @@ Specifies a destroy procedure for resources produced by this conversion, or NULL if no additional action is required to deallocate resources produced by the converter. .SH DESCRIPTION -.BR XtSetTypeConverter +.B XtSetTypeConverter registers the specified type converter and destructor in all application contexts created by the calling process, including any future application contexts that may be created. -.BR XtAppSetTypeConverter +.B XtAppSetTypeConverter registers the specified type converter in the single application context specified. If the same \fIfrom_type\fP and \fIto_type\fP are specified in multiple calls to either function, the most recent overrides the diff --git a/man/XtBuildEventMask.man b/man/XtBuildEventMask.man index b231fb1..5d770f3 100644 --- a/man/XtBuildEventMask.man +++ b/man/XtBuildEventMask.man @@ -67,16 +67,16 @@ EventMask XtBuildEventMask(Widget \fIw\fP); Specifies the widget. .SH DESCRIPTION The -.BR XtBuildEventMask +.B XtBuildEventMask function returns the event mask representing the logical OR of all event masks for event handlers registered on the widget with -.BR XtAddEventHandler +.B XtAddEventHandler and all event translations, including accelerators, installed on the widget. This is the same event mask stored into the -.BR XSetWindowAttributes +.B XSetWindowAttributes structure by -.BR XtRealizeWidget +.B XtRealizeWidget and sent to the server when event handlers and translations are installed or removed on the realized widget. .SH "SEE ALSO" diff --git a/man/XtCallAcceptFocus.man b/man/XtCallAcceptFocus.man index 7360acc..99e7721 100644 --- a/man/XtCallAcceptFocus.man +++ b/man/XtCallAcceptFocus.man @@ -69,12 +69,12 @@ Specifies the X time of the event that is causing the accept focus. Specifies the widget. .SH DESCRIPTION The -.BR XtCallAcceptFocus +.B XtCallAcceptFocus function calls the specified widget's accept_focus procedure, passing it the specified widget and time, and returns what the accept_focus procedure returns. If accept_focus is NULL, -.BR XtCallAcceptFocus +.B XtCallAcceptFocus returns .BR False . .SH "SEE ALSO" diff --git a/man/XtCallActionProc.man b/man/XtCallActionProc.man index e039776..5d44881 100644 --- a/man/XtCallActionProc.man +++ b/man/XtCallActionProc.man @@ -75,7 +75,7 @@ Specifies the contents of the \fIparams\fP passed to the action routine. .IP \fInum_params\fP 1i Specifies the num of entries in \fIparams\fP. .SH DESCRIPTION -.BR XtCallActionProc +.B XtCallActionProc searches for the named action routine in the same manner and order as translation tables are bound. If found, the action routine is invoked with the specified widget, event pointer, and parameters. It is the @@ -83,7 +83,7 @@ responsibility of the caller to ensure that the contents of \fIevent\fP, \fIparams\fP, and \fInum_params\fP arguments are appropriate for the specified routine, and if necessary, that the specified widget is realized or sensitive. If the named action routine cannot be found, -.BR XtCallActionProc +.B XtCallActionProc generates a warning message and returns. .SH "SEE ALSO" .br diff --git a/man/XtCallCallbacks.man b/man/XtCallCallbacks.man index 8cbf638..dc0f0f7 100644 --- a/man/XtCallCallbacks.man +++ b/man/XtCallCallbacks.man @@ -82,12 +82,12 @@ Specifies the callback list to be executed. Specifies the widget. .SH DESCRIPTION The -.BR XtCallCallbacks +.B XtCallCallbacks function calls each procedure that is registered in the specified widget's callback list. .LP If \fIcallbacks\fP is not NULL, -.BR XtCallCallbackList +.B XtCallCallbackList calls each of the callback procedures in the list, passing client data and \fIcall_data\fP. The \fIcallbacks\fP parameter must specify the contents of a widget or object resource declared with representation @@ -95,11 +95,11 @@ type .BR XtRCallback . .LP The -.BR XtHasCallbacks +.B XtHasCallbacks function first checks to see if the widget has a callback list identified by callback_name. If the callback list does not exist, -.BR XtHasCallbacks +.B XtHasCallbacks returns .BR XtCallbackNoList . If the callback list exists but is empty, diff --git a/man/XtClass.man b/man/XtClass.man index a7d5280..1142654 100644 --- a/man/XtClass.man +++ b/man/XtClass.man @@ -107,48 +107,48 @@ Specifies the widget class. Specifies the message that is to be used. .SH DESCRIPTION The -.BR XtClass +.B XtClass function returns a pointer to the widget's class structure. .LP The -.BR XtSuperclass +.B XtSuperclass function returns a pointer to the widget's superclass class structure. .LP The -.BR XtIsSubclass +.B XtIsSubclass function returns -.BR True +.B True if the class of the specified widget is equal to or is a subclass of the specified class. The widget's class can be any number of subclasses down the chain and need not be an immediate subclass of the specified class. Composite widgets that need to restrict the class of the items they contain can use -.BR XtIsSubclass +.B XtIsSubclass to find out if a widget belongs to the desired class of objects. .LP The -.BR XtCheckSubclass +.B XtCheckSubclass macro determines if the class of the specified widget is equal to or is a subclass of the specified widget class. The widget can be any number of subclasses down the chain and need not be an immediate subclass of the specified widget class. If the specified widget is not a subclass, -.BR XtCheckSubclass +.B XtCheckSubclass constructs an error message from the supplied message, the widget's actual class, and the expected class and calls .BR XtErrorMsg . -.BR XtCheckSubclass +.B XtCheckSubclass should be used at the entry point of exported routines to ensure that the client has passed in a valid widget class for the exported operation. .LP -.BR XtCheckSubclass +.B XtCheckSubclass is only executed when the widget has been compiled with the compiler symbol DEBUG defined; otherwise, it is defined as the empty string and generates no code. .LP To test if a given widget belongs to a subclass of an Intrinsics-defined class, the Intrinsics defines macros or functions equivalent to -.BR XtIsSubclass +.B XtIsSubclass for each of the built-in classes. These procedures are .BR XtIsObject , .BR XtIsRectObj , diff --git a/man/XtConfigureWidget.man b/man/XtConfigureWidget.man index ce9b538..c6628e2 100644 --- a/man/XtConfigureWidget.man +++ b/man/XtConfigureWidget.man @@ -88,51 +88,51 @@ Specifies the widget. Specify the new widget x and y coordinates. .SH DESCRIPTION The -.BR XtConfigureWidget +.B XtConfigureWidget function returns immediately if the specified geometry fields are the same as the old values. Otherwise, -.BR XtConfigureWidget +.B XtConfigureWidget writes the new x, y, width, height, and border_width values into the widget and, if the widget is realized, makes an Xlib -.BR XConfigureWindow +.B XConfigureWindow call on the widget's window. .LP If either the new width or height is different from its old value, -.BR XtConfigureWidget +.B XtConfigureWidget calls the widget's resize procedure to notify it of the size change; otherwise, it simply returns. .LP The -.BR XtMoveWidget +.B XtMoveWidget function returns immediately if the specified geometry fields are the same as the old values. Otherwise, -.BR XtMoveWidget +.B XtMoveWidget writes the new x and y values into the widget and, if the widget is realized, issues an Xlib -.BR XMoveWindow +.B XMoveWindow call on the widget's window. .LP The -.BR XtResizeWidget +.B XtResizeWidget function returns immediately if the specified geometry fields are the same as the old values. Otherwise, -.BR XtResizeWidget +.B XtResizeWidget writes the new width, height, and border_width values into the widget and, if the widget is realized, issues an -.BR XConfigureWindow +.B XConfigureWindow call on the widget's window. .LP If the new width or height are different from the old values, -.BR XtResizeWidget +.B XtResizeWidget calls the widget's resize procedure to notify it of the size change. .LP The -.BR XtResizeWindow +.B XtResizeWindow function calls the -.BR XConfigureWindow +.B XConfigureWindow Xlib function to make the window of the specified widget match its width, height, and border width. This request is done unconditionally because there is no way to tell if these diff --git a/man/XtConvert.man b/man/XtConvert.man index af3dd27..2d85966 100644 --- a/man/XtConvert.man +++ b/man/XtConvert.man @@ -85,27 +85,27 @@ Returns the converted value. Specifies the widget to use for additional arguments (if any are needed). .SH DESCRIPTION The -.BR XtConvert +.B XtConvert function looks up the type converter registered to convert from_type to to_type, computes any additional arguments needed, and then calls .BR XtDirectConvert . -.BR XtConvert +.B XtConvert has been replaced by .BR XtConvertAndStore . .LP The -.BR XtDirectConvert +.B XtDirectConvert function looks in the converter cache to see if this conversion procedure has been called with the specified arguments. If so, it returns a descriptor for information stored in the cache; otherwise, it calls the converter and enters the result in the cache. .LP Before calling the specified converter, -.BR XtDirectConvert +.B XtDirectConvert sets the return value size to zero and the return value address to NULL. To determine if the conversion was successful, the client should check to_return.address for non-NULL. -.BR XtDirectConvert +.B XtDirectConvert has been replaced by .BR XtCallConverter . .SH "SEE ALSO" diff --git a/man/XtConvertAndStore.man b/man/XtConvertAndStore.man index 272ff44..e738f42 100644 --- a/man/XtConvertAndStore.man +++ b/man/XtConvertAndStore.man @@ -89,33 +89,33 @@ and the destroy callback list. Specifies the display with which the conversion is to be associated. .SH DESCRIPTION The -.BR XtConvertAndStore +.B XtConvertAndStore function looks up the type converter registered to convert from_type to to_type, computes any additional arguments needed, and then calls .BR XtCallConverter . (or -.BR XtDirectConvert +.B XtDirectConvert if an old-style converter was registered with -.BR XtAddConverter +.B XtAddConverter or .BR XtAppAddConverter . ) with the from and to_in_out arguments. .LP The -.BR XtCallConverter +.B XtCallConverter function looks up the specified type converter in the application context associated with the display and, if the converter was not registered or was registered with cache type -.BR XtCacheAll +.B XtCacheAll or -.BR XtCacheByDisplay +.B XtCacheByDisplay looks in the conversion cache to see if this conversion procedure has been called with the specified conversion arguments. If so, it checks the success status of the prior call, and if the conversion failed, -.BR XtCallConverter +.B XtCallConverter returns -.BR False +.B False immediately; otherwise it checks the size specified in the \fIto\fP argument and, if it is greater than or equal to the size stored in the cache, copies the information stored in the cache into the location @@ -124,23 +124,23 @@ and returns .BR True . If the size specified in the \fIto\fP argument is smaller than the size stored in the cache, -.BR XtCallConverter +.B XtCallConverter copies the cache size into the \fIto->size\fP and returns .BR False . If the converter was registered with cache type -.BR XtCacheNone +.B XtCacheNone or no value was found in the conversion cache, -.BR XtCallConverter +.B XtCallConverter calls the converter and, if it was not registered with cache type .BR XtCacheNone , enters the result into the cache. -.BR XtCallConverter +.B XtCallConverter then returns what the converter returned. .LP The \fIcache_ref_return\fP field specifies storage allocated by the caller in which an opaque value will be stored. If the type converter has been registered with the -.BR XtCacheRefCount +.B XtCacheRefCount modifier and if the value returned in in \fIcache_ref_return\fP is non-NULL, then the call should store the \fIcache_ref_return\fP value in order to decrement the reference count when the converted value diff --git a/man/XtCreateApplicationContext.man b/man/XtCreateApplicationContext.man index 53778a3..7bc67c4 100644 --- a/man/XtCreateApplicationContext.man +++ b/man/XtCreateApplicationContext.man @@ -76,28 +76,28 @@ Specifies the application context. Specifies the widget that you want the application context for. .SH DESCRIPTION The -.BR XtCreateApplicationContext +.B XtCreateApplicationContext function returns an application context, which is an opaque type. Every application must have at least one application context. .LP The -.BR XtDestroyApplicationContext +.B XtDestroyApplicationContext function destroys the specified application context as soon as it is safe to do so. If called from with an event dispatch (for example, a callback procedure), -.BR XtDestroyApplicationContext +.B XtDestroyApplicationContext does not destroy the application context until the dispatch is complete. .LP The -.BR XtWidgetToApplicationContext +.B XtWidgetToApplicationContext function returns the application context for the specified widget. .LP The -.BR XtToolkitInitialize +.B XtToolkitInitialize function initializes the Intrinsics internals. If -.BR XtToolkitInitialize +.B XtToolkitInitialize was previously called it returns immediately. .LP .SH "SEE ALSO" diff --git a/man/XtCreateApplicationShell.man b/man/XtCreateApplicationShell.man index 007514c..caec212 100644 --- a/man/XtCreateApplicationShell.man +++ b/man/XtCreateApplicationShell.man @@ -72,9 +72,9 @@ Specifies the argument list to override any other resource specifications. Specifies the number of arguments in the argument list. .SH DESCRIPTION The procedure -.BR XtCreateApplicationShell +.B XtCreateApplicationShell calls -.BR XtAppCreateShell +.B XtAppCreateShell with the \fIapplication\fP NULL, the application class passed to .BR XtInitialize , and the default application context created by diff --git a/man/XtCreatePopupShell.man b/man/XtCreatePopupShell.man index 64f10a1..5efb43e 100644 --- a/man/XtCreatePopupShell.man +++ b/man/XtCreatePopupShell.man @@ -81,9 +81,9 @@ Specifies the widget class pointer for the created shell widget. Specifies the variable argument list to override the resource defaults. .SH DESCRIPTION The -.BR XtCreatePopupShell +.B XtCreatePopupShell function ensures that the specified class is a subclass of -.BR Shell +.B Shell and, rather than using insert_child to attach the widget to the parent's .IN "insert_child procedure" children list, attaches the shell to the parent's pop-ups list directly. diff --git a/man/XtCreateSelectionRequest.man b/man/XtCreateSelectionRequest.man index 120f307..83502a0 100644 --- a/man/XtCreateSelectionRequest.man +++ b/man/XtCreateSelectionRequest.man @@ -77,19 +77,19 @@ Specifies the particular selection desired. Specifies the timestamp to be used in making the request. .SH DESCRIPTION When -.BR XtCreateSelectionRequest +.B XtCreateSelectionRequest is called, subsequent calls to -.BR XtGetSelectionValue +.B XtGetSelectionValue and -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental with the requestor and selection as specified to -.BR XtCreateSelectionRequest +.B XtCreateSelectionRequest will be bundled into a single selection conversion request with multiple targets. The request is actually initiated by calling .BR XtSendSelectionRequest . .LP When -.BR XtSendSelectionRequest +.B XtSendSelectionRequest is called with a value of \fIrequestor\fP and \fIselection\fP matching a previous call to .BR XtCreateSelectionRequest , @@ -98,30 +98,30 @@ If a single target request is queued, that request is made. If multiple targets are queued they are bundled into a single request with the target MULTIPLE using the specified timestamp. As the conversions are made, the callbacks associated with each -.BR XtGetSelectionValue +.B XtGetSelectionValue and -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental are invoked in turn. .LP Multi-threaded applications should lock the application context before calling -.BR XtCreateSelectionRequest +.B XtCreateSelectionRequest and release the lock after calling -.BR XtSendSelectionRequest +.B XtSendSelectionRequest to ensure that the thread assembling the request is safe from interference by another thread assembling a different request naming the same widget and selection. .LP When -.BR XtCancelSelectionRequest +.B XtCancelSelectionRequest is called, any requests queued since the last call to -.BR XtCreateSelectionRequest +.B XtCreateSelectionRequest are cleaned up. Subsequent calls to .BR XtGetSelectionValue , .BR XtGetSelectionValues , .BR XtGetSelectionValueIncremental , and -.BR XtGetSelectionValuesIncremental +.B XtGetSelectionValuesIncremental will not be deferred. .SH "SEE ALSO" .br diff --git a/man/XtCreateWidget.man b/man/XtCreateWidget.man index d645f15..4922425 100644 --- a/man/XtCreateWidget.man +++ b/man/XtCreateWidget.man @@ -96,7 +96,7 @@ Specifies the widget class pointer for the created widget. Specifies the variable argument list to override the resource defaults. .SH DESCRIPTION The -.BR XtCreateWidget +.B XtCreateWidget function performs much of the boilerplate operations of widget creation: .IP \(bu 5 Checks to see if the class_initialize procedure has been called for this class @@ -124,7 +124,7 @@ and all superclasses up to .BR constraintWidgetClass . .IP \(bu 5 Calls the initialize procedures for the widget by starting at the -.BR Core +.B Core initialize procedure on down to the widget's initialize procedure. .IP \(bu 5 If the parent is a subclass of @@ -138,24 +138,24 @@ If the parent is a subclass of .BR constraintWidgetClass , it calls the constraint initialize procedures, starting at -.BR constraintWidgetClass +.B constraintWidgetClass on down to the parent's constraint initialize procedure. .LP Note that you can determine the number of arguments in an argument list by using the -.BR XtNumber +.B XtNumber macro. For further information, see Section 11.1. .LP The -.BR XtCreateManagedWidget +.B XtCreateManagedWidget function is a convenience routine that calls -.BR XtCreateWidget +.B XtCreateWidget and .BR XtManageChild . .LP The -.BR XtDestroyWidget +.B XtDestroyWidget function provides the only method of destroying a widget, including widgets that need to destroy themselves. It can be called at any time, @@ -164,7 +164,7 @@ This requires a two-phase destroy process in order to avoid dangling references to destroyed widgets. .LP In phase one, -.BR XtDestroyWidget +.B XtDestroyWidget performs the following: .IP \(bu 5 If the being_destroyed field of the widget is @@ -173,7 +173,7 @@ it returns immediately. .IP \(bu 5 Recursively descends the widget tree and sets the being_destroyed field to -.BR True +.B True for the widget and all children. .IP \(bu 5 Adds the widget to a list of widgets (the destroy list) that should be @@ -187,12 +187,12 @@ Phase two occurs when all procedures that should execute as a result of the current event have been called (including all procedures registered with the event and translation managers), that is, when the current invocation of -.BR XtDispatchEvent +.B XtDispatchEvent is about to return or immediately if not in .BR XtDispatchEvent . .LP In phase two, -.BR XtDestroyWidget +.B XtDestroyWidget performs the following on each entry in the destroy list: .IP \(bu 5 Calls the destroy callback procedures registered on the widget @@ -200,10 +200,10 @@ Calls the destroy callback procedures registered on the widget before parent callbacks). .IP \(bu 5 If the widget's parent is a subclass of -.BR compositeWidgetClass +.B compositeWidgetClass and if the parent is not being destroyed, it calls -.BR XtUnmanageChild +.B XtUnmanageChild on the widget and then calls the widget's parent's delete_child procedure (see Section 3.4). .IP \(bu 5 @@ -223,7 +223,7 @@ until finally it calls the destroy procedure declared in the Core class record. .IP \(bu 5 Calls -.BR XDestroyWindow +.B XDestroyWindow if the widget is realized (that is, has an X window). The server recursively destroys all descendant windows. .IP \(bu 5 diff --git a/man/XtCreateWindow.man b/man/XtCreateWindow.man index bb2c89e..b2c47eb 100644 --- a/man/XtCreateWindow.man +++ b/man/XtCreateWindow.man @@ -67,7 +67,7 @@ void XtCreateWindow(Widget \fIw\fP, unsigned int \fIwindow_class\fP, Visual .SH ARGUMENTS .IP \fIattributes\fP 1i Specifies the window attributes to use in the -.BR XCreateWindow +.B XCreateWindow call. .IP \fIvalue_mask\fP 1i Specifies which attribute fields to use. @@ -84,15 +84,15 @@ or .BR CopyFromParent ). .SH DESCRIPTION The -.BR XtCreateWindow +.B XtCreateWindow function calls the Xlib -.BR XCreateWindow +.B XCreateWindow function with values from the widget structure and the passed parameters. Then, it assigns the created window to the widget's window field. .LP -.BR XtCreateWindow +.B XtCreateWindow evaluates the following fields of the -.BR Core +.B Core widget structure: .IP \(bu 5 depth diff --git a/man/XtDisplay.man b/man/XtDisplay.man index 57a689c..0fbda51 100644 --- a/man/XtDisplay.man +++ b/man/XtDisplay.man @@ -78,22 +78,22 @@ Specifies the widget. .IP \fIobject\fP 1i Specifies the widget. .SH DESCRIPTION -.BR XtDisplay +.B XtDisplay returns the display pointer for the specified widget. .LP -.BR XtDisplayOfObject +.B XtDisplayOfObject returns the display pointer for the specified object. .LP -.BR XtScreen +.B XtScreen returns the screen pointer for the specified widget. .LP -.BR XtScreenOfObject +.B XtScreenOfObject returns the screen pointer for the specified object. .LP -.BR XtWindow +.B XtWindow returns the window of the specified widget. .LP -.BR XtWindowOfObject +.B XtWindowOfObject returns the window of the specified object. .SH "SEE ALSO" .br diff --git a/man/XtDisplayInitialize.man b/man/XtDisplayInitialize.man index 0356cbc..bcdda9e 100644 --- a/man/XtDisplayInitialize.man +++ b/man/XtDisplayInitialize.man @@ -102,13 +102,13 @@ see \fI\*(xL\fP. Specifies the screen whose resource database is to be returned. .SH DESCRIPTION The -.BR XtDisplayInitialize +.B XtDisplayInitialize function builds the resource database, calls the Xlib -.BR XrmParseCommand +.B XrmParseCommand function to parse the command line, and performs other per display initialization. After -.BR XrmParseCommand +.B XrmParseCommand has been called, argc and argv contain only those parameters that were not in the standard option table or in the table specified by the @@ -119,35 +119,35 @@ listing the allowable options. On UNIX-based systems, the application name is usually the final component of argv[0]. If the synchronize resource is -.BR True +.B True for the specified application, -.BR XtDisplayInitialize +.B XtDisplayInitialize calls the Xlib -.BR XSynchronize +.B XSynchronize function to put Xlib into synchronous mode for this display connection. If the reverseVideo resource is .BR True , the \*(xI exchange -.BR XtDefaultForeground +.B XtDefaultForeground and -.BR XtDefaultBackground +.B XtDefaultBackground for widgets created on this display. (See Section 9.6.1). .LP The -.BR XtOpenDisplay +.B XtOpenDisplay function calls -.BR XOpenDisplay +.B XOpenDisplay the specified display name. If display_string is NULL, -.BR XtOpenDisplay +.B XtOpenDisplay uses the current value of the \-display option specified in argv and if no display is specified in argv, uses the user's default display (on UNIX-based systems, this is the value of the DISPLAY environment variable). .LP If this succeeds, it then calls -.BR XtDisplayInitialize +.B XtDisplayInitialize and pass it the opened display and the value of the \-name option specified in argv as the application name. If no name option is specified, @@ -155,39 +155,39 @@ it uses the application name passed to .BR XtOpenDisplay . If the application name is NULL, it uses the last component of argv[0]. -.BR XtOpenDisplay +.B XtOpenDisplay returns the newly opened display or NULL if it failed. .LP -.BR XtOpenDisplay +.B XtOpenDisplay is provided as a convenience to the application programmer. .LP The -.BR XtCloseDisplay +.B XtCloseDisplay function closes the specified display as soon as it is safe to do so. If called from within an event dispatch (for example, a callback procedure), -.BR XtCloseDisplay +.B XtCloseDisplay does not close the display until the dispatch is complete. Note that applications need only call -.BR XtCloseDisplay +.B XtCloseDisplay if they are to continue executing after closing the display; otherwise, they should call -.BR XtDestroyApplicationContext +.B XtDestroyApplicationContext or just exit. .LP The -.BR XtDatabase +.B XtDatabase function returns the fully merged resource database that was built by -.BR XtDisplayInitialize +.B XtDisplayInitialize associated with the display that was passed in. If this display has not been initialized by .BR XtDisplayInitialize , the results are not defined. .LP The -.BR XtScreenDatabase +.B XtScreenDatabase function returns the fully merged resource database associated with the specified screen. If the \fIscreen\fP does not belong to a -.BR Display +.B Display initialized by .BR XtDisplayInitialize , the results are undefined. diff --git a/man/XtDisplayStringConversionWarning.man b/man/XtDisplayStringConversionWarning.man index 2e4846c..6c22c05 100644 --- a/man/XtDisplayStringConversionWarning.man +++ b/man/XtDisplayStringConversionWarning.man @@ -72,16 +72,16 @@ Specifies the string that could not be converted. Specifies the target representation type requested. .SH DESCRIPTION The -.BR XtDisplayStringConversionWarning +.B XtDisplayStringConversionWarning function issues a warning message using -.BR XtAppWarningMsg +.B XtAppWarningMsg with name ``conversionError'', type ``string'', class ``XtToolkitError, and the default message string ``Cannot convert "\fIfrom_value\fP" to type \fIto_type\fP''. .LP To issue other types of warning or error messages, the type converter should use -.BR XtAppWarningMsg +.B XtAppWarningMsg or .BR XtAppErrorMsg . .SH "SEE ALSO" diff --git a/man/XtDisplayToApplicationContext.man b/man/XtDisplayToApplicationContext.man index 9ad1bef..052c6ab 100644 --- a/man/XtDisplayToApplicationContext.man +++ b/man/XtDisplayToApplicationContext.man @@ -66,7 +66,7 @@ XtAppContext XtDisplayToApplicationContext(Display* \fIdpy\fP); Specifies the display that you want the application context for. .SH DESCRIPTION The -.BR XtDisplayToApplicationContext +.B XtDisplayToApplicationContext function returns the application context for the specified display. .SH "SEE ALSO" \fI\*(xT\fP diff --git a/man/XtError.man b/man/XtError.man index d2dfbc5..6f78a4f 100644 --- a/man/XtError.man +++ b/man/XtError.man @@ -77,22 +77,22 @@ or the nonfatal error procedure, which usually returns. Specifies the message that is to be reported. .SH DESCRIPTION The -.BR XtError +.B XtError function has been superceded by .BR XtAppError . .LP The -.BR XtSetErrorHandler +.B XtSetErrorHandler function has been superceded by .BR XtAppSetErrorHandler . .LP The -.BR XtSetWarningHandler +.B XtSetWarningHandler function has been superceded by .BR XtAppSetWarningHandler . .LP The -.BR XtWarning +.B XtWarning function has been superceded by .BR XtAppWarning . .SH "SEE ALSO" diff --git a/man/XtErrorMsg.man b/man/XtErrorMsg.man index f49f3b4..ac73614 100644 --- a/man/XtErrorMsg.man +++ b/man/XtErrorMsg.man @@ -88,24 +88,24 @@ Specifies the number of values in the parameter list. Specifies a pointer to a list of values to be stored in the message. .SH DESCRIPTION The -.BR XtErrorMsg +.B XtErrorMsg function has been superceded by .BR XtAppErrorMsg . .LP The -.BR XtSetErrorMsgHandler +.B XtSetErrorMsgHandler function has been superceded by .BR XtAppSetErrorMsgHandler . .LP The -.BR XtSetWarningMsgHandler +.B XtSetWarningMsgHandler function has been superceded by .BR XtAppSetWarningMsgHandler . .LP The -.BR XtWarningMsg +.B XtWarningMsg function has been superceded by -.BR XtAppWarningMsg +.B XtAppWarningMsg .SH "SEE ALSO" .BR XtAppErrorMsg (__libmansuffix__) .br diff --git a/man/XtFindFile.man b/man/XtFindFile.man index ad67ce9..9f4ac70 100644 --- a/man/XtFindFile.man +++ b/man/XtFindFile.man @@ -81,7 +81,7 @@ single colon. The character sequence ``%%'' specifies a percent character that does not introduce a substitution; the sequence is replaced by a single percent character. If a percent character is followed by any other character, -.BR XtFindFile +.B XtFindFile looks through the specified \fIsubstitutions\fP for that character in the \fImatch\fP field and if found replaces the percent and match characters with the string in the @@ -89,11 +89,11 @@ corresponding \fIsubstitution\fP field. A \fIsubstitution\fP field entry of NUL is equivalent to a pointer to an empty string. If the operating system does not interpret multiple embedded name separators in the path (i.e., ``/'' in POSIX) the same way as a single separator, -.BR XtFindFile +.B XtFindFile will collapse multiple separators into a single one after performing all string substitutions. Except for collapsing embedded separators, the contents of the string substitutions are not interpreted by -.BR XtFindFile +.B XtFindFile and may therefore contain any operating-system-dependent characters, including additional name separators. Each resulting string is passed to the predicate procedure until a string is found for @@ -102,16 +102,16 @@ which the procedure returns this string is the return value for .BR XtFindFile . If no string yields a -.BR True +.B True return from the predicate, -.BR XtFindFile +.B XtFindFile returns NULL. .LP If the \fIpredicate\fP parameter is NULL, an internal procedure that checks if the file exists, is readable, and is not a directory will be used. .LP It is the responsibility of the caller to free the returned string using -.BR XtFree +.B XtFree when it is no longer needed. .SH "SEE ALSO" .br diff --git a/man/XtGetActionKeysym.man b/man/XtGetActionKeysym.man index 86139ad..3423943 100644 --- a/man/XtGetActionKeysym.man +++ b/man/XtGetActionKeysym.man @@ -70,29 +70,29 @@ Intrinsics. Returns the modifiers that caused the match, if non-NULL. .SH DESCRIPTION If -.BR XtGetActionKeysym +.B XtGetActionKeysym is called after an action procedure has been invoked by the Intrinsics and before that action procedure returns, and if the event pointer has the same value as the event pointer passed to that action routine, and if the event is a -.BR KeyPress +.B KeyPress or -.BR KeyRelease +.B KeyRelease event, then -.BR XtGetActionKeysym +.B XtGetActionKeysym returns the KeySym that matched the final event specification in the translation table and, if \fImodifiers_return\fP is non-NULL, the modifier state actually used to generate this KeySym; otherwise, if the event is a -.BR KeyPress +.B KeyPress or -.BR KeyRelease +.B KeyRelease event, then -.BR XtGetActionKeysym +.B XtGetActionKeysym calls -.BR XtTranslateKeycode +.B XtTranslateKeycode and returns the results; else it returns -.BR NoSymbol +.B NoSymbol and does not examine \fImodifiers_return\fP. .SH "SEE ALSO" .br diff --git a/man/XtGetActionList.man b/man/XtGetActionList.man index 7899ee6..06a9d33 100644 --- a/man/XtGetActionList.man +++ b/man/XtGetActionList.man @@ -70,16 +70,16 @@ Returns the action list. .IP \fInum_actions_return\fP 1i Returns the number of action procedures declared by the class. .SH DESCRIPTION -.BR XtGetActionList +.B XtGetActionList returns the action table defined by the specified widget class. This table does not include actions defined by the superclasses. If \fIwidget_class\fP is not initialized, or is not -.BR coreWidgetClass +.B coreWidgetClass or a subclass thereof, or if the class does not define any actions, *\fIactions_return\fP will be NULL and *\fInum_actions_return\fP will be zero. If *\fIactions_return\fP is non-NULL the client is responsible for freeing the table using -.BR XtFree +.B XtFree when it is no longer needed. .SH "SEE ALSO" .br diff --git a/man/XtGetApplicationNameAndClass.man b/man/XtGetApplicationNameAndClass.man index 869447b..c660974 100644 --- a/man/XtGetApplicationNameAndClass.man +++ b/man/XtGetApplicationNameAndClass.man @@ -71,9 +71,9 @@ Returns the application name. .IP \fIclass_return\fP 1i Returns the application class. .SH DESCRIPTION -.BR XtGetApplicationNameAndClass +.B XtGetApplicationNameAndClass returns the application name and class passed to -.BR XtDisplayInitialize +.B XtDisplayInitialize for the specified display. If the display was never initialized or has been closed, the result is undefined. The returned strings are owned by the Intrinsics and must not be modified or freed by the diff --git a/man/XtGetApplicationResources.man b/man/XtGetApplicationResources.man index 202b31c..7e998f4 100644 --- a/man/XtGetApplicationResources.man +++ b/man/XtGetApplicationResources.man @@ -86,14 +86,14 @@ or that identifies the resource database to search. Specifies the variable arguments to override resources obtained from the resource database. .SH DESCRIPTION The -.BR XtGetApplicationResources +.B XtGetApplicationResources function first uses the passed widget, which is usually an application shell, to construct a resource name and class list, Then, it retrieves the resources from the argument list, the resource database, or the resource list default values. After adding base to each address, -.BR XtGetApplicationResources +.B XtGetApplicationResources copies the resources into the address given in the resource list. If args is NULL, num_args must be zero. diff --git a/man/XtGetClassExtension.man b/man/XtGetClassExtension.man index dc77d3e..db7f336 100644 --- a/man/XtGetClassExtension.man +++ b/man/XtGetClassExtension.man @@ -83,7 +83,7 @@ The list of extension records at the specified offset in the specified \fItype\fP, a version greater than or equal to the specified \fIversion\fP, and a record size greater than or equal the specified \fIrecord_size\fP if it is nonzero. -.BR XtGetClassExtension +.B XtGetClassExtension returns a pointer to a matching extension record or NULL if no match is found. The returned extension record is owned by the widget class and must not be modified or freed by the caller, except possibly to diff --git a/man/XtGetErrorDatabase.man b/man/XtGetErrorDatabase.man index db9ef32..a6bc763 100644 --- a/man/XtGetErrorDatabase.man +++ b/man/XtGetErrorDatabase.man @@ -83,12 +83,12 @@ of the error message. Specifies the size of the buffer in bytes. .SH DESCRIPTION The -.BR XtGetErrorDatabase +.B XtGetErrorDatabase function has been superceded by .BR XtAppGetErrorDatabase . .LP The -.BR XtGetErrorDatabaseText +.B XtGetErrorDatabaseText function has been superceded by .BR XtAppGetErrorDatabaseText . .SH "SEE ALSO" diff --git a/man/XtGetGC.man b/man/XtGetGC.man index 0df53d1..321c772 100644 --- a/man/XtGetGC.man +++ b/man/XtGetGC.man @@ -76,14 +76,14 @@ Specifies which fields of the values are specified. Specifies the widget. .SH DESCRIPTION The -.BR XtGetGC +.B XtGetGC function returns a sharable, read-only GC. The parameters to this function are the same as those for -.BR XCreateGC +.B XCreateGC except that a widget is passed instead of a display. -.BR XtGetGC +.B XtGetGC shares only GCs in which all values in the GC returned by -.BR XCreateGC +.B XCreateGC are the same. In particular, it does not use the value_mask provided to determine which fields of the GC a widget considers relevant. @@ -91,11 +91,11 @@ The value_mask is used only to tell the server which fields should be filled in with widget data and which it should fill in with default values. For further information about value_mask and values, see -.BR XCreateGC +.B XCreateGC in the \fI\*(xL\fP. .LP The -.BR XtReleaseGC +.B XtReleaseGC function deallocate the specified shared GC. .SH "SEE ALSO" .br diff --git a/man/XtGetKeyboardFocusWidget.man b/man/XtGetKeyboardFocusWidget.man index e6d6944..8846f01 100644 --- a/man/XtGetKeyboardFocusWidget.man +++ b/man/XtGetKeyboardFocusWidget.man @@ -66,7 +66,7 @@ Widget XtGetKeyboardFocusWidget(Widget \fIwidget\fP); Specifies the widget for this event handler. Must be of class Core or any subclass thereof. .SH DESCRIPTION -.BR XtGetKeyboardFocusWidget +.B XtGetKeyboardFocusWidget function returns the widget that would be the end result of keyboard event forwarding for a keyboard event for the specified widget. .SH "SEE ALSO" diff --git a/man/XtGetKeysymTable.man b/man/XtGetKeysymTable.man index 4693b28..9d50f4e 100644 --- a/man/XtGetKeysymTable.man +++ b/man/XtGetKeysymTable.man @@ -86,17 +86,17 @@ or NULL if \fIkeycount_return\fP is 0. .IP \fIkeycount_return\fP 1i Returns the number of KeyCodes in the keycode list. .SH DESCRIPTION -.BR XtGetKeysymTable +.B XtGetKeysymTable returns a pointer to the Intrinsics' copy of the server's KeyCode-to-KeySym table. This table must not be modified. .LP The -.BR XtKeysymToKeycodeList +.B XtKeysymToKeycodeList procedure returns all the KeyCodes that have \fIkeysym\fP in their entry for the keyboard mapping table associated with \fIdisplay\fP. The caller should free the storage pointed to by \fIkeycodes_return\fP using -.BR XtFree +.B XtFree when it is no longer useful. .SH "SEE ALSO" .br diff --git a/man/XtGetResourceList.man b/man/XtGetResourceList.man index 514c021..770ab2a 100644 --- a/man/XtGetResourceList.man +++ b/man/XtGetResourceList.man @@ -73,42 +73,42 @@ resource list. .IP \fIresources_return\fP 1i Specifies a pointer to where to store the returned resource list. The caller must free this storage using -.BR XtFree +.B XtFree when done with it. .IP \fIwidget_class\fP 1i Specifies the widget class for which you want the list. .SH DESCRIPTION If -.BR XtGetResourceList +.B XtGetResourceList is called before the widget class is initialized (that is, before the first widget of that class has been created), -.BR XtGetResourceList +.B XtGetResourceList returns the resource list as specified in the widget class record. If it is called after the widget class has been initialized, -.BR XtGetResourceList +.B XtGetResourceList returns a merged resource list that contains the resources for all superclasses. The list returned by -.BR XtGetResourceList +.B XtGetResourceList should be freed using -.BR XtFree +.B XtFree when it is no longer needed. .LP If -.BR XtGetConstraintResourceList +.B XtGetConstraintResourceList is called before the widget class is initialized (that is, before the first widget of that class has been created), -.BR XtGetConstraintResourceList +.B XtGetConstraintResourceList returns the resource list as specified in the widget class Constraint part record. If it is called after the widget class has been initialized, -.BR XtGetConstraintResourceList +.B XtGetConstraintResourceList returns a merged resource list that contains the Constraint resources for all superclasses. If the specified class is not a subclass of .BR constraintWidgetClass , \fI*resources_return\fP is set to NULL and \fI*num_resources_return\fP is set to zero. The list returned by -.BR XtGetConstraintResourceList +.B XtGetConstraintResourceList should be freed using -.BR XtFree +.B XtFree when it is no longer needed. .SH "SEE ALSO" XtGetSubresources(__libmansuffix__), diff --git a/man/XtGetSelectionParameters.man b/man/XtGetSelectionParameters.man index a4d1c17..ff08b36 100644 --- a/man/XtGetSelectionParameters.man +++ b/man/XtGetSelectionParameters.man @@ -86,11 +86,11 @@ stored. Specifies a pointer into which the size in bits of the parameter data in the elements of \fIvalue_return\fP will be stored. .SH DESCRIPTION -.BR XtGetSelectionParameters +.B XtGetSelectionParameters may only be called from within an -.BR XtConvertSelectionProc +.B XtConvertSelectionProc or from within the last call to an -.BR XtConvertSelectionIncrProc +.B XtConvertSelectionIncrProc with a new request_id. .SH "SEE ALSO" XtSetSelectionParameters(__libmansuffix__) diff --git a/man/XtGetSelectionRequest.man b/man/XtGetSelectionRequest.man index edd2ca7..3c549ba 100644 --- a/man/XtGetSelectionRequest.man +++ b/man/XtGetSelectionRequest.man @@ -71,19 +71,19 @@ Specifies the selection being processed. Specifies the requestor id in the case of incremental selections, or NULL in the case of atomic transfers. .SH DESCRIPTION -.BR XtGetSelectionRequest +.B XtGetSelectionRequest may only be called from within an -.BR XtConvertSelectionProc +.B XtConvertSelectionProc procedure and returns a pointer to the -.BR SelectionRequest +.B SelectionRequest event that caused the conversion procedure to be invoked. \fIRequest_id\fP specifies a unique id for the individual request in the case that multiple incremental transfers are outstanding. For atomic transfers, \fIrequest_id\fP must be specified as NULL. If no -.BR SelectionRequest +.B SelectionRequest event is being processed for the specified \fIwidget\fP, \fIselection\fP, and \fIrequest_id\fP, -.BR XtGetSelectionRequest +.B XtGetSelectionRequest returns NULL. .SH "SEE ALSO" .br diff --git a/man/XtGetSelectionTimeout.man b/man/XtGetSelectionTimeout.man index a3a71ba..1aaf35f 100644 --- a/man/XtGetSelectionTimeout.man +++ b/man/XtGetSelectionTimeout.man @@ -68,12 +68,12 @@ void XtSetSelectionTimeout(unsigned long \fItimeout\fP); Specifies the selection timeout in milliseconds. .SH DESCRIPTION The -.BR XtGetSelectionTimeout +.B XtGetSelectionTimeout function has been superceded by .BR XtAppGetSelectionTimeout . .LP The -.BR XtSetSelectionTimeout +.B XtSetSelectionTimeout function has been superceded by .BR XtAppSetSelectionTimeout . .SH "SEE ALSO" diff --git a/man/XtGetSelectionValue.man b/man/XtGetSelectionValue.man index da37a63..32e2131 100644 --- a/man/XtGetSelectionValue.man +++ b/man/XtGetSelectionValue.man @@ -91,30 +91,30 @@ Specifies the timestamp that indicates when the selection value is desired. Specifies the widget that is making the request. .SH DESCRIPTION The -.BR XtGetSelectionValue +.B XtGetSelectionValue function requests the value of the selection that has been converted to the target type. The specified callback will be called some time after -.BR XtGetSelectionValue +.B XtGetSelectionValue is called; in fact, it may be called before or after -.BR XtGetSelectionValue +.B XtGetSelectionValue returns. .LP The -.BR XtGetSelectionValues +.B XtGetSelectionValues function is similar to -.BR XtGetSelectionValue +.B XtGetSelectionValue except that it takes a list of target types and a list of client data and obtains the current value of the selection converted to each of the targets. The effect is as if each target were specified in a separate call to .BR XtGetSelectionValue . The callback is called once with the corresponding client data for each target. -.BR XtGetSelectionValues +.B XtGetSelectionValues does guarantee that all the conversions will use the same selection value because the ownership of the selection cannot change in the middle of the list, as would be when calling -.BR XtGetSelectionValue +.B XtGetSelectionValue repeatedly. .SH "SEE ALSO" XtAppGetSelectionTimeout(__libmansuffix__), diff --git a/man/XtGetSelectionValueIncremental.man b/man/XtGetSelectionValueIncremental.man index 662b3cb..cfce3b3 100644 --- a/man/XtGetSelectionValueIncremental.man +++ b/man/XtGetSelectionValueIncremental.man @@ -90,9 +90,9 @@ Specifies the timestamp that indicates when the selection value is desired. Specifies the widget that is making the request. .SH DESCRIPTION The -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental function is similar to -.BR XtGetSelectionValue +.B XtGetSelectionValue except that the \fIselection_callback\fP procedure will be called repeatedly upon delivery of multiple segments of the selection value. The end of the selection value is indicated when \fIselection_callback\fP @@ -101,7 +101,7 @@ freed by the client. If the transfer of the selection is aborted in the middle of a transfer (for example, because to timeout), the \fIselection_callback\fP procedure is called with a type value equal to the symbolic constant -.BR XT_CONVERT_FAIL +.B XT_CONVERT_FAIL so that the requestor can dispose of the partial selection value it has collected up until that point. Upon receiving .BR XT_CONVERT_FAIL , @@ -109,19 +109,19 @@ the requesting client must determine for itself whether or not a partially completed transfer is meaningful. .LP The -.BR XtGetSelectionValuesIncremental +.B XtGetSelectionValuesIncremental function is similar to -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental except that it takes a list of target types and a list of client data and obtains the current value of the selection converted to each of the targets. The effect is as if each target were specified in a separate call to .BR XtGetSelectionValueIncremental . The callback is called once with the corresponding client data for each target. -.BR XtGetSelectionValuesIncremental +.B XtGetSelectionValuesIncremental does guarantee that all the conversions will use the same selection value because the ownership of the selection cannot change in the middle of the list, as would be when calling -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental repeatedly. .SH "SEE ALSO" .br diff --git a/man/XtGetSubresources.man b/man/XtGetSubresources.man index 34797bf..acad29b 100644 --- a/man/XtGetSubresources.man +++ b/man/XtGetSubresources.man @@ -91,7 +91,7 @@ or that identifies the resource database to search. Specifies the variable arguments to override resources obtained from the resource database. .SH DESCRIPTION The -.BR XtGetSubresources +.B XtGetSubresources function constructs a name/class list from the application name/class, the name/classes of all its ancestors, and the widget itself. Then, it appends to this list the name/class pair passed in. diff --git a/man/XtGrabKey.man b/man/XtGrabKey.man index db13fc3..0998a98 100644 --- a/man/XtGrabKey.man +++ b/man/XtGrabKey.man @@ -118,125 +118,125 @@ class Core or a subclass thereof. .IP \fIcursor\fP 1i Specifies arguments to the associated Xlib function call. .SH DESCRIPTION -.BR XtGrabKey +.B XtGrabKey calls -.BR XGrabKey +.B XGrabKey specifying the widget's window as the grab window if the widget is realized. The remaining arguments are exactly as for .BR XGrabKey . If the widget is not realized, or is later unrealized, the call to -.BR XGrabKey +.B XGrabKey will be performed (again) when the widget is realized and its window becomes mapped. In the future, if -.BR XtDispatchEvent +.B XtDispatchEvent is called with a -.BR KeyPress +.B KeyPress event matching the specified keycode and modifiers (which may be -.BR AnyKey +.B AnyKey or .BR AnyModifier , respectively) for the widget's window, the Intrinsics will call -.BR XtUngrabKeyboard +.B XtUngrabKeyboard with the timestamp from the -.BR KeyPress +.B KeyPress event if either of the following conditions is true: .IP \(bu 3 There is a modal cascade and the widget is not in the active subset of the cascade and the keyboard was not previously grabbed, or .IP \(bu 3 -.BR XFilterEvent +.B XFilterEvent returns .BR True . .LP -.BR XtUngrabKey +.B XtUngrabKey calls -.BR XUngrabKey +.B XUngrabKey specifying the widget's window as the ungrab window if the widget is realized. The remaining arguments are exactly as for .BR XUngrabKey . If the widget is not realized, -.BR XtUngrabKey +.B XtUngrabKey removes a deferred -.BR XtGrabKey +.B XtGrabKey request, if any, for the specified widget, keycode, and modifiers. .LP If the specified widget is realized -.BR XtGrabKeyboard +.B XtGrabKeyboard calls -.BR XGrabKeyboard +.B XGrabKeyboard specifying the widget's window as the grab window. The remaining arguments and return value are exactly as for .BR XGrabKeyboard . If the widget is not realized, -.BR XtGrabKeyboard +.B XtGrabKeyboard immediately returns .BR GrabNotViewable . No future ungrab is implied by .BR XtGrabKeyboard . .LP -.BR XtUngrabKeyboard +.B XtUngrabKeyboard calls -.BR XUngrabKeyboard +.B XUngrabKeyboard with the specified time. .LP -.BR XtGrabButton +.B XtGrabButton calls -.BR XGrabButton +.B XGrabButton specifying the widget's window as the grab window if the widget is realized. The remaining arguments are exactly as for .BR XGrabButton . If the widget is not realized, or is later unrealized, the call to -.BR XGrabButton +.B XGrabButton will be performed (again) when the widget is realized and its window becomes mapped. In the future, if -.BR XtDispatchEvent +.B XtDispatchEvent is called with a -.BR ButtonPress +.B ButtonPress event matching the specified button and modifiers (which may be -.BR AnyButton +.B AnyButton or .BR AnyModifier , respectively) for the widget's window, the Intrinsics will call -.BR XtUngrabPointer +.B XtUngrabPointer with the timestamp from the -.BR ButtonPress +.B ButtonPress event if either of the following conditions is true: .IP \(bu 3 There is a modal cascade and the widget is not in the active subset of the cascade and the pointer was not previously grabbed, or .IP \(bu 3 -.BR XFilterEvent +.B XFilterEvent returns .BR True . .LP -.BR XtUngrabButton +.B XtUngrabButton calls -.BR XUngrabButton +.B XUngrabButton specifying the widget's window as the ungrab window if the widget is realized. The remaining arguments are exactly as for .BR XUngrabButton . If the widget is not realized, -.BR XtUngrabButton +.B XtUngrabButton removes a deferred -.BR XtGrabButton +.B XtGrabButton request, if any, for the specified widget, button, and modifiers. .LP -.BR XtGrabPointer +.B XtGrabPointer calls -.BR XGrabPointer +.B XGrabPointer specifying the widget's window as the grab window. The remaining arguments and return value are exactly as for .BR XGrabPointer . If the widget is not realized, -.BR XtGrabPointer +.B XtGrabPointer immediately returns .BR GrabNotViewable . No future ungrab is implied by .BR XtGrabPointer . .LP -.BR XtUngrabPointer +.B XtUngrabPointer calls -.BR XUngrabPointer +.B XUngrabPointer with the specified time. .SH "SEE ALSO" .br diff --git a/man/XtInitialize.man b/man/XtInitialize.man index 975c6c9..a702bdd 100644 --- a/man/XtInitialize.man +++ b/man/XtInitialize.man @@ -81,19 +81,19 @@ Specifies a pointer to the number of command line parameters. .IP \fIargv\fP 1i Specifies the command line parameters. .SH DESCRIPTION -.BR XtInitialize +.B XtInitialize calls -.BR XtToolkitInitialize +.B XtToolkitInitialize followed by -.BR XtOpenDisplay +.B XtOpenDisplay with \fIdisplay_string\fP NULL and \fIapplication_name\fP NULL, and finally calls -.BR XtAppCreateShell +.B XtAppCreateShell with \fIapplication_name\fP NULL, \fIwidget_class\fP .BR applicationShellWidgetClass , and the specified \fIargs\fP and \fInum_args\fP and returns the created shell. The semantics of calling -.BR XtInitialize +.B XtInitialize more than once are undefined. This routine has been replaced by .BR XtAppInitialize . .SH "SEE ALSO" diff --git a/man/XtInitializeWidgetClass.man b/man/XtInitializeWidgetClass.man index a246dfd..faa7a76 100644 --- a/man/XtInitializeWidgetClass.man +++ b/man/XtInitializeWidgetClass.man @@ -66,13 +66,13 @@ void XtInitializeWidgetClass(WidgetClass \fIobject_class\fP); Specifies the object class to initialize. .SH DESCRIPTION If the specified widget class is already initialized, -.BR XtInitializeWidgetClass +.B XtInitializeWidgetClass returns immediately. .LP If the class initialization procedure registers type converters, these type converters are not available until the first object of the class or subclass is created or -.BR XtInitializeWidgetClass +.B XtInitializeWidgetClass is called. .SH "SEE ALSO" .br diff --git a/man/XtInsertEventTypeHandler.man b/man/XtInsertEventTypeHandler.man index da2ab0b..56178f3 100644 --- a/man/XtInsertEventTypeHandler.man +++ b/man/XtInsertEventTypeHandler.man @@ -102,7 +102,7 @@ Specifies the range of event types for this extension. Specifies a pointer to the event to be dispatched. .SH DESCRIPTION The -.BR XtInsertEventTypeHandler +.B XtInsertEventTypeHandler function registers a procedure with the dispatch mechanism that is to be called when an event that matches the specified \fIevent_type\fP is dispatched to the specified \fIwidget\fP. @@ -114,12 +114,12 @@ indicating the event mask to be used to select for the desired event. This event mask will be included in the value returned by .BR XtBuildEventMask . If the widget is realized -.BR XtInsertEventTypeHandler +.B XtInsertEventTypeHandler calls -.BR XSelectInput +.B XSelectInput if necessary. Specifying NULL for \fIselect_data\fP is equivalent to specifying a pointer to an event mask containing 0. This is similar to the -.BR XtInsertRawEventHandler +.B XtInsertRawEventHandler function. .LP If \fIevent_type\fP specifies an extension event type then the semantics @@ -139,9 +139,9 @@ which registers this event handler after any previously registered handlers for this event type. .LP The -.BR XtRemoveEventTypeHandler +.B XtRemoveEventTypeHandler function unregisters an even handler registered with -.BR XtInsertEventTypeHandler +.B XtInsertEventTypeHandler for the specified event type. The request is ignored if \fIclient_data\fP does not match the value given with the handler was registered. .LP @@ -150,12 +150,12 @@ If \fIevent_type\fP specifies on of the core X protocol events, .BR EventMask , indicating the mask to be used to deselect for the appropriate event. If the widget is realized, -.BR XtRemoveEventTypeHandler +.B XtRemoveEventTypeHandler calls -.BR XSelectInput +.B XSelectInput if necessary. Specifying NULL for \fIselect_data\fP is equivalent to specifying a pointer to an event mask containing 0. This is similar to the -.BR XtRemoveRawEventHandler +.B XtRemoveRawEventHandler function. .LP If \fIevent_type\fP specifies an extension event type then the semantics @@ -163,20 +163,20 @@ of the data pointed to by \fIselect_data\fP are defined by the extension selector registered for the specified event type. .LP The -.BR XtRegisterExtensionSelector +.B XtRegisterExtensionSelector function registers a procedure to arrange for the delivery of extension events to widgets. .LP If \fImin_event_type\fP and \fImax_event_type\fP match the parameters to a previous call to -.BR XtRegisterExtensionSelector +.B XtRegisterExtensionSelector for the same display, the \fIproc\fP and \fIclient_data\fP replace the previously registered values. If the range specified by \fImin_event_type\fP and \fImax_event_type\fP overlaps the range of the parameters to a previous call for the same display in any other way, an error results. .LP The -.BR XtSetEventDispatcher +.B XtSetEventDispatcher function registers the event dispatcher procedure specified by \fIproc\fP for events with the type \fIevent_type\fP. The previously registered dispatcher (or the default dispatcher if there was no previously registered @@ -184,13 +184,13 @@ dispatcher) is returned. If \fIproc\fP is NULL, the default procedure is restored for the specified type. .LP In the future, when -.BR XtDispatchEvent +.B XtDispatchEvent is called with an event of \fIevent_type\fP, the specified \fIproc\fP (or the default dispatcher) will be invoked to determine a widget ot which to dispatch the event. .LP The -.BR XtDispatchEventToWidget +.B XtDispatchEventToWidget function scans the list of registered event handlers for the specified widget and calls each handler that has been registered for the specified event type, subject to the \fIcontinue_to_dispatch\fP value returned by @@ -200,7 +200,7 @@ at the head of the list for .BR NoExpose , .BR GraphicsExpose , and -.BR VisibilityNotify +.B VisibilityNotify events to invoke the widget's expose procedure according to the exposure compression rules and to update the widget's \fIvisible\fP field if \fIvisible_interest\fP is @@ -208,11 +208,11 @@ compression rules and to update the widget's \fIvisible\fP field if These internal event handlers never set \fIcontinue_to_dispatch\fP to .BR False . .LP -.BR XtDispatchEventToWidget +.B XtDispatchEventToWidget returns -.BR True +.B True if any event handler was called and -.BR False +.B False otherwise. .LP .SH "SEE ALSO" diff --git a/man/XtLastEventProcessed.man b/man/XtLastEventProcessed.man index 4f7aad7..9cd88cd 100644 --- a/man/XtLastEventProcessed.man +++ b/man/XtLastEventProcessed.man @@ -67,13 +67,13 @@ Time XtLastTimestampProcessed(Display* \fIdisplay\fP); .IP \fIdisplay\fP 1i Specifies the open display connection. .SH DESCRIPTION -.BR XtLastEventProcessed +.B XtLastEventProcessed returns the last event passed to -.BR XtDispatchEvent +.B XtDispatchEvent for the specified display and NULL if there has been no event. The client must not modify the contents of the returned event. .LP -.BR XtLastTimestampProcessed +.B XtLastTimestampProcessed returns the timestamp of the last .BR KeyPress , .BR KeyRelease , @@ -84,9 +84,9 @@ returns the timestamp of the last .BR LeaveNotify , .BR PropertyNotify , or -.BR SelectionClear +.B SelectionClear event that has been passed to -.BR XtDispatchEvent +.B XtDispatchEvent for the specified display and zero if there has been no such event. .SH "SEE ALSO" .br diff --git a/man/XtMakeGeometryRequest.man b/man/XtMakeGeometryRequest.man index 1b7043f..240151d 100644 --- a/man/XtMakeGeometryRequest.man +++ b/man/XtMakeGeometryRequest.man @@ -83,7 +83,7 @@ Specifies the widget that is making the request. Return the allowed widget width and height. .SH DESCRIPTION Depending on the condition, -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest performs the following: .IP \(bu 5 If the widget is unmanaged or the widget's parent is not realized, @@ -91,7 +91,7 @@ it makes the changes and returns .BR XtGeometryYes . .IP \(bu 5 If the parent is not a subclass of -.BR compositeWidgetClass +.B compositeWidgetClass or the parent's geometry_manager is NULL, it issues an error. .IP \(bu 5 @@ -108,14 +108,14 @@ otherwise, it calls the parent's geometry_manager procedure with the given parameters. .IP \(bu 5 If the parent's geometry manager returns -.BR XtGeometryYes +.B XtGeometryYes and if -.BR XtCWQueryOnly +.B XtCWQueryOnly is not set in the request_mode and if the widget is realized, -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest calls the -.BR XConfigureWindow +.B XConfigureWindow Xlib function to reconfigure the widget's window (set its size, location, and stacking order as appropriate). .IP \(bu 5 @@ -123,29 +123,29 @@ If the geometry manager returns .BR XtGeometryDone , the change has been approved and actually has been done. In this case, -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest does no configuring and returns .BR XtGeometryYes . -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest never returns .BR XtGeometryDone . .LP Otherwise, -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest returns the resulting value from the parent's geometry manager. .LP Children of primitive widgets are always unmanaged; thus, -.BR XtMakeGeometryRequest +.B XtMakeGeometryRequest always returns -.BR XtGeometryYes +.B XtGeometryYes when called by a child of a primitive widget. .LP The -.BR XtMakeResizeRequest +.B XtMakeResizeRequest function, a simple interface to .BR XtMakeGeometryRequest , creates a -.BR XtWidgetGeometry +.B XtWidgetGeometry structure and specifies that width and height should change. The geometry manager is free to modify any of the other window attributes (position or stacking order) to satisfy the resize request. @@ -154,10 +154,10 @@ If the return value is width_return and height_return contain a compromise width and height. If these are acceptable, the widget should immediately make an -.BR XtMakeResizeRequest +.B XtMakeResizeRequest and request that the compromise width and height be applied. If the widget is not interested in -.BR XtGeometryAlmost +.B XtGeometryAlmost replies, it can pass NULL for width_return and height_return. .SH "SEE ALSO" diff --git a/man/XtMalloc.man b/man/XtMalloc.man index c53fa74..e3525a0 100644 --- a/man/XtMalloc.man +++ b/man/XtMalloc.man @@ -92,84 +92,88 @@ Specifies a pointer to write a newly allocated string to. Specifies a formatting string as defined by sprintf(3c) .SH DESCRIPTION The -.BR XtMalloc +.B XtMalloc functions returns a pointer to a block of storage of at least the specified size bytes. If there is insufficient memory to allocate the new block, -.BR XtMalloc +.B XtMalloc calls .BR XtErrorMsg . .LP The -.BR XtCalloc +.B XtCalloc function allocates space for the specified number of array elements of the specified size and initializes the space to zero. If there is insufficient memory to allocate the new block, -.BR XtCalloc +.B XtCalloc calls .BR XtErrorMsg . .LP The -.BR XtRealloc +.B XtRealloc function changes the size of a block of storage (possibly moving it). Then, it copies the old contents (or as much as will fit) into the new block and frees the old block. If there is insufficient memory to allocate the new block, -.BR XtRealloc +.B XtRealloc calls .BR XtErrorMsg . If ptr is NULL, -.BR XtRealloc +.B XtRealloc allocates the new storage without copying the old contents; that is, it simply calls .BR XtMalloc . .LP The -.BR XtFree +.B XtFree function returns storage and allows it to be reused. If ptr is NULL, -.BR XtFree +.B XtFree returns immediately. .LP -.BR XtNew +.B XtNew returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, -.BR XtNew +.B XtNew calls .BR XtErrorMsg . -.BR XtNew +.B XtNew is a convenience macro that calls -.BR XtMalloc +.B XtMalloc with the following arguments specified: .LP .RS .5i +.ft CW ((type *) XtMalloc((unsigned) sizeof(type)) +.ft R .RE .LP -.BR XtNewString +.B XtNewString returns a pointer to the allocated storage. If there is insufficient memory to allocate the new block, -.BR XtNewString +.B XtNewString calls .BR XtErrorMsg . -.BR XtNewString +.B XtNewString is a convenience macro that calls -.BR XtMalloc +.B XtMalloc with the following arguments specified: .LP .RS .5i +.ft CW (strcpy(XtMalloc((unsigned) strlen(str) + 1), str)) +.ft R .RE .LP The -.BR XtAsprintf +.B XtAsprintf function allocates space for a string large enough to hold the string specified by the sprintf(3c) format pattern when used with the remaining arguments, and fills it with the formatted results. The address of the allocated string is placed into the pointer passed as ret. The length of the string (not including the terminating null byte) is returned. If there is insufficient memory to allocate the new block, -.BR XtAsprintf +.B XtAsprintf calls .BR XtErrorMsg . .SH "SEE ALSO" diff --git a/man/XtManageChildren.man b/man/XtManageChildren.man index a1cc74c..4ef3f0e 100644 --- a/man/XtManageChildren.man +++ b/man/XtManageChildren.man @@ -101,7 +101,7 @@ Specifies the post unmanage, pre manage hook procedure to invoke. Specifies the client data to be passed to the hook procedure. .SH DESCRIPTION The -.BR XtManageChildren +.B XtManageChildren function performs the following: .IP \(bu 5 Issues an error if the children do not all have the same parent or @@ -110,7 +110,7 @@ if the parent is not a subclass of .IP \(bu 5 Returns immediately if the common parent is being destroyed; otherwise, for each unique child on the list, -.BR XtManageChildren +.B XtManageChildren ignores the child if it already is managed or is being destroyed and marks it if not. .IP \(bu 5 @@ -121,7 +121,7 @@ it makes some of the newly managed children viewable: Calls the change_managed routine of the widgets' parent. .IP \- 5 Calls -.BR XtRealizeWidget +.B XtRealizeWidget on each previously unmanaged child that is unrealized. .IP \- 5 Maps each previously unmanaged child that has map_when_managed @@ -132,10 +132,10 @@ Managing children is independent of the ordering of children and independent of creating and deleting children. The layout routine of the parent should consider children whose managed field is -.BR True +.B True and should ignore all other children. Note that some composite widgets, especially fixed boxes, call -.BR XtManageChild +.B XtManageChild from their insert_child procedure. .LP If the parent widget is realized, @@ -145,18 +145,18 @@ The parent can reposition and resize any of its children. It moves each child as needed by calling .BR XtMoveWidget , which first updates the x and y fields and then calls -.BR XMoveWindow +.B XMoveWindow if the widget is realized. .LP The -.BR XtManageChild +.B XtManageChild function constructs a -.BR WidgetList +.B WidgetList of length one and calls .BR XtManageChildren . .LP The -.BR XtUnmanageChildren +.B XtUnmanageChildren function performs the following: .IP \(bu 5 Issues an error if the children do not all have the same parent @@ -165,7 +165,7 @@ or if the parent is not a subclass of .IP \(bu 5 Returns immediately if the common parent is being destroyed; otherwise, for each unique child on the list, -.BR XtUnmanageChildren +.B XtUnmanageChildren performs the following: .RS .IP \- 5 @@ -180,19 +180,19 @@ Calls the change_managed routine of the widgets' parent after all children have been marked if the parent is realized. .LP -.BR XtUnmanageChildren +.B XtUnmanageChildren does not destroy the children widgets. Removing widgets from a parent's managed set is often a temporary banishment, and, some time later, you may manage the children again. .LP The -.BR XtUnmanageChild +.B XtUnmanageChild function constructs a widget list of length one and calls .BR XtUnmanageChildren . .LP The -.BR XtChangeManagedSet +.B XtChangeManagedSet function performs the following: .IP \(bu 5 Issues an error if the widgets specified in the \fImanage_children\fP @@ -202,41 +202,42 @@ if that parent is not a subclass of compositeWidgetClass. Returns immediately if the common parent is being destroyed. .IP \(bu 5 If no -.BR CompositeClassExtension +.B CompositeClassExtension is defined, or a -.BR CompositeClassExtension +.B CompositeClassExtension is defined but with an \fIallows_change_managed_set\fP field with a value of .BR False , and -.BR XtChangeManagedSet +.B XtChangeManagedSet was invoked with a non-NULL \fIdo_change_proc\fP procedure then -.BR XtChangeManagedSet +.B XtChangeManagedSet performs the following: .RS .IP \- 5 Calls -.BR XtUnmanageChildren +.B XtUnmanageChildren (\fIunmanage_children\fP, \fInum_unmanage_children\fP). .IP \- 5 Calls the \fIdo_change_proc\fP specified. .IP \- 5 Calls -.BR XtManageChildren +.B XtManageChildren (\fImanage_children\fP, \fInum_manage_children\fP) and then returns immediately. .RE .IP \(bu 5 Otherwise, if a -.BR CompositeClassExtension +.B CompositeClassExtension is defined with an \fIallows_change_managed_set\fP field with a value of .BR True , or if no -.BR CompositeClassExtension +.B CompositeClassExtension is defined, and -.BR XtChangeManagedSet -was invoked with a NULL \fIdo_change_proc\fP procedure, then the following is performed: +.B XtChangeManagedSet +was invoked with a NULL \fIdo_change_proc\fP procedure, then the following is +performed: .RS .IP \- 5 For each child on the \fIunmanage_children\fP list; if the child is @@ -258,7 +259,7 @@ of the newly managed children are made viewable by: .RS .IP \- 5 Calling -.BR XtRealizeWidget +.B XtRealizeWidget on each of the previously unmanaged child that is unrealized. .IP \- 5 Mapping each previously unmanaged child that has \fImap_when_managed\fP @@ -266,12 +267,12 @@ Mapping each previously unmanaged child that has \fImap_when_managed\fP .RE .LP The -.BR XtIsManaged +.B XtIsManaged function returns -.BR True +.B True if the specified widget is of class RectObj or any subclass thereof and is managed, or -.BR False +.B False otherwise. .SH "SEE ALSO" XtMapWidget(__libmansuffix__), diff --git a/man/XtMapWidget.man b/man/XtMapWidget.man index 04d69b9..a550ad5 100644 --- a/man/XtMapWidget.man +++ b/man/XtMapWidget.man @@ -76,26 +76,26 @@ Specifies the widget. If the widget is realized and managed and if the new value of map_when_managed is .BR True , -.BR XtSetMappedWhenManaged +.B XtSetMappedWhenManaged maps the window. If the widget is realized and managed and if the new value of map_when_managed is .BR False , it unmaps the window. -.BR XtSetMappedWhenManaged +.B XtSetMappedWhenManaged is a convenience function that is equivalent to (but slightly faster than) calling -.BR XtSetValues +.B XtSetValues and setting the new value for the mappedWhenManaged resource. As an alternative to using -.BR XtSetMappedWhenManaged +.B XtSetMappedWhenManaged to control mapping, a client may set mapped_when_managed to -.BR False +.B False and use -.BR XtMapWidget +.B XtMapWidget and -.BR XtUnmapWidget +.B XtUnmapWidget explicitly. .SH "SEE ALSO" XtManageChildren(__libmansuffix__) diff --git a/man/XtName.man b/man/XtName.man index 4b7c321..49fa64a 100644 --- a/man/XtName.man +++ b/man/XtName.man @@ -65,7 +65,7 @@ String XtName(Widget \fIw\fP); .IP \fIw\fP 1i Specifies the widget. .SH DESCRIPTION -.BR XtName +.B XtName returns the widget's name. .SH "SEE ALSO" .br diff --git a/man/XtNameToWidget.man b/man/XtNameToWidget.man index c9b58d0..5d42618 100644 --- a/man/XtNameToWidget.man +++ b/man/XtNameToWidget.man @@ -75,7 +75,7 @@ Specifies the widget from which the search is to start. Specify the window for which you want the widget. .SH DESCRIPTION The -.BR XtNameToWidget +.B XtNameToWidget function looks for a widget whose name is the first component in the specified names and that is a pop-up child of reference (or a normal child if reference is a subclass of @@ -83,7 +83,7 @@ is a subclass of It then uses that widget as the new reference and repeats the search after deleting the first component from the specified names. If it cannot find the specified widget, -.BR XtNameToWidget +.B XtNameToWidget returns NULL. .LP Note that the names argument contains the name of a widget with respect to the @@ -92,20 +92,20 @@ specified reference widget and can contain more than one widget name of the specified reference widget. .LP If more than one child of the reference widget matches the name, -.BR XtNameToWidget +.B XtNameToWidget can return any of the children. The \*(xI do not require that all children of a widget have unique names. If the specified names contain more than one component and if more than one child matches the first component, -.BR XtNameToWidget +.B XtNameToWidget can return NULL if the single branch that it follows does not contain the named widget. That is, -.BR XtNameToWidget +.B XtNameToWidget does not back up and follow other matching branches of the widget tree. .LP The -.BR XtWindowToWidget +.B XtWindowToWidget function translates the specified window and display pointer into the appropriate widget instance. .SH "SEE ALSO" diff --git a/man/XtNextEvent.man b/man/XtNextEvent.man index 5766c0b..10da5ea 100644 --- a/man/XtNextEvent.man +++ b/man/XtNextEvent.man @@ -85,26 +85,26 @@ The mask is the bitwise inclusive OR of any combination of and .BR XtIMSignal . As a convenience, the \*(tk defines the symbolic name -.BR XtIMAll +.B XtIMAll to be the bitwise inclusive OR of all event types. .SH DESCRIPTION -.BR XtNextEvent +.B XtNextEvent has been replaced by .BR XtAppNextEvent . .LP -.BR XtPeekEvent +.B XtPeekEvent has been replaced by .BR XtAppPeekEvent . .LP -.BR XtPending +.B XtPending has been replaced by .BR XtAppPending . .LP -.BR XtProcessEvent +.B XtProcessEvent has been replaced by .BR XtAppProcessEvent . .LP -.BR XtMainLoop +.B XtMainLoop has been replaced by .BR XtAppMainLoop . .SH "SEE ALSO" diff --git a/man/XtOffset.man b/man/XtOffset.man index aa668c4..40ee7c3 100644 --- a/man/XtOffset.man +++ b/man/XtOffset.man @@ -76,13 +76,13 @@ Specifies a type that is declared as a pointer to the structure. Specifies a type that is declared as a structure. .SH DESCRIPTION The -.BR XtOffset +.B XtOffset macro is usually used to determine the offset of various resource fields from the beginning of a widget and can be used at compile time in static initializations. .LP The -.BR XtOffsetOf +.B XtOffsetOf macro expands to a constant expression that gives the offset in bytes to the specified structure member from the beginning of the structure. It is normally used to statically initialize resource lists and is more @@ -91,7 +91,7 @@ portable than which serves the same function. .LP The -.BR XtNumber +.B XtNumber macro returns the number of elements in the specified argument lists, resources lists, and other counted arrays. .SH "SEE ALSO" diff --git a/man/XtOpenApplication.man b/man/XtOpenApplication.man index e61e30b..382d706 100644 --- a/man/XtOpenApplication.man +++ b/man/XtOpenApplication.man @@ -102,34 +102,34 @@ Specifies the variable argument list to override any other resource specification for the created shell widget. .SH DESCRIPTION The -.BR XtOpenApplication +.B XtOpenApplication function calls -.BR XtToolkitInitialize +.B XtToolkitInitialize followed by .BR XtCreateApplicationContext , then calls -.BR XtOpenDisplay +.B XtOpenDisplay with \fIdisplay_string\fP NULL and \fIapplication_name\fP NULL, and finally calls -.BR XtAppCreateShell +.B XtAppCreateShell with \fIapplication_name\fP NULL, the specified \fIwidget_class\fP, and the specified \fIargs\fP and \fInum_args\fP and returns the created shell. The modified \fIargc\fP and \fIargv\fP returned by -.BR XtDisplayInitialize +.B XtDisplayInitialize are returned in \fIargc_in_out\fP and \fIargv_in_out\fP. If \fIapp_context_return\fP is not NULL, the created application context is also returned. If the display specified by the command line cannot be opened, an error message is issued and -.BR XtOpenApplication +.B XtOpenApplication terminates the application. If \fIfallback_resources\fP is non-NULL, -.BR XtAppSetFallbackResources +.B XtAppSetFallbackResources is called with the value prior to calling .BR XtOpenDisplay . .LP XtAppInitialize and XtVaAppInitialize have been superceded by -.BR XtOpenApplication +.B XtOpenApplication and -.BR XtVaOpenApplication +.B XtVaOpenApplication respectively. .SH "SEE ALSO" XtAppInitialize(__libmansuffix__), XtVaAppInitialize(__libmansuffix__) diff --git a/man/XtOwnSelection.man b/man/XtOwnSelection.man index 650a158..dc1f228 100644 --- a/man/XtOwnSelection.man +++ b/man/XtOwnSelection.man @@ -97,13 +97,13 @@ ownership should commence or is to be relinquished. Specifies the widget that wishes to become the owner or to relinquish ownership. .SH DESCRIPTION The -.BR XtOwnSelection +.B XtOwnSelection function informs the \*(xI selection mechanism that a widget believes it owns a selection. It returns -.BR True +.B True if the widget has successfully become the owner and -.BR False +.B False otherwise. The widget may fail to become the owner if some other widget has asserted ownership at a time later than this widget. @@ -114,30 +114,30 @@ Also note that the lose_selection procedure is not called if the widget fails to obtain selection ownership in the first place. .LP The -.BR XtOwnSelectionIncremental +.B XtOwnSelectionIncremental procedure informs the Intrinsics incremental selection mechanism that the specified widget wishes to own the selection. It returns -.BR True +.B True if the specified widget successfully becomes the selection owner or -.BR False +.B False otherwise. For more information about \fIselection\fP, \fItarget\fP, and \fItime\fP, see Section 2.6 of the \fIInter-Client Communication Conventions Manual\fP. .LP A widget that becomes the selection owner using -.BR XtOwnSelectionIncremental +.B XtOwnSelectionIncremental may use -.BR XtDisownSelection +.B XtDisownSelection to relinquish selection ownership. .LP The -.BR XtDisownSelection +.B XtDisownSelection function informs the \*(xI selection mechanism that the specified widget is to lose ownership of the selection. If the widget does not currently own the selection either because it lost the selection or because it never had the selection to begin with, -.BR XtDisownSelection +.B XtDisownSelection does nothing. .LP After a widget has called @@ -146,7 +146,7 @@ its convert procedure is not called even if a request arrives later with a timestamp during the period that this widget owned the selection. However, its done procedure will be called if a conversion that started before the call to -.BR XtDisownSelection +.B XtDisownSelection finishes after the call to .BR XtDisownSelection . .SH "SEE ALSO" diff --git a/man/XtParent.man b/man/XtParent.man index e11d029..8ca0036 100644 --- a/man/XtParent.man +++ b/man/XtParent.man @@ -66,7 +66,7 @@ Widget XtParent(Widget \fIw\fP); .IP \fIw\fP 1i Specifies the widget. .SH DESCRIPTION -.BR XtParent +.B XtParent returns the widget's parent widget ID. .SH "SEE ALSO" .br diff --git a/man/XtParseAcceleratorTable.man b/man/XtParseAcceleratorTable.man index 718c1ea..1ba850b 100644 --- a/man/XtParseAcceleratorTable.man +++ b/man/XtParseAcceleratorTable.man @@ -76,15 +76,15 @@ Specifies the widget on which the accelerators are to be installed. Specifies the widget or the root widget of the widget tree from which the accelerators are to come. .SH DESCRIPTION The -.BR XtParseAcceleratorTable +.B XtParseAcceleratorTable function compiles the accelerator table into the opaque internal representation. .LP The -.BR XtInstallAccelerators +.B XtInstallAccelerators function installs the accelerators from source onto destination by augmenting the destination translations with the source accelerators. If the source display_accelerator method is non-NULL, -.BR XtInstallAccelerators +.B XtInstallAccelerators calls it with the source widget and a string representation of the accelerator table, which indicates that its accelerators have been installed @@ -93,11 +93,11 @@ The string representation of the accelerator table is its canonical translation table representation. .LP The -.BR XtInstallAllAccelerators +.B XtInstallAllAccelerators function recursively descends the widget tree rooted at source and installs the accelerators of each widget encountered onto destination. A common use os to call -.BR XtInstallAllAccelerators +.B XtInstallAllAccelerators and pass the application main window as the source. .SH "SEE ALSO" XtParseTranslationTable(1) diff --git a/man/XtParseTranslationTable.man b/man/XtParseTranslationTable.man index b9040c2..5fd7d43 100644 --- a/man/XtParseTranslationTable.man +++ b/man/XtParseTranslationTable.man @@ -79,17 +79,17 @@ Specifies the compiled translation table to merge in (must not be NULL). Specifies the widget into which the new translations are to be merged or removed. .SH DESCRIPTION The -.BR XtParseTranslationTable +.B XtParseTranslationTable function compiles the translation table into the opaque internal representation of type .BR XtTranslations . Note that if an empty translation table is required for any purpose, one can be obtained by calling -.BR XtParseTranslationTable +.B XtParseTranslationTable and passing an empty string. .LP The -.BR XtAugmentTranslations +.B XtAugmentTranslations function nondestructively merges the new translations into the existing widget translations. If the new translations contain an event or event sequence that @@ -97,7 +97,7 @@ already exists in the widget's translations, the new translation is ignored. .LP The -.BR XtOverrideTranslations +.B XtOverrideTranslations function destructively merges the new translations into the existing widget translations. If the new translations contain an event or event sequence that @@ -105,12 +105,12 @@ already exists in the widget's translations, the new translation is merged in and override the widget's translation. .LP To replace a widget's translations completely, use -.BR XtSetValues +.B XtSetValues on the XtNtranslations resource and specify a compiled translation table as the value. .LP The -.BR XtUninstallTranslations +.B XtUninstallTranslations function causes the entire translation table for widget to be removed. .SH "SEE ALSO" XtAppAddActions(__libmansuffix__), diff --git a/man/XtPopdown.man b/man/XtPopdown.man index d78d06a..cb0c69d 100644 --- a/man/XtPopdown.man +++ b/man/XtPopdown.man @@ -73,7 +73,7 @@ Specifies the callback data, which is not used by this procedure. .IP \fIclient_data\fP 1i Specifies a pointer to the -.BR XtPopdownID +.B XtPopdownID structure. .IP \fIpopup_shell\fP 1i Specifies the widget shell to pop down. @@ -83,11 +83,11 @@ Specifies the name of the widget shell to pop down. Specifies the widget. .SH DESCRIPTION The -.BR XtPopdown +.B XtPopdown function performs the following: .IP \(bu 5 Calls -.BR XtCheckSubclass +.B XtCheckSubclass .\".ZN XtCheckSubclass(popup_shell, popupShellWidgetClass) to ensure popup_shell is a subclass of .BR Shell . @@ -98,7 +98,7 @@ otherwise, it generates an error. Unmaps popup_shell's window. .IP \(bu 5 If popup_shell's grab_kind is either -.BR XtGrabNonexclusive +.B XtGrabNonexclusive or .BR XtGrabExclusive , it calls @@ -111,38 +111,40 @@ Sets pop-up shell's popped_up field to Calls the callback procedures on the shell's popdown_callback list. .LP The -.BR XtCallbackPopdown +.B XtCallbackPopdown function casts the client data parameter to an -.BR XtPopdownID +.B XtPopdownID pointer: .LP .RS .nf +.ft CW typedef struct { Widget shell_widget; Widget enable_widget; } XtPopdownIDRec, *XtPopdownID; +.ft R .fi .RE .LP The shell_widget is the pop-up shell to pop down, and the enable_widget is the widget that was used to pop it up. .LP -.BR XtCallbackPopdown +.B XtCallbackPopdown calls -.BR XtPopdown +.B XtPopdown with the specified shell_widget and then calls -.BR XtSetSensitive +.B XtSetSensitive to resensitize the enable_widget. .LP If a shell name is not given, -.BR MenuPopdown +.B MenuPopdown calls -.BR XtPopdown +.B XtPopdown with the widget for which the translation is specified. If a shell_name is specified in the translation table, -.BR MenuPopdown +.B MenuPopdown tries to find the shell by looking up the widget tree starting at the parent of the widget in which it is invoked. If it finds a shell with the specified name in the pop-up children @@ -150,7 +152,7 @@ of that parent, it pops down the shell; otherwise, it moves up the parent chain as needed. If -.BR MenuPopdown +.B MenuPopdown gets to the application top-level shell widget and cannot find a matching shell, it generates an error. diff --git a/man/XtPopup.man b/man/XtPopup.man index 6f994eb..ad2286a 100644 --- a/man/XtPopup.man +++ b/man/XtPopup.man @@ -90,11 +90,11 @@ Specifies the widget shell. Specifies the widget. .SH DESCRIPTION The -.BR XtPopup +.B XtPopup function performs the following: .IP \(bu 5 Calls -.BR XtCheckSubclass +.B XtCheckSubclass .\".ZN XtCheckSubclass(popup_shell, popupShellWidgetClass) to ensure popup_shell is a subclass of .BR Shell . @@ -111,37 +111,41 @@ the shell spring_loaded field to and the shell grab_kind field from grab_kind. .IP \(bu 5 If the shell's create_popup_child field is non-NULL, -.BR XtPopup +.B XtPopup calls it with popup_shell as the parameter. .IP \(bu 5 If grab_kind is either -.BR XtGrabNonexclusive +.B XtGrabNonexclusive or .BR XtGrabExclusive , it calls: .LP .RS +.ft CW +.nf XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False) +.fi +.ft R .RE .IP \(bu 5 Calls -.BR XtRealizeWidget +.B XtRealizeWidget with popup_shell specified. .IP \(bu 5 Calls -.BR XMapWindow +.B XMapWindow with popup_shell specified. .LP The -.BR XtPopupSpringLoaded +.B XtPopupSpringLoaded function performs exactly as -.BR XtPopup +.B XtPopup except that it sets the shell \fIspring_loaded\fP field to -.BR True +.B True and always calls -.BR XtAddGrab +.B XtAddGrab with \fIexclusive\fP -.BR True +.B True and \fIspring_loaded\fP .BR True . .LP @@ -149,15 +153,15 @@ The .BR XtCallbackNone , .BR XtCallbackNonexclusive , and -.BR XtCallbackExclusive +.B XtCallbackExclusive functions call -.BR XtPopup +.B XtPopup with the shell specified by the client data argument and grab_kind set as the name specifies. .BR XtCallbackNone , .BR XtCallbackNonexclusive , and -.BR XtCallbackExclusive +.B XtCallbackExclusive specify .BR XtGrabNone , .BR XtGrabNonexclusive , @@ -173,32 +177,32 @@ an application must provide customized code for callbacks that create pop-up shells dynamically or that must do more than desensitizing the button. .LP -.BR MenuPopup +.B MenuPopup is known to the translation manager, which must perform special actions for spring-loaded pop-ups. Calls to -.BR MenuPopup +.B MenuPopup in a translation specification are mapped into calls to a nonexported action procedure, and the translation manager fills in parameters based on the event specified on the left-hand side of a translation. .LP If -.BR MenuPopup +.B MenuPopup is invoked on -.BR ButtonPress +.B ButtonPress (possibly with modifiers), the translation manager pops up the shell with grab_kind set to -.BR XtGrabExclusive +.B XtGrabExclusive and spring_loaded set to .BR True . If -.BR MenuPopup +.B MenuPopup is invoked on -.BR EnterWindow +.B EnterWindow (possibly with modifiers), the translation manager pops up the shell with grab_kind set to -.BR XtGrabNonexclusive +.B XtGrabNonexclusive and spring_loaded set to .BR False . Otherwise, the translation manager generates an error. @@ -206,7 +210,7 @@ When the widget is popped up, the following actions occur: .IP \(bu 5 Calls -.BR XtCheckSubclass +.B XtCheckSubclass .\".ZN XtCheckSubclass(popup_shell, popupShellWidgetClass) to ensure popup_shell is a subclass of .BR Shell . @@ -217,7 +221,7 @@ Generates an error if the shell's popped_up field is already Calls the callback procedures on the shell's popup_callback list. .IP \(bu 5 Sets the shell popped_up field to -.BR True +.B True and the shell grab_kind and spring_loaded fields appropriately. .IP \(bu 5 If the shell's create_popup_child field is non-NULL, @@ -226,27 +230,31 @@ it is called with popup_shell as the parameter. Calls: .LP .RS +.ft CW +.nf XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded) +.fi +.ft R .RE .IP \(bu 5 Calls -.BR XtRealizeWidget +.B XtRealizeWidget with popup_shell specified. .IP \(bu 5 Calls -.BR XMapWindow +.B XMapWindow with popup_shell specified. .LP (Note that these actions are the same as those for .BR XtPopup .) -.BR MenuPopup +.B MenuPopup tries to find the shell by searching the widget tree starting at the parent of the widget in which it is invoked. If it finds a shell with the specified name in the pop-up children of that parent, it pops up the shell with the appropriate parameters. Otherwise, it moves up the parent chain as needed. If -.BR MenuPopup +.B MenuPopup gets to the application widget and cannot find a matching shell, it generates an error. .SH "SEE ALSO" diff --git a/man/XtProcessLock.man b/man/XtProcessLock.man index f2b2daf..a796d5c 100644 --- a/man/XtProcessLock.man +++ b/man/XtProcessLock.man @@ -64,10 +64,10 @@ void XtProcessLock(void); .HP void XtProcessUnlock(void); .SH DESCRIPTION -.BR XtProcessLock +.B XtProcessLock is used to lock all process global data. .LP -.BR XtProcessUnlock +.B XtProcessUnlock unlocks the process. .SH "SEE ALSO" .br diff --git a/man/XtQueryGeometry.man b/man/XtQueryGeometry.man index 79404e5..12b6835 100644 --- a/man/XtQueryGeometry.man +++ b/man/XtQueryGeometry.man @@ -79,17 +79,17 @@ the intended structure, sets the corresponding bits in intended.request_mode, and calls .BR XtQueryGeometry . .LP -.BR XtQueryGeometry +.B XtQueryGeometry clears all bits in the preferred_return->request_mode and checks the query_geometry field of the specified widget's class record. If query_geometry is not NULL, -.BR XtQueryGeometry +.B XtQueryGeometry calls the query_geometry procedure and passes as arguments the specified widget, intended, and preferred_return structures. If the intended argument is NULL, -.BR XtQueryGeometry +.B XtQueryGeometry replaces it with a pointer to an -.BR XtWidgetGeometry +.B XtWidgetGeometry structure with request_mode=0 before calling query_geometry. .SH "SEE ALSO" XtConfigureWidget(__libmansuffix__), diff --git a/man/XtRealizeWidget.man b/man/XtRealizeWidget.man index 77ab5ae..80acaea 100644 --- a/man/XtRealizeWidget.man +++ b/man/XtRealizeWidget.man @@ -71,7 +71,7 @@ void XtUnrealizeWidget(Widget \fIw\fP); Specifies the widget. .SH DESCRIPTION If the widget is already realized, -.BR XtRealizeWidget +.B XtRealizeWidget simply returns. Otherwise, it performs the following: .IP \(bu 5 @@ -83,16 +83,16 @@ at the specified widget and calls the change_managed procedure of each composite widget that has one or more managed children. .IP \(bu 5 Constructs an -.BR XSetWindowAttributes +.B XSetWindowAttributes structure filled in with information derived from the -.BR Core +.B Core widget fields and calls the realize procedure for the widget, which adds any widget-specific attributes and creates the X window. .IP \(bu 5 If the widget is not a subclass of .BR compositeWidgetClass , -.BR XtRealizeWidget +.B XtRealizeWidget returns; otherwise, it continues and performs the following: .RS .IP \- 5 @@ -112,13 +112,13 @@ Some people seem to like this to indicate certain states.) If the widget is a top-level shell widget (that is, it has no parent), and mapped_when_managed is .BR True , -.BR XtRealizeWidget +.B XtRealizeWidget maps the widget window. .LP The -.BR XtIsRealized +.B XtIsRealized function returns -.BR True +.B True if the widget has been realized, that is, if the widget has a nonzero X window ID. .LP @@ -127,12 +127,12 @@ operate differently after the widget has been realized. .LP The -.BR XtUnrealizeWidget +.B XtUnrealizeWidget function destroys the windows of an existing widget and all of its children (recursively down the widget tree). To recreate the windows at a later time, call -.BR XtRealizeWidget +.B XtRealizeWidget again. If the widget was managed, it will be unmanaged automatically before its window is freed. diff --git a/man/XtRegisterDrawable.man b/man/XtRegisterDrawable.man index a8ac671..8ea1374 100644 --- a/man/XtRegisterDrawable.man +++ b/man/XtRegisterDrawable.man @@ -72,10 +72,10 @@ Specifies the drawable to register. .IP \fIwidget\fP 1i Specifies the widget to register the drawable for. .SH DESCRIPTION -.BR XtRegisterDrawable +.B XtRegisterDrawable associates the specified drawable with the specified widget so that future calls to -.BR XtWindowToWidget +.B XtWindowToWidget with the drawable will return the widget. The default event dispatcher will dispatch future core events that arrive with the drawable to the widget as though the event contained the widget's window, but the event @@ -85,15 +85,15 @@ or action procedures. If the drawable is already registered with another widget, or if the drawable is the window of a widget in the client's widget tree, the results of calling -.BR XtRegisterDrawable +.B XtRegisterDrawable are undefined. .LP -.BR XtUnregisterDrawable +.B XtUnregisterDrawable removes an association created with .BR XtRegisterDrawable . If the drawable is the window of a widget in the client's widget tree the results of calling -.BR XtUnregisterDrawable +.B XtUnregisterDrawable are undefined. .SH "SEE ALSO" .br diff --git a/man/XtRegisterGrabAction.man b/man/XtRegisterGrabAction.man index a7384a4..edf6412 100644 --- a/man/XtRegisterGrabAction.man +++ b/man/XtRegisterGrabAction.man @@ -71,11 +71,11 @@ Specifies the action procedure to search for in translation tables. .IP \fIparams\fP 1i .IP \fInum_params\fP 1i Specify arguments to -.BR XtGrabButton +.B XtGrabButton or -.BR XtGrabKey +.B XtGrabKey .SH DESCRIPTION -.BR XtRegisterGrabAction +.B XtRegisterGrabAction adds the specified \fIaction_proc\fP to a list known to the translation manager. .SH "SEE ALSO" diff --git a/man/XtReservePropertyAtom.man b/man/XtReservePropertyAtom.man index e84940c..abf4f3d 100644 --- a/man/XtReservePropertyAtom.man +++ b/man/XtReservePropertyAtom.man @@ -69,7 +69,7 @@ Specifies the widget used to reserve the atom. .IP \fIatom\fP 1i Specifies the atom whose reservation is to be released. .SH DESCRIPTION -.BR XtReservePropertyAtom +.B XtReservePropertyAtom returns an atom that may be used for properties in conjunction with conversion requests from widget \fIw\fP. The atom returned will be unique for the display of the widget specified. diff --git a/man/XtResolvePathname.man b/man/XtResolvePathname.man index e3d1b2e..d23430d 100644 --- a/man/XtResolvePathname.man +++ b/man/XtResolvePathname.man @@ -85,9 +85,9 @@ Specifies the number of entries in \fIsubstitutions\fP. Specifies a procedure called to judge each potential file name, or NULL. .SH DESCRIPTION The substitutions specified by -.BR XtResolvePathname +.B XtResolvePathname are determined from the value of the language string retrieved by -.BR XtDisplayInitialize +.B XtDisplayInitialize for the specified display. To set the language for all applications specify ``*xnlLanguage: \fIlang\fP'' in the @@ -101,9 +101,9 @@ this composition is accomplished is implementation-defined and the \*(xI make no interpretation of the parts other than to use them in substitutions as described below. .LP -.BR XtResolvePathname +.B XtResolvePathname calls -.BR XtFindFile +.B XtFindFile with the following substitutions in addition to any passed by the caller and returns the value returned by .BR XtFindFile : @@ -133,12 +133,12 @@ If a path is passed to it will be passed along to .BR XtFindFile . If the \fIpath\fP argument is NULL, the value of the -.BR \s-1XFILESEARCHPATH\s+1 +.B \s-1XFILESEARCHPATH\s+1 .IN "XFILESEARCHPATH" "" "@DEF@" environment variable will be passed to .BR XtFindFile . If -.BR \s-1XFILESEARCHPATH\s+1 +.B \s-1XFILESEARCHPATH\s+1 is not defined, an implementation-specific default path will be used which contains at least 6 entries. These entries must contain the following substitutions: @@ -190,7 +190,7 @@ allow additional directories to be searched without preventing resources in the system directories from being found. For example, a user installing resource files under a directory called ``ourdir'' might set -.BR \s-1XFILESEARCHPATH\s+1 +.B \s-1XFILESEARCHPATH\s+1 to .IP %D:ourdir/%T/%N%C:ourdir/%T/%N @@ -205,7 +205,7 @@ and \fIapplication_class\fP are the values returned by If no value is specified in the database, the empty string is used. .LP It is the responsibility of the caller to free the returned string using -.BR XtFree +.B XtFree when it is no longer needed. .SH "SEE ALSO" .br diff --git a/man/XtSessionGetToken.man b/man/XtSessionGetToken.man index 21d307c..b168ca0 100644 --- a/man/XtSessionGetToken.man +++ b/man/XtSessionGetToken.man @@ -73,7 +73,7 @@ Specifies the value in the type field of the token. Specifies the token to be returned. .SH DESCRIPTION The -.BR XtSessionGetToken +.B XtSessionGetToken function will return NULL if the checkpoint operation instigated by the session manager is not currently under way. .LP diff --git a/man/XtSetArg.man b/man/XtSetArg.man index 24bf0f7..c9e95fa 100644 --- a/man/XtSetArg.man +++ b/man/XtSetArg.man @@ -82,16 +82,17 @@ Specifies the number of arguments in the second argument list. Specifies the name of the resource. .IP \fIvalue\fP 1i Specifies the value of the resource if it will fit in an -.BR XtArgVal +.B XtArgVal or the address. .SH DESCRIPTION The -.BR XtSetArg +.B XtSetArg function is usually used in a highly stylized manner to minimize the probability of making a mistake; for example: .LP .RS .nf +.ft CW Arg args[20]; int n; @@ -99,6 +100,7 @@ n = 0; XtSetArg(args[n], XtNheight, 100); n++; XtSetArg(args[n], XtNwidth, 200); n++; XtSetValues(widget, args, n); +.ft R .fi .RE .LP @@ -108,24 +110,26 @@ and use .LP .RS .nf +.ft CW static Args args[] = { {XtNheight, (XtArgVal) 100}, {XtNwidth, (XtArgVal) 200}, }; XtSetValues(Widget, args, XtNumber(args)); +.ft R .fi .RE .LP Note that you should not use auto-increment or auto-decrement within the first argument to .BR XtSetArg . -.BR XtSetArg +.B XtSetArg can be implemented as a macro that dereferences the first argument twice. .LP The -.BR XtMergeArgLists +.B XtMergeArgLists function allocates enough storage to hold the combined -.BR ArgList +.B ArgList structures and copies them into it. Note that it does not check for duplicate entries. When it is no longer needed, diff --git a/man/XtSetKeyTranslator.man b/man/XtSetKeyTranslator.man index b8dba4e..2b6cca3 100644 --- a/man/XtSetKeyTranslator.man +++ b/man/XtSetKeyTranslator.man @@ -99,12 +99,12 @@ Specifies the first KeySym for which this converter is valid. Specifies the last KeySym for which this converter is valid. .SH DESCRIPTION The -.BR XtSetKeyTranslator +.B XtSetKeyTranslator function sets the specified procedure as the current key translator. The default translator is .BR XtTranslateKey , an -.BR XtKeyProc +.B XtKeyProc that uses Shift and Lock modifiers with the interpretations defined by the core protocol. It is provided so that new translators can call it to get default @@ -112,12 +112,12 @@ KeyCode-to-KeySym translations and so that the default translator can be reinstalled. .LP The -.BR XtTranslateKeycode +.B XtTranslateKeycode function passes the specified arguments directly to the currently registered KeyCode to KeySym translator. .LP The -.BR XtRegisterCaseConverter +.B XtRegisterCaseConverter registers the specified case converter. The start and stop arguments provide the inclusive range of KeySyms for which this converter is to be called. @@ -130,10 +130,10 @@ The default converter understands case conversion for all KeySyms defined in the core protocol. .LP The -.BR XtConvertCase +.B XtConvertCase function calls the appropriate converter and returns the results. A user-supplied -.BR XtKeyProc +.B XtKeyProc may need to use this function. .SH "SEE ALSO" .br diff --git a/man/XtSetKeyboardFocus.man b/man/XtSetKeyboardFocus.man index 0695c8b..014b72b 100644 --- a/man/XtSetKeyboardFocus.man +++ b/man/XtSetKeyboardFocus.man @@ -68,19 +68,19 @@ Specifies either the widget in the subtree structure which is to receive the keyboard event, or .BR None . Note that it is not an error to specify -.BR None +.B None when no input focus was previously set. .IP \fIdescendant\fP 1i Specifies the widget for which the keyboard focus is to be set. .SH DESCRIPTION If a future -.BR KeyPress +.B KeyPress or -.BR KeyRelease +.B KeyRelease event occurs within the specified subtree, -.BR XtSetKeyboardFocus +.B XtSetKeyboardFocus causes -.BR XtDispatchEvent +.B XtDispatchEvent to remap and send the event to the specified descendant widget. .LP When there is no modal cascade, @@ -102,15 +102,15 @@ subset of the modal cascade and one or more of the previous conditions is When subtree or one of its descendants acquires the X input focus or the pointer moves into the subtree such that keyboard events would now be delivered to subtree, a -.BR FocusIn +.B FocusIn event is generated for the descendant if -.BR FocusNotify +.B FocusNotify events have been selected by the descendant. Similarly, when W loses the X input focus or the keyboard focus for one of its ancestors, a -.BR FocusOut +.B FocusOut event is generated for descendant if -.BR FocusNotify +.B FocusNotify events have been selected by the descendant. .SH "SEE ALSO" XtCallAcceptFocus(__libmansuffix__) diff --git a/man/XtSetLanguageProc.man b/man/XtSetLanguageProc.man index b9e4e17..b8885f9 100644 --- a/man/XtSetLanguageProc.man +++ b/man/XtSetLanguageProc.man @@ -75,15 +75,15 @@ Specifies the language procedure, or NULL. Specifies additional client data to be passed to the language procedure when it is called. .SH DESCRIPTION -.BR XtSetLanguageProc +.B XtSetLanguageProc sets the language procedure that will be called from -.BR XtDisplayInitialize +.B XtDisplayInitialize for all subsequent Displays initialized in the specified application context. If \fIapp_context\fP is NULL, the specified language procedure is registered in all application contexts created by the calling process, including any future application contexts that may be created. If \fIproc\fP is NULL a default language procedure is registered. -.BR XtSetLanguageProc +.B XtSetLanguageProc returns the previously registered language procedure. If a language procedure has not yet been registered, the return value is unspecified but if this return value is used in a subsequent call to @@ -100,14 +100,14 @@ language ). If an error is encountered a warning message is issued with .BR XtWarning . .IP \(bu 5 Calls -.BR XSupportsLocale +.B XSupportsLocale to verify that the current locale is supported. If the locale is not supported, a warning message is issued with -.BR XtWarning +.B XtWarning and the locale is set to ``C''. .IP \(bu 5 Calls -.BR XSetLocaleModifiers +.B XSetLocaleModifiers specifying the empty string. .IP \(bu 5 Returns the value of the current locale. On ANSI C-based systems this @@ -118,9 +118,9 @@ NULL ). .LP A client wishing to use this mechanism to establish locale can do so by calling -.BR XtSetLanguageProc +.B XtSetLanguageProc prior to -.BR XtDisplayInitialize. +.B XtDisplayInitialize. .SH "SEE ALSO" .br \fI\*(xT\fP diff --git a/man/XtSetMultiClickTime.man b/man/XtSetMultiClickTime.man index 6eb5d7e..f643e21 100644 --- a/man/XtSetMultiClickTime.man +++ b/man/XtSetMultiClickTime.man @@ -69,11 +69,11 @@ Specifies the display connection. .IP \fItime\fP 1i Specifies the multi-click time in milliseconds. .SH DESCRIPTION -.BR XtSetMultiClickTime +.B XtSetMultiClickTime sets the time interval used by the translation manager to determine when multiple events are interpreted as a repeated event. .LP -.BR XtGetMultiClickTime +.B XtGetMultiClickTime returns the time in milliseconds that the translation manager uses to determine if multiple events are to be interpreted as a repeated event for purposes of matching a translation entry containing a repeat count. diff --git a/man/XtSetSelectionParameters.man b/man/XtSetSelectionParameters.man index 444553c..ab9301e 100644 --- a/man/XtSetSelectionParameters.man +++ b/man/XtSetSelectionParameters.man @@ -82,13 +82,13 @@ Specifies the size in bits of the data in the elements of \fIvalue\fP. The specified parameters will be copied and stored in a new property of the specified type and format on the requestor's window. To initiate a selection request with a target and these parameters, a subsequent call to -.BR XtGetSelectionValue +.B XtGetSelectionValue or to -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental specifying the same requestor widget and selection atom will generate a -.BR ConvertSelection +.B ConvertSelection request referring referring to the property containing the parameters. If -.BR XtSetSelectionParameters +.B XtSetSelectionParameters is called more than once with the same widget and selection without a call to specify a request, the most recently specified parameters are used in the subsequent request. @@ -99,18 +99,18 @@ sizeof(short); if 32, sizeof(long). .LP To generate a MULTIPLE target request with parameters for any of the multiple targets of the selection request, precede individual calls to -.BR XtGetSelectionValue +.B XtGetSelectionValue and -.BR XtGetSelectionValueIncremental +.B XtGetSelectionValueIncremental with corresponding individual calls to .BR XtSetSelectionParameters , and enclose these all within -.BR XtCreateSelectionRequest +.B XtCreateSelectionRequest and .BR XtSendSelectionRequest . -.BR XtGetSelectionValues +.B XtGetSelectionValues and -.BR XtGetSelectionValuesIncremental +.B XtGetSelectionValuesIncremental cannot be used to make selection requests with parameterized targets. .SH "SEE ALSO" XtGetSelectionParameters(__libmansuffix__) diff --git a/man/XtSetSensitive.man b/man/XtSetSensitive.man index 992090b..6a830e2 100644 --- a/man/XtSetSensitive.man +++ b/man/XtSetSensitive.man @@ -72,27 +72,27 @@ keyboard and pointer events. Specifies the widget. .SH DESCRIPTION The -.BR XtSetSensitive +.B XtSetSensitive function first calls -.BR XtSetValues +.B XtSetValues on the current widget with an argument list specifying that the sensitive field should change to the new value. It then recursively propagates the new value down the managed children tree by calling -.BR XtSetValues +.B XtSetValues on each child to set the ancestor_sensitive to the new value if the new values for sensitive and the child's ancestor_sensitive are not the same. .LP -.BR XtSetSensitive +.B XtSetSensitive calls -.BR XtSetValues +.B XtSetValues to change sensitive and ancestor_sensitive. Therefore, when one of these changes, the widget's set_values procedure should take whatever display actions are needed (for example, greying out or stippling the widget). .LP -.BR XtSetSensitive +.B XtSetSensitive maintains the invariant that if parent has either sensitive or ancestor_sensitive .BR False , @@ -100,15 +100,15 @@ then all children have ancestor_sensitive .BR False . .LP The -.BR XtIsSensitive +.B XtIsSensitive function returns -.BR True +.B True or -.BR False +.B False to indicate whether or not user input events are being dispatched. If both core.sensitive and core.ancestor_sensitive are .BR True , -.BR XtIsSensitive +.B XtIsSensitive returns .BR True ; otherwise, it returns diff --git a/man/XtSetValues.man b/man/XtSetValues.man index 1e1f95b..725ebdf 100644 --- a/man/XtSetValues.man +++ b/man/XtSetValues.man @@ -104,14 +104,14 @@ and either the address into which the resource value is to be stored or their new values. .SH DESCRIPTION The -.BR XtSetValues +.B XtSetValues function starts with the resources specified for the -.BR Core +.B Core widget fields and proceeds down the subclass chain to the widget. At each stage, it writes the new value (if specified by one of the arguments) or the existing value (if no new value is specified) to a new widget data record. -.BR XtSetValues +.B XtSetValues then calls the set_values procedures for the widget in superclass-to-subclass order. .IN "hook" @@ -123,22 +123,22 @@ This procedure permits subclasses to set nonwidget data for .LP If the widget's parent is a subclass of .BR constraintWidgetClass , -.BR XtSetValues +.B XtSetValues also updates the widget's constraints. It starts with the constraint resources specified for -.BR constraintWidgetClass +.B constraintWidgetClass and proceeds down the subclass chain to the parent's class. At each stage, it writes the new value or the existing value to a new constraint record. It then calls the constraint set_values procedures from -.BR constraintWidgetClass +.B constraintWidgetClass down to the parent's class. The constraint set_values procedures are called with widget arguments, as for all set_values procedures, not just the constraint record arguments, so that they can make adjustments to the desired values based on full information about the widget. .LP -.BR XtSetValues +.B XtSetValues determines if a geometry request is needed by comparing the current widget to the new widget. If any geometry changes are required, @@ -149,35 +149,35 @@ or .BR XtGeometryNo . If .BR XtGeometryYes , -.BR XtSetValues +.B XtSetValues calls the widget's resize procedure. If .BR XtGeometryNo , -.BR XtSetValues +.B XtSetValues resets the geometry fields to their original values. If .BR XtGeometryAlmost , -.BR XtSetValues +.B XtSetValues calls the set_values_almost procedure, which determines what should be done and writes new values for the geometry fields into the new widget. -.BR XtSetValues +.B XtSetValues then repeats this process, deciding once more whether the geometry manager should be called. .LP Finally, if any of the set_values procedures returned .BR True , -.BR XtSetValues +.B XtSetValues causes the widget's expose procedure to be invoked by calling the Xlib -.BR XClearArea +.B XClearArea function on the widget's window. .LP The -.BR XtSetSubvalues +.B XtSetSubvalues function stores resources into the structure identified by base. .LP The -.BR XtGetValues +.B XtGetValues function starts with the resources specified for the core widget fields and proceeds down the subclass chain to the widget. The value field of a passed argument list should contain the @@ -188,10 +188,10 @@ resource representation type used within the widget. .LP If the widget's parent is a subclass of .BR constraintWidgetClass , -.BR XtGetValues +.B XtGetValues then fetches the values for any constraint resources requested. It starts with the constraint resources specified for -.BR constraintWidgetClass +.B constraintWidgetClass and proceeds down to the subclass chain to the parent's constraint resources. If the argument list contains a resource name that is not found in any of the resource lists searched, @@ -205,7 +205,7 @@ This permits a subclass to provide nonwidget resource data to .BR XtGetValues . .LP The -.BR XtGetSubvalues +.B XtGetSubvalues function obtains resource values from the structure identified by base. .SH "SEE ALSO" .br diff --git a/man/XtSetWMColormapWindows.man b/man/XtSetWMColormapWindows.man index 9cfc12b..94b0210 100644 --- a/man/XtSetWMColormapWindows.man +++ b/man/XtSetWMColormapWindows.man @@ -72,10 +72,10 @@ listed in the WM_COLORMAP_WINDOWS property. .IP \fIcount\fP 1i Specifies the number of widgets in \fIlist\fP. .SH DESCRIPTION -.BR XtSetWMColormapWindows +.B XtSetWMColormapWindows returns immediately if \fIwidget\fP is not realized or if \fIcount\fP is zero. Otherwise, -.BR XtSetWMColormapWindows +.B XtSetWMColormapWindows constructs an ordered list of windows by examining each widget in \fIlist\fP in turn and ignoring the widget if it is not realized, or adding the widget's window to the window list if the widget is @@ -84,7 +84,7 @@ resources of all widgets whose windows are already on the window list. .LP Finally, -.BR XtSetWMColormapWindows +.B XtSetWMColormapWindows stores the resulting window list in the WM_COLORMAP_WINDOWS property on the specified widget's window. .SH "SEE ALSO" diff --git a/man/XtStringConversionWarning.man b/man/XtStringConversionWarning.man index 0d60d2c..ae193f0 100644 --- a/man/XtStringConversionWarning.man +++ b/man/XtStringConversionWarning.man @@ -69,12 +69,12 @@ Specifies the string that could not be converted. Specifies the name of the type to which the string could not be converted. .SH DESCRIPTION The -.BR XtStringConversionWarning +.B XtStringConversionWarning function issues a warning message with name ``conversionError'', type ``string'', class ``XtToolkitError, and the default message string ``Cannot convert "\fIsrc\fP" to type \fIdst_type\fP''. .LP -.BR XtStringConversionWarning +.B XtStringConversionWarning has been replaced by .BR XtDisplayStringConversionWarning . .SH "SEE ALSO" diff --git a/man/XtToolkitThreadInitialize.man b/man/XtToolkitThreadInitialize.man index de616b5..7707b06 100644 --- a/man/XtToolkitThreadInitialize.man +++ b/man/XtToolkitThreadInitialize.man @@ -63,14 +63,14 @@ XtToolkitThreadInitialize \- initialize the toolkit for multiple threads Boolean XtToolkitThreadInitialize(void); .SH DESCRIPTION If -.BR XtToolkitThreadInitialize +.B XtToolkitThreadInitialize was previously called, it returns. The application programmer must ensure that two or more threads do not simultaneously attempt to call .BR XtToolkitThreadInitialize ; the effect of this is undefined. -.BR XtToolkitThreadInitialize +.B XtToolkitThreadInitialize returns -.BR True +.B True if the host operating system has threads and the Intrinsics are thread safe. .SH "SEE ALSO" diff --git a/man/XtTranslateCoords.man b/man/XtTranslateCoords.man index 15d46d6..14d89eb 100644 --- a/man/XtTranslateCoords.man +++ b/man/XtTranslateCoords.man @@ -78,9 +78,9 @@ Specify the widget-relative x and y coordinates. Specifies the widget. .SH DESCRIPTION While -.BR XtTranslateCoords +.B XtTranslateCoords is similar to the Xlib -.BR XTranslateCoordinates +.B XTranslateCoordinates function, it does not generate a server request because all the required information already is in the widget's data structures. .SH "SEE ALSO" diff --git a/man/XtVaCreateArgsList.man b/man/XtVaCreateArgsList.man index 843967b..1285d21 100644 --- a/man/XtVaCreateArgsList.man +++ b/man/XtVaCreateArgsList.man @@ -67,19 +67,19 @@ Must be specified as NULL. Specifies a variable parameter list of resource name and value pairs. .SH DESCRIPTION The -.BR XtVaCreateArgsList +.B XtVaCreateArgsList function allocates memory and copies its arguments into a single list pointer, which may be used with .BR XtVaNestedList . The end of both lists is identified by a \fIname\fP entry containing NULL. Any entries of type -.BR XtVaTypedArg +.B XtVaTypedArg are copied as specified without applying conversions. Data passed by reference (including Strings) are not copied, only the pointers themselves; the caller must ensure that the data remain valid for the lifetime of the created varargs list. The list should be freed using -.BR XtFree +.B XtFree when no longer needed. .SH "SEE ALSO" .br diff --git a/src/ActionHook.c b/src/ActionHook.c index b03a116..ade4e70 100644 --- a/src/ActionHook.c +++ b/src/ActionHook.c @@ -136,7 +136,7 @@ void XtRemoveActionHook( else { XtAppWarningMsg(app, "badId", "xtRemoveActionHook", XtCXtToolkitError, "XtRemoveActionHook called with bad or old hook id", - (String*)NULL, (Cardinal*)NULL); + NULL, NULL); } #endif /*DEBUG*/ UNLOCK_APP(app); diff --git a/src/Alloc.c b/src/Alloc.c index 754881b..868af3b 100644 --- a/src/Alloc.c +++ b/src/Alloc.c @@ -143,20 +143,20 @@ Cardinal XtAsprintf( if (len < 0) _XtAllocError("vsnprintf"); - *new_string = XtMalloc(len + 1); /* snprintf doesn't count trailing '\0' */ + *new_string = XtMalloc((Cardinal) len + 1); /* snprintf doesn't count trailing '\0' */ if (len < sizeof(buf)) { - strncpy(*new_string, buf, len); + strncpy(*new_string, buf, (size_t) len); (*new_string)[len] = '\0'; } else { va_start(ap, format); - if (vsnprintf(*new_string, len + 1, format, ap) < 0) + if (vsnprintf(*new_string, (size_t) (len + 1), format, ap) < 0) _XtAllocError("vsnprintf"); va_end(ap); } - return len; + return (Cardinal) len; } @@ -252,7 +252,7 @@ char* _XtHeapAlloc( printf( "allocating large segment (%d bytes) on heap %#x\n", bytes, heap ); #endif - heap_loc = XtMalloc(bytes + sizeof(char*)); + heap_loc = XtMalloc(bytes + (Cardinal) sizeof(char*)); if (heap->start) { *(char**)heap_loc = *(char**)heap->start; *(char**)heap->start = heap_loc; @@ -273,10 +273,10 @@ char* _XtHeapAlloc( heap->current = heap_loc + sizeof(char*); heap->bytes_remaining = HEAP_SEGMENT_SIZE - sizeof(char*); } - bytes = (bytes + (sizeof(long) - 1)) & (~(sizeof(long) - 1)); + bytes = (Cardinal) ((bytes + (sizeof(long) - 1)) & (~(sizeof(long) - 1))); heap_loc = heap->current; heap->current += bytes; - heap->bytes_remaining -= bytes; /* can be negative, if rounded */ + heap->bytes_remaining = (heap->bytes_remaining - (int) bytes); /* can be negative, if rounded */ return heap_loc; } diff --git a/src/Callback.c b/src/Callback.c index 7413da0..842f5e2 100644 --- a/src/Callback.c +++ b/src/Callback.c @@ -122,17 +122,17 @@ void _XtAddCallback( if (icl && icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; icl = (InternalCallbackList) - __XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (count + 1)); + __XtMalloc((Cardinal) (sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (count + 1))); (void) memmove((char *)ToList(icl), (char *)ToList(*callbacks), sizeof(XtCallbackRec) * count); } else { icl = (InternalCallbackList) - XtRealloc((char *) icl, sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (count + 1)); + XtRealloc((char *) icl, (Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (count + 1))); } *callbacks = icl; - icl->count = count + 1; + icl->count = (unsigned short) (count + 1); icl->is_padded = 0; icl->call_state = 0; cl = ToList(icl) + count; @@ -172,7 +172,7 @@ void XtAddCallback( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtAddCallback,XtCXtToolkitError, "Cannot find callback list in XtAddCallback", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -208,17 +208,17 @@ static void AddCallbacks( for (j=0, cl = newcallbacks; cl->callback; cl++, j++); if (icl && icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; - icl = (InternalCallbackList) __XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (i+j)); + icl = (InternalCallbackList) __XtMalloc((Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (i+j))); (void) memmove((char *)ToList(*callbacks), (char *)ToList(icl), - sizeof(XtCallbackRec) * i); + sizeof(XtCallbackRec) * (size_t) i); } else { icl = (InternalCallbackList) XtRealloc((char *) icl, - sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (i+j)); + (Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (i+j))); } *callbacks = icl; - icl->count = i+j; + icl->count = (unsigned short) (i+j); icl->is_padded = 0; icl->call_state = 0; for (cl = ToList(icl) + i; --j >= 0; ) @@ -241,7 +241,7 @@ void XtAddCallbacks( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtAddCallback,XtCXtToolkitError, "Cannot find callback list in XtAddCallbacks", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -283,9 +283,9 @@ void _XtRemoveCallback ( j = icl->count - i - 1; ocl = ToList(icl); icl = (InternalCallbackList) - __XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (i + j)); - icl->count = i + j; + __XtMalloc((Cardinal) (sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (i + j))); + icl->count = (unsigned short) (i + j); icl->is_padded = 0; icl->call_state = 0; ncl = ToList(icl); @@ -301,8 +301,8 @@ void _XtRemoveCallback ( while (--i >= 0) *cl++ = *ncl++; icl = (InternalCallbackList) - XtRealloc((char *) icl, sizeof(InternalCallbackRec) - + sizeof(XtCallbackRec) * icl->count); + XtRealloc((char *) icl, (Cardinal) (sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * icl->count)); icl->is_padded = 0; *callbacks = icl; } else { @@ -332,7 +332,7 @@ void XtRemoveCallback ( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtRemoveCallback,XtCXtToolkitError, "Cannot find callback list in XtRemoveCallback", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -370,7 +370,7 @@ void XtRemoveCallbacks ( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtRemoveCallback,XtCXtToolkitError, "Cannot find callback list in XtRemoveCallbacks", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -385,9 +385,9 @@ void XtRemoveCallbacks ( cl = ToList(icl); if (icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; - icl = (InternalCallbackList)__XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * i); - icl->count = i; + icl = (InternalCallbackList)__XtMalloc((Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) i)); + icl->count = (unsigned short) i; icl->call_state = 0; } ccl = ToList(icl); @@ -404,7 +404,7 @@ void XtRemoveCallbacks ( } if (icl->count) { icl = (InternalCallbackList) - XtRealloc((char *)icl, (sizeof(InternalCallbackRec) + + XtRealloc((char *)icl, (Cardinal) (sizeof(InternalCallbackRec) + sizeof(XtCallbackRec) * icl->count)); icl->is_padded = 0; *callbacks = icl; @@ -455,7 +455,7 @@ void XtRemoveAllCallbacks( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtRemoveAllCallback,XtCXtToolkitError, "Cannot find callback list in XtRemoveAllCallbacks", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -484,9 +484,9 @@ InternalCallbackList _XtCompileCallbackList( for (n=0, xtcl=xtcallbacks; xtcl->callback; n++, xtcl++) {}; if (n == 0) return (InternalCallbackList) NULL; - callbacks = (InternalCallbackList) __XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * n); - callbacks->count = n; + callbacks = (InternalCallbackList) __XtMalloc((Cardinal) (sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) n)); + callbacks->count = (unsigned short) n; callbacks->is_padded = 0; callbacks->call_state = 0; cl = ToList(callbacks); @@ -514,17 +514,17 @@ XtCallbackList _XtGetCallbackList( if (icl->call_state) { icl->call_state |= _XtCBFreeAfterCalling; ocl = ToList(icl); - icl = (InternalCallbackList) __XtMalloc(sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (i+1)); - icl->count = i; + icl = (InternalCallbackList) __XtMalloc((Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t) (i+1))); + icl->count = (unsigned short) i; icl->call_state = 0; cl = ToList(icl); while (--i >= 0) *cl++ = *ocl++; } else { icl = (InternalCallbackList) XtRealloc((char *)icl, - sizeof(InternalCallbackRec) + - sizeof(XtCallbackRec) * (i+1)); + (Cardinal)(sizeof(InternalCallbackRec) + + sizeof(XtCallbackRec) * (size_t)(i+1))); cl = ToList(icl) + i; } icl->is_padded = 1; @@ -553,7 +553,7 @@ void XtCallCallbacks( XtAppWarningMsg(app, XtNinvalidCallbackList,XtNxtCallCallback,XtCXtToolkitError, "Cannot find callback list in XtCallCallbacks", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } diff --git a/src/Composite.c b/src/Composite.c index 29893d8..7b6982c 100644 --- a/src/Composite.c +++ b/src/Composite.c @@ -242,7 +242,7 @@ static void CompositeInsertChild( cw->composite.num_slots += (cw->composite.num_slots / 2) + 2; cw->composite.children = children = (WidgetList) XtRealloc((XtPointer) children, - (unsigned) (cw->composite.num_slots) * sizeof(Widget)); + (Cardinal)((unsigned) (cw->composite.num_slots) * sizeof(Widget))); } /* Ripple children up one space from "position" */ for (i = cw->composite.num_children; i > position; i--) { diff --git a/src/Convert.c b/src/Convert.c index 70004da..f9cafe3 100644 --- a/src/Convert.c +++ b/src/Convert.c @@ -207,15 +207,15 @@ void _XtTableAddConverter( XtFree((char *)p); } - p = (ConverterPtr) __XtMalloc(sizeof(ConverterRec) + - sizeof(XtConvertArgRec) * num_args); + p = (ConverterPtr) __XtMalloc((Cardinal)(sizeof(ConverterRec) + + sizeof(XtConvertArgRec) * num_args)); p->next = *pp; *pp = p; p->from = from_type; p->to = to_type; p->converter = converter; p->destructor = destructor; - p->num_args = num_args; + p->num_args = (unsigned short) num_args; p->global = global; args = ConvertArgs(p); while (num_args--) @@ -223,7 +223,7 @@ void _XtTableAddConverter( p->new_style = new_style; p->do_ref_count = False; if (destructor || (cache_type & 0xff)) { - p->cache_type = cache_type & 0xff; + p->cache_type = (char) (cache_type & 0xff); if (cache_type & XtCacheRefCount) p->do_ref_count = True; } else { @@ -367,7 +367,7 @@ CacheEnter( pHashEntry = &cacheHashTable[hash & CACHEHASHMASK]; if ((succeeded && destructor) || do_ref) { - p = (CachePtr) _XtHeapAlloc(heap, (sizeof(CacheRec) + + p = (CachePtr) _XtHeapAlloc(heap, (Cardinal) (sizeof(CacheRec) + sizeof(CacheRecExt) + num_args * sizeof(XrmValue))); CEXT(p)->prev = pHashEntry; @@ -377,7 +377,7 @@ CacheEnter( p->has_ext = True; } else { - p = (CachePtr)_XtHeapAlloc(heap, (sizeof(CacheRec) + + p = (CachePtr)_XtHeapAlloc(heap, (Cardinal) (sizeof(CacheRec) + num_args * sizeof(XrmValue))); p->has_ext = False; } @@ -403,7 +403,7 @@ CacheEnter( p->from.addr = (XPointer)_XtHeapAlloc(heap, from->size); (void) memmove((char *)p->from.addr, (char *)from->addr, from->size); } - p->num_args = num_args; + p->num_args = (unsigned short) num_args; if (num_args) { XrmValue *pargs = CARGS(p); for (i = 0; i < num_args; i++) { @@ -540,7 +540,7 @@ static Boolean ResourceQuarkToOffset( for (i = 0; i < wc->core_class.num_resources; i++, resources++) { res = *resources; if (res->xrm_name == name) { - *offset = -res->xrm_offset - 1; + *offset = (Cardinal) (-res->xrm_offset - 1); return True; } } /* for i in resources */ diff --git a/src/Converters.c b/src/Converters.c index 7020ca8..3402a24 100644 --- a/src/Converters.c +++ b/src/Converters.c @@ -144,11 +144,11 @@ void _XtConvertInitialize(void) (char*) fromVal->addr, tstr); \ return False; \ } \ - *(type*)(toVal->addr) = (value); \ + *(type*)(toVal->addr) = (type) (value); \ } \ else { \ static type static_val; \ - static_val = (value); \ + static_val = (type) (value); \ toVal->addr = (XPointer)&static_val; \ } \ toVal->size = sizeof(type); \ @@ -162,11 +162,11 @@ void _XtConvertInitialize(void) toVal->size = sizeof(type); \ return False; \ } \ - *(type*)(toVal->addr) = (value); \ + *(type*)(toVal->addr) = (type) (value); \ } \ else { \ static type static_val; \ - static_val = (value); \ + static_val = (type) (value); \ toVal->addr = (XPointer)&static_val; \ } \ toVal->size = sizeof(type); \ @@ -312,7 +312,7 @@ Boolean XtCvtIntToBoolean( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToBoolean",XtCXtToolkitError, "Integer to Boolean conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); done(Boolean, (*(int *)fromVal->addr != 0)); } @@ -330,7 +330,7 @@ Boolean XtCvtIntToShort( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToShort",XtCXtToolkitError, "Integer to Short conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); done(short, (*(int *)fromVal->addr)); } @@ -349,7 +349,7 @@ Boolean XtCvtStringToBoolean( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToBoolean",XtCXtToolkitError, "String to Boolean conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if ( (CompareISOLatin1(str, "true") == 0) || (CompareISOLatin1(str, "yes") == 0) @@ -379,7 +379,7 @@ Boolean XtCvtIntToBool( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToBool",XtCXtToolkitError, "Integer to Bool conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); done(Bool, (*(int *)fromVal->addr != 0)); } @@ -399,7 +399,7 @@ Boolean XtCvtStringToBool( XtNwrongParameters,"cvtStringToBool", XtCXtToolkitError, "String to Bool conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if ( (CompareISOLatin1(str, "true") == 0) || (CompareISOLatin1(str, "yes") == 0) @@ -440,12 +440,12 @@ Boolean XtCvtIntToColor( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntOrPixelToXColor",XtCXtToolkitError, "Pixel to color conversion needs screen and colormap arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return False; } screen = *((Screen **) args[0].addr); colormap = *((Colormap *) args[1].addr); - c.pixel = *(int *)fromVal->addr; + c.pixel = (unsigned long) (*(int *)fromVal->addr); XQueryColor(DisplayOfScreen(screen), colormap, &c); done(XColor, c); @@ -474,7 +474,7 @@ Boolean XtCvtStringToPixel( XtAppWarningMsg(pd->appContext, XtNwrongParameters, "cvtStringToPixel", XtCXtToolkitError, "String to pixel conversion needs screen and colormap arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -534,7 +534,7 @@ static void FreePixel( if (*num_args != 2) { XtAppWarningMsg(app, XtNwrongParameters,"freePixel",XtCXtToolkitError, "Freeing a pixel requires screen and colormap arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -564,7 +564,7 @@ static void FetchDisplayArg( if (widget == NULL) XtErrorMsg("missingWidget", "fetchDisplayArg", XtCXtToolkitError, "FetchDisplayArg called without a widget to reference", - (String*)NULL, (Cardinal*)NULL); + NULL, NULL); /* can't return any useful Display and caller will de-ref NULL, so aborting is the only useful option */ @@ -675,7 +675,7 @@ Boolean XtCvtStringToCursor( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToCursor",XtCXtToolkitError, "String to cursor conversion needs display argument", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -704,7 +704,7 @@ static void FreeCursor( XtAppWarningMsg(app, XtNwrongParameters,"freeCursor",XtCXtToolkitError, "Free Cursor requires display argument", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -727,7 +727,7 @@ Boolean XtCvtStringToDisplay( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToDisplay",XtCXtToolkitError, "String to Display conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); d = XOpenDisplay((char *)fromVal->addr); if (d != NULL) @@ -753,7 +753,7 @@ Boolean XtCvtStringToFile( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToFile",XtCXtToolkitError, "String to File conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); f = fopen((char *)fromVal->addr, "r"); if (f != NULL) @@ -775,7 +775,7 @@ static void FreeFile( XtAppWarningMsg(app, XtNwrongParameters,"freeFile",XtCXtToolkitError, "Free File requires no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); fclose( *(FILE**)toVal->addr ); } @@ -793,7 +793,7 @@ Boolean XtCvtIntToFloat( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToFloat",XtCXtToolkitError, "Integer to Float conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); done(float, (*(int *)fromVal->addr)); } @@ -819,7 +819,7 @@ Boolean XtCvtStringToFloat( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToFloat",XtCXtToolkitError, "String to Float conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); ret = sscanf (fromVal->addr, "%g", &f); if (ret == 0) { @@ -847,7 +847,7 @@ Boolean XtCvtStringToFont( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToFont",XtCXtToolkitError, "String to font conversion needs display argument", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -898,7 +898,7 @@ Boolean XtCvtStringToFont( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "noFont","cvtStringToFont",XtCXtToolkitError, "Unable to load any usable ISO8859 font", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -916,7 +916,7 @@ static void FreeFont( XtAppWarningMsg(app, XtNwrongParameters,"freeFont",XtCXtToolkitError, "Free Font needs display argument", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -937,7 +937,7 @@ Boolean XtCvtIntToFont( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToFont",XtCXtToolkitError, "Integer to Font conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); done(Font, *(int*)fromVal->addr); } @@ -960,7 +960,7 @@ Boolean XtCvtStringToFontSet( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToFontSet",XtCXtToolkitError, "String to FontSet conversion needs display and locale arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -974,7 +974,7 @@ Boolean XtCvtStringToFontSet( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNmissingCharsetList,"cvtStringToFontSet",XtCXtToolkitError, "Missing charsets in String to FontSet conversion", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); XFreeStringList(missing_charset_list); } if (f != NULL) { @@ -1007,7 +1007,7 @@ Boolean XtCvtStringToFontSet( XtNmissingCharsetList,"cvtStringToFontSet", XtCXtToolkitError, "Missing charsets in String to FontSet conversion", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); XFreeStringList(missing_charset_list); } if (f != NULL) @@ -1031,7 +1031,7 @@ Boolean XtCvtStringToFontSet( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNmissingCharsetList,"cvtStringToFontSet",XtCXtToolkitError, "Missing charsets in String to FontSet conversion", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); XFreeStringList(missing_charset_list); } if (f != NULL) @@ -1040,7 +1040,7 @@ Boolean XtCvtStringToFontSet( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "noFont","cvtStringToFontSet",XtCXtToolkitError, "Unable to load any usable fontset", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -1058,7 +1058,7 @@ static void FreeFontSet( XtAppWarningMsg(app, XtNwrongParameters,"freeFontSet",XtCXtToolkitError, "FreeFontSet needs display and locale arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -1103,7 +1103,7 @@ XtCvtStringToFontStruct( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToFontStruct",XtCXtToolkitError, "String to font conversion needs display argument", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -1157,7 +1157,7 @@ XtCvtStringToFontStruct( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "noFont","cvtStringToFontStruct",XtCXtToolkitError, "Unable to load any usable ISO8859 font", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -1175,7 +1175,7 @@ static void FreeFontStruct( XtAppWarningMsg(app, XtNwrongParameters,"freeFontStruct",XtCXtToolkitError, "Free FontStruct requires display argument", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -1198,7 +1198,7 @@ Boolean XtCvtStringToInt( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToInt",XtCXtToolkitError, "String to Integer conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); if (IsInteger((String)fromVal->addr, &i)) donestr(int, i, XtRInt); @@ -1221,7 +1221,7 @@ Boolean XtCvtStringToShort( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToShort",XtCXtToolkitError, "String to Integer conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); if (IsInteger((String)fromVal->addr, &i)) donestr(short, (short)i, XtRShort); @@ -1244,7 +1244,7 @@ Boolean XtCvtStringToDimension( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToDimension",XtCXtToolkitError, "String to Dimension conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); if (IsInteger((String)fromVal->addr, &i)) { if ( i < 0 ) XtDisplayStringConversionWarning(dpy, (char*)fromVal->addr, @@ -1268,7 +1268,7 @@ Boolean XtCvtIntToUnsignedChar( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToUnsignedChar",XtCXtToolkitError, "Integer to UnsignedChar conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); done(unsigned char, (*(int *)fromVal->addr)); } @@ -1288,7 +1288,7 @@ Boolean XtCvtStringToUnsignedChar( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToUnsignedChar",XtCXtToolkitError, "String to Integer conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); if (IsInteger((String)fromVal->addr, &i)) { if ( i < 0 || i > 255 ) XtDisplayStringConversionWarning(dpy, (char*)fromVal->addr, @@ -1314,7 +1314,7 @@ Boolean XtCvtColorToPixel( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtXColorToPixel",XtCXtToolkitError, "Color to Pixel conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); done(Pixel, ((XColor *)fromVal->addr)->pixel); } @@ -1331,7 +1331,7 @@ Boolean XtCvtIntToPixel( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToPixel",XtCXtToolkitError, "Integer to Pixel conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); done(Pixel, *(int*)fromVal->addr); } @@ -1348,7 +1348,7 @@ Boolean XtCvtIntToPixmap( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtIntToPixmap",XtCXtToolkitError, "Integer to Pixmap conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); done(Pixmap, *(int*)fromVal->addr); } @@ -1381,18 +1381,18 @@ static int CompareISOLatin1 (const char *first, const char *second) /* try lowercasing and try again */ if ((a >= XK_A) && (a <= XK_Z)) - a += (XK_a - XK_A); + a = (unsigned char) (a + (XK_a - XK_A)); else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis)) - a += (XK_agrave - XK_Agrave); + a = (unsigned char) (a + (XK_agrave - XK_Agrave)); else if ((a >= XK_Ooblique) && (a <= XK_Thorn)) - a += (XK_oslash - XK_Ooblique); + a = (unsigned char) (a + (XK_oslash - XK_Ooblique)); if ((b >= XK_A) && (b <= XK_Z)) - b += (XK_a - XK_A); + b = (unsigned char) (b + (XK_a - XK_A)); else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis)) - b += (XK_agrave - XK_Agrave); + b = (unsigned char) (b + (XK_agrave - XK_Agrave)); else if ((b >= XK_Ooblique) && (b <= XK_Thorn)) - b += (XK_oslash - XK_Ooblique); + b = (unsigned char) (b + (XK_oslash - XK_Ooblique)); if (a != b) break; } @@ -1407,11 +1407,11 @@ static void CopyISOLatin1Lowered(char *dst, const char *src) for ( ; *source; source++, dest++) { if (*source >= XK_A && *source <= XK_Z) - *dest = *source + (XK_a - XK_A); + *dest = (unsigned char) (*source + (XK_a - XK_A)); else if (*source >= XK_Agrave && *source <= XK_Odiaeresis) - *dest = *source + (XK_agrave - XK_Agrave); + *dest = (unsigned char) (*source + (XK_agrave - XK_Agrave)); else if (*source >= XK_Ooblique && *source <= XK_Thorn) - *dest = *source + (XK_oslash - XK_Ooblique); + *dest = (unsigned char) (*source + (XK_oslash - XK_Ooblique)); else *dest = *source; } @@ -1433,7 +1433,7 @@ XtCvtStringToInitialState( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToInitialState",XtCXtToolkitError, "String to InitialState conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); if (CompareISOLatin1(str, "NormalState") == 0) donestr(int, NormalState, XtRInitialState); if (CompareISOLatin1(str, "IconicState") == 0) donestr(int, IconicState, XtRInitialState); @@ -1468,7 +1468,7 @@ Boolean XtCvtStringToVisual( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToVisual",XtCXtToolkitError, "String to Visual conversion needs screen and depth arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -1519,7 +1519,7 @@ Boolean XtCvtStringToAtom( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToAtom",XtCXtToolkitError, "String to Atom conversion needs Display argument", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -1543,7 +1543,7 @@ Boolean XtCvtStringToDirectoryString( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToDirectoryString",XtCXtToolkitError, "String to DirectoryString conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); str = (String)fromVal->addr; if (CompareISOLatin1(str, "XtCurrentDirectory") == 0) { @@ -1584,7 +1584,7 @@ static void FreeDirectoryString( XtAppWarningMsg(app, XtNwrongParameters,"freeDirectoryString",XtCXtToolkitError, "Free Directory String requires no extra arguments", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); XtFree((char *) toVal->addr); } @@ -1603,7 +1603,7 @@ Boolean XtCvtStringToRestartStyle( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToRestartStyle",XtCXtToolkitError, "String to RestartStyle conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if (CompareISOLatin1(str, "RestartIfRunning") == 0) donestr(unsigned char, SmRestartIfRunning, XtRRestartStyle); @@ -1636,7 +1636,7 @@ Boolean XtCvtStringToCommandArgArray( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters,"cvtStringToCommandArgArray",XtCXtToolkitError, "String to CommandArgArray conversion needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); src = fromVal->addr; dst = dst_str = __XtMalloc((unsigned) strlen(src) + 1); @@ -1656,10 +1656,10 @@ Boolean XtCvtStringToCommandArgArray( while (*src != '\0' && !IsWhitespace(*src) && !IsNewline(*src)) { if (*src == '\\' && (IsWhitespace(*(src+1)) || IsNewline(*(src+1)))) { - len = src - start; + len = (int) (src - start); if (len) { /* copy preceeding part of token */ - memcpy(dst, start, len); + memcpy(dst, start, (size_t) len); dst += len; } /* skip backslash */ @@ -1669,10 +1669,10 @@ Boolean XtCvtStringToCommandArgArray( } src++; } - len = src - start; + len = (int) (src - start); if (len) { /* copy last part of token */ - memcpy(dst, start, len); + memcpy(dst, start, (size_t) len); dst += len; } *dst = '\0'; @@ -1680,13 +1680,13 @@ Boolean XtCvtStringToCommandArgArray( dst++; } - ptr = strarray = (String*) __XtMalloc((Cardinal)(tokens+1) * sizeof(String)); + ptr = strarray = (String*) __XtMalloc((Cardinal)((size_t)(tokens+1) * sizeof(String))); src = dst_str; while (--tokens >= 0) { *ptr = src; ptr++; if (tokens) { - len = strlen(src); + len = (int) strlen(src); src = src + len + 1; } } @@ -1762,7 +1762,7 @@ Boolean XtCvtStringToGravity ( XtAppWarningMsg(XtDisplayToApplicationContext (dpy), "wrongParameters","cvtStringToGravity","XtToolkitError", "String to Gravity conversion needs no extra arguments", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); return False; } if (!haveQuarks) { @@ -349,7 +349,7 @@ static Boolean CoreSetValues( } else { attributes.background_pixmap = new->core.background_pixmap; - window_mask &= ~CWBackPixel; + window_mask &= (unsigned long) (~CWBackPixel); window_mask |= CWBackPixmap; } redisplay = TRUE; @@ -366,14 +366,14 @@ static Boolean CoreSetValues( } else { attributes.border_pixmap = new->core.border_pixmap; - window_mask &= ~CWBorderPixel; + window_mask &= (unsigned long) (~CWBorderPixel); window_mask |= CWBorderPixmap; } } if (old->core.depth != new->core.depth) { XtAppWarningMsg(XtWidgetToApplicationContext(old), "invalidDepth","setValues",XtCXtToolkitError, - "Can't change widget depth", (String *)NULL, (Cardinal *)NULL); + "Can't change widget depth", NULL, NULL); new->core.depth = old->core.depth; } if (old->core.colormap != new->core.colormap) { diff --git a/src/Create.c b/src/Create.c index 67537a1..47ba2ca 100644 --- a/src/Create.c +++ b/src/Create.c @@ -297,7 +297,7 @@ xtWidgetAlloc( (sizeof(struct {char a; unsigned long b;}) - sizeof(unsigned long) + sizeof(double))) { if (csize && !(csize & (sizeof(double) - 1))) - wsize = (wsize + sizeof(double) - 1) & ~(sizeof(double)-1); + wsize = (Cardinal) ((wsize + sizeof(double) - 1) & ~(sizeof(double)-1)); } } widget = (Widget) __XtCalloc(1,(unsigned)(wsize + csize)); @@ -620,7 +620,7 @@ popupPostProc(Widget w) parent->core.popup_list = (WidgetList) XtRealloc((char*) parent->core.popup_list, - (unsigned) (parent->core.num_popups+1) * sizeof(Widget)); + (Cardinal)((unsigned) (parent->core.num_popups+1) * sizeof(Widget))); parent->core.popup_list[parent->core.num_popups++] = w; } @@ -640,12 +640,12 @@ _XtCreatePopupShell( if (parent == NULL) { XtErrorMsg("invalidParent",XtNxtCreatePopupShell,XtCXtToolkitError, "XtCreatePopupShell requires non-NULL parent", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } else if (widget_class == NULL) { XtAppErrorMsg(XtWidgetToApplicationContext(parent), "invalidClass",XtNxtCreatePopupShell,XtCXtToolkitError, "XtCreatePopupShell requires non-NULL widget class", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } XtCheckSubclass(parent, coreWidgetClass, "in XtCreatePopupShell"); default_screen = parent->core.screen; @@ -697,7 +697,7 @@ _XtAppCreateShell( XtAppErrorMsg(XtDisplayToApplicationContext(display), "invalidClass","xtAppCreateShell",XtCXtToolkitError, "XtAppCreateShell requires non-NULL widget class", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } if (name == NULL) name = XrmNameToString(_XtGetPerDisplay(display)->name); diff --git a/src/Destroy.c b/src/Destroy.c index e952bcc..b72f4c6 100644 --- a/src/Destroy.c +++ b/src/Destroy.c @@ -351,7 +351,7 @@ void XtDestroyWidget (Widget widget) app->destroy_list_size += 10; app->destroy_list = (DestroyRec*) XtRealloc( (char*)app->destroy_list, - (unsigned)sizeof(DestroyRec)*app->destroy_list_size + (Cardinal)(sizeof(DestroyRec) * (size_t)app->destroy_list_size) ); } dr = app->destroy_list + app->destroy_count++; diff --git a/src/Display.c b/src/Display.c index ec01d29..669c8b4 100644 --- a/src/Display.c +++ b/src/Display.c @@ -120,9 +120,9 @@ static void AddToAppContext( #define DISPLAYS_TO_ADD 4 if (app->count >= app->max) { - app->max += DISPLAYS_TO_ADD; + app->max = (short) (app->max + DISPLAYS_TO_ADD); app->list = (Display **) XtRealloc((char *)app->list, - (unsigned) app->max * sizeof(Display *)); + (Cardinal) ((unsigned) app->max * sizeof(Display *))); } app->list[app->count++] = d; @@ -218,8 +218,8 @@ static XtPerDisplay InitPerDisplay( pd->pdi.keyboard.grabType = XtNoServerGrab; pd->pdi.pointer.grabType = XtNoServerGrab; _XtAllocWWTable(pd); - pd->per_screen_db = (XrmDatabase *)__XtCalloc(ScreenCount(dpy), - sizeof(XrmDatabase)); + pd->per_screen_db = (XrmDatabase *)__XtCalloc((Cardinal)ScreenCount(dpy), + (Cardinal)sizeof(XrmDatabase)); pd->cmd_db = (XrmDatabase)NULL; pd->server_db = (XrmDatabase)NULL; pd->dispatcher_list = NULL; @@ -288,9 +288,9 @@ Display *XtOpenDisplay( } else { int len; displayName = XDisplayName(displayName); - len = strlen (displayName); - app->display_name_tried = (String) __XtMalloc (len + 1); - strncpy ((char*) app->display_name_tried, displayName, len + 1); + len = (int) strlen (displayName); + app->display_name_tried = (String) __XtMalloc ((Cardinal)(len + 1)); + strncpy ((char*) app->display_name_tried, displayName, (size_t) (len + 1)); app->display_name_tried[len] = '\0'; } if (db) XrmDestroyDatabase(db); @@ -317,7 +317,7 @@ _XtAppInit( */ saved_argv = (String *) - __XtMalloc( (Cardinal)((*argc_in_out + 1) * sizeof(String)) ); + __XtMalloc( (Cardinal)((size_t)(*argc_in_out + 1) * sizeof(String)) ); for (i = 0 ; i < *argc_in_out ; i++) saved_argv[i] = (*argv_in_out)[i]; saved_argv[i] = NULL; /* NULL terminate that sucker. */ @@ -329,7 +329,7 @@ _XtAppInit( if (fallback_resources) /* save a procedure call */ XtAppSetFallbackResources(*app_context_return, fallback_resources); - dpy = XtOpenDisplay(*app_context_return, (String) NULL, NULL, + dpy = XtOpenDisplay(*app_context_return, NULL, NULL, application_class, options, num_options, argc_in_out, *argv_in_out); @@ -507,7 +507,7 @@ void XtDestroyApplicationContext(XtAppContext app) _XtAppDestroyCount++; appDestroyList = (XtAppContext *) XtRealloc((char *) appDestroyList, - (unsigned) (_XtAppDestroyCount * sizeof(XtAppContext))); + (unsigned) ((size_t)_XtAppDestroyCount * sizeof(XtAppContext))); appDestroyList[_XtAppDestroyCount-1] = app; UNLOCK_PROCESS; UNLOCK_APP(app); @@ -520,7 +520,7 @@ void _XtDestroyAppContexts(void) XtAppContext apps[8]; XtAppContext* pApps; - pApps = XtStackAlloc (sizeof (XtAppContext) * _XtAppDestroyCount, apps); + pApps = XtStackAlloc (sizeof (XtAppContext) * (size_t)_XtAppDestroyCount, apps); for (i = ii = 0; i < _XtAppDestroyCount; i++) { if (_XtSafeToDestroy(appDestroyList[i])) @@ -566,7 +566,7 @@ XtPerDisplay _XtSortPerDisplayList(Display *dpy) if (pd == NULL) { XtErrorMsg(XtNnoPerDisplay, "getPerDisplay", XtCXtToolkitError, "Couldn't find per display information", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); } if (pd != _XtperDisplayList) { /* move it to the front */ @@ -607,7 +607,7 @@ static void CloseDisplay(Display *dpy) if (pd == NULL) { XtErrorMsg(XtNnoPerDisplay, "closeDisplay", XtCXtToolkitError, "Couldn't find per display information", - (String *) NULL, (Cardinal *)NULL); + NULL, NULL); } if (pd == _XtperDisplayList) _XtperDisplayList = pd->next; @@ -683,7 +683,7 @@ void XtCloseDisplay(Display *dpy) app->dpy_destroy_count++; app->dpy_destroy_list = (Display **) XtRealloc((char *) app->dpy_destroy_list, - (unsigned) (app->dpy_destroy_count * sizeof(Display *))); + (Cardinal) ((size_t)app->dpy_destroy_count * sizeof(Display *))); app->dpy_destroy_list[app->dpy_destroy_count-1] = dpy; } UNLOCK_APP(app); @@ -756,8 +756,8 @@ void XtGetDisplays( { int ii; LOCK_APP(app_context); - *num_dpy_return = app_context->count; - *dpy_return = (Display**)__XtMalloc(app_context->count * sizeof(Display*)); + *num_dpy_return = (Cardinal)app_context->count; + *dpy_return = (Display**)__XtMalloc((Cardinal)((size_t)app_context->count * sizeof(Display*))); for (ii = 0; ii < app_context->count; ii++) (*dpy_return)[ii] = app_context->list[ii]; UNLOCK_APP(app_context); diff --git a/src/Error.c b/src/Error.c index 18a80b5..44e8a2a 100644 --- a/src/Error.c +++ b/src/Error.c @@ -194,12 +194,12 @@ void XtAppGetErrorDatabaseText( #endif /* GLOBALERRORS */ } else (void) XrmGetResource(db, str_name, str_class, &type_str, &result); if (result.addr) { - (void) strncpy (buffer, result.addr, nbytes); + (void) strncpy (buffer, result.addr, (size_t) nbytes); if (result.size > (unsigned) nbytes) buffer[nbytes-1] = 0; } else { - int len = strlen(defaultp); + int len = (int) strlen(defaultp); if (len >= nbytes) len = nbytes-1; - (void) memmove(buffer, defaultp, len); + (void) memmove(buffer, defaultp, (size_t) len); buffer[len] = '\0'; } if (str_name) diff --git a/src/Event.c b/src/Event.c index 11823d6..de52910 100644 --- a/src/Event.c +++ b/src/Event.c @@ -150,7 +150,7 @@ static void CallExtensionSelector( for (p = widget->core.event_table; p != NULL; p = p->next) if (p->has_type_specifier && EXT_TYPE(p) >= rec->min && EXT_TYPE(p) <= rec->max) - count += p->mask; + count = (Cardinal) (count + p->mask); if (count == 0 && !forceCall) return; @@ -230,7 +230,7 @@ RemoveEventHandler( Display* dpy = XtDisplay (widget); if (oldMask != mask) - XSelectInput(dpy, XtWindow(widget), mask); + XSelectInput(dpy, XtWindow(widget), (long) mask); if (has_type_specifier) { XtPerDisplay pd = _XtGetPerDisplay(dpy); @@ -348,9 +348,9 @@ AddEventHandler( i++; if (i == p->mask) { p = (XtEventRec*) XtRealloc((char*)p, - sizeof(XtEventRec) + + (Cardinal)(sizeof(XtEventRec) + sizeof(XtEventRecExt) + - p->mask * sizeof(XtPointer)); + p->mask * sizeof(XtPointer))); EXT_SELECT_DATA(p,i) = select_data; p->mask++; *pp = p; @@ -363,7 +363,7 @@ AddEventHandler( Display* dpy = XtDisplay (widget); if (oldMask != mask) - XSelectInput(dpy, XtWindow(widget), mask); + XSelectInput(dpy, XtWindow(widget), (long) mask); if (has_type_specifier) { XtPerDisplay pd = _XtGetPerDisplay (dpy); @@ -514,7 +514,7 @@ static const WidgetRec WWfake; /* placeholder for deletions */ #define WWHASH(tab,win) ((win) & tab->mask) #define WWREHASHVAL(tab,win) ((((win) % tab->rehash) + 2) | 1) -#define WWREHASH(tab,idx,rehash) ((idx + rehash) & tab->mask) +#define WWREHASH(tab,idx,rehash) ((unsigned)(idx + rehash) & (tab->mask)) #define WWTABLE(display) (_XtGetPerDisplay(display)->WWtable) static void ExpandWWTable(WWTable); @@ -547,11 +547,11 @@ void XtRegisterDrawable( if ((tab->occupied + (tab->occupied >> 2)) > tab->mask) ExpandWWTable(tab); - idx = WWHASH(tab, window); + idx = (int) WWHASH(tab, window); if ((entry = tab->entries[idx]) && entry != &WWfake) { - rehash = WWREHASHVAL(tab, window); + rehash = (int) WWREHASHVAL(tab, window); do { - idx = WWREHASH(tab, idx, rehash); + idx = (int) WWREHASH(tab, idx, rehash); } while ((entry = tab->entries[idx]) && entry != &WWfake); } if (!entry) @@ -593,12 +593,12 @@ void XtUnregisterDrawable( UNLOCK_APP(app); return; } - idx = WWHASH(tab, window); + idx = (int) WWHASH(tab, window); if ((entry = tab->entries[idx])) { if (entry != widget) { - rehash = WWREHASHVAL(tab, window); + rehash = (int) WWREHASHVAL(tab, window); do { - idx = WWREHASH(tab, idx, rehash); + idx = (int) WWREHASH(tab, idx, rehash); if (!(entry = tab->entries[idx])) { UNLOCK_PROCESS; UNLOCK_APP(app); @@ -633,11 +633,11 @@ static void ExpandWWTable( entries = tab->entries = (Widget *) __XtCalloc(tab->mask+1, sizeof(Widget)); for (oldidx = 0; oldidx <= oldmask; oldidx++) { if ((entry = oldentries[oldidx]) && entry != &WWfake) { - newidx = WWHASH(tab, XtWindow(entry)); + newidx = (Cardinal) WWHASH(tab, XtWindow(entry)); if (entries[newidx]) { - rehash = WWREHASHVAL(tab, XtWindow(entry)); + rehash = (Cardinal) WWREHASHVAL(tab, XtWindow(entry)); do { - newidx = WWREHASH(tab, newidx, rehash); + newidx = (Cardinal) WWREHASH(tab, newidx, rehash); } while (entries[newidx]); } entries[newidx] = entry; @@ -662,11 +662,11 @@ Widget XtWindowToWidget( LOCK_APP(app); LOCK_PROCESS; tab = WWTABLE(display); - idx = WWHASH(tab, window); + idx = (int) WWHASH(tab, window); if ((entry = tab->entries[idx]) && XtWindow(entry) != window) { - rehash = WWREHASHVAL(tab, window); + rehash = (int) WWREHASHVAL(tab, window); do { - idx = WWREHASH(tab, idx, rehash); + idx = (int) WWREHASH(tab, idx, rehash); } while ((entry = tab->entries[idx]) && XtWindow(entry) != window); } if (entry) { @@ -740,8 +740,8 @@ static Boolean CallEventHandlers( numprocs++; } if (numprocs > EHMAXSIZE) { - proc = (XtEventHandler *)__XtMalloc(numprocs * (sizeof(XtEventHandler) + - sizeof(XtPointer))); + proc = (XtEventHandler *)__XtMalloc((Cardinal)((size_t)numprocs * (sizeof(XtEventHandler) + + sizeof(XtPointer)))); closure = (XtPointer *)(proc + numprocs); } else { proc = procs; @@ -1037,10 +1037,10 @@ void XtAddExposureToRegion( /* These Expose and GraphicsExpose fields are at identical offsets */ if (event->type == Expose || event->type == GraphicsExpose) { - rect.x = ev->x; - rect.y = ev->y; - rect.width = ev->width; - rect.height = ev->height; + rect.x = (Position) ev->x; + rect.y = (Position) ev->y; + rect.width = (Dimension) ev->width; + rect.height = (Dimension) ev->height; XUnionRectWithRegion(&rect, region, region); } } @@ -1061,10 +1061,10 @@ static void AddExposureToRectangularRegion( XExposeEvent *ev = (XExposeEvent *) event; /* These Expose and GraphicsExpose fields are at identical offsets */ - rect.x = ev->x; - rect.y = ev->y; - rect.width = ev->width; - rect.height = ev->height; + rect.x = (Position) ev->x; + rect.y = (Position) ev->y; + rect.width = (Dimension) ev->width; + rect.height = (Dimension) ev->height; if (XEmptyRegion(region)) { XUnionRectWithRegion(&rect, region, region); @@ -1331,7 +1331,7 @@ Boolean _XtDefaultDispatcher( was_dispatched = (XFilterEvent(event, XtWindow(widget)) || XtDispatchEventToWidget(widget, event)); } - else was_dispatched = XFilterEvent(event, None); + else was_dispatched = (Boolean) XFilterEvent(event, None); } else if (grabType == pass) { if (event->type == LeaveNotify || @@ -1359,7 +1359,7 @@ Boolean _XtDefaultDispatcher( if ((grabList == NULL ||_XtOnGrabList(dspWidget, grabList)) && XtIsSensitive(dspWidget)) { - if ((was_filtered = XFilterEvent(event, XtWindow(dspWidget)))) { + if ((was_filtered = (Boolean) XFilterEvent(event, XtWindow(dspWidget)))) { /* If this event activated a device grab, release it. */ _XtUngrabBadGrabs(event, widget, mask, pdi); was_dispatched = True; @@ -1487,7 +1487,7 @@ void XtAddGrab( XtAppWarningMsg(app, "grabError", "xtAddGrab", XtCXtToolkitError, "XtAddGrab requires exclusive grab if spring_loaded is TRUE", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); exclusive = TRUE; } @@ -1522,7 +1522,7 @@ void XtRemoveGrab( XtAppWarningMsg(app, "grabError","xtRemoveGrab",XtCXtToolkitError, "XtRemoveGrab asked to remove a widget not on the list", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_PROCESS; UNLOCK_APP(app); return; @@ -1672,7 +1672,7 @@ void XtRegisterExtensionSelector( if (dpy == NULL) XtErrorMsg("nullDisplay", "xtRegisterExtensionSelector", XtCXtToolkitError, "XtRegisterExtensionSelector requires a non-NULL display", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); LOCK_APP(app); LOCK_PROCESS; @@ -1690,7 +1690,7 @@ void XtRegisterExtensionSelector( XtErrorMsg("rangeError", "xtRegisterExtensionSelector", XtCXtToolkitError, "Attempt to register multiple selectors for one extension event type", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); UNLOCK_PROCESS; UNLOCK_APP(app); return; @@ -1699,7 +1699,7 @@ void XtRegisterExtensionSelector( pd->ext_select_count++; pd->ext_select_list = (ExtSelectRec *) XtRealloc((char *) pd->ext_select_list, - pd->ext_select_count * sizeof(ExtSelectRec)); + (Cardinal) ((size_t)pd->ext_select_count * sizeof(ExtSelectRec))); for (i = pd->ext_select_count - 1; i > 0; i--) { if (pd->ext_select_list[i-1].min > min_event_type) { pd->ext_select_list[i] = pd->ext_select_list[i-1]; diff --git a/src/EventUtil.c b/src/EventUtil.c index 91ad31f..4dcbbc6 100644 --- a/src/EventUtil.c +++ b/src/EventUtil.c @@ -173,12 +173,12 @@ void _XtFillAncestorList( happen again, so grow the ancestor list */ *maxElemsPtr += CACHESIZE; trace = (Widget *) XtRealloc((char*)trace, - sizeof(Widget) * (*maxElemsPtr)); + (Cardinal)(sizeof(Widget) * (size_t)(*maxElemsPtr))); } trace[i] = w; } *listPtr = trace; - *numElemsPtr = i; + *numElemsPtr = (int) i; #undef CACHESIZE } diff --git a/src/GCManager.c b/src/GCManager.c index ba3d9c4..5769d11 100644 --- a/src/GCManager.c +++ b/src/GCManager.c @@ -235,8 +235,8 @@ GC XtAllocateGC( /* No matches, have to create a new one */ cur = XtNew(GCrec); - cur->screen = XScreenNumberOfScreen(screen); - cur->depth = depth; + cur->screen = (unsigned char) XScreenNumberOfScreen(screen); + cur->depth = (unsigned char) depth; cur->ref_count = 1; cur->dynamic_mask = dynamicMask; cur->unused_mask = (unusedMask & ~dynamicMask); @@ -250,8 +250,8 @@ GC XtAllocateGC( if (!drawable) { if (!pd->pixmap_tab) { int n; - pd->pixmap_tab = (Drawable **)__XtMalloc((unsigned)ScreenCount(dpy) * - sizeof(Drawable *)); + pd->pixmap_tab = (Drawable **)__XtMalloc((Cardinal)((unsigned)ScreenCount(dpy) * + sizeof(Drawable *))); for (n = 0; n < ScreenCount(dpy); n++) pd->pixmap_tab[n] = NULL; } diff --git a/src/Geometry.c b/src/Geometry.c index 8d16c63..fdd5661 100644 --- a/src/Geometry.c +++ b/src/Geometry.c @@ -85,7 +85,7 @@ static void ClearRectObjAreas( bw2 = old->border_width << 1; XClearArea( XtDisplay(pw), XtWindow(pw), old->x, old->y, - old->width + bw2, old->height + bw2, + (unsigned)(old->width + bw2), (unsigned)(old->height + bw2), TRUE ); bw2 = r->rectangle.border_width << 1; @@ -168,7 +168,7 @@ _XtMakeGeometryRequest ( "invalidParent","xtMakeGeometryRequest", XtCXtToolkitError, "non-shell has no parent in XtMakeGeometryRequest", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); managed = XtIsManaged(widget); parentRealized = XtIsRealized(parent); @@ -201,7 +201,7 @@ _XtMakeGeometryRequest ( "invalidParent", "xtMakeGeometryRequest", XtCXtToolkitError, "XtMakeGeometryRequest - parent not composite", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } else if (manager == (XtGeometryHandler) NULL) { @@ -209,7 +209,7 @@ _XtMakeGeometryRequest ( "invalidGeometryManager","xtMakeGeometryRequest", XtCXtToolkitError, "XtMakeGeometryRequest - parent has no geometry manager", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } } #else @@ -430,7 +430,7 @@ _XtMakeGeometryRequest ( if (XtIsWidget(request->sibling)) req.changes.sibling = XtWindow(request->sibling); else - req.changeMask &= ~(CWStackMode | CWSibling); + req.changeMask = (XtGeometryMask) (req.changeMask & (unsigned long) (~(CWStackMode | CWSibling))); } } @@ -716,20 +716,20 @@ void XtTranslateCoords( *rooty = y; for (; w != NULL && ! XtIsShell(w); w = w->core.parent) { - *rootx += w->core.x + w->core.border_width; - *rooty += w->core.y + w->core.border_width; + *rootx = (Position) (*rootx + w->core.x + w->core.border_width); + *rooty = (Position) (*rooty + w->core.y + w->core.border_width); } if (w == NULL) XtAppWarningMsg(app, "invalidShell","xtTranslateCoords",XtCXtToolkitError, "Widget has no shell ancestor", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); else { Position x2, y2; _XtShellGetCoordinates( w, &x2, &y2 ); - *rootx += x2 + w->core.border_width; - *rooty += y2 + w->core.border_width; + *rootx = (Position) (*rootx + x2 + w->core.border_width); + *rooty = (Position) (*rooty + y2 + w->core.border_width); } UNLOCK_APP(app); } diff --git a/src/GetResList.c b/src/GetResList.c index c22725c..4c8fe0d 100644 --- a/src/GetResList.c +++ b/src/GetResList.c @@ -90,14 +90,14 @@ void XtGetResourceList( register XtResourceList *list, dlist; LOCK_PROCESS; - size = widget_class->core_class.num_resources * sizeof(XtResource); + size = (int) (widget_class->core_class.num_resources * sizeof(XtResource)); *resources = (XtResourceList) __XtMalloc((unsigned) size); if (!widget_class->core_class.class_inited) { /* Easy case */ (void) memmove((char *) *resources, - (char *)widget_class->core_class.resources, size); + (char *)widget_class->core_class.resources, (size_t) size); *num_resources = widget_class->core_class.num_resources; UNLOCK_PROCESS; return; @@ -161,14 +161,14 @@ void XtGetConstraintResourceList( return; } - size = class->constraint_class.num_resources * sizeof(XtResource); + size = (int) (class->constraint_class.num_resources * sizeof(XtResource)); *resources = (XtResourceList) __XtMalloc((unsigned) size); if (!class->core_class.class_inited) { /* Easy case */ (void) memmove((char *) *resources, - (char *)class->constraint_class.resources, size); + (char *)class->constraint_class.resources, (size_t) size); *num_resources = class->constraint_class.num_resources; UNLOCK_PROCESS; return; diff --git a/src/GetValues.c b/src/GetValues.c index 511b8d8..c836366 100644 --- a/src/GetValues.c +++ b/src/GetValues.c @@ -209,7 +209,7 @@ void XtGetValues( XtAppErrorMsg(app, "invalidArgCount","xtGetValues",XtCXtToolkitError, "Argument count > 0 on NULL argument list in XtGetValues", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } LOCK_APP(app); diff --git a/src/Hooks.c b/src/Hooks.c index bf26a13..64e8355 100644 --- a/src/Hooks.c +++ b/src/Hooks.c @@ -80,7 +80,7 @@ void XtRemoveBlockHook( #ifdef DEBUG XtAppWarningMsg(app, "badId", "xtRemoveBlockHook", XtCXtToolkitError, "XtRemoveBlockHook called with bad or old hook id", - (String*)NULL, (Cardinal*)NULL); + NULL, NULL); #endif /*DEBUG*/ UNLOCK_APP(app); return; @@ -123,7 +123,7 @@ void _XtAddShellToHookObj( ho->hooks.max_shells += SHELL_INCR; ho->hooks.shells = (WidgetList)XtRealloc((char*)ho->hooks.shells, - ho->hooks.max_shells * sizeof (Widget)); + (Cardinal) (ho->hooks.max_shells * sizeof (Widget))); } ho->hooks.shells[ho->hooks.num_shells++] = shell; diff --git a/src/Initialize.c b/src/Initialize.c index a9b8844..acfeaec 100644 --- a/src/Initialize.c +++ b/src/Initialize.c @@ -180,7 +180,7 @@ static void GetHostname ( return; buf[0] = '\0'; - (void) gethostname (buf, maxlen); + (void) gethostname (buf, (size_t) maxlen); buf [maxlen - 1] = '\0'; #endif } @@ -268,7 +268,7 @@ void _XtInherit(void) { XtErrorMsg("invalidProcedure","inheritanceProc",XtCXtToolkitError, "Unresolved inheritance operation", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } @@ -320,11 +320,11 @@ String _XtGetUserName( char* ptr; if ((ptr = getenv("USER"))) { - (void) strncpy (dest, ptr, len-1); + (void) strncpy (dest, ptr, (size_t) (len-1)); dest[len-1] = '\0'; } else { if ((pw = _XGetpwuid(getuid(),pwparams)) != NULL) { - (void) strncpy (dest, pw->pw_name, len-1); + (void) strncpy (dest, pw->pw_name, (size_t)(len-1)); dest[len-1] = '\0'; } else *dest = '\0'; @@ -367,7 +367,7 @@ static String GetRootDirName( return NULL; if ((ptr = getenv("HOME"))) { - (void) strncpy (dest, ptr, len-1); + (void) strncpy (dest, ptr, (size_t)(len-1)); dest[len-1] = '\0'; } else { if ((ptr = getenv("USER"))) @@ -375,7 +375,7 @@ static String GetRootDirName( else pw = _XGetpwuid(getuid(),pwparams); if (pw != NULL) { - (void) strncpy (dest, pw->pw_dir, len-1); + (void) strncpy (dest, pw->pw_dir, (size_t)(len-1)); dest[len-1] = '\0'; } else *dest = '\0'; @@ -437,7 +437,7 @@ static void CombineUserDefaults( } else { char filename[PATH_MAX]; (void) GetRootDirName(filename, - PATH_MAX - strlen (slashDotXdefaults) - 1); + PATH_MAX - (int)strlen (slashDotXdefaults) - 1); (void) strcat(filename, slashDotXdefaults); (void)XrmCombineFileDatabase(filename, pdb, False); } @@ -574,9 +574,9 @@ XrmDatabase XtScreenDatabase( #endif (void) GetRootDirName(filename = filenamebuf, - PATH_MAX - strlen (slashDotXdefaultsDash) - 1); + PATH_MAX - (int)strlen (slashDotXdefaultsDash) - 1); (void) strcat(filename, slashDotXdefaultsDash); - len = strlen(filename); + len = (int)strlen(filename); GetHostname (filename+len, PATH_MAX-len); } (void)XrmCombineFileDatabase(filename, &db, False); @@ -657,14 +657,14 @@ static void _MergeOptionTables( enum {Check, NotSorted, IsSorted} sort_order = Check; *dst = table = (XrmOptionDescRec*) - __XtMalloc( sizeof(XrmOptionDescRec) * (num_src1 + num_src2) ); + __XtMalloc( (Cardinal)(sizeof(XrmOptionDescRec) * (num_src1 + num_src2) )); (void) memmove(table, src1, sizeof(XrmOptionDescRec) * num_src1 ); if (num_src2 == 0) { *num_dst = num_src1; return; } - endP = &table[dst_len = num_src1]; + endP = &table[dst_len = (int)num_src1]; for (opt2 = src2, i2= 0; i2 < num_src2; opt2++, i2++) { found = False; whereP = endP-1; /* assume new option goes at the end */ @@ -709,7 +709,7 @@ static void _MergeOptionTables( dst_len++; } } - *num_dst = dst_len; + *num_dst = (Cardinal)dst_len; } @@ -770,13 +770,13 @@ XrmDatabase _XtPreparseCommandLine( String *targv; int targc = argc; - targv = (String *) __XtMalloc(sizeof(char *) * argc); - (void) memmove(targv, argv, sizeof(char *) * argc); + targv = (String *) __XtMalloc((Cardinal)(sizeof(char *) * (size_t)argc)); + (void) memmove(targv, argv, sizeof(char *) * (size_t) argc); _MergeOptionTables(opTable, XtNumber(opTable), urlist, num_urs, &options, &num_options); name_list[0] = class_list[0] = XrmPermStringToQuark("."); name_list[2] = class_list[2] = NULLQUARK; - XrmParseCommand(&db, options, num_options, ".", &targc, targv); + XrmParseCommand(&db, options, (int) num_options, ".", &targc, targv); if (applName) { name_list[1] = XrmPermStringToQuark("name"); if (XrmQGetResource(db, name_list, name_list, &type, &val) && @@ -893,7 +893,7 @@ void _XtDisplayInitialize( /* Parse the command line and remove Xt arguments from argv */ _MergeOptionTables( opTable, XtNumber(opTable), urlist, num_urs, &options, &num_options ); - XrmParseCommand(&pd->cmd_db, options, num_options, name, argc, argv); + XrmParseCommand(&pd->cmd_db, options, (int) num_options, name, argc, argv); db = XtScreenDatabase(DefaultScreenOfDisplay(dpy)); @@ -908,7 +908,7 @@ void _XtDisplayInitialize( while (!XrmQGetSearchList(db, name_list, class_list, search_list, search_list_size)) { XrmHashTable* old = search_list; - Cardinal size = (search_list_size*=2)*sizeof(XrmHashTable); + Cardinal size = (Cardinal) ((size_t)(search_list_size *= 2)*sizeof(XrmHashTable)); if (!(search_list = (XrmHashTable*)ALLOCATE_LOCAL(size))) _XtAllocError(NULL); (void) memmove((char*)search_list, (char*)old, (size>>1) ); diff --git a/src/Intrinsic.c b/src/Intrinsic.c index 450dce7..cd70b15 100644 --- a/src/Intrinsic.c +++ b/src/Intrinsic.c @@ -181,7 +181,7 @@ static void ComputeWindowAttributes( XtExposeProc expose; *value_mask = CWEventMask | CWColormap; - (*values).event_mask = XtBuildEventMask(widget); + (*values).event_mask = (long) XtBuildEventMask(widget); (*values).colormap = widget->core.colormap; if (widget->core.background_pixmap != XtUnspecifiedPixmap) { *value_mask |= CWBackPixmap; @@ -310,7 +310,7 @@ static void RealizeWidget( XtAppErrorMsg(XtWidgetToApplicationContext(widget), "invalidProcedure","realizeProc",XtCXtToolkitError, "No realize class procedure defined", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); else { CALLGEOTAT(_XtGeoTrace(widget,"Call \"%s\"[%d,%d]'s realize proc\n", XtName(widget), @@ -333,8 +333,8 @@ static void RealizeWidget( int len_nm, len_cl; char *s; - len_nm = widget->core.name ? strlen(widget->core.name) : 0; - len_cl = strlen(class_name); + len_nm = widget->core.name ? (int) strlen(widget->core.name) : 0; + len_cl = (int) strlen(class_name); s = __XtMalloc((unsigned) (len_nm + len_cl + 2)); s[0] = '\0'; if (len_nm) @@ -634,7 +634,7 @@ Widget XtNameToWidget( Widget result; WIDGET_TO_APPCON(root); - len = strlen(name); + len = (int) strlen(name); if (len == 0) return NULL; LOCK_APP(app); @@ -963,7 +963,7 @@ static Boolean TestFile( #else (status.st_mode & S_IFMT) != S_IFDIR); /* not a directory */ #endif /* X_NOT_POSIX else */ - return ret; + return (Boolean) ret; #else /* VMS */ return TRUE; /* Who knows what to do here? */ #endif /* VMS */ @@ -1092,7 +1092,7 @@ String XtFindFile( if (*colon == ':') break; } - len = colon - path; + len = (int) (colon - path); if (Resolve(path, len, substitutions, num_substitutions, buf, '/')) { if (firstTime || strcmp(buf1,buf2) != 0) { @@ -1214,11 +1214,11 @@ static char *ExtractLocaleName( # endif if ((end = strchr (start, ENDCHAR))) { - len = end - start; + len = (int) (end - start); if (buf != NULL) XtFree (buf); - buf = XtMalloc (len + 1); + buf = XtMalloc ((Cardinal)(len + 1)); if (buf == NULL) return NULL; - strncpy(buf, start, len); + strncpy(buf, start, (size_t) len); *(buf + len) = '\0'; # ifdef WHITEFILL for (start = buf; start = strchr(start, ' '); ) @@ -1272,9 +1272,9 @@ static void FillInLangSubs( return; } - len = strlen(string) + 1; + len = (int) strlen(string) + 1; subs[0].substitution = string; - p1 = subs[1].substitution = __XtMalloc((Cardinal) 3*len); + p1 = subs[1].substitution = __XtMalloc((Cardinal) (3*len)); p2 = subs[2].substitution = subs[1].substitution + len; p3 = subs[3].substitution = subs[2].substitution + len; @@ -1286,8 +1286,8 @@ static void FillInLangSubs( ch = strchr(string, '_'); if (ch != NULL) { - len = ch - string; - (void) strncpy(p1, string, len); + len = (int) (ch - string); + (void) strncpy(p1, string, (size_t) len); p1[len] = '\0'; string = ch + 1; rest = &p2; @@ -1297,8 +1297,8 @@ static void FillInLangSubs( ch = strchr(string, '.'); if (ch != NULL) { - len = ch - string; - strncpy(*rest, string, len); + len = (int) (ch - string); + strncpy(*rest, string, (size_t) len); (*rest)[len] = '\0'; (void) strcpy(p3, ch+1); } else (void) strcpy(*rest, string); @@ -1347,7 +1347,7 @@ String XtResolvePathname( XtPerDisplay pd; static const char *defaultPath = NULL; const char *impl_default = implementation_default_path(); - int idef_len = strlen(impl_default); + int idef_len = (int) strlen(impl_default); char *massagedPath; int bytesAllocd, bytesLeft; char *ch, *result; @@ -1399,7 +1399,7 @@ String XtResolvePathname( char *new; bytesAllocd +=1000; new = __XtMalloc((Cardinal) bytesAllocd); - strncpy( new, massagedPath, bytesUsed ); + strncpy( new, massagedPath, (size_t) bytesUsed ); ch = new + bytesUsed; if (pathMallocd) XtFree(massagedPath); @@ -1444,10 +1444,10 @@ String XtResolvePathname( int i = XtNumber(defaultSubs); Substitution sub, def; merged_substitutions = sub = (Substitution) - ALLOCATE_LOCAL((unsigned)(num_substitutions+i)*sizeof(SubstitutionRec)); + ALLOCATE_LOCAL((unsigned)(num_substitutions+(Cardinal)i)*sizeof(SubstitutionRec)); if (sub == NULL) _XtAllocError(NULL); for (def = defaultSubs; i--; sub++, def++) sub->match = def->match; - for (i = num_substitutions; i--; ) *sub++ = *substitutions++; + for (i = (int) num_substitutions; i--; ) *sub++ = *substitutions++; } merged_substitutions[0].substitution = (String)filename; merged_substitutions[1].substitution = (String)type; diff --git a/src/Keyboard.c b/src/Keyboard.c index c8ba863..4c43b95 100644 --- a/src/Keyboard.c +++ b/src/Keyboard.c @@ -241,10 +241,10 @@ static Boolean IsOutside( */ XtTranslateCoords(w, 0, 0, &left, &top); /* We need to take borders into consideration */ - left = left - w->core.border_width; - top = top - w->core.border_width; - right = left + w->core.width + w->core.border_width; - bottom = top + w->core.height + w->core.border_width; + left = (Position) (left - w->core.border_width); + top = (Position) (top - w->core.border_width); + right = (Position) (left + w->core.width + w->core.border_width); + bottom = (Position) (top + w->core.height + w->core.border_width); if ( (e->x_root < left) || (e->y_root < top) || @@ -367,12 +367,12 @@ static Widget FindKeyDestination( } if ((grab = CheckServerGrabs((XEvent*)event, pseudoTrace, - pseudoTraceDepth))) + (Cardinal)pseudoTraceDepth))) { XtDevice device = &pdi->keyboard; device->grabType = XtPseudoPassiveServerGrab; - pdi->activatingKey = event->keycode; + pdi->activatingKey = (KeyCode) event->keycode; device->grab = *grab; if (grab @@ -411,7 +411,7 @@ Widget _XtProcessKeyboardEvent( !IsServerGrab(device->grabType) && (newGrab = CheckServerGrabs((XEvent*)event, pdi->trace, - pdi->traceDepth))) + (Cardinal) pdi->traceDepth))) { /* * honor pseudo-grab from prior event by X @@ -424,7 +424,7 @@ Widget _XtProcessKeyboardEvent( { /* Activate the grab */ device->grab = *newGrab; - pdi->activatingKey = event->keycode; + pdi->activatingKey = (KeyCode) event->keycode; device->grabType = XtPassiveServerGrab; } } diff --git a/src/Manage.c b/src/Manage.c index 4ff7219..f51ca59 100644 --- a/src/Manage.c +++ b/src/Manage.c @@ -103,7 +103,7 @@ static void UnmanageChildren( XtAppErrorMsg(XtWidgetToApplicationContext((Widget)parent), "invalidParent",caller_func, XtCXtToolkitError, "Attempt to unmanage a child when parent is not Composite", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); } for (i = 0; i < num_children; i++) { @@ -112,14 +112,14 @@ static void UnmanageChildren( XtAppWarningMsg(XtWidgetToApplicationContext(parent), XtNinvalidChild,caller_func,XtCXtToolkitError, "Null child passed to XtUnmanageChildren", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } if (child->core.parent != parent) { XtAppWarningMsg(XtWidgetToApplicationContext(parent), "ambiguousParent",caller_func,XtCXtToolkitError, "Not all children have same parent in UnmanageChildren", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } else if (child->core.managed) { (*num_unique_children)++; @@ -138,8 +138,8 @@ static void UnmanageChildren( if ((pw!=NULL) && XtIsRealized (pw)) XClearArea (XtDisplay (pw), XtWindow (pw), r->rectangle.x, r->rectangle.y, - r->rectangle.width + (r->rectangle.border_width << 1), - r->rectangle.height + (r->rectangle.border_width << 1), + (unsigned) (r->rectangle.width + (r->rectangle.border_width << 1)), + (unsigned) (r->rectangle.height + (r->rectangle.border_width << 1)), TRUE); } @@ -169,7 +169,7 @@ void XtUnmanageChildren ( if (children[0] == NULL) { XtWarningMsg(XtNinvalidChild,XtNxtUnmanageChildren,XtCXtToolkitError, "Null child found in argument list to unmanage", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } #ifdef XTHREADS @@ -230,14 +230,14 @@ static void ManageChildren( XtAppErrorMsg(XtWidgetToApplicationContext((Widget)parent), "invalidParent",caller_func, XtCXtToolkitError, "Attempt to manage a child when parent is not Composite", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); } /* Construct new list of children that really need to be operated upon. */ if (num_children <= MAXCHILDREN) { unique_children = cache; } else { - unique_children = (WidgetList) __XtMalloc(num_children * sizeof(Widget)); + unique_children = (WidgetList) __XtMalloc((Cardinal) ((size_t)num_children * sizeof(Widget))); } num_unique_children = 0; for (i = 0; i < num_children; i++) { @@ -246,7 +246,7 @@ static void ManageChildren( XtAppWarningMsg(XtWidgetToApplicationContext((Widget)parent), XtNinvalidChild,caller_func,XtCXtToolkitError, "null child passed to ManageChildren", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if (unique_children != cache) XtFree((char *) unique_children); return; } @@ -267,7 +267,7 @@ static void ManageChildren( XtAppWarningMsg(XtWidgetToApplicationContext((Widget)parent), "ambiguousParent",caller_func,XtCXtToolkitError, "Not all children have same parent in XtManageChildren", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } else if (! child->core.managed && !child->core.being_destroyed) { unique_children[num_unique_children++] = child; CALLGEOTAT(_XtGeoTrace(child, @@ -302,8 +302,8 @@ static void ManageChildren( if (pw != NULL) XClearArea (XtDisplay (pw), XtWindow (pw), r->rectangle.x, r->rectangle.y, - r->rectangle.width + (r->rectangle.border_width << 1), - r->rectangle.height + (r->rectangle.border_width << 1), + (unsigned) (r->rectangle.width + (r->rectangle.border_width << 1)), + (unsigned) (r->rectangle.height + (r->rectangle.border_width << 1)), TRUE); } } @@ -325,7 +325,7 @@ void XtManageChildren( if (children[0] == NULL) { XtWarningMsg(XtNinvalidChild, XtNxtManageChildren, XtCXtToolkitError, "null child passed to XtManageChildren", - (String*)NULL, (Cardinal*)NULL); + NULL, NULL); return; } #ifdef XTHREADS @@ -432,21 +432,21 @@ void XtChangeManagedSet( parent = XtParent(*childp); childp = unmanage_children; - for (i = num_unmanage; --i >= 0 && XtParent(*childp) == parent; childp++); + for (i = (int) num_unmanage; --i >= 0 && XtParent(*childp) == parent; childp++); call_out = (i >= 0); childp = manage_children; - for (i = num_manage; --i >= 0 && XtParent(*childp) == parent; childp++); + for (i = (int) num_manage; --i >= 0 && XtParent(*childp) == parent; childp++); if (call_out || i >= 0) { XtAppWarningMsg(app, "ambiguousParent", XtNxtChangeManagedSet, XtCXtToolkitError, "Not all children have same parent", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } if (! XtIsComposite(parent)) { UNLOCK_APP(app); XtAppErrorMsg(app, "invalidParent", XtNxtChangeManagedSet, XtCXtToolkitError, "Attempt to manage a child when parent is not Composite", - (String *) NULL, (Cardinal *) NULL); + NULL, NULL); } if (parent->core.being_destroyed) { UNLOCK_APP(app); diff --git a/src/NextEvent.c b/src/NextEvent.c index c6fbcf1..824429c 100644 --- a/src/NextEvent.c +++ b/src/NextEvent.c @@ -154,7 +154,7 @@ static void AdjustHowLong ( if(*howlong <= (unsigned long)(time_spent.tv_sec*1000+time_spent.tv_usec/1000)) *howlong = (unsigned long)0; /* Timed out */ else - *howlong -= (time_spent.tv_sec*1000+time_spent.tv_usec/1000); + *howlong = (*howlong - (unsigned long)(time_spent.tv_sec*1000+time_spent.tv_usec/1000)); } typedef struct { @@ -195,12 +195,12 @@ static void InitTimes ( wt->poll_wait = X_BLOCK; #endif } else { /* block until at most */ - wt->max_wait_time.tv_sec = *howlong/1000; - wt->max_wait_time.tv_usec = (*howlong %1000)*1000; + wt->max_wait_time.tv_sec = (time_t) (*howlong/1000); + wt->max_wait_time.tv_usec = (suseconds_t) ((*howlong %1000)*1000); #ifndef USE_POLL wt->wait_time_ptr = &wt->max_wait_time; #else - wt->poll_wait = *howlong; + wt->poll_wait = (int) *howlong; #endif } } else { /* don't block */ @@ -279,11 +279,11 @@ static void InitFds ( if (!wf->fdlist || wf->fdlist == wf->stack) { wf->fdlist = (struct pollfd*) - XtStackAlloc (sizeof (struct pollfd) * wf->fdlistlen, wf->stack); + XtStackAlloc (sizeof (struct pollfd) * (size_t)wf->fdlistlen, wf->stack); } else { wf->fdlist = (struct pollfd*) XtRealloc ((char*) wf->fdlist, - sizeof (struct pollfd) * wf->fdlistlen); + (Cardinal) (sizeof (struct pollfd) * (size_t)wf->fdlistlen)); } if (wf->fdlistlen) { @@ -334,9 +334,9 @@ static void AdjustTimes ( wt->wait_time_ptr = &zero_time; } #else - wt->poll_wait = wt->wait_time.tv_sec * 1000 + wt->wait_time.tv_usec / 1000; + wt->poll_wait = (int) (wt->wait_time.tv_sec * 1000 + wt->wait_time.tv_usec / 1000); else - wt->poll_wait = wt->max_wait_time.tv_sec * 1000 + wt->max_wait_time.tv_usec / 1000; + wt->poll_wait = (int) (wt->max_wait_time.tv_sec * 1000 + wt->max_wait_time.tv_usec / 1000); } else wt->poll_wait = X_DONT_BLOCK; } @@ -352,7 +352,7 @@ 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); + return poll (wf->fdlist, (nfds_t) wf->fdlistlen, wt->poll_wait); #endif } @@ -797,8 +797,8 @@ XtIntervalId XtAppAddTimeOut( tptr->te_closure = closure; tptr->te_proc = proc; tptr->app = app; - tptr->te_timer_value.tv_sec = interval/1000; - tptr->te_timer_value.tv_usec = (interval%1000)*1000; + tptr->te_timer_value.tv_sec = (time_t) (interval/1000); + tptr->te_timer_value.tv_usec = (suseconds_t) ((interval%1000)*1000); X_GETTIMEOFDAY (¤t_time); FIXUP_TIMEVAL(current_time); ADD_TIME(tptr->te_timer_value,tptr->te_timer_value,current_time); @@ -992,19 +992,19 @@ XtInputId XtAppAddInput( LOCK_APP(app); if (!condition || - condition & ~(XtInputReadMask|XtInputWriteMask|XtInputExceptMask)) + condition & (unsigned long)(~(XtInputReadMask|XtInputWriteMask|XtInputExceptMask))) XtAppErrorMsg(app,"invalidParameter","xtAddInput",XtCXtToolkitError, "invalid condition passed to XtAppAddInput", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if (app->input_max <= source) { - Cardinal n = source + 1; + Cardinal n = (Cardinal) (source + 1); int ii; app->input_list = (InputEvent**)XtRealloc((char*) app->input_list, - n * sizeof(InputEvent*)); + (Cardinal)((size_t)n * sizeof(InputEvent*))); for (ii = app->input_max; ii < (int) n; ii++) app->input_list[ii] = (InputEvent*) NULL; - app->input_max = n; + app->input_max = (short) n; } sptr = XtNew(InputEvent); sptr->ie_proc = proc; @@ -1095,7 +1095,7 @@ void XtRemoveInput( XtAppWarningMsg(app, "invalidProcedure","inputHandler", XtCXtToolkitError, "XtRemoveInput: Input handler not found", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); } @@ -1271,7 +1271,7 @@ void XtAppNextEvent( #ifdef XTHREADS /* assert(app->list[d] == event->xany.display); */ #endif - app->last = d; + app->last = (short) d; if (event->xany.type == MappingNotify) _XtRefreshMapping(event, False); UNLOCK_APP(app); @@ -1389,7 +1389,7 @@ void XtAppProcessEvent( #ifdef XTHREADS /* assert(app->list[d] == event.xany.display); */ #endif - app->last = d; + app->last = (short) d; if (event.xany.type == MappingNotify) { _XtRefreshMapping(&event, False); } @@ -1561,7 +1561,7 @@ Boolean XtAppPeekEvent( if (d != -1) { /* event */ GotEvent: XPeekEvent(app->list[d], event); - app->last = (d == 0 ? app->count : d) - 1; + app->last = (short) ((d == 0 ? app->count : d) - 1); UNLOCK_APP(app); return TRUE; } diff --git a/src/Object.c b/src/Object.c index ae1ac75..d5ed095 100644 --- a/src/Object.c +++ b/src/Object.c @@ -130,7 +130,7 @@ externaldef(objectClass) WidgetClass objectClass static void ConstructCallbackOffsets( - WidgetClass widgetClass) + WidgetClass myWidgetClass) { static XrmQuark QCallback = NULLQUARK; register int i; @@ -138,7 +138,7 @@ static void ConstructCallbackOffsets( register CallbackTable newTable; register CallbackTable superTable; register XrmResourceList resourceList; - ObjectClass objectClass = (ObjectClass)widgetClass; + ObjectClass myObjectClass = (ObjectClass)myWidgetClass; /* This function builds an array of pointers to the resource @@ -150,9 +150,9 @@ static void ConstructCallbackOffsets( if (QCallback == NULLQUARK) QCallback = XrmPermStringToQuark(XtRCallback); - if (objectClass->object_class.superclass != NULL) { + if (myObjectClass->object_class.superclass != NULL) { superTable = (CallbackTable) - ((ObjectClass) objectClass->object_class.superclass)-> + ((ObjectClass) myObjectClass->object_class.superclass)-> object_class.callback_private; tableSize = (int)(long) superTable[0]; } else { @@ -161,8 +161,8 @@ static void ConstructCallbackOffsets( } /* Count the number of callbacks */ - resourceList = (XrmResourceList) objectClass->object_class.resources; - for (i = objectClass->object_class.num_resources; --i >= 0; resourceList++) + resourceList = (XrmResourceList) myObjectClass->object_class.resources; + for (i = (int) myObjectClass->object_class.num_resources; --i >= 0; resourceList++) if (resourceList->xrm_type == QCallback) tableSize++; @@ -172,13 +172,13 @@ static void ConstructCallbackOffsets( * offsets so that resource overrides work. */ newTable = (CallbackTable) - __XtMalloc(sizeof(XrmResource *) * (tableSize + 1)); + __XtMalloc((Cardinal) (sizeof(XrmResource *) * (size_t) (tableSize + 1))); newTable[0] = (XrmResource *)(long) tableSize; if (superTable) tableSize -= (int)(long) superTable[0]; - resourceList = (XrmResourceList) objectClass->object_class.resources; + resourceList = (XrmResourceList) myObjectClass->object_class.resources; for (i=1; tableSize > 0; resourceList++) if (resourceList->xrm_type == QCallback) { newTable[i++] = resourceList; @@ -190,7 +190,7 @@ static void ConstructCallbackOffsets( --tableSize >= 0; superTable++) newTable[i++] = *superTable; - objectClass->object_class.callback_private = (XtPointer) newTable; + myObjectClass->object_class.callback_private = (XtPointer) newTable; } static void InheritObjectExtensionMethods( diff --git a/src/PassivGrab.c b/src/PassivGrab.c index 8d3a1d1..42907d9 100644 --- a/src/PassivGrab.c +++ b/src/PassivGrab.c @@ -111,7 +111,7 @@ static void DeleteDetailFromMask( int i; pDetailMask = (Mask *)__XtMalloc(sizeof(Mask) * MasksPerDetailMask); for (i = MasksPerDetailMask; --i >= 0; ) - pDetailMask[i] = ~0; + pDetailMask[i] = (unsigned long) (~0); *ppDetailMask = pDetailMask; } BITCLEAR((pDetailMask), detail); @@ -172,7 +172,7 @@ static XtServerGrabPtr CreateGrab( grab->eventMask = event_mask; grab->hasExt = need_ext; grab->confineToIsWidgetWin = (XtWindow (widget) == confine_to); - grab->modifiers = modifiers; + grab->modifiers = (unsigned short) modifiers; grab->keybut = keybut; if (need_ext) { XtServerGrabExtPtr ext = GRABEXT(grab); @@ -578,7 +578,7 @@ XtServerGrabPtr _XtCheckServerGrabsOnWidget ( * Extension may be representing keyboard group state in two upper bits. */ tempGrab.widget = widget; - tempGrab.keybut = event->xkey.keycode; /* also xbutton.button */ + tempGrab.keybut = (KeyCode) event->xkey.keycode; /* also xbutton.button */ tempGrab.modifiers = event->xkey.state & 0x1FFF; /*also xbutton.state*/ tempGrab.hasExt = False; @@ -782,8 +782,8 @@ void UngrabKeyOrButton ( /* Build a temporary grab list entry */ tempGrab.widget = widget; - tempGrab.modifiers = modifiers; - tempGrab.keybut = keyOrButton; + tempGrab.modifiers = (unsigned short) modifiers; + tempGrab.keybut = (KeyCode) keyOrButton; tempGrab.hasExt = False; LOCK_PROCESS; @@ -797,7 +797,7 @@ void UngrabKeyOrButton ( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidGrab", "ungrabKeyOrButton", XtCXtToolkitError, "Attempt to remove nonexistent passive grab", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -809,7 +809,7 @@ void UngrabKeyOrButton ( widget->core.window); else XUngrabButton(widget->core.screen->display, - keyOrButton, (unsigned int)modifiers, + (unsigned) keyOrButton, (unsigned int)modifiers, widget->core.window); } @@ -912,7 +912,7 @@ static int GrabDevice ( UNLOCK_PROCESS; if (!isKeyboard) returnVal = XGrabPointer(XtDisplay(widget), XtWindow(widget), - owner_events, event_mask, + owner_events, (unsigned) event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time); else diff --git a/src/Pointer.c b/src/Pointer.c index 4e53717..70b0ea8 100644 --- a/src/Pointer.c +++ b/src/Pointer.c @@ -75,7 +75,7 @@ Widget _XtProcessPointerEvent( { Cardinal i; - for (i = pdi->traceDepth; + for (i = (Cardinal) pdi->traceDepth; i > 0 && !newGrab; i--) newGrab = _XtCheckServerGrabsOnWidget((XEvent*)event, @@ -94,7 +94,7 @@ Widget _XtProcessPointerEvent( case ButtonRelease: { if ((device->grabType == XtPassiveServerGrab) && - !(event->state & ~(Button1Mask << (event->button - 1)) & + !(event->state & (unsigned)(~(Button1Mask << (event->button - 1))) & AllButtonsMask)) deactivateGrab = TRUE; } diff --git a/src/Popup.c b/src/Popup.c index 3f4554b..acf3633 100644 --- a/src/Popup.c +++ b/src/Popup.c @@ -62,7 +62,7 @@ void _XtPopup( XtAppErrorMsg(XtWidgetToApplicationContext(widget), "invalidClass","xtPopup",XtCXtToolkitError, "XtPopup requires a subclass of shellWidgetClass", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } if (! shell_widget->shell.popped_up) { @@ -102,7 +102,7 @@ void XtPopup (Widget widget, XtGrabKind grab_kind) XtWidgetToApplicationContext(widget), "invalidGrabKind","xtPopup",XtCXtToolkitError, "grab kind argument has invalid value; XtGrabNone assumed", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); grab_kind = XtGrabNone; } @@ -152,7 +152,7 @@ void XtPopdown( XtAppErrorMsg(XtWidgetToApplicationContext(widget), "invalidClass","xtPopdown",XtCXtToolkitError, "XtPopdown requires a subclass of shellWidgetClass", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } #ifndef X_NO_XT_POPDOWN_CONFORMANCE diff --git a/src/ResConfig.c b/src/ResConfig.c index eb21fd5..444cf70 100644 --- a/src/ResConfig.c +++ b/src/ResConfig.c @@ -702,8 +702,8 @@ _search_widget_tree ( if ((loose == NULL) && (tight == NULL)) return; - loose_len = (loose) ? strlen (loose) : 0; - tight_len = (tight) ? strlen (tight) : 0; + loose_len = (loose) ? (int) strlen (loose) : 0; + tight_len = (tight) ? (int) strlen (tight) : 0; if ((loose == NULL) || (tight_len > loose_len)) remainder = XtNewString (tight); @@ -774,16 +774,16 @@ _locate_children ( * count the number of children */ if (XtIsWidget (parent)) - num_children += parent->core.num_popups; + num_children = (int) ((Cardinal) num_children + parent->core.num_popups); if (XtIsComposite (parent)) - num_children += comp->composite.num_children; + num_children = (int) ((Cardinal) num_children + comp->composite.num_children); if (num_children == 0) { *children = NULL; return (0); } *children = (Widget *) - XtMalloc ((Cardinal) sizeof(Widget) * num_children); + XtMalloc ((Cardinal) (sizeof(Widget) * (size_t) num_children)); if (XtIsComposite (parent)) { for (i=0; i<comp->composite.num_children; i++) { diff --git a/src/Resources.c b/src/Resources.c index 562aac9..50d30fb 100644 --- a/src/Resources.c +++ b/src/Resources.c @@ -96,7 +96,7 @@ void _XtCopyFromParent( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidParent","xtCopyFromParent",XtCXtToolkitError, "CopyFromParent must have non-NULL parent", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); value->addr = NULL; return; } @@ -173,7 +173,7 @@ void _XtCopyToArg( (void) memmove((char*)dst, (char*)src, (size_t)size ); #else XtErrorMsg("invalidGetValues", "xtGetValues", XtCXtToolkitError, - "NULL ArgVal in XtGetValues", (String*) NULL, (Cardinal*) NULL); + "NULL ArgVal in XtGetValues", NULL, NULL); #endif } else { @@ -290,7 +290,7 @@ void _XtCompileResourceList( xrmres->xrm_name = PSToQ(resources->resource_name); xrmres->xrm_class = PSToQ(resources->resource_class); xrmres->xrm_type = PSToQ(resources->resource_type); - xrmres->xrm_offset = (Cardinal) + xrmres->xrm_offset = (int) (-(int)resources->resource_offset - 1); xrmres->xrm_default_type = PSToQ(resources->default_type); } @@ -311,7 +311,7 @@ static void XrmCompileResourceListEphem( xrmres->xrm_name = StringToName(resources->resource_name); xrmres->xrm_class = StringToClass(resources->resource_class); xrmres->xrm_type = StringToQuark(resources->resource_type); - xrmres->xrm_offset = (Cardinal) + xrmres->xrm_offset = (int) (-(int)resources->resource_offset - 1); xrmres->xrm_default_type = StringToQuark(resources->default_type); } @@ -363,7 +363,7 @@ void _XtDependencies( /* Allocate and initialize new_res with superclass resource pointers */ new_num_res = super_num_res + class_num_res; - new_res = (XrmResourceList *) __XtMalloc(new_num_res*sizeof(XrmResourceList)); + new_res = (XrmResourceList *) __XtMalloc((Cardinal)(new_num_res*sizeof(XrmResourceList))); if (super_num_res > 0) XtMemmove(new_res, super_res, super_num_res * sizeof(XrmResourceList)); @@ -452,7 +452,7 @@ XrmResourceList* _XtCreateIndirectionTable ( register Cardinal idx; XrmResourceList* table; - table = (XrmResourceList*)__XtMalloc(num_resources * sizeof(XrmResourceList)); + table = (XrmResourceList*)__XtMalloc((Cardinal)(num_resources * sizeof(XrmResourceList))); for (idx = 0; idx < num_resources; idx++) table[idx] = (XrmResourceList)(&(resources[idx])); return table; @@ -491,7 +491,7 @@ static XtCacheRef *GetResources( XtCacheRef *cache_ptr, *cache_base; Boolean persistent_resources = True; Boolean found_persistence = False; - int num_typed_args = *pNumTypedArgs; + int num_typed_args = (int) *pNumTypedArgs; XrmDatabase db; Boolean do_tm_hack = False; @@ -499,7 +499,7 @@ static XtCacheRef *GetResources( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidArgCount","getResources",XtCXtToolkitError, "argument count > 0 on NULL argument list", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); num_args = 0; } if (num_resources == 0) { @@ -508,13 +508,13 @@ static XtCacheRef *GetResources( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidResourceCount","getResources",XtCXtToolkitError, "too many resources", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return NULL; } else if (table == NULL) { XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidResourceCount","getResources",XtCXtToolkitError, "resource count > 0 on NULL resource list", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return NULL; } @@ -584,12 +584,12 @@ static XtCacheRef *GetResources( db = XtScreenDatabase(XtScreenOfObject(widget)); while (!XrmQGetSearchList(db, names, classes, - searchList, searchListSize)) { + searchList, (int) searchListSize)) { if (searchList == stackSearchList) searchList = NULL; searchList = (XrmHashTable*)XtRealloc((char*)searchList, - sizeof(XrmHashTable) * - (searchListSize *= 2)); + (Cardinal) (sizeof(XrmHashTable) * + (searchListSize *= 2))); } if (persistent_resources) @@ -612,7 +612,7 @@ static XtCacheRef *GetResources( XrmValue from_val, to_val; from_type = StringToQuark(arg->type); - from_val.size = arg->size; + from_val.size = (Cardinal) arg->size; if ((from_type == QString) || ((unsigned) arg->size > sizeof(XtArgVal))) from_val.addr = (XPointer)arg->value; else @@ -645,12 +645,12 @@ static XtCacheRef *GetResources( if (widget->core.screen != oldscreen) { db = XtScreenDatabase(widget->core.screen); while (!XrmQGetSearchList(db, names, classes, - searchList, searchListSize)) { + searchList, (int) searchListSize)) { if (searchList == stackSearchList) searchList = NULL; searchList = (XrmHashTable*)XtRealloc((char*)searchList, - sizeof(XrmHashTable) * - (searchListSize *= 2)); + (Cardinal)(sizeof(XrmHashTable) * + (searchListSize *= 2))); } } } @@ -692,7 +692,7 @@ static XtCacheRef *GetResources( for (res = table, j = 0; j < num_resources; j++, res++) { rx = *res; - xrm_type = rx->xrm_type; + xrm_type = (XrmRepresentation) rx->xrm_type; if (typed[j]) { register XtTypedArg* arg = typed_args + typed[j] - 1; @@ -706,7 +706,7 @@ static XtCacheRef *GetResources( Boolean converted; from_type = StringToQuark(arg->type); - from_val.size = arg->size; + from_val.size = (Cardinal) arg->size; if ((from_type == QString) || ((unsigned) arg->size > sizeof(XtArgVal))) from_val.addr = (XPointer)arg->value; else @@ -733,7 +733,7 @@ static XtCacheRef *GetResources( */ if(rx->xrm_size > sizeof(XtArgVal)) { - arg->value = (XtArgVal) __XtMalloc(rx->xrm_size); + arg->value = (XtArgVal) (void *) __XtMalloc(rx->xrm_size); arg->size = -(arg->size); } else { /* will fit - copy directly into value field */ arg->value = (XtArgVal) NULL; @@ -755,7 +755,7 @@ static XtCacheRef *GetResources( Boolean have_value = False; if (XrmQGetSearchResource(searchList, - rx->xrm_name, rx->xrm_class, &rawType, &value)) { + (XrmName) rx->xrm_name, (XrmClass) rx->xrm_class, &rawType, &value)) { if (rawType != xrm_type) { convValue.size = rx->xrm_size; convValue.addr = (XPointer)(base - rx->xrm_offset - 1); @@ -774,7 +774,7 @@ static XtCacheRef *GetResources( || (rx->xrm_default_type == xrm_type) || (rx->xrm_default_addr != NULL))) { /* Convert default value to proper type */ - xrm_default_type = rx->xrm_default_type; + xrm_default_type = (XrmRepresentation) rx->xrm_default_type; if (xrm_default_type == QCallProc) { (*(XtResourceDefaultProc)(rx->xrm_default_addr))( widget,-(rx->xrm_offset+1), &value); @@ -806,7 +806,7 @@ static XtCacheRef *GetResources( } else { value.addr = rx->xrm_default_addr; if (xrm_default_type == QString) { - value.size = strlen((char *)value.addr) + 1; + value.size = (unsigned) strlen((char *)value.addr) + 1; } else { value.size = sizeof(XtPointer); } @@ -876,15 +876,15 @@ static XtCacheRef *GetResources( } } } - if ((Cardinal)num_typed_args != *pNumTypedArgs) *pNumTypedArgs = num_typed_args; + if ((Cardinal)num_typed_args != *pNumTypedArgs) *pNumTypedArgs = (Cardinal) num_typed_args; if (searchList != stackSearchList) XtFree((char*)searchList); if (!cache_ptr) cache_ptr = cache_base; if (cache_ptr && cache_ptr != cache_ref) { - int cache_ref_size = cache_ptr - cache_ref; + int cache_ref_size = (int) (cache_ptr - cache_ref); XtCacheRef *refs = (XtCacheRef*) - __XtMalloc((unsigned)sizeof(XtCacheRef)*(cache_ref_size + 1)); - (void) memmove(refs, cache_ref, sizeof(XtCacheRef)*cache_ref_size ); + __XtMalloc((Cardinal)(sizeof(XtCacheRef) * (size_t)(cache_ref_size + 1))); + (void) memmove(refs, cache_ref, sizeof(XtCacheRef)*(size_t)cache_ref_size ); refs[cache_ref_size] = NULL; return refs; } @@ -909,7 +909,7 @@ static void CacheArgs( count = (args != NULL) ? num_args : num_typed_args; if (num_quarks < count) { - quarks = (XrmQuarkList) __XtMalloc(count * sizeof(XrmQuark)); + quarks = (XrmQuarkList) __XtMalloc((Cardinal)(count * sizeof(XrmQuark))); } else { quarks = quark_cache; } @@ -1145,7 +1145,7 @@ void _XtResourceListInitialize(void) if (initialized) { XtWarningMsg("initializationError","xtInitialize",XtCXtToolkitError, "Initializing Resource Lists twice", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_PROCESS; return; } diff --git a/src/Selection.c b/src/Selection.c index ead96fc..9af6b08 100644 --- a/src/Selection.c +++ b/src/Selection.c @@ -139,7 +139,7 @@ static void RemoveParamInfo(Widget, Atom); static Atom GetParamInfo(Widget, Atom); static int StorageSize[3] = {1, sizeof(short), sizeof(long)}; -#define BYTELENGTH(length, format) ((length) * StorageSize[(format)>>4]) +#define BYTELENGTH(length, format) ((length) * (size_t)StorageSize[(format)>>4]) #define NUMELEM(bytelength, format) ((bytelength) / StorageSize[(format)>>4]) /* Xlib and Xt are permitted to have different memory allocators, and in the @@ -225,7 +225,7 @@ static Atom GetSelectionProperty( } propCount = sarray->propCount++; sarray->list = (SelectionProp) XtRealloc((XtPointer)sarray->list, - (unsigned)(sarray->propCount*sizeof(SelectionPropRec))); + (Cardinal)((size_t)sarray->propCount * sizeof(SelectionPropRec))); (void) snprintf(propname, sizeof(propname), "_XT_SELECTION_%d", propCount); sarray->list[propCount].prop = XInternAtom(dpy, propname, FALSE); sarray->list[propCount].avail = FALSE; @@ -246,7 +246,7 @@ static void FreeSelectionProperty( XtAppErrorMsg(XtDisplayToApplicationContext(dpy), "noSelectionProperties", "freeSelectionProperty", XtCXtToolkitError, "internal error: no selection property context for display", - (String *)NULL, (Cardinal *)NULL ); + NULL, NULL ); UNLOCK_PROCESS; for (p = sarray->list, propCount=sarray->propCount; propCount; @@ -281,13 +281,13 @@ static CallBackInfo MakeInfo( info->ctx = ctx; info->callbacks = (XtSelectionCallbackProc *) - __XtMalloc((unsigned) (count * sizeof(XtSelectionCallbackProc))); + __XtMalloc((unsigned) ((size_t)count * sizeof(XtSelectionCallbackProc))); (void) memmove((char*)info->callbacks, (char*)callbacks, - count * sizeof(XtSelectionCallbackProc)); + (size_t)count * sizeof(XtSelectionCallbackProc)); info->req_closure = - (XtPointer*)__XtMalloc((unsigned) (count * sizeof(XtPointer))); + (XtPointer*)__XtMalloc((unsigned) ((size_t)count * sizeof(XtPointer))); (void) memmove((char*)info->req_closure, (char*)closures, - count * sizeof(XtPointer)); + (size_t)count * sizeof(XtPointer)); if (count == 1 && properties != NULL && properties[0] != None) info->property = properties[0]; else { @@ -298,9 +298,9 @@ static CallBackInfo MakeInfo( info->proc = HandleSelectionReplies; info->widget = widget; info->time = time; - info->incremental = (Boolean*) __XtMalloc(count * sizeof(Boolean)); + info->incremental = (Boolean*) __XtMalloc((Cardinal)((size_t)count * sizeof(Boolean))); (void) memmove((char*)info->incremental, (char*) incremental, - count * sizeof(Boolean)); + (size_t)count * sizeof(Boolean)); info->current = 0; info->value = NULL; return (info); @@ -499,7 +499,7 @@ static void AddHandler( UNLOCK_PROCESS; if (requestWindowRec->active_transfer_count++ == 0) { XtRegisterDrawable(dpy, window, widget); - XSelectInput(dpy, window, mask); + XSelectInput(dpy, window, (long)mask); } XtAddRawEventHandler(widget, mask, FALSE, proc, closure); } @@ -579,7 +579,7 @@ static void SendIncrement( { Display *dpy = incr->ctx->dpy; - unsigned long incrSize = MAX_SELECTION_INCR(dpy); + unsigned long incrSize = (unsigned long) MAX_SELECTION_INCR(dpy); if (incrSize > incr->bytelength - incr->offset) incrSize = incr->bytelength - incr->offset; StartProtectedSection(dpy, incr->requestor); @@ -643,7 +643,7 @@ static void HandlePropertyGone( if (req->bytelength == 0) AllSent(req); else { - unsigned long size = MAX_SELECTION_INCR(ctx->dpy); + unsigned long size = (unsigned long) MAX_SELECTION_INCR(ctx->dpy); SendIncrement(req); (*(XtConvertSelectionIncrProc)ctx->convert) (ctx->widget, &ctx->selection, &req->target, @@ -725,7 +725,7 @@ static Boolean GetConversion( if (timestamp_target) { value = __XtMalloc(sizeof(long)); - *(long*)value = ctx->time; + *(long*)value = (long) ctx->time; targetType = XA_INTEGER; length = 1; format = 32; @@ -733,7 +733,7 @@ static Boolean GetConversion( else { ctx->ref_count++; if (ctx->incremental == TRUE) { - unsigned long size = MAX_SELECTION_INCR(ctx->dpy); + unsigned long size = (unsigned long) MAX_SELECTION_INCR(ctx->dpy); if ((*(XtConvertSelectionIncrProc)ctx->convert) (ctx->widget, &event->selection, &target, &targetType, &value, &length, &format, @@ -846,7 +846,7 @@ static void HandleSelectionEvents( event->xselectionrequest.property, 0L, 1000000, False,(Atom)AnyPropertyType, &target, &format, &length, &bytesafter, &value) == Success) - count = BYTELENGTH(length, format) / sizeof(IndirectPair); + count = (int) (BYTELENGTH(length, format) / sizeof(IndirectPair)); else count = 0; for (p = (IndirectPair *)value; count; p++, count--) { @@ -1206,7 +1206,7 @@ static void HandleGetIncrement( } else { /* add increment to collection */ if (info->incremental[n]) { #ifdef XT_COPY_SELECTION - int size = BYTELENGTH(length, info->format) + 1; + int size = (int) BYTELENGTH(length, info->format) + 1; char *tmp = __XtMalloc((Cardinal) size); (void) memmove(tmp, value, size); XFree(value); @@ -1215,14 +1215,14 @@ static void HandleGetIncrement( (*info->callbacks[n])(widget, *info->req_closure, &ctx->selection, &info->type, value, &length, &info->format); } else { - int size = BYTELENGTH(length, info->format); + int size = (int) BYTELENGTH(length, info->format); if (info->offset + size > info->bytelength) { /* allocate enough for this and the next increment */ info->bytelength = info->offset + size * 2; info->value = XtRealloc(info->value, (Cardinal) info->bytelength); } - (void) memmove(&info->value[info->offset], value, size); + (void) memmove(&info->value[info->offset], value, (size_t)size); info->offset += size; XFree(value); } @@ -1253,7 +1253,7 @@ static void HandleNone( } -static long IncrPropSize( +static unsigned long IncrPropSize( Widget widget, unsigned char* value, int format, @@ -1261,14 +1261,14 @@ static long IncrPropSize( { unsigned long size; if (format == 32) { - size = ((long*)value)[length-1]; /* %%% what order for longs? */ + size = ((unsigned long*)value)[length-1]; /* %%% what order for longs? */ return size; } else { XtAppWarningMsg( XtWidgetToApplicationContext(widget), "badFormat","xtGetSelectionValue",XtCXtToolkitError, "Selection owner returned type INCR property with format != 32", - (String*)NULL, (Cardinal*)NULL ); + NULL, NULL ); return 0; } } @@ -1315,7 +1315,7 @@ Boolean HandleNormal( XDeleteProperty(dpy, XtWindow(widget), property); #ifdef XT_COPY_SELECTION if (value) { /* it could have been deleted after the SelectionNotify */ - int size = BYTELENGTH(length, info->format) + 1; + int size = (int) BYTELENGTH(length, info->format) + 1; char *tmp = __XtMalloc((Cardinal) size); (void) memmove(tmp, value, size); XFree(value); @@ -1349,7 +1349,7 @@ static void HandleIncremental( XDeleteProperty(dpy, XtWindow(widget), property); XFlush(dpy); - info->bytelength = size; + info->bytelength = (int) size; if (info->incremental[info->current]) /* requestor wants incremental too */ info->value = NULL; /* so no need for buffer to assemble value */ else @@ -1453,7 +1453,7 @@ static void DoLocalTransfer( req->event.requestor = req->requestor = XtWindow(widget); if (ctx->incremental) { - unsigned long size = MAX_SELECTION_INCR(ctx->dpy); + unsigned long size = (unsigned long) MAX_SELECTION_INCR(ctx->dpy); if (!(*(XtConvertSelectionIncrProc)ctx->convert) (ctx->widget, &selection, &target, &resulttype, &value, &length, &format, @@ -1465,10 +1465,10 @@ static void DoLocalTransfer( Boolean allSent = FALSE; while (!allSent) { if (ctx->notify && (value != NULL)) { - int bytelength = BYTELENGTH(length,format); + int bytelength = (int) BYTELENGTH(length,format); /* both sides think they own this storage */ temp = __XtMalloc((unsigned)bytelength); - (void) memmove(temp, value, bytelength); + (void) memmove(temp, value, (size_t) bytelength); value = temp; } /* use care; older clients were never warned that @@ -1491,12 +1491,12 @@ static void DoLocalTransfer( } } else { while (length) { - int bytelength = BYTELENGTH(length, format); + int bytelength = (int) BYTELENGTH(length, format); total = XtRealloc(total, - (unsigned) (totallength += bytelength)); + (Cardinal) (totallength = totallength + (unsigned long)bytelength)); (void) memmove((char*)total + totallength - bytelength, value, - bytelength); + (size_t) bytelength); (*(XtConvertSelectionIncrProc)ctx->convert) (ctx->widget, &selection, &target, &resulttype, &value, &length, &format, @@ -1519,10 +1519,10 @@ static void DoLocalTransfer( HandleNone(widget, callback, closure, selection); } else { if (ctx->notify && (value != NULL)) { - int bytelength = BYTELENGTH(length,format); + int bytelength = (int) BYTELENGTH(length,format); /* both sides think they own this storage; better copy */ temp = __XtMalloc((unsigned)bytelength); - (void) memmove(temp, value, bytelength); + (void) memmove(temp, value, (size_t) bytelength); value = temp; } if (value == NULL) value = __XtMalloc((unsigned)1); @@ -1673,7 +1673,7 @@ static void GetSelectionValues( int i = 0, j = 0; passed_callbacks = (XtSelectionCallbackProc *) - XtStackAlloc(sizeof(XtSelectionCallbackProc) * count, stack_cbs); + XtStackAlloc(sizeof(XtSelectionCallbackProc) * (size_t)count, stack_cbs); /* To deal with the old calls from XtGetSelectionValues* we will repeat however many callbacks have been passed into @@ -1687,11 +1687,11 @@ static void GetSelectionValues( time, incremental, properties); XtStackFree((XtPointer) passed_callbacks, stack_cbs); - info->target = (Atom *)__XtMalloc((unsigned) ((count+1) * sizeof(Atom))); + info->target = (Atom *)__XtMalloc((unsigned) ((size_t)(count+1) * sizeof(Atom))); (*info->target) = ctx->prop_list->indirect_atom; (void) memmove((char *) info->target+sizeof(Atom), (char *) targets, - count * sizeof(Atom)); - pairs = (IndirectPair*)__XtMalloc((unsigned)(count*sizeof(IndirectPair))); + (size_t) count * sizeof(Atom)); + pairs = (IndirectPair*)__XtMalloc((unsigned)((size_t)count*sizeof(IndirectPair))); for (p = &pairs[count-1], t = &targets[count-1], i = count - 1; p >= pairs; p--, t--, i--) { p->target = *t; @@ -1728,7 +1728,7 @@ void XtGetSelectionValues( WIDGET_TO_APPCON(widget); LOCK_APP(app); - incremental = XtStackAlloc(count * sizeof(Boolean), incremental_values); + incremental = XtStackAlloc((size_t)count * sizeof(Boolean), incremental_values); for(i = 0; i < count; i++) incremental[i] = FALSE; if (IsGatheringRequest(widget, selection)) { AddSelectionRequests(widget, selection, count, targets, &callback, @@ -1757,7 +1757,7 @@ void XtGetSelectionValuesIncremental( WIDGET_TO_APPCON(widget); LOCK_APP(app); - incremental = XtStackAlloc(count * sizeof(Boolean), incremental_values); + incremental = XtStackAlloc((size_t)count * sizeof(Boolean), incremental_values); for(i = 0; i < count; i++) incremental[i] = TRUE; if (IsGatheringRequest(widget, selection)) { AddSelectionRequests(widget, selection, count, targets, &callback, @@ -1890,8 +1890,8 @@ static void AddSelectionRequests( qi->count += count; req = (QueuedRequest*) XtRealloc((char*) req, - (start + count) * - sizeof(QueuedRequest)); + (Cardinal)((size_t)(start + count) * + sizeof(QueuedRequest))); while(i < count) { QueuedRequest newreq = (QueuedRequest) __XtMalloc(sizeof(QueuedRequestRec)); @@ -2027,7 +2027,7 @@ void XtCreateSelectionRequest( while(queueInfo->selections[n] != None) n++; queueInfo->selections = (Atom*) XtRealloc((char*) queueInfo->selections, - (n + 2) * sizeof(Atom)); + (Cardinal)((size_t)(n + 2) * sizeof(Atom))); queueInfo->selections[n] = selection; queueInfo->selections[n + 1] = None; @@ -2082,12 +2082,12 @@ void XtSendSelectionRequest( int j = 0; /* Allocate */ - targets = (Atom *) XtStackAlloc(count * sizeof(Atom), t); + targets = (Atom *) XtStackAlloc((size_t)count * sizeof(Atom), t); cbs = (XtSelectionCallbackProc *) - XtStackAlloc(count * sizeof(XtSelectionCallbackProc), c); - closures = (XtPointer *) XtStackAlloc(count * sizeof(XtPointer), cs); - incrs = (Boolean *) XtStackAlloc(count * sizeof(Boolean), ins); - props = (Atom *) XtStackAlloc(count * sizeof(Atom), p); + XtStackAlloc((size_t)count * sizeof(XtSelectionCallbackProc), c); + closures = (XtPointer *) XtStackAlloc((size_t)count * sizeof(XtPointer), cs); + incrs = (Boolean *) XtStackAlloc((size_t)count * sizeof(Boolean), ins); + props = (Atom *) XtStackAlloc((size_t)count * sizeof(Atom), p); /* Copy */ for(i = 0; i < queueInfo->count; i++) { @@ -2163,7 +2163,7 @@ void XtSetSelectionParameters( XChangeProperty(dpy, window, property, type, format, PropModeReplace, - (unsigned char *) value, length); + (unsigned char *) value, (int) length); } /* Retrieves data passed in a parameter. Data for this is stored @@ -2182,7 +2182,7 @@ void XtGetSelectionParameters( WIDGET_TO_APPCON(owner); *value_return = NULL; - *length_return = *format_return = 0; + *length_return = (unsigned long) (*format_return = 0); *type_return = None; LOCK_APP(app); @@ -2199,7 +2199,7 @@ void XtGetSelectionParameters( EndProtectedSection(dpy); #ifdef XT_COPY_SELECTION if (*value_return) { - int size = BYTELENGTH(*length_return, *format_return) + 1; + int size = (int) BYTELENGTH(*length_return, *format_return) + 1; char *tmp = __XtMalloc((Cardinal) size); (void) memmove(tmp, *value_return, size); XFree(*value_return); @@ -2239,7 +2239,7 @@ static void AddParamInfo( (char *)pinfo); } else { - for (n = pinfo->count, p = pinfo->paramlist; n; n--, p++) { + for (n = (int) pinfo->count, p = pinfo->paramlist; n; n--, p++) { if (p->selection == None || p->selection == selection) break; } @@ -2247,7 +2247,7 @@ static void AddParamInfo( pinfo->count++; pinfo->paramlist = (Param) XtRealloc((char*) pinfo->paramlist, - pinfo->count * sizeof(ParamRec)); + (Cardinal)(pinfo->count * sizeof(ParamRec))); p = &pinfo->paramlist[pinfo->count - 1]; (void) XSaveContext(XtDisplay(w), XtWindow(w), paramPropertyContext, (char *)pinfo); @@ -2273,7 +2273,7 @@ static void RemoveParamInfo( (XPointer *) &pinfo) == 0)) { /* Find and invalidate the parameter data. */ - for (n = pinfo->count, p = pinfo->paramlist; n; n--, p++) { + for (n = (int) pinfo->count, p = pinfo->paramlist; n; n--, p++) { if (p->selection != None) { if (p->selection == selection) p->selection = None; @@ -2305,7 +2305,7 @@ static Atom GetParamInfo( && (XFindContext(XtDisplay(w), XtWindow(w), paramPropertyContext, (XPointer *) &pinfo) == 0)) { - for (n = pinfo->count, p = pinfo->paramlist; n; n--, p++) + for (n = (int) pinfo->count, p = pinfo->paramlist; n; n--, p++) if (p->selection == selection) { atom = p->param; break; diff --git a/src/SetValues.c b/src/SetValues.c index f274000..8108576 100644 --- a/src/SetValues.c +++ b/src/SetValues.c @@ -158,7 +158,7 @@ CallConstraintSetValues ( XtAppErrorMsg(XtWidgetToApplicationContext(current), "invalidClass","constraintSetValue",XtCXtToolkitError, "Subclass of Constraint required in CallConstraintSetValues", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); LOCK_PROCESS; superclass = (ConstraintWidgetClass) class->core_class.superclass; UNLOCK_PROCESS; @@ -214,7 +214,7 @@ void XtSetValues( XtAppErrorMsg(app, "invalidArgCount","xtSetValues",XtCXtToolkitError, "Argument count > 0 on NULL argument list in XtSetValues", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } /* Allocate and copy current widget into old widget */ @@ -383,7 +383,7 @@ void XtSetValues( "invalidProcedure","set_values_almost", XtCXtToolkitError, "set_values_almost procedure shouldn't be NULL", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); break; } if (result == XtGeometryNo) geoReply.request_mode = 0; @@ -432,8 +432,8 @@ void XtSetValues( XtName(w),XtName(pw))); XClearArea (XtDisplay (pw), XtWindow (pw), r->rectangle.x, r->rectangle.y, - r->rectangle.width + bw2, - r->rectangle.height + bw2,TRUE); + (unsigned) (r->rectangle.width + bw2), + (unsigned) (r->rectangle.height + bw2), TRUE); } } } diff --git a/src/Shell.c b/src/Shell.c index f160527..664eedb 100644 --- a/src/Shell.c +++ b/src/Shell.c @@ -1193,11 +1193,11 @@ static void Realize( */ register Widget *childP = w->composite.children; int i; - for (i = w->composite.num_children; i; i--, childP++) { + for (i = (int) w->composite.num_children; i; i--, childP++) { if (XtIsWidget(*childP) && XtIsManaged(*childP)) { if ((*childP)->core.background_pixmap != XtUnspecifiedPixmap) { - mask &= ~(CWBackPixel); + mask &= (unsigned long) (~(CWBackPixel)); mask |= CWBackPixmap; attr->background_pixmap = w->core.background_pixmap = @@ -1502,7 +1502,7 @@ static void _popup_set_prop( XInternAtom(XtDisplay((Widget)w), "WM_LOCALE_NAME", False), XA_STRING, 8, PropModeReplace, - (unsigned char *)locale, strlen(locale)); + (unsigned char *)locale, (int) strlen(locale)); } UNLOCK_PROCESS; @@ -1525,7 +1525,7 @@ static void _popup_set_prop( "SM_CLIENT_ID", False), XA_STRING, 8, PropModeReplace, (unsigned char *) sm_client_id, - strlen(sm_client_id)); + (int) strlen(sm_client_id)); } } } @@ -1537,7 +1537,7 @@ static void _popup_set_prop( "WM_WINDOW_ROLE", False), XA_STRING, 8, PropModeReplace, (unsigned char *)wmshell->wm.window_role, - strlen(wmshell->wm.window_role)); + (int) strlen(wmshell->wm.window_role)); } /* ARGSUSED */ @@ -1555,7 +1555,7 @@ static void EventHandler( XtAppErrorMsg(XtWidgetToApplicationContext(wid), "invalidWindow","eventHandler",XtCXtToolkitError, "Event with wrong window", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -1567,16 +1567,16 @@ static void EventHandler( if( NEQ(width) || NEQ(height) || NEQ(border_width) ) { sizechanged = TRUE; #undef NEQ - w->core.width = event->xconfigure.width; - w->core.height = event->xconfigure.height; - w->core.border_width = event->xconfigure.border_width; + w->core.width = (Dimension) event->xconfigure.width; + w->core.height = (Dimension) event->xconfigure.height; + w->core.border_width = (Dimension) event->xconfigure.border_width; } if (event->xany.send_event /* ICCCM compliant synthetic ev */ /* || w->shell.override_redirect */ || w->shell.client_specified & _XtShellNotReparented) { - w->core.x = event->xconfigure.x; - w->core.y = event->xconfigure.y; + w->core.x = (Position) event->xconfigure.x; + w->core.y = (Position) event->xconfigure.y; w->shell.client_specified |= _XtShellPositionValid; } else w->shell.client_specified &= ~_XtShellPositionValid; @@ -1599,8 +1599,8 @@ static void EventHandler( w->shell.client_specified &= ~(_XtShellNotReparented | _XtShellPositionValid); else { - w->core.x = event->xreparent.x; - w->core.y = event->xreparent.y; + w->core.x = (Position) event->xreparent.x; + w->core.y = (Position) event->xreparent.y; w->shell.client_specified |= (_XtShellNotReparented | _XtShellPositionValid); } @@ -1885,7 +1885,7 @@ static XtGeometryResult GeometryManager( wid->core.width = shell->core.width; wid->core.height = shell->core.height; if (request->request_mode & CWBorderWidth) { - wid->core.x = wid->core.y = -request->border_width; + wid->core.x = wid->core.y = (Position) (-request->border_width); } } return XtGeometryYes; @@ -1941,7 +1941,7 @@ static Boolean _wait_for_response( unsigned long timeout; if (XtIsWMShell((Widget)w)) - timeout = ((WMShellWidget)w)->wm.wm_timeout; + timeout = (unsigned long) ((WMShellWidget)w)->wm.wm_timeout; else timeout = DEFAULT_WM_TIMEOUT; @@ -2008,16 +2008,16 @@ static XtGeometryResult RootGeometryManager( oldborder_width = w->core.border_width; #define PutBackGeometry() \ - { w->core.x = oldx; \ - w->core.y = oldy; \ - w->core.width = oldwidth; \ - w->core.height = oldheight; \ - w->core.border_width = oldborder_width; } + { w->core.x = (Position) (oldx); \ + w->core.y = (Position) (oldy); \ + w->core.width = (Dimension) (oldwidth); \ + w->core.height = (Dimension) (oldheight); \ + w->core.border_width = (Dimension) (oldborder_width); } if (mask & CWX) { - if (w->core.x == request->x) mask &= ~CWX; + if (w->core.x == request->x) mask &= (unsigned int) (~CWX); else { - w->core.x = values.x = request->x; + w->core.x = (Position) (values.x = request->x); if (wm) { hintp->flags &= ~USPosition; hintp->flags |= PPosition; @@ -2026,9 +2026,9 @@ static XtGeometryResult RootGeometryManager( } } if (mask & CWY) { - if (w->core.y == request->y) mask &= ~CWY; + if (w->core.y == request->y) mask &= (unsigned int) (~CWY); else { - w->core.y = values.y = request->y; + w->core.y = (Position) (values.y = request->y); if (wm) { hintp->flags &= ~USPosition; hintp->flags |= PPosition; @@ -2038,16 +2038,16 @@ static XtGeometryResult RootGeometryManager( } if (mask & CWBorderWidth) { if (w->core.border_width == request->border_width) { - mask &= ~CWBorderWidth; + mask &= (unsigned int) (~CWBorderWidth); } else w->core.border_width = - values.border_width = - request->border_width; + (Dimension) (values.border_width = + request->border_width); } if (mask & CWWidth) { - if (w->core.width == request->width) mask &= ~CWWidth; + if (w->core.width == request->width) mask &= (unsigned int) (~CWWidth); else { - w->core.width = values.width = request->width; + w->core.width = (Dimension)(values.width = request->width); if (wm) { hintp->flags &= ~USSize; hintp->flags |= PSize; @@ -2056,9 +2056,9 @@ static XtGeometryResult RootGeometryManager( } } if (mask & CWHeight) { - if (w->core.height == request->height) mask &= ~CWHeight; + if (w->core.height == request->height) mask &= (unsigned int) (~CWHeight); else { - w->core.height = values.height = request->height; + w->core.height = (Dimension)(values.height = request->height); if (wm) { hintp->flags &= ~USSize; hintp->flags |= PSize; @@ -2113,7 +2113,7 @@ static XtGeometryResult RootGeometryManager( /* If no non-stacking bits are set, there's no way to tell whether or not this worked, so assume it did */ - if (!(mask & ~(CWStackMode | CWSibling))) return XtGeometryYes; + if (!(mask & (unsigned)(~(CWStackMode | CWSibling)))) return XtGeometryYes; if (wm && ((WMShellWidget)w)->wm.wait_for_wm == FALSE) { /* the window manager is sick @@ -2184,14 +2184,14 @@ static XtGeometryResult RootGeometryManager( return XtGeometryNo; } else { - w->core.width = event.xconfigure.width; - w->core.height = event.xconfigure.height; - w->core.border_width = event.xconfigure.border_width; + w->core.width = (Dimension) event.xconfigure.width; + w->core.height = (Dimension) event.xconfigure.height; + w->core.border_width = (Dimension) event.xconfigure.border_width; if (event.xany.send_event || /* ICCCM compliant synth */ w->shell.client_specified & _XtShellNotReparented) { - w->core.x = event.xconfigure.x; - w->core.y = event.xconfigure.y; + w->core.x = (Position) event.xconfigure.x; + w->core.y = (Position) event.xconfigure.y; w->shell.client_specified |= _XtShellPositionValid; } else w->shell.client_specified &= ~_XtShellPositionValid; @@ -2209,7 +2209,7 @@ static XtGeometryResult RootGeometryManager( } else XtAppWarningMsg(XtWidgetToApplicationContext((Widget)w), "internalError", "shell", XtCXtToolkitError, "Shell's window manager interaction is broken", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } else if (wm) { /* no event */ ((WMShellWidget)w)->wm.wait_for_wm = FALSE; /* timed out; must be broken */ } @@ -2377,7 +2377,7 @@ static Boolean WMSetValues( False), XA_STRING, 8, PropModeReplace, (unsigned char *)nwmshell->wm.window_role, - strlen(nwmshell->wm.window_role)); + (int) strlen(nwmshell->wm.window_role)); } else if (XtIsRealized(new) && ! nwmshell->wm.window_role) { XDeleteProperty(XtDisplay(new), XtWindow(new), XInternAtom(XtDisplay(new), "WM_WINDOW_ROLE", @@ -2487,11 +2487,11 @@ static String * NewArgv( if (count <= 0 || !str) return NULL; - for (num = count; num--; str++) { - nbytes += strlen(*str); + for (num = (Cardinal) count; num--; str++) { + nbytes = (nbytes + (Cardinal) strlen(*str)); nbytes++; } - num = (count+1) * sizeof(String); + num = (Cardinal) ((size_t)(count+1) * sizeof(String)); new = newarray = (String *) __XtMalloc(num + nbytes); sptr = ((char *) new) + num; @@ -2661,7 +2661,7 @@ static Boolean SessionSetValues( False), XA_STRING, 8, PropModeReplace, (unsigned char *) nw->session.session_id, - strlen(nw->session.session_id)); + (int) strlen(nw->session.session_id)); } } return False; @@ -2682,8 +2682,8 @@ void _XtShellGetCoordinates( (int) -w->core.border_width, (int) -w->core.border_width, &tmpx, &tmpy, &tmpchild); - w->core.x = tmpx; - w->core.y = tmpy; + w->core.x = (Position) tmpx; + w->core.y = (Position) tmpy; w->shell.client_specified |= _XtShellPositionValid; } *x = w->core.x; @@ -2722,7 +2722,7 @@ static void ApplicationShellInsertChild( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidClass", "applicationShellInsertChild", XtCXtToolkitError, "ApplicationShell does not accept RectObj children; ignored", - (String*)NULL, (Cardinal*)NULL); + NULL, NULL); } else { XtWidgetProc insert_child; @@ -2853,10 +2853,10 @@ static String * NewStringArray(String *str) if (!str) return NULL; for (num = 0; *str; num++, str++) { - nbytes += strlen(*str); + nbytes = nbytes + (Cardinal)strlen(*str); nbytes++; } - num = (num + 1) * sizeof(String); + num = (Cardinal)((size_t)(num + 1) * sizeof(String)); new = newarray = (String *) __XtMalloc(num + nbytes); sptr = ((char *) new) + num; @@ -2906,7 +2906,7 @@ static SmProp * ArrayPack(char *name, XtPointer closure) p->num_vals = 1; p->type = SmARRAY8; p->name = name; - p->vals->length = strlen(prop) + 1; + p->vals->length = (int) strlen(prop) + 1; p->vals->value = prop; return p; } @@ -2923,13 +2923,13 @@ static SmProp * ListPack( for (ptr = prop; *ptr; ptr++) n++; - p = (SmProp*) __XtMalloc(sizeof(SmProp) + (Cardinal)(n*sizeof(SmPropValue))); + p = (SmProp*) __XtMalloc((Cardinal)(sizeof(SmProp) + (size_t)n * sizeof(SmPropValue))); p->vals = (SmPropValue *) (((char *) p) + sizeof(SmProp)); p->num_vals = n; p->type = SmLISTofARRAY8; p->name = name; for (ptr = prop, vals = p->vals; *ptr; ptr++, vals++) { - vals->length = strlen(*ptr) + 1; + vals->length = (int) strlen(*ptr) + 1; vals->value = *ptr; } return p; @@ -3099,8 +3099,8 @@ static void XtCallSaveCallbacks( save->next = NULL; save->save_type = save_type; save->interact_style = interact; - save->shutdown = shutdown; - save->fast = fast; + save->shutdown = (Boolean) shutdown; + save->fast = (Boolean) fast; save->cancel_shutdown = False; save->phase = 1; save->interact_dialog_type = SmDialogNormal; @@ -3380,17 +3380,17 @@ static String* EditCommand( count++; if (want) { - s = new = (String *) __XtMalloc((Cardinal)(count+3) * sizeof(String*)); + s = new = (String *) __XtMalloc((Cardinal)((size_t) (count+3) * sizeof(String*))); *s = *sarray; s++; sarray++; *s = "-xtsessionID"; s++; *s = str; s++; for (; --count > 0; s++, sarray++) *s = *sarray; - *s = (String) NULL; + *s = NULL; } else { if (count < 3) return NewStringArray(sarray); - s = new = (String *) __XtMalloc((Cardinal)(count-1) * sizeof(String*)); + s = new = (String *) __XtMalloc((Cardinal)((size_t)(count-1) * sizeof(String*))); for (; --count >= 0; sarray++) { if (strcmp(*sarray, "-xtsessionID") == 0) { sarray++; @@ -3400,7 +3400,7 @@ static String* EditCommand( s++; } } - *s = (String) NULL; + *s = NULL; } s = new; new = NewStringArray(new); diff --git a/src/TMaction.c b/src/TMaction.c index 2e49ffc..c9066b9 100644 --- a/src/TMaction.c +++ b/src/TMaction.c @@ -117,16 +117,16 @@ static CompiledActionTable CompileActionTable( if (! stat) { cTableHold = cActions = (CompiledActionTable) - __XtMalloc(count * sizeof(CompiledAction)); + __XtMalloc((Cardinal)((size_t)count * sizeof(CompiledAction))); - for (i=count; --i >= 0; cActions++, actions++) { + for (i= (int)count; --i >= 0; cActions++, actions++) { cActions->proc = actions->proc; cActions->signature = (*func)(actions->string); } } else { cTableHold = (CompiledActionTable) actions; - for (i=count; --i >= 0; actions++) + for (i= (int)count; --i >= 0; actions++) ((CompiledActionTable) actions)->signature = (*func)(actions->string); } @@ -136,7 +136,7 @@ static CompiledActionTable CompileActionTable( for (i=1; (Cardinal) i <= count - 1; i++) { register Cardinal j; hold = cActions[i]; - j = i; + j = (Cardinal)i; while (j && cActions[j-1].signature > hold.signature) { cActions[j] = cActions[j-1]; j--; @@ -181,7 +181,7 @@ static void ReportUnboundActions( String s = XrmQuarkToString(stateTree->quarkTbl[j]); if (num_unbound != 0) num_chars += 2; - num_chars += strlen(s); + num_chars += (Cardinal)strlen(s); num_unbound++; } } @@ -228,7 +228,7 @@ static CompiledAction *SearchActionTable( register int i, left, right; left = 0; - right = numActions - 1; + right = (int)numActions - 1; while (left <= right) { i = (left + right) >> 1; if (signature < actionTable[i].signature) @@ -251,7 +251,7 @@ static int BindActions( TMShortCard numActions, Cardinal *ndxP) { - register int unbound = stateTree->numQuarks - *ndxP; + register int unbound = (int)(stateTree->numQuarks - *ndxP); CompiledAction* action; register Cardinal ndx; register Boolean savedNdx = False; @@ -331,7 +331,7 @@ static int BindProcs( BindActions(stateTree, procs, GetClassActions(class), - class->core_class.num_actions, + (TMShortCard) class->core_class.num_actions, &ndx); class = class->core_class.superclass; } while (unbound != 0 && class != NULL); @@ -444,7 +444,7 @@ static XtActionProc *EnterBindCache( LOCK_PROCESS; classCache = GetClassCache(w); bindCachePtr = &classCache->bindCache; - procsSize = stateTree->numQuarks * sizeof(XtActionProc); + procsSize = (TMShortCard)(stateTree->numQuarks * sizeof(XtActionProc)); for (bindCache = *bindCachePtr; (*bindCachePtr); @@ -466,8 +466,8 @@ static XtActionProc *EnterBindCache( { *bindCachePtr = bindCache = (TMBindCache) - __XtMalloc(sizeof(TMBindCacheRec) + - (procsSize - sizeof(XtActionProc))); + __XtMalloc((Cardinal)(sizeof(TMBindCacheRec) + + (size_t)(procsSize - sizeof(XtActionProc)))); bindCache->next = NULL; bindCache->status = *bindStatus; bindCache->status.refCount = 1; @@ -553,7 +553,7 @@ static void RemoveAccelerators( XtAppWarningMsg(XtWidgetToApplicationContext(widget), XtNtranslationError,"nullTable",XtCXtToolkitError, "Can't remove accelerators from NULL table", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } @@ -581,7 +581,7 @@ static void RemoveAccelerators( XtAppWarningMsg(XtWidgetToApplicationContext(widget), XtNtranslationError,"nullTable",XtCXtToolkitError, "Tried to remove nonexistent accelerators", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); else { if (!destination->core.being_destroyed) for (i = 0; i < numXlations; i++) @@ -776,7 +776,7 @@ void XtAppAddActions( rec->next = app->action_table; app->action_table = rec; rec->table = CompileActionTable(actions, num_actions, False, False); - rec->count = num_actions; + rec->count = (TMShortCard) num_actions; UNLOCK_APP(app); } @@ -804,10 +804,10 @@ void XtGetActionList( *num_actions_return = widget_class->core_class.num_actions; if (*num_actions_return) { list = *actions_return = (XtActionList) - __XtMalloc(*num_actions_return * sizeof(XtActionsRec)); + __XtMalloc((Cardinal)((size_t)*num_actions_return * sizeof(XtActionsRec))); table = GetClassActions(widget_class); if (table != NULL) { - for (i= (*num_actions_return); --i >= 0; list++, table++) { + for (i= (int)(*num_actions_return); --i >= 0; list++, table++) { list->string = XrmQuarkToString(table->signature); list->proc = table->proc; } @@ -855,7 +855,7 @@ void XtMenuPopupAction( XtAppWarningMsg(app, "invalidParameters","xtMenuPopupAction",XtCXtToolkitError, "MenuPopup wants exactly one argument", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -868,7 +868,7 @@ void XtMenuPopupAction( XtAppWarningMsg(app, "invalidPopup","unsupportedOperation",XtCXtToolkitError, "Pop-up menu creation is only supported on ButtonPress, KeyPress or EnterNotify events.", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); UNLOCK_APP(app); return; } @@ -914,7 +914,7 @@ static void _XtMenuPopdownAction( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidParameters","xtMenuPopdown",XtCXtToolkitError, "XtMenuPopdown called with num_params != 0 or 1", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); } } diff --git a/src/TMgrab.c b/src/TMgrab.c index 08cb486..551cc51 100644 --- a/src/TMgrab.c +++ b/src/TMgrab.c @@ -102,8 +102,8 @@ static void GrabAllCorrectKeys( &careOn, &careMask); if (!resolved) return; } - careOn |= modMatch->modifiers; - careMask |= modMatch->modifierMask; + careOn = (careOn | (Modifiers)modMatch->modifiers); + careMask = (careMask | (Modifiers)modMatch->modifierMask); XtKeysymToKeycodeList( dpy, @@ -130,13 +130,13 @@ static void GrabAllCorrectKeys( ); /* continue; */ /* grab all modifier combinations */ } - least_mod = modifiers_return & (~modifiers_return + 1); - for (std_mods = modifiers_return; + least_mod = (int) (modifiers_return & (~modifiers_return + 1)); + for (std_mods = (int) modifiers_return; std_mods >= least_mod; std_mods--) { Modifiers dummy; /* check all useful combinations of modifier bits */ - if (modifiers_return & std_mods && - !(~modifiers_return & std_mods)) { + if ((modifiers_return & (Modifiers)std_mods) && + !(~modifiers_return & (Modifiers)std_mods)) { XtTranslateKeycode( dpy, *keycodeP, (Modifiers)std_mods, &dummy, &keysym ); @@ -205,10 +205,10 @@ static Boolean DoGrab( &careOn, &careMask); if (!resolved) break; } - careOn |= modMatch->modifiers; + careOn = (careOn | (Modifiers) modMatch->modifiers); XtGrabButton( widget, - (unsigned) typeMatch->eventCode, + (int) typeMatch->eventCode, careOn, grabP->owner_events, grabP->event_mask, @@ -231,7 +231,7 @@ static Boolean DoGrab( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "invalidPopup","unsupportedOperation",XtCXtToolkitError, "Pop-up menu creation is only supported on Button, Key or EnterNotify events.", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); break; } UNLOCK_PROCESS; @@ -277,7 +277,7 @@ void _XtRegisterGrabs( */ doGrab.widget = widget; doGrab.grabP = grabP; - doGrab.count = count; + doGrab.count = (TMShortCard) count; _XtTraverseStateTree((TMStateTree)*stateTreePtr, DoGrab, (XtPointer)&doGrab); diff --git a/src/TMkey.c b/src/TMkey.c index 864b6ec..6071658 100644 --- a/src/TMkey.c +++ b/src/TMkey.c @@ -136,7 +136,7 @@ FM(0x1e), FM(0x9e), FM(0x5e), FM(0xde), FM(0x3e), FM(0xbe), FM(0x7e), FM(0xfe) #define TRANSLATE(ctx,pd,dpy,key,mod,mod_ret,sym_ret) \ { \ - int _i_ = (((key) - (pd)->min_keycode + modmix[(mod) & 0xff]) & \ + int _i_ = (((key) - (TMLongCard) (pd)->min_keycode + modmix[(mod) & 0xff]) & \ (TMKEYCACHESIZE-1)); \ if ((key) == 0) { /* Xlib XIM composed input */ \ mod_ret = 0; \ @@ -147,8 +147,8 @@ FM(0x1e), FM(0x9e), FM(0x5e), FM(0xde), FM(0x3e), FM(0xbe), FM(0x7e), FM(0xfe) mod_ret = MOD_RETURN(ctx, key); \ sym_ret = (ctx)->keycache.keysym[_i_]; \ } else { \ - XtTranslateKeycode(dpy, key, mod, &mod_ret, &sym_ret); \ - (ctx)->keycache.keycode[_i_] = key; \ + XtTranslateKeycode(dpy, (KeyCode) key, mod, &mod_ret, &sym_ret); \ + (ctx)->keycache.keycode[_i_] = (KeyCode) (key); \ (ctx)->keycache.modifiers[_i_] = (unsigned char)(mod); \ (ctx)->keycache.keysym[_i_] = sym_ret; \ MOD_RETURN(ctx, key) = (unsigned char)mod_ret; \ @@ -157,12 +157,12 @@ FM(0x1e), FM(0x9e), FM(0x5e), FM(0xde), FM(0x3e), FM(0xbe), FM(0x7e), FM(0xfe) #define UPDATE_CACHE(ctx, pd, key, mod, mod_ret, sym_ret) \ { \ - int _i_ = (((key) - (pd)->min_keycode + modmix[(mod) & 0xff]) & \ + int _i_ = (((key) - (TMLongCard) (pd)->min_keycode + modmix[(mod) & 0xff]) & \ (TMKEYCACHESIZE-1)); \ - (ctx)->keycache.keycode[_i_] = key; \ + (ctx)->keycache.keycode[_i_] = (KeyCode) (key); \ (ctx)->keycache.modifiers[_i_] = (unsigned char)(mod); \ (ctx)->keycache.keysym[_i_] = sym_ret; \ - MOD_RETURN(ctx, key) = (unsigned char)mod_ret; \ + MOD_RETURN(ctx, key) = (unsigned char)(mod_ret); \ } /* usual number of expected keycodes in XtKeysymToKeycodeList */ @@ -185,7 +185,7 @@ Boolean _XtComputeLateBindings( XtAppWarningMsg(XtDisplayToApplicationContext(dpy), "displayError","invalidDisplay",XtCXtToolkitError, "Can't find display structure", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return FALSE; } _InitializeKeysymTables(dpy, perDisplay); @@ -262,8 +262,8 @@ Boolean _XtMatchUsingDontCareMods( resolved = _XtComputeLateBindings(dpy, modMatch->lateModifiers, &computed, &computedMask); if (!resolved) return FALSE; - computed |= modMatch->modifiers; - computedMask |= modMatch->modifierMask; /* gives do-care mask */ + computed = (Modifiers) (computed | modMatch->modifiers); + computedMask = (Modifiers) (computedMask | modMatch->modifierMask); /* gives do-care mask */ if ( (computed & computedMask) == (eventSeq->event.modifiers & computedMask) ) { @@ -283,7 +283,7 @@ Boolean _XtMatchUsingDontCareMods( useful_mods = ~computedMask & modifiers_return; if (useful_mods == 0) return FALSE; - switch (num_modbits = num_bits(useful_mods)) { + switch (num_modbits = (int) num_bits(useful_mods)) { case 1: case 8: /* @@ -296,7 +296,7 @@ Boolean _XtMatchUsingDontCareMods( * applications. We can only hope that Motif's virtual * modifiers won't result in all eight modbits being set. */ - for (i = useful_mods; i > 0; i--) { + for (i = (int) useful_mods; i > 0; i--) { TRANSLATE(tm_context, pd, dpy, eventSeq->event.eventCode, (Modifiers)i, modifiers_return, keysym_return); if (keysym_return == @@ -389,13 +389,13 @@ Boolean _XtMatchUsingStandardMods ( modifiers_return = MOD_RETURN(tm_context, eventSeq->event.eventCode); if (!modifiers_return) { XtTranslateKeycode(dpy, (KeyCode)eventSeq->event.eventCode, - eventSeq->event.modifiers, &modifiers_return, + (Modifiers)eventSeq->event.modifiers, &modifiers_return, &keysym_return); - translateModifiers = eventSeq->event.modifiers & modifiers_return; + translateModifiers = (Modifiers) (eventSeq->event.modifiers & modifiers_return); UPDATE_CACHE(tm_context, pd, eventSeq->event.eventCode, translateModifiers, modifiers_return, keysym_return); } else { - translateModifiers = eventSeq->event.modifiers & modifiers_return; + translateModifiers = (Modifiers) (eventSeq->event.modifiers & modifiers_return); TRANSLATE(tm_context, pd, dpy, (KeyCode)eventSeq->event.eventCode, translateModifiers, modifiers_return, keysym_return); } @@ -406,8 +406,8 @@ Boolean _XtMatchUsingStandardMods ( resolved = _XtComputeLateBindings(dpy, modMatch->lateModifiers, &computed, &computedMask); if (!resolved) return FALSE; - computed |= modMatch->modifiers; - computedMask |= modMatch->modifierMask; + computed = (Modifiers) (computed | modMatch->modifiers); + computedMask = (Modifiers) (computedMask | modMatch->modifierMask); if ((computed & computedMask) == (eventSeq->event.modifiers & ~modifiers_return & computedMask)) { @@ -437,7 +437,7 @@ void _XtBuildKeysymTables( if (pd->keysyms) XFree( (char *)pd->keysyms ); pd->keysyms_serial = NextRequest(dpy); - pd->keysyms = XGetKeyboardMapping(dpy, pd->min_keycode, + pd->keysyms = XGetKeyboardMapping(dpy, (KeyCode) pd->min_keycode, pd->max_keycode-pd->min_keycode+1, &pd->keysyms_per_keycode); if (pd->modKeysyms) @@ -472,21 +472,21 @@ void _XtBuildKeysymTables( for (j=0;j<modKeymap->max_keypermod;j++) { keycode = modKeymap->modifiermap[i*modKeymap->max_keypermod+j]; if (keycode != 0) { - pd->isModifier[keycode>>3] |= 1 << (keycode & 7); + pd->isModifier[keycode>>3] |= (unsigned char) (1 << (keycode & 7)); for (k=0; k<pd->keysyms_per_keycode;k++) { idx = ((keycode-pd->min_keycode)* pd->keysyms_per_keycode)+k; keysym = pd->keysyms[idx]; if ((keysym == XK_Mode_switch) && (i > 2)) - pd->mode_switch |= 1 << i; + pd->mode_switch = (pd->mode_switch | (Modifiers) (1 << i)); if ((keysym == XK_Num_Lock) && (i > 2)) - pd->num_lock |= 1 << i; + pd->num_lock = (pd->num_lock | (Modifiers) (1 << i)); if (keysym != 0 && keysym != tempKeysym ){ if (tempCount==maxCount) { maxCount += KeysymTableSize; pd->modKeysyms = (KeySym*)XtRealloc( (char*)pd->modKeysyms, - (unsigned) (maxCount*sizeof(KeySym)) ); + (unsigned) ((size_t)maxCount * sizeof(KeySym)) ); } pd->modKeysyms[tempCount++] = keysym; table[i].count++; @@ -656,7 +656,7 @@ KeySym *XtGetKeysymTable( LOCK_APP(app); pd = _XtGetPerDisplay(dpy); _InitializeKeysymTables(dpy, pd); - *min_keycode_return = pd->min_keycode; /* %%% */ + *min_keycode_return = (KeyCode) pd->min_keycode; /* %%% */ *keysyms_per_keycode_return = pd->keysyms_per_keycode; retval = pd->keysyms; UNLOCK_APP(app); diff --git a/src/TMparse.c b/src/TMparse.c index cdfacd1..9d46db4 100644 --- a/src/TMparse.c +++ b/src/TMparse.c @@ -445,7 +445,7 @@ static void Compile_XtEventTable( register int i; register EventKeys entry = table; - for (i=count; --i >= 0; entry++) + for (i= (int)count; --i >= 0; entry++) entry->signature = XrmPermStringToQuark(entry->event); qsort(table, count, sizeof(EventKey), OrderEvents); } @@ -463,7 +463,7 @@ static void Compile_XtModifierTable( register int i; register ModifierKeys entry = table; - for (i=count; --i >= 0; entry++) + for (i= (int)count; --i >= 0; entry++) entry->signature = XrmPermStringToQuark(entry->name); qsort(table, count, sizeof(ModifierRec), OrderModifiers); } @@ -666,7 +666,7 @@ static String FetchModifierToken( modStr = XtStackAlloc ((size_t)(str - start + 1), modStrbuf); if (modStr == NULL) _XtAllocError (NULL); - (void) memmove(modStr, start, str-start); + (void) memmove(modStr, start, (size_t) (str - start)); modStr[str-start] = '\0'; *token_return = XrmStringToQuark(modStr); XtStackFree (modStr, modStrbuf); @@ -691,7 +691,7 @@ static String ParseModifiers( exclusive = FALSE; if (start != str) { if (Qmod == QNone) { - event->event.modifierMask = ~0; + event->event.modifierMask = (unsigned long) (~0); event->event.modifiers = 0; ScanWhitespace(str); return str; @@ -749,11 +749,11 @@ static String ParseModifiers( return PanicModeRecovery(str); } event->event.modifierMask |= maskBit; - if (notFlag) event->event.modifiers &= ~maskBit; + if (notFlag) event->event.modifiers = (event->event.modifiers & (TMLongCard) (~maskBit)); else event->event.modifiers |= maskBit; ScanWhitespace(str); } - if (exclusive) event->event.modifierMask = ~0; + if (exclusive) event->event.modifierMask = (unsigned long) (~0); return str; } @@ -770,13 +770,13 @@ static String ParseXtEventType( ScanAlphanumeric(str); eventTypeStr = XtStackAlloc ((size_t)(str - start + 1), eventTypeStrbuf); if (eventTypeStr == NULL) _XtAllocError (NULL); - (void) memmove(eventTypeStr, start, str-start); + (void) memmove(eventTypeStr, start, (size_t)(str-start)); eventTypeStr[str-start] = '\0'; *tmEventP = LookupTMEventType(eventTypeStr,error); XtStackFree (eventTypeStr, eventTypeStrbuf); if (*error) return PanicModeRecovery(str); - event->event.eventType = events[*tmEventP].eventType; + event->event.eventType = (TMLongCard) events[*tmEventP].eventType; return str; } @@ -787,9 +787,9 @@ static unsigned long StrToHex( register unsigned long val = 0; while ((c = *str)) { - if ('0' <= c && c <= '9') val = val*16+c-'0'; - else if ('a' <= c && c <= 'z') val = val*16+c-'a'+10; - else if ('A' <= c && c <= 'Z') val = val*16+c-'A'+10; + if ('0' <= c && c <= '9') val = (unsigned long) (val * 16 + (unsigned long)c - '0'); + else if ('a' <= c && c <= 'z') val = (unsigned long) (val*16+(unsigned long)c-'a'+10); + else if ('A' <= c && c <= 'Z') val = (unsigned long) (val*16+(unsigned long)c-'A'+10); else return 0; str++; } @@ -804,7 +804,7 @@ static unsigned long StrToOct( register unsigned long val = 0; while ((c = *str)) { - if ('0' <= c && c <= '7') val = val*8+c-'0'; else return 0; + if ('0' <= c && c <= '7') val = val*8+(unsigned long)c-'0'; else return 0; str++; } @@ -824,7 +824,7 @@ static unsigned long StrToNum( } while ((c = *str)) { - if ('0' <= c && c <= '9') val = val*10+c-'0'; + if ('0' <= c && c <= '9') val = val*10+(unsigned long)c-'0'; else return 0; str++; } @@ -843,7 +843,7 @@ static KeySym StringToKeySym( #ifndef NOTASCII /* special case single character ASCII, for speed */ if (*(str+1) == '\0') { - if (' ' <= *str && *str <= '~') return XK_space + (*str - ' '); + if (' ' <= *str && *str <= '~') return (KeySym) (XK_space + (*str - ' ')); } #endif @@ -907,7 +907,7 @@ static String ParseImmed( Boolean* error) { event->event.eventCode = (unsigned long)closure; - event->event.eventCodeMask = ~0UL; + event->event.eventCodeMask = (unsigned long) (~0UL); return BROKEN_OPTIMIZER_HACK(str); } @@ -966,7 +966,7 @@ static String ParseKeySym( if (*str != '\0' && !IsNewline(*str)) str++; keySymName[1] = '\0'; event->event.eventCode = StringToKeySym(keySymName, error); - event->event.eventCodeMask = ~0L; + event->event.eventCodeMask = (unsigned long) (~0L); } else if (*str == ',' || *str == ':' || /* allow leftparen to be single char symbol, * for backwards compatibility @@ -987,10 +987,10 @@ static String ParseKeySym( && (*str != '(' || *(str+1) <= '0' || *(str+1) >= '9') && *str != '\0') str++; keySymName = XtStackAlloc ((size_t)(str - start + 1), keySymNamebuf); - (void) memmove(keySymName, start, str-start); + (void) memmove(keySymName, start, (size_t) (str-start)); keySymName[str-start] = '\0'; event->event.eventCode = StringToKeySym(keySymName, error); - event->event.eventCodeMask = ~0L; + event->event.eventCodeMask = (unsigned long) (~0L); } if (*error) { /* We never get here when keySymName hasn't been allocated */ @@ -1033,13 +1033,13 @@ static String ParseTable( *error = TRUE; return str; } - (void) memmove(tableSymName, start, str-start); + (void) memmove(tableSymName, start, (size_t) (str-start)); tableSymName[str-start] = '\0'; signature = StringToQuark(tableSymName); for (; table->signature != NULLQUARK; table++) if (table->signature == signature) { event->event.eventCode = table->value; - event->event.eventCodeMask = ~0L; + event->event.eventCodeMask = (unsigned long) (~0L); return str; } @@ -1089,9 +1089,9 @@ static String ParseAtom( *error = TRUE; return str; } - (void) memmove(atomName, start, str-start); + (void) memmove(atomName, start, (size_t) (str-start)); atomName[str-start] = '\0'; - event->event.eventCode = XrmStringToQuark(atomName); + event->event.eventCode = (TMLongCard) XrmStringToQuark(atomName); event->event.matchEvent = _XtMatchAtom; } return str; @@ -1142,8 +1142,8 @@ static String ParseEvent( && (event->event.modifiers | event->event.modifierMask) /* any */ && (event->event.modifiers != AnyModifier)) { - event->event.modifiers - |= buttonModifierMasks[event->event.eventCode]; + event->event.modifiers = (event->event.modifiers + | (TMLongCard) buttonModifierMasks[event->event.eventCode]); /* the button that is going up will always be in the modifiers... */ } @@ -1174,7 +1174,7 @@ static String ParseQuotedStringEvent( event->event.eventType = KeyPress; event->event.eventCode = StringToKeySym(s, error); if (*error) return PanicModeRecovery(str); - event->event.eventCodeMask = ~0L; + event->event.eventCodeMask = (unsigned long) (~0L); event->event.matchEvent = _XtMatchUsingStandardMods; event->event.standard = TRUE; @@ -1206,11 +1206,11 @@ static void RepeatDown( if ((upEvent->event.eventType == ButtonRelease) && (upEvent->event.modifiers != AnyModifier) && (upEvent->event.modifiers | upEvent->event.modifierMask)) - upEvent->event.modifiers - |= buttonModifierMasks[event->event.eventCode]; + upEvent->event.modifiers = (upEvent->event.modifiers + | (TMLongCard) buttonModifierMasks[event->event.eventCode]); if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += (reps - 1) * 2; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + (reps - 1) * 2); for (i=1; i<reps; i++) { @@ -1253,11 +1253,11 @@ static void RepeatDownPlus( if ((upEvent->event.eventType == ButtonRelease) && (upEvent->event.modifiers != AnyModifier) && (upEvent->event.modifiers | upEvent->event.modifierMask)) - upEvent->event.modifiers - |= buttonModifierMasks[event->event.eventCode]; + upEvent->event.modifiers = (upEvent->event.modifiers + | (TMLongCard) buttonModifierMasks[event->event.eventCode]); if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += reps * 2 - 1; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + reps * 2 - 1); for (i=0; i<reps; i++) { @@ -1307,11 +1307,11 @@ static void RepeatUp( if ((downEvent->event.eventType == ButtonPress) && (downEvent->event.modifiers != AnyModifier) && (downEvent->event.modifiers | downEvent->event.modifierMask)) - downEvent->event.modifiers - &= ~buttonModifierMasks[event->event.eventCode]; + downEvent->event.modifiers = (downEvent->event.modifiers + & (TMLongCard) (~buttonModifierMasks[event->event.eventCode])); if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += reps * 2 - 1; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + reps * 2 - 1); /* up */ event->next = XtNew(EventSeqRec); @@ -1363,11 +1363,11 @@ static void RepeatUpPlus( if ((downEvent->event.eventType == ButtonPress) && (downEvent->event.modifiers != AnyModifier) && (downEvent->event.modifiers | downEvent->event.modifierMask)) - downEvent->event.modifiers - &= ~buttonModifierMasks[event->event.eventCode]; + downEvent->event.modifiers = (downEvent->event.modifiers + & (TMLongCard) (~buttonModifierMasks[event->event.eventCode])); if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += reps * 2; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + reps * 2); for (i=0; i<reps; i++) { @@ -1404,7 +1404,7 @@ static void RepeatOther( tempEvent = event = *eventP; if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += reps - 1; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + reps - 1); for (i=1; i<reps; i++) { event->next = XtNew(EventSeqRec); @@ -1427,7 +1427,7 @@ static void RepeatOtherPlus( tempEvent = event = *eventP; if (event->event.lateModifiers) - event->event.lateModifiers->ref_count += reps - 1; + event->event.lateModifiers->ref_count = (unsigned short) (event->event.lateModifiers->ref_count + reps - 1); for (i=1; i<reps; i++) { event->next = XtNew(EventSeqRec); @@ -1482,11 +1482,11 @@ static String ParseRepeat( size_t len; ScanNumeric(str); - len = (str - start); + len = (size_t) (str - start); if (len < sizeof repStr) { (void) memmove(repStr, start, len); repStr[len] = '\0'; - *reps = StrToNum(repStr); + *reps = (int) StrToNum(repStr); } else { Syntax("Repeat count too large.", ""); *error = TRUE; @@ -1617,7 +1617,7 @@ static String ParseActionProc( *error = TRUE; return str; } - (void) memmove(procName, start, str-start); + (void) memmove(procName, start, (size_t) (str-start)); procName[str-start] = '\0'; *actionProcNameP = XrmStringToQuark( procName ); return str; @@ -1643,9 +1643,9 @@ static String ParseString( */ if (*str == '\\' && (*(str+1) == '"' || (*(str+1) == '\\' && *(str+2) == '"'))) { - len = prev_len + (str-start+2); + len = (unsigned) (prev_len + (str-start+2)); *strP = XtRealloc(*strP, len); - (void) memmove(*strP + prev_len, start, str-start); + (void) memmove(*strP + prev_len, start, (size_t) (str-start)); prev_len = len-1; str++; (*strP)[prev_len-1] = *str; @@ -1654,9 +1654,9 @@ static String ParseString( } str++; } - len = prev_len + (str-start+1); + len = (unsigned) (prev_len + (str-start+1)); *strP = XtRealloc(*strP, len); - (void) memmove( *strP + prev_len, start, str-start); + (void) memmove( *strP + prev_len, start, (size_t) (str-start)); (*strP)[len-1] = '\0'; if (*str == '"') str++; else XtWarningMsg(XtNtranslationParseError,"parseString", @@ -1672,7 +1672,7 @@ static String ParseString( && !IsNewline(*str) && *str != '\0') str++; *strP = __XtMalloc((unsigned)(str-start+1)); - (void) memmove(*strP, start, str-start); + (void) memmove(*strP, start, (size_t) (str-start)); (*strP)[str-start] = '\0'; } return str; @@ -1717,7 +1717,7 @@ static String ParseParamSeq( if (num_params != 0) { String *paramP = (String *) - __XtMalloc( (unsigned)(num_params+1) * sizeof(String) ); + __XtMalloc( (Cardinal)((num_params+1) * sizeof(String)) ); *paramSeqP = paramP; *paramNumP = num_params; paramP += num_params; /* list is LIFO right now */ @@ -1804,7 +1804,7 @@ static void ShowProduction( char *eol, *production, productionbuf[500]; eol = strchr(currentProduction, '\n'); - if (eol) len = eol - currentProduction; + if (eol) len = (size_t) (eol - currentProduction); else len = strlen (currentProduction); production = XtStackAlloc (len + 1, productionbuf); if (production == NULL) _XtAllocError (NULL); @@ -1869,7 +1869,7 @@ static String CheckForPoundSign( start = str; str = ScanIdent(str); len = MIN(19, str-start); - (void) memmove(operation, start, len); + (void) memmove(operation, start, (size_t) len); operation[len] = '\0'; if (!strcmp(operation,"replace")) opType = XtTableReplace; @@ -1941,7 +1941,7 @@ static XtTranslations ParseTranslationTable( XtFree((char *)parseTree->complexBranchHeadTbl); xlations = _XtCreateXlations(stateTrees, 1, NULL, NULL); - xlations->operation = actualOp; + xlations->operation = (unsigned char) actualOp; #ifdef notdef XtFree(stateTrees); diff --git a/src/TMprint.c b/src/TMprint.c index 6c469f1..95cda25 100644 --- a/src/TMprint.c +++ b/src/TMprint.c @@ -92,10 +92,10 @@ if (sb->current - sb->start > (int)sb->max - STR_THRESHOLD) \ } #define ExpandForChars(sb, nchars ) \ - if ((unsigned)(sb->current - sb->start) > sb->max - STR_THRESHOLD - nchars) { \ + if ((unsigned)(sb->current - sb->start) > (sb->max - STR_THRESHOLD - nchars)) { \ String old = sb->start; \ sb->start = XtRealloc(old, \ - (Cardinal)(sb->max += STR_INCAMOUNT + nchars)); \ + (Cardinal)(sb->max = (Cardinal)(sb->max + STR_INCAMOUNT + (Cardinal) nchars))); \ sb->current = sb->current - old + sb->start; \ } @@ -338,7 +338,7 @@ static void PrintActions( if (accelWidget) { /* accelerator */ String name = XtName(accelWidget); - int nameLen = strlen(name); + int nameLen = (int) strlen(name); ExpandForChars(sb, nameLen ); XtMemmove(sb->current, name, nameLen ); sb->current += nameLen; @@ -396,8 +396,8 @@ static Boolean LookAheadForCycleOrMulticlick( else if (typeMatch->eventType == _XtEventTimerEventType) continue; else /* not same event as starting event and not timer */ { - unsigned int type = sTypeMatch->eventType; - unsigned int t = typeMatch->eventType; + unsigned int type = (unsigned) sTypeMatch->eventType; + unsigned int t = (unsigned) typeMatch->eventType; if ( (type == ButtonPress && t != ButtonRelease) || (type == ButtonRelease && t != ButtonPress) || (type == KeyPress && t != KeyRelease) @@ -569,8 +569,8 @@ static void ProcessLaterMatches( branchHead, (state ? state->nextLevel : NULL), 0) == TM_NO_MATCH)) { - printData[*numPrintsRtn].tIndex = i; - printData[*numPrintsRtn].bIndex = j; + printData[*numPrintsRtn].tIndex = (TMShortCard) i; + printData[*numPrintsRtn].bIndex = (TMShortCard) j; (*numPrintsRtn)++; } } @@ -603,7 +603,7 @@ static void ProcessStateTree( == TM_NO_MATCH) { if (!branchHead->isSimple || branchHead->hasActions) { printData[*numPrintsRtn].tIndex = tIndex; - printData[*numPrintsRtn].bIndex = i; + printData[*numPrintsRtn].bIndex = (TMShortCard) i; (*numPrintsRtn)++; } LOCK_PROCESS; @@ -690,14 +690,14 @@ String _XtPrintXlations( sb->max = 1000; maxPrints = 0; for (i = 0; i < xlations->numStateTrees; i++) - maxPrints += - ((TMSimpleStateTree)(xlations->stateTreeTbl[i]))->numBranchHeads; + maxPrints = (TMShortCard) (maxPrints + + ((TMSimpleStateTree)(xlations->stateTreeTbl[i]))->numBranchHeads); prints = (PrintRec *) XtStackAlloc(maxPrints * sizeof(PrintRec), stackPrints); numPrints = 0; for (i = 0; i < xlations->numStateTrees; i++) - ProcessStateTree(prints, xlations, i, &numPrints); + ProcessStateTree(prints, xlations, (TMShortCard) i, &numPrints); for (i = 0; i < numPrints; i++) { TMSimpleStateTree stateTree = (TMSimpleStateTree) @@ -796,8 +796,8 @@ void _XtDisplayInstalledAccelerators( sb->max = 1000; maxPrints = 0; for (i = 0; i < xlations->numStateTrees; i++) - maxPrints += - ((TMSimpleStateTree)xlations->stateTreeTbl[i])->numBranchHeads; + maxPrints = (TMShortCard) (maxPrints + + ((TMSimpleStateTree)xlations->stateTreeTbl[i])->numBranchHeads); prints = (PrintRec *) XtStackAlloc(maxPrints * sizeof(PrintRec), stackPrints); @@ -809,7 +809,7 @@ void _XtDisplayInstalledAccelerators( i++, complexBindProcs++) { if (complexBindProcs->widget) { - ProcessStateTree(prints, xlations, i, &numPrints); + ProcessStateTree(prints, xlations, (TMShortCard) i, &numPrints); } } for (i = 0; i < numPrints; i++) { diff --git a/src/TMstate.c b/src/TMstate.c index fda9a23..87f6749 100644 --- a/src/TMstate.c +++ b/src/TMstate.c @@ -130,11 +130,11 @@ static TMShortCard GetBranchHead( if (parseTree->numBranchHeads == parseTree->branchHeadTblSize) { if (parseTree->branchHeadTblSize == 0) - parseTree->branchHeadTblSize += TM_BRANCH_HEAD_TBL_ALLOC; + parseTree->branchHeadTblSize = (TMShortCard) (parseTree->branchHeadTblSize + TM_BRANCH_HEAD_TBL_ALLOC); else - parseTree->branchHeadTblSize += - TM_BRANCH_HEAD_TBL_REALLOC; - newSize = (parseTree->branchHeadTblSize * sizeof(TMBranchHeadRec)); + parseTree->branchHeadTblSize = (TMShortCard) (parseTree->branchHeadTblSize + + TM_BRANCH_HEAD_TBL_REALLOC); + newSize = (TMShortCard) (parseTree->branchHeadTblSize * sizeof(TMBranchHeadRec)); if (parseTree->isStackBranchHeads) { TMBranchHead oldBranchHeadTbl = parseTree->branchHeadTbl; parseTree->branchHeadTbl = (TMBranchHead) __XtMalloc(newSize); @@ -144,7 +144,7 @@ static TMShortCard GetBranchHead( else { parseTree->branchHeadTbl = (TMBranchHead) XtRealloc((char *)parseTree->branchHeadTbl, - (parseTree->branchHeadTblSize * + (Cardinal)(parseTree->branchHeadTblSize * sizeof(TMBranchHeadRec))); } } @@ -161,7 +161,7 @@ static TMShortCard GetBranchHead( branchHead->isSimple = True; branchHead->hasActions = False; branchHead->hasCycles = False; - return parseTree->numBranchHeads-1; + return (TMShortCard) (parseTree->numBranchHeads - 1); } TMShortCard _XtGetQuarkIndex( @@ -183,10 +183,10 @@ TMShortCard _XtGetQuarkIndex( TMShortCard newSize; if (parseTree->quarkTblSize == 0) - parseTree->quarkTblSize += TM_QUARK_TBL_ALLOC; + parseTree->quarkTblSize = (TMShortCard) (parseTree->quarkTblSize + TM_QUARK_TBL_ALLOC); else - parseTree->quarkTblSize += TM_QUARK_TBL_REALLOC; - newSize = (parseTree->quarkTblSize * sizeof(XrmQuark)); + parseTree->quarkTblSize = (TMShortCard) (parseTree->quarkTblSize + TM_QUARK_TBL_REALLOC); + newSize = (TMShortCard) (parseTree->quarkTblSize * sizeof(XrmQuark)); if (parseTree->isStackQuarks) { XrmQuark *oldquarkTbl = parseTree->quarkTbl; @@ -197,7 +197,7 @@ TMShortCard _XtGetQuarkIndex( else { parseTree->quarkTbl = (XrmQuark *) XtRealloc((char *)parseTree->quarkTbl, - (parseTree->quarkTblSize * + (Cardinal)(parseTree->quarkTblSize * sizeof(XrmQuark))); } } @@ -223,11 +223,11 @@ static TMShortCard GetComplexBranchIndex( TMShortCard newSize; if (parseTree->complexBranchHeadTblSize == 0) - parseTree->complexBranchHeadTblSize += TM_COMPLEXBRANCH_HEAD_TBL_ALLOC; + parseTree->complexBranchHeadTblSize = (TMShortCard) (parseTree->complexBranchHeadTblSize + TM_COMPLEXBRANCH_HEAD_TBL_ALLOC); else - parseTree->complexBranchHeadTblSize += TM_COMPLEXBRANCH_HEAD_TBL_REALLOC; + parseTree->complexBranchHeadTblSize = (TMShortCard) (parseTree->complexBranchHeadTblSize + TM_COMPLEXBRANCH_HEAD_TBL_REALLOC); - newSize = (parseTree->complexBranchHeadTblSize * sizeof(StatePtr)); + newSize = (TMShortCard) (parseTree->complexBranchHeadTblSize * sizeof(StatePtr)); if (parseTree->isStackComplexBranchHeads) { StatePtr *oldcomplexBranchHeadTbl @@ -240,12 +240,12 @@ static TMShortCard GetComplexBranchIndex( else { parseTree->complexBranchHeadTbl = (StatePtr *) XtRealloc((char *)parseTree->complexBranchHeadTbl, - (parseTree->complexBranchHeadTblSize * + (Cardinal)(parseTree->complexBranchHeadTblSize * sizeof(StatePtr))); } } parseTree->complexBranchHeadTbl[parseTree->numComplexBranchHeads++] = NULL; - return parseTree->numComplexBranchHeads-1; + return (TMShortCard) (parseTree->numComplexBranchHeads - 1); } TMShortCard _XtGetTypeIndex( @@ -276,10 +276,10 @@ TMShortCard _XtGetTypeIndex( if (j == TM_TYPE_SEGMENT_SIZE) { if (_XtGlobalTM.numTypeMatchSegments == _XtGlobalTM.typeMatchSegmentTblSize) { - _XtGlobalTM.typeMatchSegmentTblSize += 4; + _XtGlobalTM.typeMatchSegmentTblSize = (TMShortCard) (_XtGlobalTM.typeMatchSegmentTblSize + 4); _XtGlobalTM.typeMatchSegmentTbl = (TMTypeMatch *) XtRealloc((char *)_XtGlobalTM.typeMatchSegmentTbl, - (_XtGlobalTM.typeMatchSegmentTblSize * sizeof(TMTypeMatch))); + (Cardinal)(_XtGlobalTM.typeMatchSegmentTblSize * sizeof(TMTypeMatch))); } _XtGlobalTM.typeMatchSegmentTbl[_XtGlobalTM.numTypeMatchSegments++] = segment = (TMTypeMatch) @@ -371,10 +371,10 @@ TMShortCard _XtGetModifierIndex( if (j == TM_MOD_SEGMENT_SIZE) { if (_XtGlobalTM.numModMatchSegments == _XtGlobalTM.modMatchSegmentTblSize) { - _XtGlobalTM.modMatchSegmentTblSize += 4; + _XtGlobalTM.modMatchSegmentTblSize = (TMShortCard) (_XtGlobalTM.modMatchSegmentTblSize + 4); _XtGlobalTM.modMatchSegmentTbl = (TMModifierMatch *) XtRealloc((char *)_XtGlobalTM.modMatchSegmentTbl, - (_XtGlobalTM.modMatchSegmentTblSize * sizeof(TMModifierMatch))); + (Cardinal)(_XtGlobalTM.modMatchSegmentTblSize * sizeof(TMModifierMatch))); } _XtGlobalTM.modMatchSegmentTbl[_XtGlobalTM.numModMatchSegments++] = segment = (TMModifierMatch) @@ -446,8 +446,8 @@ Boolean _XtRegularMatch( modMatch->lateModifiers, &computed, &computedMask); if (!resolved) return FALSE; - computed |= modMatch->modifiers; - computedMask |= modMatch->modifierMask; + computed = (Modifiers) (computed | modMatch->modifiers); + computedMask = (Modifiers) (computedMask | modMatch->modifierMask); return ( (computed & computedMask) == (eventSeq->event.modifiers & computedMask)); @@ -462,7 +462,7 @@ Boolean _XtMatchAtom( Atom atom; atom = XInternAtom(eventSeq->xev->xany.display, - XrmQuarkToString(typeMatch->eventCode), + XrmQuarkToString((XrmQuark)(typeMatch->eventCode)), False); return (atom == eventSeq->event.eventCode); } @@ -498,7 +498,7 @@ static void XEventToTMEvent( tmEvent->xev = event; tmEvent->event.eventCodeMask = 0; tmEvent->event.modifierMask = 0; - tmEvent->event.eventType = event->type; + tmEvent->event.eventType = (TMLongCard) event->type; tmEvent->event.lateModifiers = NULL; tmEvent->event.matchEvent = NULL; tmEvent->event.standard = FALSE; @@ -518,13 +518,13 @@ static void XEventToTMEvent( break; case MotionNotify: - tmEvent->event.eventCode = event->xmotion.is_hint; + tmEvent->event.eventCode = (TMLongCard) event->xmotion.is_hint; tmEvent->event.modifiers = event->xmotion.state; break; case EnterNotify: case LeaveNotify: - tmEvent->event.eventCode = event->xcrossing.mode; + tmEvent->event.eventCode = (TMLongCard) event->xcrossing.mode; tmEvent->event.modifiers = event->xcrossing.state; break; @@ -554,13 +554,13 @@ static void XEventToTMEvent( break; case MappingNotify: - tmEvent->event.eventCode = event->xmapping.request; + tmEvent->event.eventCode = (TMLongCard) event->xmapping.request; tmEvent->event.modifiers = 0; break; case FocusIn: case FocusOut: - tmEvent->event.eventCode = event->xfocus.mode; + tmEvent->event.eventCode = (TMLongCard) event->xfocus.mode; tmEvent->event.modifiers = 0; break; @@ -699,7 +699,7 @@ static void PushContext( !(context->matches[i].isCycleStart); i++){}; if (i < context->numMatches) - context->numMatches = i+1; + context->numMatches = (TMShortCard) (i + 1); #ifdef DEBUG else XtWarning("pushing cycle end with no cycle start"); @@ -710,12 +710,12 @@ static void PushContext( if (context->numMatches == context->maxMatches) { if (context->maxMatches == 0) - context->maxMatches += TM_CONTEXT_MATCHES_ALLOC; + context->maxMatches = (TMShortCard) (context->maxMatches + TM_CONTEXT_MATCHES_ALLOC); else - context->maxMatches += TM_CONTEXT_MATCHES_REALLOC; + context->maxMatches = (TMShortCard) (context->maxMatches + TM_CONTEXT_MATCHES_REALLOC); context->matches = (MatchPairRec *) XtRealloc((char *)context->matches, - context->maxMatches * sizeof(MatchPairRec)); + (Cardinal)(context->maxMatches * sizeof(MatchPairRec))); } context->matches[context->numMatches].isCycleStart = newState->isCycleStart; context->matches[context->numMatches].isCycleEnd = newState->isCycleEnd; @@ -901,7 +901,7 @@ static int MatchComplexBranch( TMShortCard i; LOCK_PROCESS; - for (i = startIndex; i < stateTree->numComplexBranchHeads; i++) + for (i = (TMShortCard) startIndex; i < stateTree->numComplexBranchHeads; i++) { StatePtr candState; TMShortCard numMatches = context->numMatches; @@ -981,7 +981,7 @@ static StatePtr TryCurrentTree( XEvent *xev = curEventPtr->xev; unsigned long time = GetTime(tmRecPtr, xev); XtPerDisplay pd = _XtGetPerDisplay(xev->xany.display); - unsigned long delta = pd->multi_click_time; + unsigned long delta = (unsigned long) pd->multi_click_time; if ((tmRecPtr->lastEventTime + delta) >= time) { if (nextState->actions) { @@ -1093,7 +1093,7 @@ void _XtTranslateEvent ( XtAppWarningMsg(XtWidgetToApplicationContext(w), XtNtranslationError,"nullTable",XtCXtToolkitError, "Can't translate event through NULL table", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return ; } if (current_state == NULL) @@ -1184,7 +1184,7 @@ static EventMask EventToMask( unsigned long eventType = typeMatch->eventType; if (eventType == MotionNotify) { - Modifiers modifierMask = modMatch->modifierMask; + Modifiers modifierMask = (Modifiers) modMatch->modifierMask; Modifiers tempMask; returnMask = 0; @@ -1211,7 +1211,7 @@ static EventMask EventToMask( returnMask |= Button5MotionMask; return returnMask; } - returnMask = _XtConvertTypeToMask(eventType); + returnMask = _XtConvertTypeToMask((int)eventType); if (returnMask == (StructureNotifyMask|SubstructureNotifyMask)) returnMask = StructureNotifyMask; return returnMask; @@ -1285,7 +1285,7 @@ void _XtInstallTranslations( _XtTraverseStateTree(stateTree, AggregateEventMask, (XtPointer)&xlations->eventMask); - mappingNotifyInterest |= stateTree->simple.mappingNotifyInterest; + mappingNotifyInterest = (Boolean) (mappingNotifyInterest | stateTree->simple.mappingNotifyInterest); } /* double click needs to make sure that you have selected on both button down and up. */ @@ -1339,7 +1339,7 @@ void _XtRemoveTranslations( i++) { stateTree = (TMSimpleStateTree)xlations->stateTreeTbl[i]; - mappingNotifyInterest |= stateTree->mappingNotifyInterest; + mappingNotifyInterest = (Boolean) (mappingNotifyInterest | stateTree->mappingNotifyInterest); } if (mappingNotifyInterest) RemoveFromMappingCallbacks(widget, (XtPointer)widget, NULL); @@ -1399,7 +1399,7 @@ void XtUninstallTranslations( _XtUninstallTranslations(widget); if (XtIsRealized(widget) && oldMask) XSelectInput(XtDisplay(widget), XtWindow(widget), - XtBuildEventMask(widget)); + (long) XtBuildEventMask(widget)); hookobj = XtHooksOfDisplay(XtDisplayOfObject(widget)); if (XtHasCallbacks(hookobj, XtNchangeHook) == XtCallbackHasSome) { XtChangeHookDataRec call_data; @@ -1423,8 +1423,8 @@ XtTranslations _XtCreateXlations( TMShortCard i; xlations = (XtTranslations) - __XtMalloc(sizeof(TranslationData) + - (numStateTrees-1) * sizeof(TMStateTree)); + __XtMalloc((Cardinal)(sizeof(TranslationData) + + (numStateTrees - 1) * sizeof(TMStateTree))); #ifdef TRACE_TM LOCK_PROCESS; if (_XtGlobalTM.numTms == _XtGlobalTM.tmTblSize) { @@ -1463,7 +1463,7 @@ TMStateTree _XtParseTreeToStateTree( complexTree = XtNew(TMComplexStateTreeRec); complexTree->isSimple = False; - tableSize = parseTree->numComplexBranchHeads * sizeof(StatePtr); + tableSize = (unsigned) (parseTree->numComplexBranchHeads * sizeof(StatePtr)); complexTree->complexBranchHeadTbl = (StatePtr *) __XtMalloc(tableSize); XtMemmove(complexTree->complexBranchHeadTbl, @@ -1480,13 +1480,13 @@ TMStateTree _XtParseTreeToStateTree( simpleTree->refCount = 0; simpleTree->mappingNotifyInterest = parseTree->mappingNotifyInterest; - tableSize = parseTree->numBranchHeads * sizeof(TMBranchHeadRec); + tableSize = (unsigned) (parseTree->numBranchHeads * sizeof(TMBranchHeadRec)); simpleTree->branchHeadTbl = (TMBranchHead) __XtMalloc(tableSize); XtMemmove(simpleTree->branchHeadTbl, parseTree->branchHeadTbl, tableSize); simpleTree->numBranchHeads = parseTree->numBranchHeads; - tableSize = parseTree->numQuarks * sizeof(XrmQuark); + tableSize = (unsigned) (parseTree->numQuarks * sizeof(XrmQuark)); simpleTree->quarkTbl = (XrmQuark *) __XtMalloc(tableSize); XtMemmove(simpleTree->quarkTbl, parseTree->quarkTbl, tableSize); simpleTree->numQuarks = parseTree->numQuarks; @@ -1501,7 +1501,7 @@ static void FreeActions( TMShortCard i; for (action = actions; action;) { ActionPtr nextAction = action->next; - for (i = action->num_params; i;) { + for (i = (TMShortCard) action->num_params; i;) { XtFree( action->params[--i] ); } XtFree( (char*)action->params ); @@ -1535,7 +1535,7 @@ static void AmbigActions( XtWarningMsg (XtNtranslationError,"ambiguousActions", XtCXtToolkitError, "Overriding earlier translation manager actions.", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); FreeActions((*state)->actions); (*state)->actions = NULL; @@ -1659,7 +1659,7 @@ Boolean _XtCvtMergeTranslations( if (*num_args != 0) XtWarningMsg("invalidParameters","mergeTranslations",XtCXtToolkitError, "MergeTM to TranslationTable needs no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); if (to->addr != NULL && to->size < sizeof(XtTranslations)) { to->size = sizeof(XtTranslations); @@ -1669,7 +1669,7 @@ Boolean _XtCvtMergeTranslations( first = ((TMConvertRec*)from->addr)->old; second = ((TMConvertRec*)from->addr)->new; - numStateTrees = first->numStateTrees + second->numStateTrees; + numStateTrees = (TMShortCard) (first->numStateTrees + second->numStateTrees); stateTrees = (TMStateTree *) XtStackAlloc(numStateTrees * sizeof(TMStateTree), stackStateTrees); @@ -1773,7 +1773,7 @@ static XtTranslations UnmergeTranslations( if (xlations->composers[1]) { second = UnmergeTranslations(widget, xlations->composers[1], unmergeXlations, - currIndex + + (TMShortCard)currIndex + xlations->composers[0]->numStateTrees, oldBindings, numOldBindings, newBindings, numNewBindingsRtn); @@ -1908,14 +1908,14 @@ static TMBindData MakeBindData( isComplex = (i < numBindings); if (isComplex) bytes = (sizeof(TMComplexBindDataRec) + - ((numBindings - 1) * + ((TMLongCard)(numBindings - 1) * sizeof(TMComplexBindProcsRec))); else bytes = (sizeof(TMSimpleBindDataRec) + - ((numBindings - 1) * + ((TMLongCard)(numBindings - 1) * sizeof(TMSimpleBindProcsRec))); - bindData = (TMBindData) __XtCalloc(sizeof(char), bytes); + bindData = (TMBindData) __XtCalloc((Cardinal) sizeof(char), (Cardinal) bytes); bindData->simple.isComplex = isComplex; if (isComplex) { TMComplexBindData cBindData = (TMComplexBindData)bindData; @@ -1961,7 +1961,7 @@ static Boolean ComposeTranslations( XtAppWarningMsg(XtWidgetToApplicationContext(dest), XtNtranslationError,"nullTable",XtCXtToolkitError, "table to (un)merge must not be null", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return False; } @@ -2020,7 +2020,7 @@ static Boolean ComposeTranslations( (&((TMSimpleBindData)bindData)->bindTbl[0]); } - numBytes =(((oldXlations ? oldXlations->numStateTrees : 0) + numBytes =(TMShortCard) (((oldXlations ? oldXlations->numStateTrees : 0) + newXlations->numStateTrees) * sizeof(TMComplexBindProcsRec)); newBindings = (TMComplexBindProcs) XtStackAlloc(numBytes, stackBindings); XtBZero((char *)newBindings, numBytes); @@ -2072,7 +2072,7 @@ static Boolean ComposeTranslations( mask = newTable->eventMask; if (mask != oldMask) XSelectInput(XtDisplay(dest), XtWindow(dest), - XtBuildEventMask(dest)); + (long) XtBuildEventMask(dest)); } XtStackFree((XtPointer)newBindings, (XtPointer)stackBindings); return(newTable != NULL); @@ -2113,8 +2113,8 @@ XtTranslations _XtGetTranslationValue( Cardinal numBindings = xlations->numStateTrees; (*aXlationsPtr) = aXlations = (ATranslations) - __XtMalloc(sizeof(ATranslationData) + - (numBindings - 1) * sizeof(TMComplexBindProcsRec)); + __XtMalloc((Cardinal) (sizeof(ATranslationData) + + (numBindings - 1) * sizeof(TMComplexBindProcsRec))); aXlations->hasBindings = True; aXlations->xlations = xlations; @@ -2193,7 +2193,7 @@ void _XtFreeTranslations( XtAppWarningMsg(app, "invalidParameters","freeTranslations",XtCXtToolkitError, "Freeing XtTranslations requires no extra arguments", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); xlations = *(XtTranslations*)toVal->addr; for (i = 0; i < (int)xlations->numStateTrees; i++) diff --git a/src/Threads.c b/src/Threads.c index 7ae9e18..ee19c2e 100644 --- a/src/Threads.c +++ b/src/Threads.c @@ -199,7 +199,7 @@ AppUnlock(XtAppContext app) xmutex_unlock(app_lock->mutex); #else xthread_t self; - + (void)self; self = xthread_self(); xmutex_lock(app_lock->mutex); assert(xthread_equal(app_lock->holder, self)); @@ -236,7 +236,7 @@ YieldAppLock( unsigned ii; app_lock->stack.st = (struct _Tstack *) XtRealloc ((char *)app_lock->stack.st, - (app_lock->stack.size + STACK_INCR) * sizeof (struct _Tstack)); + (Cardinal)((app_lock->stack.size + STACK_INCR) * sizeof (struct _Tstack))); ii = app_lock->stack.size; app_lock->stack.size += STACK_INCR; for ( ; ii < app_lock->stack.size; ii++) { diff --git a/src/VarCreate.c b/src/VarCreate.c index 4f5058c..ad07253 100644 --- a/src/VarCreate.c +++ b/src/VarCreate.c @@ -298,7 +298,7 @@ _XtVaOpenApplication( count++; typed_args = (XtTypedArgList) XtRealloc((char *) typed_args, - (unsigned) (count + 1) * sizeof(XtTypedArg)); + (Cardinal) ((size_t)(count + 1) * sizeof(XtTypedArg))); } typed_args[count].name = NULL; diff --git a/src/VarGet.c b/src/VarGet.c index ccd4d10..ce66e6f 100644 --- a/src/VarGet.c +++ b/src/VarGet.c @@ -149,7 +149,7 @@ GetTypedArg( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "unknownType", XtNxtGetTypedArg, XtCXtToolkitError, "Unable to find type of resource for conversion", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return; } diff --git a/src/Varargs.c b/src/Varargs.c index b33e287..0e1900b 100644 --- a/src/Varargs.c +++ b/src/Varargs.c @@ -138,7 +138,7 @@ XtTypedArgList _XtVaCreateTypedArgList(va_list var, register int count) XtTypedArgList avlist; avlist = (XtTypedArgList) - __XtCalloc((int)count + 1, (unsigned)sizeof(XtTypedArg)); + __XtCalloc((Cardinal)count + 1, (unsigned)sizeof(XtTypedArg)); for(attr = va_arg(var, String), count = 0; attr != NULL; attr = va_arg(var, String)) { @@ -185,7 +185,7 @@ TypedArgToArg( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "nullWidget", XtNxtConvertVarToArgList, XtCXtToolkitError, "XtVaTypedArg conversion needs non-NULL widget handle", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return(0); } @@ -201,12 +201,12 @@ TypedArgToArg( XtAppWarningMsg(XtWidgetToApplicationContext(widget), "unknownType", XtNxtConvertVarToArgList, XtCXtToolkitError, "Unable to find type of resource for conversion", - (String *)NULL, (Cardinal *)NULL); + NULL, NULL); return(0); } to_val.addr = NULL; - from_val.size = typed_arg->size; + from_val.size = (Cardinal) typed_arg->size; if ((strcmp(typed_arg->type, XtRString) == 0) || ((unsigned) typed_arg->size > sizeof(XtArgVal))) { from_val.addr = (XPointer)typed_arg->value; @@ -221,7 +221,7 @@ TypedArgToArg( UNLOCK_PROCESS; XtAppWarningMsg(XtWidgetToApplicationContext(widget), "conversionFailed", XtNxtConvertVarToArgList, XtCXtToolkitError, - "Type conversion failed", (String *)NULL, (Cardinal *)NULL); + "Type conversion failed", NULL, NULL); return(0); } @@ -243,7 +243,7 @@ TypedArgToArg( else if (to_val.size == sizeof(XtArgVal)) arg_return->value = *(XtArgVal *)to_val.addr; else if (to_val.size > sizeof(XtArgVal)) { - arg_return->value = (XtArgVal) __XtMalloc(to_val.size); + arg_return->value = (XtArgVal) (void *) __XtMalloc(to_val.size); memory_return->value = (XtArgVal) memcpy((void *)arg_return->value, to_val.addr, to_val.size); } @@ -359,7 +359,7 @@ _XtVaToArgList( return; } - args = (ArgList)__XtMalloc((unsigned)(max_count * 2 * sizeof(Arg))); + args = (ArgList)__XtMalloc((Cardinal)((size_t)(max_count * 2) * sizeof(Arg))); for (count = max_count * 2; --count >= 0; ) args[count].value = (XtArgVal) NULL; count = 0; @@ -435,7 +435,7 @@ GetResources( cons_top = constraint; *res_list = (XtResourceList) XtRealloc((char*)*res_list, - ((*number + num_constraint) * + (Cardinal)((*number + num_constraint) * sizeof(XtResource))); for (temp= num_constraint, res= *res_list + *number; temp != 0; temp--) @@ -491,7 +491,7 @@ _XtVaToTypedArgList( int count; args = (XtTypedArgList) - __XtMalloc((unsigned)(max_count * sizeof(XtTypedArg))); + __XtMalloc((Cardinal)((size_t) max_count * sizeof(XtTypedArg))); for(attr = va_arg(var, String), count = 0 ; attr != NULL; attr = va_arg(var, String)) { @@ -513,5 +513,5 @@ _XtVaToTypedArgList( } *args_return = args; - *num_args_return = count; + *num_args_return = (Cardinal) count; } diff --git a/util/makestrs.c b/util/makestrs.c index e626dee..774faa4 100644 --- a/util/makestrs.c +++ b/util/makestrs.c @@ -151,7 +151,7 @@ static void IntelABIWriteHeader (FILE *f, File *phile) externrefstr, conststr ? conststr : fileprotstr, t->name); for (te = t->tableent; te; te = te->next) { (void) fprintf (f, - "#ifndef %s%s\n#define %s%s ((char*)&%s[%lu])\n#endif\n", + "#ifndef %s%s\n#define %s%s ((String)&%s[%lu])\n#endif\n", prefixstr, te->left, prefixstr, te->left, t->name, (unsigned long) te->offset); } @@ -230,7 +230,7 @@ static void DefaultWriteHeader (FILE *f, File *phile) for (t = phile->table; t; t = t->next) { for (te = t->tableent; te; te = te->next) { (void) fprintf (f, - "#ifndef %s%s\n#define %s%s ((char*)&%s[%lu])\n#endif\n", + "#ifndef %s%s\n#define %s%s ((String)&%s[%lu])\n#endif\n", prefixstr, te->left, prefixstr, te->left, phile->table->name, (unsigned long) te->offset); } |