From f9790767f3a4f6153485880348ebb81273ccce62 Mon Sep 17 00:00:00 2001 From: Jose Rubio Date: Thu, 10 Oct 2019 19:25:07 +0200 Subject: [PATCH] Fix to different compile warnings. Fix to multiple int-conversion Removal of duplicated function definition in dtudcfonted/util.h Added XtEventHandler prototypes to mtfgui --- cde/lib/DtSearch/dberr.c | 4 ++- cde/programs/dtksh/dtkcmds.c | 4 +-- cde/programs/dtksh/findsym.c | 2 +- cde/programs/dtksh/xmcvt.c | 2 +- cde/programs/dtudcfonted/mtfgui.c | 5 ++++ cde/programs/dtudcfonted/ufont.c | 8 ++++++ cde/programs/dtudcfonted/util.c | 17 ++++++----- cde/programs/dtudcfonted/util.h | 48 ++++--------------------------- 8 files changed, 33 insertions(+), 57 deletions(-) diff --git a/cde/lib/DtSearch/dberr.c b/cde/lib/DtSearch/dberr.c index 8aba2984..a54bcafa 100644 --- a/cde/lib/DtSearch/dberr.c +++ b/cde/lib/DtSearch/dberr.c @@ -80,7 +80,9 @@ static char vista_errmsg[1024]; void (*dberr_exit) (int) = exit; /* non AusText user should #define to -1 */ -#define dtsearch_catd -1 +/* the nl_types functions, will discard all catalogs */ +/* with -1 as Message catalog descriptor type. */ +#define dtsearch_catd ((nl_catd)-1) /* non AusText user should #define to stderr */ #define aa_stderr stderr diff --git a/cde/programs/dtksh/dtkcmds.c b/cde/programs/dtksh/dtkcmds.c index 1c1e273f..84476475 100644 --- a/cde/programs/dtksh/dtkcmds.c +++ b/cde/programs/dtksh/dtkcmds.c @@ -7065,14 +7065,14 @@ static struct named_integer CallbackReasons[] = { { "CR_TEAR_OFF_DEACTIVATE", XmCR_TEAR_OFF_DEACTIVATE }, { "CR_OBSCURED_TRAVERSAL", XmCR_OBSCURED_TRAVERSAL }, { "CR_PROTOCOLS", 6666 }, - { NULL, NULL }, + { NULL, 0 }, }; static struct named_integer HelpCallbackReasons[] = { { "HELP_CR_CLOSE", DtCR_HELP_CLOSE }, { "HELP_CR_LINK_ACTIVATE", DtCR_HELP_LINK_ACTIVATE }, - { NULL, NULL }, + { NULL, 0 }, }; diff --git a/cde/programs/dtksh/findsym.c b/cde/programs/dtksh/findsym.c index aa4214fb..8f939666 100644 --- a/cde/programs/dtksh/findsym.c +++ b/cde/programs/dtksh/findsym.c @@ -99,5 +99,5 @@ fsym( #endif #endif - return(NULL); + return(0); } diff --git a/cde/programs/dtksh/xmcvt.c b/cde/programs/dtksh/xmcvt.c index 09955a73..61299e79 100644 --- a/cde/programs/dtksh/xmcvt.c +++ b/cde/programs/dtksh/xmcvt.c @@ -1272,7 +1272,7 @@ static ModifierState modifierTable[] = { {"Mod4Mask", Mod4Mask}, {"Mod5Mask", Mod5Mask}, {"ShiftMask", ShiftMask}, - {NULL, NULL}, + {NULL, 0}, }; diff --git a/cde/programs/dtudcfonted/mtfgui.c b/cde/programs/dtudcfonted/mtfgui.c index b9066713..14acb0d0 100644 --- a/cde/programs/dtudcfonted/mtfgui.c +++ b/cde/programs/dtudcfonted/mtfgui.c @@ -36,6 +36,11 @@ #include #include +#ifdef __linux__ +/* needed for intptr_t */ +#include +#endif + #include "xoakufont.h" #include "util.h" diff --git a/cde/programs/dtudcfonted/ufont.c b/cde/programs/dtudcfonted/ufont.c index 1372e945..864610d1 100644 --- a/cde/programs/dtudcfonted/ufont.c +++ b/cde/programs/dtudcfonted/ufont.c @@ -92,7 +92,11 @@ static void musLine(int evtype, int px, int py); static void musCircle(int evtype, int px, int py); static void musRect(int proc, int evtype, int px, int py); static void musRegionProc(int proc, int evtype, int px, int py); +#ifdef __linux__ +static void musPasteProc(Widget w, XtPointer client_data, XEvent *event, Boolean*); +#else static void musPasteProc(Widget w, XtPointer client_data, XEvent *event); +#endif static void rubLine(int x1, int y1, int x2, int y2); static void rubBand(int x1, int y1, int x2, int y2); static void rubCircle(int ox, int oy, int rx, int ry); @@ -2280,7 +2284,11 @@ musRegionProc( int proc, int evtype, int px, int py ) /*ARGSUSED*/ static void +#ifdef __linux__ +musPasteProc(Widget w, XtPointer client_data, XEvent *event, Boolean* continue_to_dispatch) +#else musPasteProc(Widget w, XtPointer client_data, XEvent *event) +#endif { static int ox=0, oy=0; int rc, tx, ty; diff --git a/cde/programs/dtudcfonted/util.c b/cde/programs/dtudcfonted/util.c index d9d4eac7..33e9eab5 100644 --- a/cde/programs/dtudcfonted/util.c +++ b/cde/programs/dtudcfonted/util.c @@ -43,8 +43,11 @@ #include "FaLib.h" extern Widget toplevel; -static void _destroy(Widget w); -void _unmap(void); + +typedef void (*XtCallbackProc)( Widget widget, XtPointer closure, XtPointer call_data); + +static void _destroy( Widget w, XtPointer closure, XtPointer call_data); +void _unmap( Widget w, XtPointer closure, XtPointer call_data); extern Resource resource ; @@ -175,11 +178,7 @@ RadioButt *data) * */ -#ifdef _HPUX_SOURCE String -#else -XtPointer -#endif GetTextFieldValue(TextField *textf) { char *s1, *s2, *s3; @@ -645,14 +644,14 @@ format_str(Widget st, int charcnt , char *str) XmStringFree(cs); } -void _unmap(void) +void _unmap( Widget w, XtPointer closure, XtPointer call_data) { if (notice && XtIsManaged(notice)){ XtUnmanageChild(notice); } } -static void _destroy(Widget w) +static void _destroy( Widget w, XtPointer closure, XtPointer call_data) { if (w){ XtDestroyWidget(w); @@ -978,7 +977,7 @@ CreateLabel( Widget owner, String name, String str ) /*ARGSUSED*/ Widget -CreateFrame(Widget owner, String name, XtPointer type, XtPointer thickness) +CreateFrame(Widget owner, String name, int type, int thickness) { Widget frame; Arg args[20]; diff --git a/cde/programs/dtudcfonted/util.h b/cde/programs/dtudcfonted/util.h index 057a4acc..80da5a81 100644 --- a/cde/programs/dtudcfonted/util.h +++ b/cde/programs/dtudcfonted/util.h @@ -39,7 +39,6 @@ #define MinimumSpace 4 /***** Exclusive Set *****/ - typedef struct _ToggleButt { Widget w; char * label; @@ -204,39 +203,22 @@ typedef struct _TextField { XmNbottomAttachment, XmATTACH_FORM, \ XmNbottomOffset, offset, \ 0) +#endif /* USE_MACRO */ + -extern Widget GetMenuWidget(MButton *buttons, int buttons_num); -extern Widget CreateFrame(Widget owner, - String name, - XtPointer type, - XtPointer thickness); -extern Widget CreateScrollBar(Widget owner, - String name, - int height, - int val, - int min, - int max, - void (*proc)()); extern Widget CreateDrawingArea(Widget owner, String name, int width, int height, void (*proc)(), int val); -extern Widget CreateLabel(Widget owner, String name, String str); extern Widget CreateDialogAndButtons(Widget owner, String name, void (*delcb)(), Button *btns, int btns_cnt, Widget *pop); -extern -#ifdef _HPUX_SOURCE -String -#else -XtPointer -#endif -GetTextFieldValue(TextField *textf); +extern String GetTextFieldValue(TextField *textf); extern Widget CreateTemplateDialog(Widget w, char *message, unsigned char type, @@ -250,41 +232,22 @@ extern Widget CreateScrollBase(Widget owner, int val, int vcnt, void (*sbproc)()); -extern Widget CreateForm(Widget owner, String name); Widget CreateCaptionFrame(Widget owner, String name, String labelstr, int type, int thickness); -#ifdef _HPUX_SOURCE -String -#else -XtPointer -#endif -GetTextFieldValue(TextField *textf); void CreateTextField(Widget owner, String name, String labelstr, TextField *data, int maxlength); void CreateMenuButtons(Widget owner, Button *buttons, int buttons_cnt); -Widget CreateDialogAndButtons(Widget owner, - String name, - void (*delcb)(), - Button *btns, - int btns_cnt, - Widget *pop); Widget GuiInitialize(XtAppContext *app, String class_name, int *ac, String av[]); -Widget CreateDrawingArea(Widget owner, - String name, - int width, - int height, - void (*proc)(), - int val); void AddLeftAttachWidget(Widget w, Widget ref, int offset); void AddLeftAttachForm(Widget w, int offset); void AddTopAttachWidget(Widget w, Widget ref, int offset); @@ -315,8 +278,8 @@ Widget CreateForm(Widget owner, String name); Widget CreateLabel(Widget owner, String name, String str); Widget CreateFrame(Widget owner, String name, - XtPointer type, - XtPointer thickness); + int type, + int thickness); Widget CreateRowColumn(Widget owner, String name, int layout, @@ -331,4 +294,3 @@ Widget CreateScrollBar(Widget owner, int max, void (*proc)()); -#endif /* USE_MACRO */ -- 2.25.1