fix misleading indentation

Mostly to shut up the compiler, but some real bugs hidden in there.
This commit is contained in:
Patrick Georgi
2025-12-09 21:21:13 +01:00
parent dca08bc5c2
commit ae001c320f
26 changed files with 243 additions and 135 deletions

View File

@@ -1957,7 +1957,7 @@ void _DtHelpSetupDisplayType(
{
/* Update the History and Jump Lists */
if (updateType == DtHISTORY_AND_JUMP)
if (updateType == DtHISTORY_AND_JUMP) {
_DtHelpUpdateJumpList(hw->help_dialog.display.manPage,
DtHELP_TYPE_MAN_PAGE, (Widget)hw);
@@ -1966,6 +1966,7 @@ void _DtHelpSetupDisplayType(
_DtHelpDisplayAreaSetList (hw->help_dialog.help.pDisplayArea,
topicHandle, FALSE,
hw->help_dialog.backtr.scrollPosition);
}
}
else
{

View File

@@ -922,11 +922,9 @@ _DtTermPrimScrollCompleteIfNecessary(Widget w, short scrollTopRow,
if ((lines + tpd->scroll.jump.scrollLines > maxJumpScrollLines) ||
(lines + tpd->scroll.jump.scrollLines < -maxJumpScrollLines))
(void) _DtTermPrimScrollComplete(w, True);
return;
} else {
if (!tw->term.jumpScroll && tpd->scroll.nojump.pendingScroll) {
(void) _DtTermPrimScrollComplete(w, True);
return;
}
}
}

View File

@@ -667,7 +667,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
(void) XtFree(accelerator);
(void) XtFree(acceleratorText);
}
if (menuBar || (!menuBar && firstPopup))
if (menuBar || (!menuBar && firstPopup)) {
#ifdef PULLDOWN_ACCELERATORS
ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,21, "W"));
(void) _DtTermViewCreateCascadeButton(menu, pulldown[pc],
@@ -679,6 +679,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
(GETMESSAGE(NL_SETN_ViewMenu,20, "Window")),
NoSymbol, NULL, NULL, NULL, NULL);
#endif /* PULLDOWN_ACCELERATORS */
}
(void) pc++;
if (first) {
@@ -710,7 +711,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
(void) XtFree(accelerator);
(void) XtFree(acceleratorText);
}
if (menuBar || (!menuBar && firstPopup))
if (menuBar || (!menuBar && firstPopup)) {
#ifdef PULLDOWN_ACCELERATORS
ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,31, "E"));
(void) _DtTermViewCreateCascadeButton(menu, pulldown[pc],
@@ -722,6 +723,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
(GETMESSAGE(NL_SETN_ViewMenu,30, "Edit")),
NoSymbol, NULL, NULL, NULL, NULL);
#endif /* PULLDOWN_ACCELERATORS */
}
(void) pc++;
if (first) {
@@ -777,7 +779,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
ks,
NULL, NULL, NULL, NULL);
}
if (menuBar || (!menuBar && firstPopup))
if (menuBar || (!menuBar && firstPopup)) {
#ifdef PULLDOWN_ACCELERATORS
ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,47, "O"));
(void) _DtTermViewCreateCascadeButton(menu, pulldown[pc],
@@ -789,6 +791,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
(GETMESSAGE(NL_SETN_ViewMenu,46, "Options")),
NoSymbol, NULL, NULL, NULL, NULL);
#endif /* PULLDOWN_ACCELERATORS */
}
(void) pc++;
if (first) {
@@ -905,7 +908,7 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
NULL, NULL, helpAboutDttermCallback, NULL);
}
if (menuBar || (!menuBar && firstPopup))
if (menuBar || (!menuBar && firstPopup)) {
#ifdef PULLDOWN_ACCELERATORS
ks = XStringToKeysym(GETMESSAGE(NL_SETN_ViewMenu,81,"H"));
cascade = _DtTermViewCreateCascadeButton(menu, pulldown[pc],
@@ -918,6 +921,8 @@ CreateMenu(Widget termView, Widget parent, Boolean menuBar,
NoSymbol, NULL, NULL, NULL, NULL);
#endif /* PULLDOWN_ACCELERATORS */
#endif /* HPVUE */
}
if (menuBar) {
/* this is the help button... */
i = 0;

View File

@@ -2481,7 +2481,7 @@ activate_cb( Widget w,
XmProcessTraversal((Widget)combo_w,
(XmTraversalDirection) XmTRAVERSE_CURRENT);
if (Type(combo_w) == DtDROP_DOWN_COMBO_BOX)
if (Type(combo_w) == DtDROP_DOWN_COMBO_BOX)
TextFieldActivate(combo_p, call_data);
/*

View File

@@ -364,7 +364,7 @@ schedule_appt(Calendar *c, Dtcm_appointment *a) {
set_message(c->message_text, "");
if ( rc == 2)
return 0;
return -1;
return -1;
}
} else {
if (!t->frame)

View File

@@ -63,7 +63,8 @@ _DtCm_rtable_lookup_2_svc (Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -85,7 +86,8 @@ _DtCm_rtable_lookup_next_larger_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -107,7 +109,8 @@ _DtCm_rtable_lookup_next_smaller_2_svc(Table_Args_2 *args, struct svc_req *svcrq
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -130,7 +133,8 @@ _DtCm_rtable_lookup_range_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -152,7 +156,8 @@ _DtCm_rtable_abbreviated_lookup_range_2_svc(Table_Args_2 *args, struct svc_req *
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -174,7 +179,8 @@ _DtCm_rtable_insert_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -196,7 +202,8 @@ _DtCm_rtable_delete_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_all_4);
if(newargs) {
@@ -216,7 +223,8 @@ _DtCm_rtable_delete_instance_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_one_4);
if(newargs) {
@@ -237,7 +245,8 @@ _DtCm_rtable_change_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -259,7 +268,8 @@ _DtCm_rtable_change_instance_2_svc(Table_Args_2 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -281,7 +291,8 @@ _DtCm_rtable_lookup_next_reminder_2_svc(Table_Args_2 *args, struct svc_req *svcr
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
res = NULL;
newargs = _DtCm_tableargs2_to_tableargs4(args);
if(newargs) {
@@ -427,7 +438,8 @@ _DtCm_rtable_get_access_2_svc(Access_Args_2 *args, struct svc_req *svcrq)
Access_Args_4 *newargs;
Access_Args_4 *newres;
if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_2, (char*)res); res = NULL;
if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_2, (char*)res);
res = NULL;
newargs = _DtCm_accargs2_to_accargs4(args);
if(newargs) {

View File

@@ -63,7 +63,8 @@ _DtCm_rtable_lookup_3_svc (Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -84,7 +85,8 @@ _DtCm_rtable_lookup_next_larger_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -105,7 +107,8 @@ _DtCm_rtable_lookup_next_smaller_3_svc(Table_Args_3 *args, struct svc_req *svcrq
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -126,7 +129,8 @@ _DtCm_rtable_lookup_range_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -147,7 +151,8 @@ _DtCm_rtable_abbreviated_lookup_range_3_svc(Table_Args_3 *args, struct svc_req *
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -168,7 +173,8 @@ _DtCm_rtable_insert_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -189,7 +195,8 @@ _DtCm_rtable_delete_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_all_4);
if(newargs) {
@@ -210,7 +217,8 @@ _DtCm_rtable_delete_instance_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_one_4);
if(newargs) {
@@ -231,7 +239,8 @@ _DtCm_rtable_change_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -253,7 +262,8 @@ _DtCm_rtable_change_instance_3_svc(Table_Args_3 *args, struct svc_req *svcrq)
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -275,7 +285,8 @@ _DtCm_rtable_lookup_next_reminder_3_svc(Table_Args_3 *args, struct svc_req *svcr
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {
@@ -415,7 +426,8 @@ _DtCm_rtable_get_access_3_svc(Access_Args_3 *args, struct svc_req *svcrq)
Access_Args_4 *newargs;
Access_Args_4 *newres;
if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_3, (char*)res);
res = NULL;
newargs = _DtCm_accargs3_to_accargs4(args);
if(newargs) {
@@ -435,7 +447,8 @@ _DtCm_rtable_abbreviated_lookup_key_range_3_svc(Table_Args_3 *args, struct svc_r
Table_Args_4 *newargs;
Table_Res_4 *newres;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res); res = NULL;
if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
res = NULL;
newargs = _DtCm_tableargs3_to_tableargs4(args);
if(newargs) {

View File

@@ -1273,8 +1273,10 @@ void UxDoEditPixmap(Widget wid, char *fname)
return;
}
}
if (fd1 > -1) close(fd1); fd1 = -1;
if (fd2 > -1) close(fd2); fd2 = -1;
if (fd1 > -1) close(fd1);
fd1 = -1;
if (fd2 > -1) close(fd2);
fd2 = -1;
#ifdef DEBUG
printf("final buffer = '%s'\n", buffer); /* debug */

View File

@@ -736,7 +736,8 @@ int Putc(
case '\\':
*pc++ = '\\';
}
for (j = 0; j < i; ++j) *pc++ = argBuf[j]; i = 0;
for (j = 0; j < i; ++j) *pc++ = argBuf[j];
i = 0;
*pc++ = '"';
*pc++ = 0;
tcl_enc = Tcl_GetEncoding(NULL, NULL);

View File

@@ -4111,17 +4111,18 @@ WorkSpaceRemoved (
for(k=0;
k<desktop_data->workspaceData[new_index]->files_selected;k++)
{
/* Adjust the selectedDTWindows of current to accommadate the old list */
/* Adjust the selectedDTWindows of current to accommodate the old list */
if(desktop_data->workspaceData[new_index]->
selectedDTWindows[k] == desktop_data->desktopWindows[i])
{
desktop_data->workspaceData[new_index]->
selectedDTWindows[k] = NULL;
for(;k<desktop_data->workspaceData[new_index]->files_selected;k++)
for(;k<desktop_data->workspaceData[new_index]->files_selected;k++) {
desktop_data->workspaceData[new_index]->
selectedDTWindows[k] = desktop_data->
workspaceData[new_index]-> selectedDTWindows[k+1];
desktop_data->workspaceData[new_index]->files_selected--;
}
break;
}
}

View File

@@ -5706,23 +5706,30 @@ UpdateOneFileIcon(
/* Build the rest of the arg list and either create or reuse the widget. */
XtSetArg (args[n], XmNstring, icon_label); n++;
XtSetArg (args[n], XmNstring, icon_label);
n++;
argi_imageName = n;
if (pixmapData)
XtSetArg (args[n], XmNimageName, pixmapData->iconFileName);
else
XtSetArg (args[n], XmNimageName, NULL);
n++;
XtSetArg (args[n], XmNmaxPixmapWidth, layout_data->pixmap_width); n++;
XtSetArg (args[n], XmNmaxPixmapHeight, layout_data->pixmap_height); n++;
XtSetArg (args[n], XmNuserData, directory_set); n++;
XtSetArg (args[n], XmNunderline, False); n++;
XtSetArg (args[n], XmNfillMode, XmFILL_TRANSPARENT); n++;
XtSetArg (args[n], XmNmaxPixmapWidth, layout_data->pixmap_width);
n++;
XtSetArg (args[n], XmNmaxPixmapHeight, layout_data->pixmap_height);
n++;
XtSetArg (args[n], XmNuserData, directory_set);
n++;
XtSetArg (args[n], XmNunderline, False);
n++;
XtSetArg (args[n], XmNfillMode, XmFILL_TRANSPARENT);
n++;
if (file_mgr_data->view == BY_NAME_AND_ICON &&
file_mgr_data->show_type != MULTIPLE_DIRECTORY)
XtSetArg (args[n], XmNpixmapPosition, XmPIXMAP_TOP);
else
XtSetArg (args[n], XmNpixmapPosition, XmPIXMAP_LEFT); n++;
XtSetArg (args[n], XmNpixmapPosition, XmPIXMAP_LEFT);
n++;
/* See if we can re-use the same or some other icon gadget */
if (file_view_data->widget)
@@ -5738,7 +5745,8 @@ UpdateOneFileIcon(
/* reuse the icon gadget */
if (icon_widget != file_view_data->widget || file_mgr_data->newSize)
{
XtSetArg (args[n], XmNdropSiteOperations, XmDROP_NOOP);n++;
XtSetArg (args[n], XmNdropSiteOperations, XmDROP_NOOP);
n++;
XtRemoveAllCallbacks(icon_widget, XmNdropCallback);
file_view_data->registered = False;
}
@@ -5766,25 +5774,34 @@ UpdateOneFileIcon(
else
{
/* create a new or duplicate an existing widget */
XtSetArg (args[n], XmNshadowThickness, 2); n++;
XtSetArg (args[n], XmNdropSiteOperations, XmDROP_NOOP);n++;
XtSetArg (args[n], XmNfontList, user_font); n++;
XtSetArg (args[n], XmNshadowThickness, 2);
n++;
XtSetArg (args[n], XmNdropSiteOperations, XmDROP_NOOP);
n++;
XtSetArg (args[n], XmNfontList, user_font);
n++;
if( keybdFocusPolicy == XmEXPLICIT)
{
XtSetArg (args[n], XmNtraversalOn, True); n++;
XtSetArg (args[n], XmNtraversalOn, True);
n++;
}
else
{
XtSetArg (args[n], XmNtraversalOn, False); n++;
XtSetArg (args[n], XmNhighlightThickness, 0); n++;
XtSetArg (args[n], XmNtraversalOn, False);
n++;
XtSetArg (args[n], XmNhighlightThickness, 0);
n++;
}
XtSetArg (args[n], XmNborderType, DtNON_RECTANGLE); n++;
XtSetArg (args[n], XmNborderType, DtNON_RECTANGLE);
n++;
if (layout_data->dup_icon_widget == NULL)
{
#ifdef HARDCODED_ICON_MARGINS
XtSetArg (args[n], XmNmarginWidth, 0); n++;
XtSetArg (args[n], XmNmarginHeight, 0); n++;
XtSetArg (args[n], XmNmarginWidth, 0);
n++;
XtSetArg (args[n], XmNmarginHeight, 0);
n++;
#endif
XtSetArg (args[n], XmNx, -999); n++;
XtSetArg (args[n], XmNy, -999); n++;
@@ -5815,9 +5832,12 @@ UpdateOneFileIcon(
icon_widget->core.y = -999;
/* make sure colors, drop operations, and clipping are right */
XtSetArg(args[i], XmNdropSiteOperations, XmDROP_NOOP); i++;
XtSetArg(args[i], XmNmaxPixmapWidth, layout_data->pixmap_width); i++;
XtSetArg(args[i], XmNmaxPixmapHeight, layout_data->pixmap_height); i++;
XtSetArg(args[i], XmNdropSiteOperations, XmDROP_NOOP);
i++;
XtSetArg(args[i], XmNmaxPixmapWidth, layout_data->pixmap_width);
i++;
XtSetArg(args[i], XmNmaxPixmapHeight, layout_data->pixmap_height);
i++;
XtSetValues (icon_widget, args, i);
}
XtAddCallback(icon_widget, XmNhelpCallback,

View File

@@ -1887,7 +1887,8 @@ FileTypePreview(
if (pixmapData)
XtSetArg (args[n], XmNimageName, pixmapData->iconFileName);
else
XtSetArg (args[n], XmNimageName, NULL); n++;
XtSetArg (args[n], XmNimageName, NULL);
n++;
XtSetValues (call_struct->file_type_widget, args, n);
_DtCheckAndFreePixmapData(file_type,

View File

@@ -914,67 +914,96 @@ SetValues(
LARGE);
n = 0;
XtSetArg (args[n], XmNstring, icon_label); n++;
XtSetArg (args[n], XmNstring, icon_label);
n++;
if (pixmapData)
XtSetArg (args[n], XmNimageName, pixmapData->iconFileName);
else
XtSetArg (args[n], XmNimageName, NULL); n++;
XtSetArg (args[n], XmNunderline, False); n++;
XtSetArg (args[n], XmNimageName, NULL);
n++;
XtSetArg (args[n], XmNunderline, False);
n++;
XtSetArg (args[n], XmNpixmapPosition, XmPIXMAP_TOP); n++;
XtSetArg (args[n], XmNbehavior, XmICON_BUTTON); n++;
XtSetArg (args[n], XmNfillMode, XmFILL_PARENT); n++;
XtSetArg (args[n], XmNpixmapPosition, XmPIXMAP_TOP);
n++;
XtSetArg (args[n], XmNbehavior, XmICON_BUTTON);
n++;
XtSetArg (args[n], XmNfillMode, XmFILL_PARENT);
n++;
XtSetArg (args[n], XmNforeground, foreground_color); n++;
XtSetArg (args[n], XmNarmColor, white_pixel); n++;
XtSetArg (args[n], XmNforeground, foreground_color);
n++;
XtSetArg (args[n], XmNarmColor, white_pixel);
n++;
if (background_color == white_pixel)
{
XtSetArg (args[n], XmNbackground, white_pixel); n++;
XtSetArg (args[n], XmNpixmapBackground, white_pixel); n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel); n++;
XtSetArg (args[n], XmNbackground, white_pixel);
n++;
XtSetArg (args[n], XmNpixmapBackground, white_pixel);
n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel);
n++;
}
else if (background_color == black_pixel)
{
XtSetArg (args[n], XmNbackground, black_pixel); n++;
XtSetArg (args[n], XmNpixmapBackground, white_pixel); n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel); n++;
XtSetArg (args[n], XmNbackground, black_pixel);
n++;
XtSetArg (args[n], XmNpixmapBackground, white_pixel);
n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel);
n++;
}
else
{
XtSetArg (args[n], XmNbackground, background_color); n++;
XtSetArg (args[n], XmNpixmapBackground, pixmap_background); n++;
XtSetArg (args[n], XmNpixmapForeground, pixmap_foreground); n++;
XtSetArg (args[n], XmNbackground, background_color);
n++;
XtSetArg (args[n], XmNpixmapBackground, pixmap_background);
n++;
XtSetArg (args[n], XmNpixmapForeground, pixmap_foreground);
n++;
}
if (i - count < num_children)
{
icon_widget = mgr->composite.children[i - count];
XtSetArg (args[n], XmNx, x); n++;
XtSetArg (args[n], XmNy, 5); n++;
XtSetArg (args[n], XmNuserData, user_data); n++;
XtSetArg (args[n], XmNx, x);
n++;
XtSetArg (args[n], XmNy, 5);
n++;
XtSetArg (args[n], XmNuserData, user_data);
n++;
XtSetValues(icon_widget, args, n);
XtRemoveAllCallbacks (icon_widget, XmNcallback);
}
else
{
XtSetArg (args[n], XmNx, x); n++;
XtSetArg (args[n], XmNy, 5); n++;
XtSetArg (args[n], XmNshadowThickness, 2); n++;
XtSetArg (args[n], XmNfontList, user_font); n++;
XtSetArg (args[n], XmNx, x);
n++;
XtSetArg (args[n], XmNy, 5);
n++;
XtSetArg (args[n], XmNshadowThickness, 2);
n++;
XtSetArg (args[n], XmNfontList, user_font);
n++;
if(keybdFocusPolicy == XmEXPLICIT)
{
XtSetArg (args[n], XmNtraversalOn, True); n++;
XtSetArg (args[n], XmNtraversalOn, True);
n++;
}
else
{
XtSetArg (args[n], XmNtraversalOn, False); n++;
XtSetArg (args[n], XmNhighlightThickness, 0); n++;
XtSetArg (args[n], XmNtraversalOn, False);
n++;
XtSetArg (args[n], XmNhighlightThickness, 0);
n++;
}
XtSetArg (args[n], XmNborderType, DtNON_RECTANGLE); n++;
XtSetArg (args[n], XmNborderType, DtNON_RECTANGLE);
n++;
if (mgr->composite.num_children == 0)
{
XtSetArg (args[n], XmNuserData, user_data); n++;
XtSetArg (args[n], XmNuserData, user_data);
n++;
icon_widget= _DtCreateIcon ((Widget)mgr, "icon", args, n);
}
else
@@ -984,8 +1013,10 @@ SetValues(
(XmString)args[0].value, (String)args[1].value,
(XtPointer)user_data, (Boolean)args[2].value);
n = 0;
XtSetArg (args[n], XmNx, x); n++;
XtSetArg (args[n], XmNy, 5); n++;
XtSetArg (args[n], XmNx, x);
n++;
XtSetArg (args[n], XmNy, 5);
n++;
XtSetValues(icon_widget, args, n);
}
XtAddCallback(icon_widget, XmNhelpCallback,
@@ -1020,18 +1051,25 @@ SetValues(
/* Draw the selected icon as selected */
if (background_color == white_pixel)
{
XtSetArg (args[n], XmNbackground, black_pixel); n++;
XtSetArg (args[n], XmNforeground, white_pixel); n++;
XtSetArg (args[n], XmNbackground, black_pixel);
n++;
XtSetArg (args[n], XmNforeground, white_pixel);
n++;
}
else
{
XtSetArg (args[n], XmNbackground, white_pixel); n++;
XtSetArg (args[n], XmNforeground, black_pixel); n++;
XtSetArg (args[n], XmNbackground, white_pixel);
n++;
XtSetArg (args[n], XmNforeground, black_pixel);
n++;
}
XtSetArg (args[n], XmNpixmapBackground, white_pixel); n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel); n++;
XtSetArg (args[n], XmNarmColor, white_pixel); n++;
XtSetArg (args[n], XmNpixmapBackground, white_pixel);
n++;
XtSetArg (args[n], XmNpixmapForeground, black_pixel);
n++;
XtSetArg (args[n], XmNarmColor, white_pixel);
n++;
XtSetValues(icon_widget, args, n);
}
}
@@ -1054,7 +1092,8 @@ SetValues(
{
n = 0;
XtSetArg(args[n], XmNy,
5 + (max - mgr->composite.children[i]->core.height)); n++;
5 + (max - mgr->composite.children[i]->core.height));
n++;
XtSetValues(mgr->composite.children[i], args, n);
}
}

View File

@@ -637,10 +637,12 @@ int read_selection_file(FileSel *fsel, FILE *fp)
if (str_to_int(valp, &i) && i >= 0)
select_mode = i;
} else if (strncmp(lp + 1, STR_IMSNAME, 4) == 0) {
vp = valp; cut_field(valp);
vp = valp;
cut_field(valp);
RENEWSTR(imsname, vp);
} else if (strncmp(lp + 1, STR_HOSTNAME, 4) == 0) {
vp = valp; cut_field(valp);
vp = valp;
cut_field(valp);
FREE(hostname);
if (strcmp(vp, NAME_LOCAL))
hostname = NEWSTR(vp);

View File

@@ -223,9 +223,9 @@ void *_mp_;
#define is_white(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
#define skip_white(p) while (is_white(*(p))) (p)++
#define next_field(p) \
for ((p)++; *(p) && !is_white(*(p)); (p)++) ; skip_white(p)
do { for ((p)++; *(p) && !is_white(*(p)); (p)++) ; skip_white(p); } while (0)
#define cut_field(p) \
for ((p)++; *(p) && !is_white(*(p)); (p)++) ; *(p)++ = 0; skip_white(p)
do { for ((p)++; *(p) && !is_white(*(p)); (p)++) ; *(p)++ = 0; skip_white(p); } while (0)
/* misc */
#define Max(a, b) ((a) < (b) ? (b) : (a))

View File

@@ -142,7 +142,8 @@ ApplyFontPathMods( struct display *d, Display *dpy )
for (s=fph, i=j=0; j<numHeads; j++) {
if (!PathInPList(s,newList,i))
newList[i++] = s;
while (*s) s++; s++;
while (*s) s++;
s++;
}
for (j=0; j<numPaths; j++) {
if (!PathInPList(fontPath[j],newList,i) &&
@@ -153,7 +154,8 @@ ApplyFontPathMods( struct display *d, Display *dpy )
for (s=fpt, j=0; j<numTails; j++) {
if (!PathInPList(s,newList,i))
newList[i++] = s;
while (*s) s++; s++;
while (*s) s++;
s++;
}
if (debugLevel > 0)
DebugFontPath("Request (XSetFontPath)",newList,i);
@@ -239,7 +241,8 @@ PathInZList(char *path, char *fplist, int listlen)
s++; while (*s == '/') s++;
}
if (!*s && !*t) return 1;
while (*t) t++; t++;
while (*t) t++;
t++;
}
return 0;
}

View File

@@ -181,7 +181,7 @@ Verify(
case NOTIFY_OK:
if(d->session)
argv = parseArgs (argv,d->session);
break;
break;
case NOTIFY_ALT_DTS:
if((argv = setDt(d,argv,notify_dt)) == NULL)
/*if no startup file, startup the regular desktop*/

View File

@@ -339,7 +339,7 @@ void AliasListUiItem::handleChangeButtonPress()
XmNvalue, &value_str,
NULL);
if(key_str != NULL)
if(key_str != NULL) {
if(strlen(key_str) > 0)
{
@@ -378,6 +378,7 @@ void AliasListUiItem::handleChangeButtonPress()
TRUE);
}
props_changed = TRUE;
}
}
}
///////////////////////////////////////////////////////////

View File

@@ -295,7 +295,7 @@ void AlternatesListUiItem::handleChangeButtonPress()
XmNvalue, &test_str,
NULL);
if(test_str != NULL)
if(test_str != NULL) {
if(strlen(test_str) > 1)
{
@@ -323,6 +323,7 @@ void AlternatesListUiItem::handleChangeButtonPress()
TRUE);
}
props_changed = TRUE;
}
}
}
///////////////////////////////////////////////////////////

