From a35c50297bd4c2d388b8d903c4d90ce816bdb0c4 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 28 Feb 2008 17:21:40 -0300 Subject: [PATCH] libX11 ansification. This patch was done only by viewing file by file, but should be safe to apply as "ansified" functions did not have "promotable" arguments. There are several functions that use char/short arguments, and are already ansified. This should not be a problem, and none should compile code without function prototypes, but here is a listing: src/UIThrStubs.c not ansified to avoid possibility of creating binary incompatibilities, but probably should really define "ansified" stubs for thread functions. "Standard functions" i.e. functions defined in header in /usr/include/X11 with char or short arguments (should use #if NeedWidePrototypes): src/xkb/XKBBind.c: XkbLookupKeySym() XkbToControl() XkbTranslateKey() XkbTranslateKeyCode() src/xkb/XKBMisc.c: XkbApplyCompatMapToKey() XkbUpdateMapFromCore() "Extern functions" i.e. functions defined in private header files that may be used by different files, with char or short arguments: src/KeyBind.c: _XTranslateKey() modules/im/ximcp/imDefLkup.c: _XimRespSyncReply() modules/im/ximcp/imCallbk.c: _XimCbDispatch() modules/im/ximcp/imDefLkup.c: _XimCommitCallback() _XimError() _XimErrorCallback() _XimForwardEventCallback() _XimRegisterTriggerKeysCallback() _XimSetEventMaskCallback() _XimSyncCallback() modules/im/ximcp/imDispch.c: _XimRegProtoIntrCallback() modules/im/ximcp/imExten.c: _XimExtenMove() modules/im/ximcp/imRmAttr.c: _XimDecodeIMATTRIBUTE() _XimDecodeICATTRIBUTE() modules/im/ximcp/imTrans.c: _XimTransCallDispatcher() _XimTransWrite() _XimWrite() "Extern functions that receive a pointer function argument that wants 16 bit arguments": modules/im/ximcp/imTransR.c: _XimRead() _XimRegisterDispatcher() "Static functions" that used char or short arguments. Listed only for information, as it is unlikely that these functions will be made extern, but they are also frequently those "callbacks" that need 16 bit arguments: modules/im/ximcp/imDefIc.c: _XimCreateICCheck() _XimDestroyICCheck() _XimGetICValuesCheck() _XimResetICCheck() _XimSetICValuesCheck() modules/im/ximcp/imDefIm.c: _XimAllRecv() _XimCloseCheck() _XimDisconnectCheck() _XimEncodingNegoCheck() _XimGetEncoding() _XimGetIMValuesCheck() _XimOpenCheck() _XimSetIMValuesCheck() modules/im/ximcp/imDefLkup.c: _XimSyncCheck() _XimTriggerNotifyCheck() modules/im/ximcp/imDispch.c: _XimTransportIntr() modules/im/ximcp/imExten.c: _XimCountNumberOfExtension() _XimExtMove() _XimExtForwardKeyEventCheck() _XimExtSetEventMaskCallback() _XimQueryExtensionCheck() modules/im/ximcp/imRm.c: _XimSetResourceList() _XimGetResourceListRecByMode() modules/im/ximcp/imRmAttr.c: _XimAttributeToValue() _XimCountNumberOfAttr() modules/im/ximcp/imThaiFlt.c: IC_RealGetPreviousChar() THAI_apply_write_rules() THAI_apply_scm() THAI_chlevel() THAI_chtype() THAI_isaccepted() THAI_iscons() THAI_iscomposible() THAI_isdead() THAI_istone() THAI_isvowel() ThaiFltAcceptInput() ThaiFltReorderInput() ThaiFltReplaceInput() XThaiTranslateKey() modules/im/ximcp/imTrX.c: _XimXCallDispatcher() _XimXWrite() modules/im/ximcp/imTransR.c: _XimCallDispatcher() _XimReadData() modules/lc/def/lcDefConv.c: get_charset() The callbacks with 16 bit arguments are defined in src/xlibi18n/XimintP.h, see XimProtoIntrProc and XimTransCallDispatcher. No listing of functions retuning char/short was done, but there are also several such functions. --- modules/im/ximcp/imDefIc.c | 56 +++++++-------- modules/im/ximcp/imDefLkup.c | 14 ++-- modules/im/ximcp/imDispch.c | 6 +- modules/im/ximcp/imInsClbk.c | 3 +- modules/im/ximcp/imInt.c | 11 +-- modules/im/ximcp/imLcFlt.c | 10 ++-- modules/im/ximcp/imLcGIc.c | 6 +- modules/im/ximcp/imLcIm.c | 3 +- modules/im/ximcp/imLcLkup.c | 84 ++++++++++++------------ modules/im/ximcp/imLcSIc.c | 6 +- modules/im/ximcp/imRm.c | 46 ++++++------- modules/im/ximcp/imThaiFlt.c | 44 +++++++++--- modules/im/ximcp/imThaiIm.c | 12 +-- modules/im/ximcp/imTrX.c | 6 +- modules/im/ximcp/imTransR.c | 26 +++---- modules/om/generic/omGeneric.c | 26 ------- modules/om/generic/omImText.c | 4 - src/ConnDis.c | 30 ++++---- src/Context.c | 18 +++--- src/OpenDis.c | 9 +-- src/ParseGeom.c | 3 +- src/XlibInt.c | 64 +++++++++--------- src/globals.c | 121 --------------------------------- src/locking.c | 69 ++++++++++--------- src/os2Stubs.c | 24 ++++--- src/udcInf.c | 146 +++++++++++++++++++++------------------ src/xlibi18n/ICWrap.c | 63 ++++++++---------- src/xlibi18n/IMWrap.c | 33 ++++----- src/xlibi18n/Xaixlcint.h | 2 +- src/xlibi18n/XlcSL.c | 6 +- src/xlibi18n/lcCT.c | 2 +- src/xlibi18n/lcFile.c | 22 +++--- src/xlibi18n/lcGeneric.c | 3 +- src/xlibi18n/lcInit.c | 4 +- src/xlibi18n/lcWrap.c | 4 +- 35 files changed, 420 insertions(+), 566 deletions(-) diff --git a/modules/im/ximcp/imDefIc.c b/modules/im/ximcp/imDefIc.c index c04744b..5643167 100644 --- a/modules/im/ximcp/imDefIc.c +++ b/modules/im/ximcp/imDefIc.c @@ -63,8 +63,7 @@ _XimCreateICCheck( #ifdef XIM_CONNECTABLE Public Bool -_XimReCreateIC(ic) - Xic ic; +_XimReCreateIC(Xic ic) { Xim im = (Xim)ic->core.im; Xic save_ic; @@ -226,9 +225,9 @@ ErrorOnReCreateIC: } Private char * -_XimDelayModeGetICValues(ic, arg) - Xic ic; - XIMArg *arg; +_XimDelayModeGetICValues( + Xic ic, + XIMArg *arg) { XimDefICValues ic_values; @@ -406,11 +405,11 @@ _XimProtoGetICValues( #ifdef XIM_CONNECTABLE Private Bool -_XimCheckNestQuarkList(quark_list, num_quark, quark, separator) - XrmQuark *quark_list; - int num_quark; - XrmQuark quark; - XrmQuark separator; +_XimCheckNestQuarkList( + XrmQuark *quark_list, + int num_quark, + XrmQuark quark, + XrmQuark separator) { register int i; @@ -426,12 +425,12 @@ _XimCheckNestQuarkList(quark_list, num_quark, quark, separator) } Private Bool -_XimCheckNestedQuarkList(quark_list, idx, num_quark, arg, separator) - XrmQuark **quark_list; - int idx; - int *num_quark; - XIMArg *arg; - XrmQuark separator; +_XimCheckNestedQuarkList( + XrmQuark **quark_list, + int idx, + int *num_quark, + XIMArg *arg, + XrmQuark separator) { XrmQuark *q_list = *quark_list; int n_quark = *num_quark; @@ -467,11 +466,11 @@ _XimCheckNestedQuarkList(quark_list, idx, num_quark, arg, separator) } Private Bool -_XimCheckICQuarkList(quark_list, num_quark, quark, idx) - XrmQuark *quark_list; - int num_quark; - XrmQuark quark; - int *idx; +_XimCheckICQuarkList( + XrmQuark *quark_list, + int num_quark, + XrmQuark quark, + int *idx) { register int i; @@ -485,9 +484,9 @@ _XimCheckICQuarkList(quark_list, num_quark, quark, idx) } Private Bool -_XimSaveICValues(ic, arg) - Xic ic; - XIMArg *arg; +_XimSaveICValues( + Xic ic, + XIMArg *arg) { register XIMArg *p; register int n; @@ -592,9 +591,9 @@ _XimSaveICValues(ic, arg) } Private char * -_XimDelayModeSetICValues(ic, arg) - Xic ic; - XIMArg *arg; +_XimDelayModeSetICValues( + Xic ic, + XIMArg *arg) { XimDefICValues ic_values; char *name; @@ -1342,8 +1341,7 @@ _XimDelayModeCreateIC( } Public Bool -_XimReconnectModeCreateIC(ic) - Xic ic; +_XimReconnectModeCreateIC(Xic ic) { Xim im = (Xim)ic->core.im; int len; diff --git a/modules/im/ximcp/imDefLkup.c b/modules/im/ximcp/imDefLkup.c index 66e4add..e73b80f 100644 --- a/modules/im/ximcp/imDefLkup.c +++ b/modules/im/ximcp/imDefLkup.c @@ -893,13 +893,13 @@ _Ximctsconvert( } Public int -_Ximctstombs(xim, from, from_len, to, to_len, state) - XIM xim; - char *from; - int from_len; - char *to; - int to_len; - Status *state; +_Ximctstombs( + XIM xim, + char *from, + int from_len, + char *to, + int to_len, + Status *state) { return _Ximctsconvert(((Xim)xim)->private.proto.ctom_conv, from, from_len, to, to_len, state); diff --git a/modules/im/ximcp/imDispch.c b/modules/im/ximcp/imDispch.c index c0c4bc7..628f6dd 100644 --- a/modules/im/ximcp/imDispch.c +++ b/modules/im/ximcp/imDispch.c @@ -63,8 +63,7 @@ _XimRegProtoIntrCallback( } Public void -_XimFreeProtoIntrCallback(im) - Xim im; +_XimFreeProtoIntrCallback(Xim im) { register XimProtoIntrRec *rec, *next; @@ -99,8 +98,7 @@ _XimTransportIntr( } Public Bool -_XimDispatchInit(im) - Xim im; +_XimDispatchInit(Xim im) { if (_XimRegisterDispatcher(im, _XimTransportIntr, (XPointer)im)) return True; diff --git a/modules/im/ximcp/imInsClbk.c b/modules/im/ximcp/imInsClbk.c index ac39f9d..3f384f4 100644 --- a/modules/im/ximcp/imInsClbk.c +++ b/modules/im/ximcp/imInsClbk.c @@ -271,8 +271,7 @@ _XimUnRegisterIMInstantiateCallback( Public void -_XimResetIMInstantiateCallback( xim ) - Xim xim; +_XimResetIMInstantiateCallback(Xim xim) { char locale[XIM_MAXLCNAMELEN]; XimInstCallback icb; diff --git a/modules/im/ximcp/imInt.c b/modules/im/ximcp/imInt.c index c759cf3..01c9f3d 100644 --- a/modules/im/ximcp/imInt.c +++ b/modules/im/ximcp/imInt.c @@ -75,8 +75,7 @@ _XimSetIMStructureList( } Public void -_XimDestroyIMStructureList(im) - Xim im; +_XimDestroyIMStructureList(Xim im) { register int i; @@ -90,8 +89,7 @@ _XimDestroyIMStructureList(im) } Public void -_XimServerDestroy(im_2_destroy) - Xim im_2_destroy; +_XimServerDestroy(Xim im_2_destroy) { register int i; Xim im; @@ -125,7 +123,7 @@ _XimServerDestroy(im_2_destroy) #ifdef XIM_CONNECTABLE Public void -_XimServerReconectableDestroy() +_XimServerReconectableDestroy(void) { register int i; Xim im; @@ -259,8 +257,7 @@ Error1: } Public Bool -_XInitIM(lcd) - XLCd lcd; +_XInitIM(XLCd lcd) { if(lcd == (XLCd)NULL) return False; diff --git a/modules/im/ximcp/imLcFlt.c b/modules/im/ximcp/imLcFlt.c index 3b8f69e..dcf9523 100644 --- a/modules/im/ximcp/imLcFlt.c +++ b/modules/im/ximcp/imLcFlt.c @@ -40,11 +40,11 @@ PERFORMANCE OF THIS SOFTWARE. #include "Ximint.h" Bool -_XimLocalFilter(d, w, ev, client_data) - Display *d; - Window w; - XEvent *ev; - XPointer client_data; +_XimLocalFilter( + Display *d, + Window w, + XEvent *ev, + XPointer client_data) { Xic ic = (Xic)client_data; KeySym keysym; diff --git a/modules/im/ximcp/imLcGIc.c b/modules/im/ximcp/imLcGIc.c index e4f89a0..18a0645 100644 --- a/modules/im/ximcp/imLcGIc.c +++ b/modules/im/ximcp/imLcGIc.c @@ -36,9 +36,9 @@ PERFORMANCE OF THIS SOFTWARE. #include "Ximint.h" Public char * -_XimLocalGetICValues(xic, values) - XIC xic; - XIMArg *values; +_XimLocalGetICValues( + XIC xic, + XIMArg *values) { Xic ic = (Xic)xic; XimDefICValues ic_values; diff --git a/modules/im/ximcp/imLcIm.c b/modules/im/ximcp/imLcIm.c index b1bbce5..16de02d 100644 --- a/modules/im/ximcp/imLcIm.c +++ b/modules/im/ximcp/imLcIm.c @@ -96,8 +96,7 @@ Private int _XimCachedDefaultTreeRefcount = 0; Public Bool -_XimCheckIfLocalProcessing(im) - Xim im; +_XimCheckIfLocalProcessing(Xim im) { FILE *fp; char *name; diff --git a/modules/im/ximcp/imLcLkup.c b/modules/im/ximcp/imLcLkup.c index b6a6ff6..053c7ce 100644 --- a/modules/im/ximcp/imLcLkup.c +++ b/modules/im/ximcp/imLcLkup.c @@ -46,13 +46,13 @@ PERFORMANCE OF THIS SOFTWARE. #include "Ximint.h" Public int -_XimLocalMbLookupString(xic, ev, buffer, bytes, keysym, status) - XIC xic; - XKeyEvent *ev; - char *buffer; - int bytes; - KeySym *keysym; - Status *status; +_XimLocalMbLookupString( + XIC xic, + XKeyEvent *ev, + char *buffer, + int bytes, + KeySym *keysym, + Status *status) { Xic ic = (Xic)xic; int ret; @@ -125,13 +125,13 @@ _XimLocalMbLookupString(xic, ev, buffer, bytes, keysym, status) } Public int -_XimLocalWcLookupString(xic, ev, buffer, wlen, keysym, status) - XIC xic; - XKeyEvent *ev; - wchar_t *buffer; - int wlen; - KeySym *keysym; - Status *status; +_XimLocalWcLookupString( + XIC xic, + XKeyEvent *ev, + wchar_t *buffer, + int wlen, + KeySym *keysym, + Status *status) { Xic ic = (Xic)xic; int ret; @@ -202,13 +202,13 @@ _XimLocalWcLookupString(xic, ev, buffer, wlen, keysym, status) } Public int -_XimLocalUtf8LookupString(xic, ev, buffer, bytes, keysym, status) - XIC xic; - XKeyEvent *ev; - char *buffer; - int bytes; - KeySym *keysym; - Status *status; +_XimLocalUtf8LookupString( + XIC xic, + XKeyEvent *ev, + char *buffer, + int bytes, + KeySym *keysym, + Status *status) { Xic ic = (Xic)xic; int ret; @@ -341,26 +341,26 @@ _XimLcctsconvert( } Public int -_XimLcctstombs(xim, from, from_len, to, to_len, state) - XIM xim; - char *from; - int from_len; - char *to; - int to_len; - Status *state; +_XimLcctstombs( + XIM xim, + char *from, + int from_len, + char *to, + int to_len, + Status *state) { return _XimLcctsconvert(((Xim)xim)->private.local.ctom_conv, from, from_len, to, to_len, state); } Public int -_XimLcctstowcs(xim, from, from_len, to, to_len, state) - XIM xim; - char *from; - int from_len; - wchar_t *to; - int to_len; - Status *state; +_XimLcctstowcs( + XIM xim, + char *from, + int from_len, + wchar_t *to, + int to_len, + Status *state) { Xim im = (Xim)xim; XlcConv conv = im->private.local.ctow_conv; @@ -422,13 +422,13 @@ _XimLcctstowcs(xim, from, from_len, to, to_len, state) } Public int -_XimLcctstoutf8(xim, from, from_len, to, to_len, state) - XIM xim; - char *from; - int from_len; - char *to; - int to_len; - Status *state; +_XimLcctstoutf8( + XIM xim, + char *from, + int from_len, + char *to, + int to_len, + Status *state) { return _XimLcctsconvert(((Xim)xim)->private.local.ctoutf8_conv, from, from_len, to, to_len, state); diff --git a/modules/im/ximcp/imLcSIc.c b/modules/im/ximcp/imLcSIc.c index a32211c..3aa52f6 100644 --- a/modules/im/ximcp/imLcSIc.c +++ b/modules/im/ximcp/imLcSIc.c @@ -39,9 +39,9 @@ PERFORMANCE OF THIS SOFTWARE. #include "Ximint.h" Public char * -_XimLocalSetICValues(xic, values) - XIC xic; - XIMArg *values; +_XimLocalSetICValues( + XIC xic, + XIMArg *values) { XimDefICValues ic_values; Xic ic = (Xic)xic; diff --git a/modules/im/ximcp/imRm.c b/modules/im/ximcp/imRm.c index f6599eb..e731381 100644 --- a/modules/im/ximcp/imRm.c +++ b/modules/im/ximcp/imRm.c @@ -61,8 +61,7 @@ typedef struct _XimValueOffsetInfo { #ifdef XIM_CONNECTABLE Private Bool -_XimCheckBool(str) - char *str; +_XimCheckBool(char *str) { if(!strcmp(str, "True") || !strcmp(str, "true") || !strcmp(str, "Yes") || !strcmp(str, "yes") || @@ -72,8 +71,7 @@ _XimCheckBool(str) } Public void -_XimSetProtoResource(im) - Xim im; +_XimSetProtoResource(Xim im) { char res_name_buf[256]; char* res_name; @@ -2380,10 +2378,10 @@ Public int } Public void -_XimSetICMode(res_list, list_num, style) - XIMResourceList res_list; - unsigned int list_num; - XIMStyle style; +_XimSetICMode( + XIMResourceList res_list, + unsigned int list_num, + XIMStyle style) { XIMResourceList res; unsigned int n = XIMNumber(ic_mode); @@ -3018,13 +3016,13 @@ _XimDecodeLocalICAttr( } Public char * -_XimGetICValueData(ic, top, res_list, list_num, values, mode) - Xic ic; - XPointer top; - XIMResourceList res_list; - unsigned int list_num; - XIMArg *values; - unsigned long mode; +_XimGetICValueData( + Xic ic, + XPointer top, + XIMResourceList res_list, + unsigned int list_num, + XIMArg *values, + unsigned long mode) { register XIMArg *p; XIMResourceList res; @@ -3072,9 +3070,9 @@ _XimGetICValueData(ic, top, res_list, list_num, values, mode) } Public void -_XimGetCurrentIMValues(im, im_values) - Xim im; - XimDefIMValues *im_values; +_XimGetCurrentIMValues( + Xim im, + XimDefIMValues *im_values) { bzero((char *)im_values, sizeof(XimDefIMValues)); @@ -3088,9 +3086,9 @@ _XimGetCurrentIMValues(im, im_values) } Public void -_XimSetCurrentIMValues(im, im_values) - Xim im; - XimDefIMValues *im_values; +_XimSetCurrentIMValues( + Xim im, + XimDefIMValues *im_values) { im->core.styles = im_values->styles; im->core.im_values_list = im_values->im_values_list; @@ -3102,9 +3100,9 @@ _XimSetCurrentIMValues(im, im_values) } Public void -_XimGetCurrentICValues(ic, ic_values) - Xic ic; - XimDefICValues *ic_values; +_XimGetCurrentICValues( + Xic ic, + XimDefICValues *ic_values) { bzero((char *)ic_values, sizeof(XimDefICValues)); diff --git a/modules/im/ximcp/imThaiFlt.c b/modules/im/ximcp/imThaiFlt.c index ac85196..4988333 100644 --- a/modules/im/ximcp/imThaiFlt.c +++ b/modules/im/ximcp/imThaiFlt.c @@ -468,17 +468,41 @@ THAI_apply_scm( /* The following functions are copied from XKeyBind.c */ -Private void ComputeMaskFromKeytrans(); +Private void ComputeMaskFromKeytrans( + Display * /* dpy */, + register struct _XKeytrans * /* p */ +); + Private int IsCancelComposeKey(KeySym *symbol, XKeyEvent *event); Private void SetLed(Display *dpy, int num, int state); -Private CARD8 FindKeyCode(); +Private CARD8 FindKeyCode( + register Display * /* dpy */, + register KeySym /* code */ +); -/* The following functions are specific to this module */ -Private int XThaiTranslateKey(); -Private int XThaiTranslateKeySym(); +/* The following functions are specific to this module */ +Private int XThaiTranslateKey( + register Display * /* dpy */, + KeyCode /* keycode */, + register unsigned int /* modifiers */, + unsigned int * /* modifiers_return */, + KeySym * /* keysym_return */, + KeySym * /* lsym_return */, + KeySym * /* usym_return */ +); + +Private int XThaiTranslateKeySym( + Display * /* dpy */, + register KeySym /* symbol */, + register KeySym /* lsym */, + register KeySym /* usym */, + unsigned int /* modifiers */, + unsigned char * /* buffer */, + int /* nbytes */ +); Private KeySym HexIMNormalKey( XicThaiPart *thai_part, @@ -1240,11 +1264,11 @@ ThaiFltReplaceInput(Xic ic, unsigned char new_char, KeySym symbol) * Filter function for TACTIS */ Bool -_XimThaiFilter(d, w, ev, client_data) -Display *d; -Window w; -XEvent *ev; -XPointer client_data; +_XimThaiFilter( + Display *d, + Window w, + XEvent *ev, + XPointer client_data) { Xic ic = (Xic)client_data; KeySym symbol; diff --git a/modules/im/ximcp/imThaiIm.c b/modules/im/ximcp/imThaiIm.c index e247150..21da91a 100644 --- a/modules/im/ximcp/imThaiIm.c +++ b/modules/im/ximcp/imThaiIm.c @@ -61,8 +61,7 @@ Private XIMMethodsRec Xim_im_thai_methods = { #define THAI_LANGUAGE_NAME "th" Bool -_XimCheckIfThaiProcessing(im) - Xim im; +_XimCheckIfThaiProcessing(Xim im) { char *language; @@ -74,8 +73,7 @@ _XimCheckIfThaiProcessing(im) } Public Bool -_XimThaiOpenIM(im) - Xim im; +_XimThaiOpenIM(Xim im) { XLCd lcd = im->core.lcd; XlcConv conv; @@ -144,8 +142,7 @@ Open_Error : } Public void -_XimThaiIMFree(im) - Xim im; +_XimThaiIMFree(Xim im) { if(im->core.im_resources) { Xfree(im->core.im_resources); @@ -215,8 +212,7 @@ _XimThaiIMFree(im) } Public Status -_XimThaiCloseIM(xim) - XIM xim; +_XimThaiCloseIM(XIM xim) { Xim im = (Xim)xim; XIC ic; diff --git a/modules/im/ximcp/imTrX.c b/modules/im/ximcp/imTrX.c index 5076839..e0d2c29 100644 --- a/modules/im/ximcp/imTrX.c +++ b/modules/im/ximcp/imTrX.c @@ -464,9 +464,9 @@ _XimXFlush(Xim im) } Public Bool -_XimXConf(im, address) - Xim im; - char *address; +_XimXConf( + Xim im, + char *address) { XSpecRec *spec; diff --git a/modules/im/ximcp/imTransR.c b/modules/im/ximcp/imTransR.c index 5ca4a39..92d2ee2 100644 --- a/modules/im/ximcp/imTransR.c +++ b/modules/im/ximcp/imTransR.c @@ -57,15 +57,13 @@ Public TransportSW _XimTransportRec[] = { }; Public Bool -_XimConnect(im) - Xim im; +_XimConnect(Xim im) { return im->private.proto.connect(im); } Public Bool -_XimShutdown(im) - Xim im; +_XimShutdown(Xim im) { return im->private.proto.shutdown(im); } @@ -214,15 +212,15 @@ _XimCallDispatcher( } Public int -_XimRead(im, len, buf, buf_size, predicate, arg) - Xim im; - INT16 *len; - XPointer buf; - int buf_size; +_XimRead( + Xim im, + INT16 *len, + XPointer buf, + int buf_size, Bool (*predicate)( Xim, INT16, XPointer, XPointer - ); - XPointer arg; + ), + XPointer arg) { INT16 read_len; int ret_code; @@ -254,16 +252,14 @@ _XimRegisterDispatcher( } Public void -_XimFlush(im) - Xim im; +_XimFlush(Xim im) { im->private.proto.flush(im); return; } Public Bool -_XimFilterWaitEvent(im) - Xim im; +_XimFilterWaitEvent(Xim im) { INT16 read_len; CARD32 reply32[BUFSIZE/4]; diff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c index 3a813b3..b970db1 100644 --- a/modules/om/generic/omGeneric.c +++ b/modules/om/generic/omGeneric.c @@ -67,32 +67,6 @@ #define CHARSET_ENCODING_FIELD 14 #define XLFD_MAX_LEN 255 -#if 0 -extern int _XmbDefaultTextEscapement(), _XwcDefaultTextEscapement(), - _Xutf8DefaultTextEscapement(); -extern int _XmbDefaultTextExtents(), _XwcDefaultTextExtents(), - _Xutf8DefaultTextExtents(); -extern Status _XmbDefaultTextPerCharExtents(), _XwcDefaultTextPerCharExtents(), - _Xutf8DefaultTextPerCharExtents(); -extern int _XmbDefaultDrawString(), _XwcDefaultDrawString(), - _Xutf8DefaultDrawString(); -extern void _XmbDefaultDrawImageString(), _XwcDefaultDrawImageString(), - _Xutf8DefaultDrawImageString(); - -extern int _XmbGenericTextEscapement(), _XwcGenericTextEscapement(), - _Xutf8GenericTextEscapement(); -extern int _XmbGenericTextExtents(), _XwcGenericTextExtents(), - _Xutf8GenericTextExtents(); -extern Status _XmbGenericTextPerCharExtents(), _XwcGenericTextPerCharExtents(), - _Xutf8GenericTextPerCharExtents(); -extern int _XmbGenericDrawString(), _XwcGenericDrawString(), - _Xutf8GenericDrawString(); -extern void _XmbGenericDrawImageString(), _XwcGenericDrawImageString(), - _Xutf8GenericDrawImageString(); - -extern void _XlcDbg_printValue (const char *str, char **value, int num); -#endif - /* For VW/UDC start */ static FontData diff --git a/modules/om/generic/omImText.c b/modules/om/generic/omImText.c index 627c45b..ddf21b1 100644 --- a/modules/om/generic/omImText.c +++ b/modules/om/generic/omImText.c @@ -31,10 +31,6 @@ #include "Xlibint.h" #include "XomGeneric.h" -#if 0 -extern int _XomGenericTextExtents(), _XomGenericDrawString(); -#endif - #define GET_VALUE_MASK (GCFunction | GCForeground | GCBackground | GCFillStyle) #define SET_VALUE_MASK (GCFunction | GCForeground | GCFillStyle) diff --git a/src/ConnDis.c b/src/ConnDis.c index f4a4dc8..a07d988 100644 --- a/src/ConnDis.c +++ b/src/ConnDis.c @@ -559,10 +559,7 @@ int _XConnectDisplay ( * Disconnect from server. */ -int _XDisconnectDisplay (trans_conn) - -XtransConnInfo trans_conn; - +int _XDisconnectDisplay (XtransConnInfo trans_conn) { _X11TransDisconnect(trans_conn); _X11TransClose(trans_conn); @@ -572,11 +569,12 @@ XtransConnInfo trans_conn; Bool -_XSendClientPrefix (dpy, client, auth_proto, auth_string, prefix) - Display *dpy; - xConnClientPrefix *client; /* contains count for auth_* */ - char *auth_proto, *auth_string; /* NOT null-terminated */ - xConnSetupPrefix *prefix; /* prefix information */ +_XSendClientPrefix( + Display *dpy, + xConnClientPrefix *client, /* contains count for auth_* */ + char *auth_proto, /* NOT null-terminated */ + char *auth_string, + xConnSetupPrefix *prefix) /* prefix information */ { int auth_length = client->nbytesAuthProto; int auth_strlen = client->nbytesAuthString; @@ -697,9 +695,11 @@ static _Xconst int *xauth_lengths = default_xauth_lengths; static int xauth_names_length = NUM_DEFAULT_AUTH; -void XSetAuthorization (name, namelen, data, datalen) - int namelen, datalen; /* lengths of name and data */ - char *name, *data; /* NULL or arbitrary array of bytes */ +void XSetAuthorization ( + char *name, /* NULL or arbitrary array of bytes */ + int namelen, /* length of name */ + char *data, /* NULL or arbitrary array of bytes */ + int datalen) /* length of data */ { char *tmpname, *tmpdata; @@ -801,9 +801,9 @@ extern krb5_flags krb5_kdc_default_options; * so we can tell XOpenDisplay to not bother looking for it by * itself. */ -static int k5_clientauth(dpy, sprefix) - Display *dpy; - xConnSetupPrefix *sprefix; +static int k5_clientauth( + Display *dpy, + xConnSetupPrefix *sprefix) { krb5_error_code retval; xReq prefix; diff --git a/src/Context.c b/src/Context.c index 747bb6b..5e4d32f 100644 --- a/src/Context.c +++ b/src/Context.c @@ -235,11 +235,11 @@ int XSaveContext( if an error has occured, 0 otherwise. Possible errors are Entry-not-found. */ -int XFindContext(display, rid, context, data) - Display *display; - register XID rid; - register XContext context; - XPointer *data; /* RETURN */ +int XFindContext( + Display *display, + register XID rid, + register XContext context, + XPointer *data) /* RETURN */ { register DB db; register TableEntry entry; @@ -274,10 +274,10 @@ int XFindContext(display, rid, context, data) with the same arguments. */ -int XDeleteContext(display, rid, context) - Display *display; - register XID rid; - register XContext context; +int XDeleteContext( + Display *display, + register XID rid, + register XContext context) { register DB db; register TableEntry entry, *prev; diff --git a/src/OpenDis.c b/src/OpenDis.c index 9c327d1..edb2839 100644 --- a/src/OpenDis.c +++ b/src/OpenDis.c @@ -790,8 +790,7 @@ _XBigReqHandler( * before the first possible call on this. */ -void _XFreeDisplayStructure(dpy) - register Display *dpy; +void _XFreeDisplayStructure(register Display *dpy) { while (dpy->ext_procs) { _XExtension *ext = dpy->ext_procs; @@ -920,9 +919,9 @@ void _XFreeDisplayStructure(dpy) /* OutOfMemory is called if malloc fails. XOpenDisplay returns NULL after this returns. */ -static void OutOfMemory (dpy, setup) - Display *dpy; - char *setup; +static void OutOfMemory( + Display *dpy, + char *setup) { #if USE_XCB if(dpy->xcb->connection) diff --git a/src/ParseGeom.c b/src/ParseGeom.c index 6aaaccf..177ce81 100644 --- a/src/ParseGeom.c +++ b/src/ParseGeom.c @@ -39,8 +39,7 @@ from The Open Group. /* *Returns pointer to first char ins search which is also in what, else NULL. */ -static char *strscan (search, what) -char *search, *what; +static char *strscan(char *search, char *what) { int i, len = strlen (what); char c; diff --git a/src/XlibInt.c b/src/XlibInt.c index d6e7220..8bf475d 100644 --- a/src/XlibInt.c +++ b/src/XlibInt.c @@ -2855,10 +2855,10 @@ int _XDefaultError( } /*ARGSUSED*/ -Bool _XDefaultWireError(display, he, we) - Display *display; - XErrorEvent *he; - xError *we; +Bool _XDefaultWireError( + Display *display, + XErrorEvent *he, + xError *we) { return True; } @@ -3025,9 +3025,10 @@ XFree (void *data) } #ifdef _XNEEDBCOPYFUNC -void _Xbcopy(b1, b2, length) - register char *b1, *b2; - register length; +void _Xbcopy( + register char *b1, + register char *b2, + register int length) { if (b1 < b2) { b2 += length; @@ -3254,9 +3255,9 @@ int _XGetHostname ( * _XScreenOfWindow - get the Screen of a given window */ -Screen *_XScreenOfWindow (dpy, w) - Display *dpy; - Window w; +Screen *_XScreenOfWindow( + Display *dpy, + Window w) { register int i; Window root; @@ -3287,11 +3288,11 @@ Screen *_XScreenOfWindow (dpy, w) * be converted to "C:/usr/X11R6.3/lib/X11/locale/locale.dir". */ -static int access_file (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; +static int access_file( + char *path, + char *pathbuf, + int len_pathbuf, + char **pathret) { if (access (path, F_OK) == 0) { if (strlen (path) < len_pathbuf) @@ -3306,11 +3307,11 @@ static int access_file (path, pathbuf, len_pathbuf, pathret) return 0; } -static int AccessFile (path, pathbuf, len_pathbuf, pathret) - char* path; - char* pathbuf; - int len_pathbuf; - char** pathret; +static int AccessFile( + char *path, + char *pathbuf, + int len_pathbuf, + char **pathret) { unsigned long drives; int i, len; @@ -3379,9 +3380,9 @@ static int AccessFile (path, pathbuf, len_pathbuf, pathret) return 0; } -int _XOpenFile(path, flags) - _Xconst char* path; - int flags; +int _XOpenFile( + _Xconst char *path, + int flags) { char buf[MAX_PATH]; char* bufp = NULL; @@ -3398,10 +3399,10 @@ int _XOpenFile(path, flags) return ret; } -int _XOpenFileMode(path, flags, mode) - _Xconst char* path; - int flags; - mode_t mode; +int _XOpenFileMode( + _Xconst char *path, + int flags, + mode_t mode) { char buf[MAX_PATH]; char* bufp = NULL; @@ -3418,9 +3419,9 @@ int _XOpenFileMode(path, flags, mode) return ret; } -void* _XFopenFile(path, mode) - _Xconst char* path; - _Xconst char* mode; +void* _XFopenFile( + _Xconst char *path, + _Xconst char *mode) { char buf[MAX_PATH]; char* bufp = NULL; @@ -3437,8 +3438,7 @@ void* _XFopenFile(path, mode) return ret; } -int _XAccessFile(path) - _Xconst char* path; +int _XAccessFile(_Xconst char *path) { char buf[MAX_PATH]; char* bufp; diff --git a/src/globals.c b/src/globals.c index 11965cb..51bdac2 100644 --- a/src/globals.c +++ b/src/globals.c @@ -90,127 +90,6 @@ ZEROINIT (int, _Xdebug, 0); ZEROINIT (Display *, _XHeadOfDisplayList, NULL); - -#if 0 -#ifdef STREAMSCONN - - -/* The following are how the Xstream connections are used: */ -/* 1) Local connections over pseudo-tty ports. */ -/* 2) SVR4 local connections using named streams or SVR3.2 */ -/* local connections using streams. */ -/* 3) SVR4 stream pipe code. This code is proprietary and */ -/* the actual code is not included in the XC distribution. */ -/* 4) remote connections using tcp */ -/* 5) remote connections using StarLan */ - -/* - * descriptor block for streams connections - */ - -#include "Xstreams.h" - -char _XsTypeOfStream[100] = { 0 }; - -extern int write(); -extern int close(); -#ifdef SVR4 -extern int _XsSetupSpStream(); -extern int _XsSetupNamedStream(); -#endif -extern int _XsSetupLocalStream(); -extern int _XsConnectLocalClient(); -extern int _XsCallLocalServer(); -extern int _XsReadLocalStream(); -extern int _XsErrorCall(); -extern int _XsWriteLocalStream(); -extern int _XsCloseLocalStream(); -extern int _XsSetupTliStream(); -extern int _XsConnectTliClient(); -extern int _XsCallTliServer(); -extern int _XsReadTliStream(); -extern int _XsWriteTliStream(); -extern int _XsCloseTliStream(); - - -Xstream _XsStream[] = { - - { - /* local connections using pseudo-ttys */ - - _XsSetupLocalStream, - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - { -#ifdef SVR4 - /* local connections using named streams */ - - _XsSetupNamedStream, -#else - /* local connections using streams */ - _XsSetupLocalStream, -#endif - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - /* Enhanced Application Compatibility Support */ - { -#ifdef SVR4 - /* SVR4 stream pipe code */ - _XsSetupSpStream, -#else - _XsSetupLocalStream, -#endif - _XsConnectLocalClient, - _XsCallLocalServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - /* End Enhanced Application Compatibility Support */ - - { - /* remote connections using tcp */ - _XsSetupTliStream, - _XsConnectTliClient, - _XsCallTliServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - }, - { - /* remote connections using StarLan */ - _XsSetupTliStream, - _XsConnectTliClient, - _XsCallTliServer, - _XsReadLocalStream, - _XsErrorCall, - write, - close, - NULL - } -}; - - -#endif /* STREAMSCONN */ -#endif - - #ifdef XTEST1 /* * Stuff for input synthesis extension: diff --git a/src/locking.c b/src/locking.c index 537ffa3..98c70b2 100644 --- a/src/locking.c +++ b/src/locking.c @@ -60,14 +60,15 @@ extern LockInfoPtr _Xi18n_lock; #ifdef WIN32 static DWORD _X_TlsIndex = (DWORD)-1; -_Xthread_init() +void +_Xthread_init(void) { if (_X_TlsIndex == (DWORD)-1) _X_TlsIndex = TlsAlloc(); } struct _xthread_waiter * -_Xthread_waiter() +_Xthread_waiter(void) { struct _xthread_waiter *me; @@ -90,10 +91,10 @@ static LockInfoRec global_lock; static LockInfoRec i18n_lock; #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XLockMutex(lip,file,line) - LockInfoPtr lip; - char* file; - int line; +static void _XLockMutex( + LockInfoPtr lip, + char *file, + int line) #else static void _XLockMutex( LockInfoPtr lip) @@ -203,10 +204,10 @@ static void _XLockDisplayWarn( #endif /* XTHREADS_WARN */ #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XUnlockDisplay(dpy,file,line) - Display *dpy; - char *file; - int line; +static void _XUnlockDisplay( + Display *dpy, + char *file, + int line) #else static void _XUnlockDisplay( Display *dpy) @@ -331,11 +332,11 @@ static void _XPopReader( } #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XConditionWait(cv, mutex,file,line) - xcondition_t cv; - xmutex_t mutex; - char *file; - int line; +static void _XConditionWait( + xcondition_t cv, + xmutex_t mutex, + char *file, + int line) #else static void _XConditionWait( xcondition_t cv, @@ -382,10 +383,10 @@ static void _XConditionWait( } #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XConditionSignal(cv,file,line) - xcondition_t cv; - char *file; - int line; +static void _XConditionSignal( + xcondition_t cv, + char *file, + int line) #else static void _XConditionSignal( xcondition_t cv) @@ -401,10 +402,10 @@ static void _XConditionSignal( #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XConditionBroadcast(cv,file,line) - xcondition_t cv; - char *file; - int line; +static void _XConditionBroadcast( + xcondition_t cv, + char *file, + int line) #else static void _XConditionBroadcast( xcondition_t cv) @@ -470,10 +471,10 @@ static void _XDisplayLockWait( } #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XLockDisplay(dpy, file, line) - Display *dpy; - char *file; /* source file, from macro */ - int line; +static void _XLockDisplay( + Display *dpy, + char *file, /* source file, from macro */ + int line) #else static void _XLockDisplay( Display *dpy) @@ -493,11 +494,11 @@ static void _XLockDisplay( * user-level lock is in force, so it uses this instead of _XFancyLockDisplay. */ #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) -static void _XInternalLockDisplay(dpy, wskip, file, line) - Display *dpy; - Bool wskip; - char *file; /* source file, from macro */ - int line; +static void _XInternalLockDisplay( + Display *dpy, + Bool wskip, + char *file, /* source file, from macro */ + int line) #else static void _XInternalLockDisplay( Display *dpy, @@ -597,7 +598,7 @@ xthread_t (*_x11_thr_self)() = __x11_thr_self; #endif -Status XInitThreads() +Status XInitThreads(void) { if (_Xglobal_lock) return 1; @@ -646,7 +647,7 @@ Status XInitThreads() } #else /* XTHREADS */ -Status XInitThreads() +Status XInitThreads(void) { return 0; } diff --git a/src/os2Stubs.c b/src/os2Stubs.c index 9d10902..492b0cc 100644 --- a/src/os2Stubs.c +++ b/src/os2Stubs.c @@ -94,7 +94,7 @@ char *__XOS2RedirRoot1(char *format, char *arg1, char *arg2, char *arg3) HEV hPipeSem; HMODULE hmod_so32dll; static int (*os2_tcp_select)(int*,int,int,int,long); -ULONG os2_get_sys_millis(); +ULONG os2_get_sys_millis(void); extern int _files[]; #define MAX_TCP 256 @@ -262,7 +262,7 @@ return(ready_handles); } -ULONG os2_get_sys_millis() +ULONG os2_get_sys_millis(void) { APIRET rc; ULONG milli; @@ -275,9 +275,9 @@ ULONG os2_get_sys_millis() return(milli); } -int os2_parse_select(sd,nfds) -struct select_data *sd; -int nfds; +int os2_parse_select( + struct select_data *sd, + int nfds) { int i; APIRET rc; @@ -342,9 +342,10 @@ return(sd->socket_ntotal); } -int os2_check_sockets(sd,readfds,writefds) -struct select_data *sd; -fd_set *readfds,*writefds; +int os2_check_sockets( + struct select_data *sd, + fd_set *readfds, + fd_set *writefds) { int e,i; int j,n; @@ -384,9 +385,10 @@ fd_set *readfds,*writefds; /* Check to see if anything is ready on pipes */ -int os2_check_pipes(sd,readfds,writefds) -struct select_data *sd; -fd_set *readfds,*writefds; +int os2_check_pipes( + struct select_data *sd, + fd_set *readfds, + fd_set *writefds) { int i,e; ULONG ulPostCount; diff --git a/src/udcInf.c b/src/udcInf.c index 43b1cb0..5ba51a9 100644 --- a/src/udcInf.c +++ b/src/udcInf.c @@ -50,8 +50,17 @@ from The Open Group. /* external symbols */ -extern FontData read_EncodingInfo(); -extern int _xudc_get_codeset(); +extern FontData read_EncodingInfo( /* omGeneric.c */ + int /* count */, + char ** /* value */ +); + +int _xudc_get_codeset( + char * /* locale */, + char * /* charset_str */, + int ** /* codeset */, + int * /* num_codeset */ +); extern int _xudc_utyderror ; extern int _xudc_utyerror ; @@ -72,9 +81,9 @@ typedef struct __XUDCGlyphRegion { /* * "code" no jyoui "i" byte me wo "unsigned char" toshite kaesu. */ -static unsigned char getbyte(code,i) -unsigned long code; -int i; +static unsigned char getbyte( + unsigned long code, + int i) { unsigned long byteL; unsigned char byte; @@ -89,11 +98,11 @@ int i; charset_str : JISX0208.1983-0 */ -_xudc_get_codeset(locale,charset_str,codeset,num_codeset) -char *locale; -char *charset_str; -int **codeset; -int *num_codeset; +_xudc_get_codeset( + char *locale, + char *charset_str, + int **codeset, + int *num_codeset) { XLCdRec lcdrec; XLCd lcd; @@ -177,9 +186,10 @@ int *num_codeset; return 0; } -static Bool gi_to_vgi(gi,vgi,scope) -unsigned long gi,*vgi; -FontScope scope; +static Bool gi_to_vgi( + unsigned long gi, + unsigned long *vgi, + FontScope scope) { if(scope->shift_direction == (unsigned long)'+'){ gi -= scope->shift; @@ -193,9 +203,9 @@ FontScope scope; return(False); } -static void shift_area(udc,scope) -_XUDCGlyphRegion *udc; -FontScope scope; +static void shift_area( + _XUDCGlyphRegion *udc, + FontScope scope) { if(scope->shift_direction == (unsigned long)'+'){ udc->start += scope->shift; @@ -212,12 +222,12 @@ FontScope scope; locale : ja_JP charset_str : JISX0208.1983-0 */ -_XUDCGetUDCGIArea(locale,codeset,charset_str,gr,num_gr) -char *locale; -int codeset; -char *charset_str; -_XUDCGlyphRegion **gr; -int *num_gr; +_XUDCGetUDCGIArea( + char *locale, + int codeset, + char *charset_str, + _XUDCGlyphRegion **gr, + int *num_gr) { XLCdRec lcdrec; XLCd lcd; @@ -316,15 +326,15 @@ int *num_gr; */ static int -_xudc_gi_to_vgi(lcd,locale,charset_str,codeset,gi,vgi,charsetname,size) -XLCd lcd; -char *locale; -char *charset_str; -int codeset; -unsigned long gi; -unsigned long *vgi; -char *charsetname; -int size; +_xudc_gi_to_vgi( + XLCd lcd, + char *locale, + char *charset_str, + int codeset, + unsigned long gi, + unsigned long *vgi, + char *charsetname, + int size) { _XUDCGlyphRegion *udc; int num = 0,count,num_ret=0; @@ -361,9 +371,9 @@ int size; return(True); } -Bool non_standard(lcd,charset) -XLCd lcd; -XlcCharSet charset; +Bool non_standard( + XLCd lcd, + XlcCharSet charset) { char buf[256]; int count,i; @@ -386,11 +396,11 @@ XlcCharSet charset; } static Bool -make_none_standard(from,charset,src,size) -char *from; -XlcCharSet charset; -char *src; -int size; +make_none_standard( + char *from, + XlcCharSet charset, + char *src, + int size) { int name_len,seq_len,rest_len,i; name_len = 2 + strlen(charset->encoding_name) + 1; @@ -407,12 +417,12 @@ int size; return True; } int -_xudc_glyph_to_code(locale,charset_str,codeset,glyph_index,codepoint) -char *locale; -char *charset_str; -int codeset; -unsigned long glyph_index; -unsigned long *codepoint; +_xudc_glyph_to_code( + char *locale, + char *charset_str, + int codeset, + unsigned long glyph_index, + unsigned long *codepoint) { XLCd lcd; unsigned char *from; int from_left; @@ -490,12 +500,12 @@ typedef struct __XUDCCodeRegion { } _XUDCCodeRegion ; int -_XUDCGetUDCCPArea(locale,codeset,charset_str,cr,num_cr) -char *locale; -int codeset; -char *charset_str; -_XUDCCodeRegion **cr; -int *num_cr; +_XUDCGetUDCCPArea( + char *locale, + int codeset, + char *charset_str, + _XUDCCodeRegion **cr, + int *num_cr) { int i,num_gr,ret; _XUDCGlyphRegion *gr; @@ -571,9 +581,10 @@ typedef struct __XUDCGIInf { * * */ -static Bool vgi_to_gi(gi,vgi,scope) -unsigned long *gi,vgi; -FontScope scope; +static Bool vgi_to_gi( + unsigned long *gi, + unsigned long vgi, + FontScope scope) { if(vgi >= scope->start && vgi <= scope->end){ if(scope->shift_direction == (unsigned long)'+'){ @@ -590,14 +601,14 @@ FontScope scope; * */ static Bool -_xudc_vgi_to_gi(lcd,locale,vglyph,glyph,charset,charsetname,size) -XLCd lcd; -char *locale; -unsigned long vglyph; -unsigned long *glyph; -XlcCharSet charset; -char *charsetname; -int size; +_xudc_vgi_to_gi( + XLCd lcd, + char *locale, + unsigned long vglyph, + unsigned long *glyph, + XlcCharSet charset, + char *charsetname, + int size) { int num = 0,count,num_ret=0; int i,j,k; @@ -644,12 +655,13 @@ int size; *glyph = vglyph; return(True); } + int -_xudc_code_to_glyph(locale,codepoint,gi,num_gi) -char *locale; -unsigned long codepoint; -_XUDCGIInf **gi; -int *num_gi; +_xudc_code_to_glyph( + char *locale, + unsigned long codepoint, + _XUDCGIInf **gi, + int *num_gi) { XLCd lcd; unsigned char *from; int from_left; diff --git a/src/xlibi18n/ICWrap.c b/src/xlibi18n/ICWrap.c index b51da6f..7d1af52 100644 --- a/src/xlibi18n/ICWrap.c +++ b/src/xlibi18n/ICWrap.c @@ -263,8 +263,7 @@ XCreateIC(XIM im, ...) * Free the input context. */ void -XDestroyIC(ic) - XIC ic; +XDestroyIC(XIC ic) { XIM im = ic->core.im; XIC *prev; @@ -346,8 +345,7 @@ XSetICValues(XIC ic, ...) * argument. */ void -XSetICFocus(ic) - XIC ic; +XSetICFocus(XIC ic) { if (ic && ic->core.im) (*ic->methods->set_focus) (ic); @@ -358,8 +356,7 @@ XSetICFocus(ic) * argument. */ void -XUnsetICFocus(ic) - XIC ic; +XUnsetICFocus(XIC ic) { if (ic->core.im) (*ic->methods->unset_focus) (ic); @@ -369,15 +366,13 @@ XUnsetICFocus(ic) * Return the XIM associated with the input context. */ XIM -XIMOfIC(ic) - XIC ic; +XIMOfIC(XIC ic) { return ic->core.im; } char * -XmbResetIC(ic) - XIC ic; +XmbResetIC(XIC ic) { if (ic->core.im) return (*ic->methods->mb_reset)(ic); @@ -385,8 +380,7 @@ XmbResetIC(ic) } wchar_t * -XwcResetIC(ic) - XIC ic; +XwcResetIC(XIC ic) { if (ic->core.im) return (*ic->methods->wc_reset)(ic); @@ -394,8 +388,7 @@ XwcResetIC(ic) } char * -Xutf8ResetIC(ic) - XIC ic; +Xutf8ResetIC(XIC ic) { if (ic->core.im) { if (ic->methods->utf8_reset) @@ -407,13 +400,13 @@ Xutf8ResetIC(ic) } int -XmbLookupString(ic, ev, buffer, nbytes, keysym, status) - XIC ic; - register XKeyEvent *ev; - char *buffer; - int nbytes; - KeySym *keysym; - Status *status; +XmbLookupString( + XIC ic, + register XKeyEvent *ev, + char *buffer, + int nbytes, + KeySym *keysym, + Status *status) { if (ic->core.im) return (*ic->methods->mb_lookup_string) (ic, ev, buffer, nbytes, @@ -422,13 +415,13 @@ XmbLookupString(ic, ev, buffer, nbytes, keysym, status) } int -XwcLookupString(ic, ev, buffer, nchars, keysym, status) - XIC ic; - register XKeyEvent *ev; - wchar_t *buffer; - int nchars; - KeySym *keysym; - Status *status; +XwcLookupString( + XIC ic, + register XKeyEvent *ev, + wchar_t *buffer, + int nchars, + KeySym *keysym, + Status *status) { if (ic->core.im) return (*ic->methods->wc_lookup_string) (ic, ev, buffer, nchars, @@ -437,13 +430,13 @@ XwcLookupString(ic, ev, buffer, nchars, keysym, status) } int -Xutf8LookupString(ic, ev, buffer, nbytes, keysym, status) - XIC ic; - register XKeyEvent *ev; - char *buffer; - int nbytes; - KeySym *keysym; - Status *status; +Xutf8LookupString( + XIC ic, + register XKeyEvent *ev, + char *buffer, + int nbytes, + KeySym *keysym, + Status *status) { if (ic->core.im) { if (ic->methods->utf8_lookup_string) diff --git a/src/xlibi18n/IMWrap.c b/src/xlibi18n/IMWrap.c index a90b406..533f179 100644 --- a/src/xlibi18n/IMWrap.c +++ b/src/xlibi18n/IMWrap.c @@ -69,9 +69,9 @@ from The Open Group. * Compile the resource name. (resource_name ---> xrm_name) */ void -_XIMCompileResourceList(res, num_res) - register XIMResourceList res; - unsigned int num_res; +_XIMCompileResourceList( + register XIMResourceList res, + unsigned int num_res) { register unsigned int count; @@ -81,10 +81,10 @@ _XIMCompileResourceList(res, num_res) } void -_XCopyToArg(src, dst, size) - XPointer src; - XPointer *dst; - register unsigned int size; +_XCopyToArg( + XPointer src, + XPointer *dst, + register unsigned int size) { if (!*dst) { union { @@ -122,11 +122,11 @@ _XCopyToArg(src, dst, size) */ XIM -XOpenIM( display, rdb, res_name, res_class ) - Display *display; - XrmDatabase rdb; - char *res_name; - char *res_class; +XOpenIM( + Display *display, + XrmDatabase rdb, + char *res_name, + char *res_class) { XLCd lcd = _XOpenLC( (char *)NULL ); @@ -139,8 +139,7 @@ XOpenIM( display, rdb, res_name, res_class ) * Close the connection to the input manager, and free the XIM structure */ Status -XCloseIM(im) - XIM im; +XCloseIM(XIM im) { Status s; XIC ic; @@ -158,8 +157,7 @@ XCloseIM(im) * Return the Display associated with the input method. */ Display * -XDisplayOfIM(im) - XIM im; +XDisplayOfIM(XIM im) { return im->core.display; } @@ -168,8 +166,7 @@ XDisplayOfIM(im) * Return the Locale associated with the input method. */ char * -XLocaleOfIM(im) - XIM im; +XLocaleOfIM(XIM im) { return im->core.lcd->core->name; } diff --git a/src/xlibi18n/Xaixlcint.h b/src/xlibi18n/Xaixlcint.h index 2e4f3f5..badbc3d 100644 --- a/src/xlibi18n/Xaixlcint.h +++ b/src/xlibi18n/Xaixlcint.h @@ -41,7 +41,7 @@ typedef struct _LC_core_ldx_t { _LC_object_t lc_object_header; - XLCd (*default_loader)(); + XLCd (*default_loader)(void); Bool sticky; } _XlcCoreObjRec, *_XlcCoreObj; diff --git a/src/xlibi18n/XlcSL.c b/src/xlibi18n/XlcSL.c index 9e6b67f..04988da 100644 --- a/src/xlibi18n/XlcSL.c +++ b/src/xlibi18n/XlcSL.c @@ -54,8 +54,7 @@ extern XIM _XDefaultOpenIM( ); Bool -_XInitDefaultIM(lcd) -XLCd lcd; +_XInitDefaultIM(XLCd lcd) { if(lcd == (XLCd)NULL) return False; @@ -71,8 +70,7 @@ extern XOM _XDefaultOpenOM( ); Bool -_XInitDefaultOM(lcd) - XLCd lcd; +_XInitDefaultOM(XLCd lcd) { lcd->methods->open_om = _XDefaultOpenOM; return True; diff --git a/src/xlibi18n/lcCT.c b/src/xlibi18n/lcCT.c index f3a91e6..090bdf1 100644 --- a/src/xlibi18n/lcCT.c +++ b/src/xlibi18n/lcCT.c @@ -1262,7 +1262,7 @@ open_cstostr( /* =========================== Initialization =========================== */ Bool -_XlcInitCTInfo() +_XlcInitCTInfo(void) { if (ct_list == NULL) { const CTDataRec *ct_data; diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c index 65008fa..5e50b5b 100644 --- a/src/xlibi18n/lcFile.c +++ b/src/xlibi18n/lcFile.c @@ -628,9 +628,9 @@ _XlcResolveLocaleName( /************************************************************************/ int -_XlcResolveI18NPath(buf, buf_len) - char *buf; - int buf_len; +_XlcResolveI18NPath( + char *buf, + int buf_len) { if (buf != NULL) { xlocaledir(buf, buf_len); @@ -639,10 +639,10 @@ _XlcResolveI18NPath(buf, buf_len) } char * -_XlcLocaleDirName(dir_name, dir_len, lc_name) - char *dir_name; - size_t dir_len; - char *lc_name; +_XlcLocaleDirName( + char *dir_name, + size_t dir_len, + char *lc_name) { char dir[PATH_MAX], buf[PATH_MAX], *name = NULL; int i, n; @@ -742,10 +742,10 @@ _XlcLocaleDirName(dir_name, dir_len, lc_name) } char * -_XlcLocaleLibDirName(dir_name, dir_len, lc_name) - char *dir_name; - size_t dir_len; - char *lc_name; +_XlcLocaleLibDirName( + char *dir_name, + size_t dir_len, + char *lc_name) { char dir[PATH_MAX], buf[PATH_MAX], *name = NULL; int i, n; diff --git a/src/xlibi18n/lcGeneric.c b/src/xlibi18n/lcGeneric.c index dead305..43dccc6 100644 --- a/src/xlibi18n/lcGeneric.c +++ b/src/xlibi18n/lcGeneric.c @@ -1007,8 +1007,7 @@ initialize_core( #endif static Bool -initialize(lcd) - XLCd lcd; +initialize(XLCd lcd) { XLCdPublicMethods superclass = (XLCdPublicMethods) _XlcPublicMethods; diff --git a/src/xlibi18n/lcInit.c b/src/xlibi18n/lcInit.c index 6375de8..fd1818a 100644 --- a/src/xlibi18n/lcInit.c +++ b/src/xlibi18n/lcInit.c @@ -103,7 +103,7 @@ Sun Microsystems, Inc. or its licensors is granted. */ void -_XlcInitLoader() +_XlcInitLoader(void) { #ifdef USE_DYNAMIC_LC @@ -142,7 +142,7 @@ _XlcInitLoader() } void -_XlcDeInitLoader() +_XlcDeInitLoader(void) { #ifdef USE_DYNAMIC_LC diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c index ea26231..285392b 100644 --- a/src/xlibi18n/lcWrap.c +++ b/src/xlibi18n/lcWrap.c @@ -96,7 +96,7 @@ XSetLocaleModifiers( } Bool -XSupportsLocale() +XSupportsLocale(void) { return _XlcCurrentLC() != (XLCd)NULL; } @@ -349,7 +349,7 @@ _XCloseLC( */ XLCd -_XlcCurrentLC() +_XlcCurrentLC(void) { XLCd lcd; static XLCd last_lcd = NULL; -- 1.5.4.3