View File

@@ -275,7 +275,7 @@ void IgnoreListUiItem::handleChangeButtonPress()
XmNvalue, &test_str,
NULL);
if(test_str != NULL)
if(test_str != NULL) {
if(strlen(test_str) > 1)
{
@@ -304,6 +304,7 @@ void IgnoreListUiItem::handleChangeButtonPress()
TRUE);
}
props_changed = TRUE;
}
}
}
///////////////////////////////////////////////////////////

View File

@@ -5459,23 +5459,23 @@ Widget parent=NULL;
}
if(!parent)
parent = theApplication->baseWidget();
DtMailGenDialog *genDialog = new DtMailGenDialog("Dialog",parent,XmDIALOG_FULL_APPLICATION_MODAL);
DtMailGenDialog *genDialog = new DtMailGenDialog("Dialog",parent,XmDIALOG_FULL_APPLICATION_MODAL);
char *errMsg = (char *) XtCalloc(1,10240+strlen(fsname));
char *errMsg = (char *) XtCalloc(1,10240+strlen(fsname));
// Serious error here -- No Space on Filesystem --
sprintf(errMsg,"Insufficient space on %s filesystem. Dtmail unable to show any new \n messages, delete messages, or save further changes to the open \n mailbox. Please contact your System Administrator to correct the \n filesystem space problem.",fsname);
free(fsname);
genDialog->setToErrorDialog(
CATGETS(DT_catd, 1, 6, "Mailer"),
errMsg);
XtFree(errMsg);
// Serious error here -- No Space on Filesystem --
sprintf(errMsg,"Insufficient space on %s filesystem. Dtmail unable to show any new \n messages, delete messages, or save further changes to the open \n mailbox. Please contact your System Administrator to correct the \n filesystem space problem.",fsname);
free(fsname);
genDialog->setToErrorDialog(
CATGETS(DT_catd, 1, 6, "Mailer"),
errMsg);
XtFree(errMsg);
genDialog->post_and_return(
CATGETS(DT_catd, 3, 9, "OK"),
NULL);
delete genDialog;
genDialog->post_and_return(
CATGETS(DT_catd, 3, 9, "OK"),
NULL);
delete genDialog;
}
void
RoamMenuWindow::stopAutoSave(void)

View File

@@ -1875,7 +1875,7 @@ RFCMailBox::mapFile(DtMailEnv & error,
DEBUG_PRINTF(
("mapFile: Error mmap(1) == %p, errno = %d\n", map->map_region, errno));
if (_errorLogging)
if (_errorLogging) {
writeToDumpFile(
mmap_format_string,
pname, err_phase,
@@ -1885,6 +1885,7 @@ RFCMailBox::mapFile(DtMailEnv & error,
"%s(%d): statbuf: ino=%d, dev=%d, nlink=%d, size=%ld\n",
pname, err_phase,
statbuf.st_ino, statbuf.st_dev, statbuf.st_nlink, statbuf.st_size);
}
if (map->map_region == (char *) -1)
{
@@ -2030,7 +2031,7 @@ RFCMailBox::mapFile(DtMailEnv & error,
(map->map_region[offset_from_map+map->file_size-1] == '\0'))
) {
if (_errorLogging)
if (_errorLogging) {
writeToDumpFile(
"%s(%d): SafeRead(%d(%s), 0x%08lx, %d) == %d, errno == %d\n",
pname, err_phase, _fd, _real_path, map->map_region, bytesToRead,
@@ -2039,6 +2040,7 @@ RFCMailBox::mapFile(DtMailEnv & error,
"%s(%d): stat buf: ino=%d, dev=%d, nlink=%d, size=%ld\n",
pname, err_phase, statbuf.st_ino, statbuf.st_dev,
statbuf.st_nlink, statbuf.st_size);
}
if (readResults > 0) {
if (_errorLogging)

View File

@@ -641,9 +641,11 @@ changeSampleFontCB(
/* Set the sample System Font string to different Font */
n = 0;
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].sysFont); n++;
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].sysFont);
n++;
/* string_val = CMPSTR(SYSTEM_MSG);*/
XtSetArg (args[n], XmNlabelString, CMPSTR(SYSTEM_MSG)); n++;
XtSetArg (args[n], XmNlabelString, CMPSTR(SYSTEM_MSG));
n++;
XtSetValues (font.systemLabel, args, n);
/*
@@ -652,8 +654,10 @@ changeSampleFontCB(
*/
n = 0;
if (!font.userTextChanged)
XtSetArg (args[n], XmNvalue, USER_MSG); n++;
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].userFont); n++;
XtSetArg (args[n], XmNvalue, USER_MSG);
n++;
XtSetArg(args[n], XmNfontList, style.xrdb.fontChoice[pos].userFont);
n++;
XtSetValues (font.userText, args, n);
XmTextShowPosition(font.userText, 0);
}

View File

@@ -66,7 +66,7 @@
#define is_white(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
#define skip_white(p) while (is_white(*(p))) (p)++
#define cut_field(p) \
for ((p)++; *(p) && !is_white(*(p)); (p)++) ; *(p)++ = 0; skip_white(p)
do { for ((p)++; *(p) && !is_white(*(p)); (p)++) ; *(p)++ = 0; skip_white(p); } while (0)
void start_tag_line(char *fname);

View File

@@ -1566,12 +1566,13 @@ ButtonCB(
}
mouse.dclickChanged = False;
if (mouse.btn2Changed)
if (mouse.btn2Changed) {
if(mouse.function == TRANSFER)
sprintf(enableBtn1Res, enableBtn1TransferString, "button2_transfer");
else
sprintf(enableBtn1Res, enableBtn1TransferString, "True");
_DtAddToResource(style.display,enableBtn1Res);
}
break;

View File

@@ -893,16 +893,16 @@ int GetBitmapIndex (WmScreenData *pSD, char *name, Boolean bReportError)
{
if (bReportError)
MWarning (((char *)GETMESSAGE(38, 7, "Unable to read bitmap file %s\n")), path);
XtFree ((char *)bitmapc->path);
return (-1);
XtFree ((char *)bitmapc->path);
return (-1);
}
if (bitmapc->width == 0 || bitmapc->height == 0)
{
if (bReportError)
MWarning (((char *)GETMESSAGE(38, 8, "Invalid bitmap file %s\n")), path);
XtFree ((char *)bitmapc->path);
return (-1);
XtFree ((char *)bitmapc->path);
return (-1);
}
}
else