diff --git a/cde/programs/dtinfo/dtinfo/Imakefile b/cde/programs/dtinfo/dtinfo/Imakefile index ba43720a6..32e89d1c6 100644 --- a/cde/programs/dtinfo/dtinfo/Imakefile +++ b/cde/programs/dtinfo/dtinfo/Imakefile @@ -5,6 +5,13 @@ XCOMM $TOG: Imakefile /main/9 1998/08/10 15:54:01 mgreess $ SUBDIRS=wwl src install +XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir +#undef TopLevelProject +#define TopLevelProject DtInfo +IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' + MakeSubdirs($(SUBDIRS)) DependSubdirs(wwl src) diff --git a/cde/programs/dtinfo/dtinfo/install/Imakefile b/cde/programs/dtinfo/dtinfo/install/Imakefile index 3cfe67912..28992c648 100644 --- a/cde/programs/dtinfo/dtinfo/install/Imakefile +++ b/cde/programs/dtinfo/dtinfo/install/Imakefile @@ -5,5 +5,12 @@ XCOMM $TOG: Imakefile /main/8 1998/08/10 15:53:37 mgreess $ SUBDIRS = lib +XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir +#undef TopLevelProject +#define TopLevelProject DtInfo +IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' + MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/cde/programs/dtinfo/dtinfo/install/lib/fonts/Imakefile b/cde/programs/dtinfo/dtinfo/install/lib/fonts/Imakefile index df907b7c1..af671a976 100644 --- a/cde/programs/dtinfo/dtinfo/install/lib/fonts/Imakefile +++ b/cde/programs/dtinfo/dtinfo/install/lib/fonts/Imakefile @@ -1,5 +1,10 @@ XCOMM $XConsortium: Imakefile /main/6 1996/09/13 17:26:30 drk $ +#ifdef X11ProjectRoot +FONTC = $(XPROJECTROOT)/bin/bdftopcf +MKFONTDIR = $(XPROJECTROOT)/bin/mkfontdir +#endif + OBJS = FontObj(dtinfo) LinkSourceFile(dtinfo.bdf,$(CDESRC)/fontaliases/bdf) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgent.msg b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgent.msg index 8b1affed7..6d09a9742 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgent.msg +++ b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgent.msg @@ -38,4 +38,3 @@ $ (This string will be shown in a directory listing where there $ are no Infolibs found in the directory.) 11 "No Infolibs Present" - diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C index 684fcaf70..71f13aa4c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/AddLibraryAgentMotif.C @@ -46,7 +46,8 @@ #define C_AddLibraryAgent #define C_HelpAgent #define L_Agents -#include +#include +using namespace std; #include "Other/XmStringLocalized.hh" #include "Managers/CatMgr.hh" @@ -118,7 +119,7 @@ AddLibraryAgent::create_ui (Widget parent) { ON_ACTIVATE (f_ok, ok); ON_ACTIVATE (f_clr, clear); ON_ACTIVATE (canc, cancel); - help_agent().add_activate_help (help, "add_infolib_help"); + help_agent().add_activate_help (help, (char*)"add_infolib_help"); f_shell.Realize (); // XtVaSetValues(f_form, XmNinitialFocus, (Widget)f_text, NULL); @@ -134,7 +135,7 @@ void AddLibraryAgent::clear () { // autoUnmanage must be set to False for this button to work properly - XmTextFieldSetString( f_text, "" ); + XmTextFieldSetString( f_text, (char*)"" ); } void @@ -212,8 +213,8 @@ AddLibraryAgent::pick_dir () { CATGETS(Set_AddLibraryAgent, 10, "Dtinfo: Infolib Selection")); XmString no_libs_str = XmStringCreateLocalized( CATGETS(Set_AddLibraryAgent, 11, "No Infolibs Present")); - XmString patt_str = XmStringCreateLocalized( "*.dti" ); - XmString infolibs_str = XmStringCreateLocalized( "Infolibs" ); + XmString patt_str = XmStringCreateLocalized( (char*)"*.dti" ); + XmString infolibs_str = XmStringCreateLocalized( (char*)"Infolibs" ); // default initial directory on first entry char *buf = new char[256]; @@ -244,7 +245,7 @@ AddLibraryAgent::pick_dir () { XtSetArg(args[n], XmNpathMode, XmPATH_MODE_RELATIVE); n++; f_file_sel = XmCreateFileSelectionDialog( - f_shell, "pick_dir_file", args, n ); + f_shell, (char*)"pick_dir_file", args, n ); XmStringFree(basedir_str); XmStringFree(initdir_str); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C index b612b8222..20441d1b4 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/BookmarkEditMotif.C @@ -87,7 +87,8 @@ #include #include -#include +#include +using namespace std; int BookmarkEdit::g_modified_count = 0; @@ -250,14 +251,14 @@ BookmarkEdit::create_ui() WXmPushButtonGadget help (form, "help", WAutoManage); mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); - help_agent().add_activate_help (help, "bookmark_edit_help"); + help_agent().add_activate_help (help, (char*)"bookmark_edit_help"); f_wm_delete_callback = new WCallback (*f_shell, window_system().WM_DELETE_WINDOW(), this, (WWL_FUN) &BookmarkEdit::cancel); WXmSeparatorGadget separator (form, "separator", WAutoManage); - Widget notes_text = XmCreateScrolledText (form, "notes_text", NULL, 0); + Widget notes_text = XmCreateScrolledText (form, (char*)"notes_text", NULL, 0); f_notes_text = new WXmText (notes_text); f_notes_text->Manage(); @@ -295,11 +296,11 @@ BookmarkEdit::ok() f_mark_ptr->set_name (f_name_text->Value()); f_mark_ptr->set_notes (f_notes_text->Value()); // Save the mark to disk. - try + mtry { f_mark_ptr->save(); } - catch_any() + mcatch_any() { message_mgr().error_dialog( CATGETS(Set_BookmarkEdit, 1, "Dtinfo: Bookmark Editor")); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C index b8e954700..73daa3f20 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/GraphicAgentMotif.C @@ -80,7 +80,8 @@ #include "Other/XmStringLocalized.hh" #include -#include +#include +using namespace std; #include #include @@ -142,7 +143,7 @@ GraphicAgent::~GraphicAgent() pixmap); // a scaled pixmap...give it back } - if(f_shell != NULL) + if(f_shell != 0) f_shell.Destroy(); } @@ -153,7 +154,7 @@ GraphicAgent::~GraphicAgent() void GraphicAgent::popup() { - if (f_shell == NULL) + if (f_shell == 0) create_ui(); f_shell.Popup(); @@ -167,7 +168,7 @@ GraphicAgent::popup() void GraphicAgent::display() { - if (f_shell == NULL) + if (f_shell == 0) create_ui(); // assume all graphics are scalable for now. @@ -240,7 +241,7 @@ GraphicAgent::create_ui() f_shell.SetDestroyCallback (this, (WWL_FUN) &GraphicAgent::ui_destroyed); DECL (WXmForm, form, f_shell, "form" ); - DECLM (WXmMenuBar, menu_bar, form, "menu_bar" ); + DECLMC(WXmMenuBar, menu_bar, form, "menu_bar" ); #ifdef hpux // // rtp: hard-wire the menu bar's background, since @@ -252,7 +253,7 @@ GraphicAgent::create_ui() #endif DECLM (WXmCascadeButton, file, menu_bar, "file" ); - DECLM (WXmPulldownMenu, file_menu, menu_bar, "file_menu" ); + DECLMC(WXmPulldownMenu, file_menu, menu_bar, "file_menu" ); DECLM (WXmPushButton, attach, file_menu, "attach" ); DECLM (WXmPushButton, visit, file_menu, "visit" ); DECLM (WXmPushButton, close, file_menu, "close" ); @@ -282,7 +283,7 @@ GraphicAgent::create_ui() NULL); DECLM (WXmCascadeButton, pan, menu_bar, "panner" ); - DECLM (WXmPulldownMenu, panner_menu, menu_bar, "panner_menu" ); + DECLMC(WXmPulldownMenu, panner_menu, menu_bar, "panner_menu" ); DECLM (WXmToggleButton, none, panner_menu, "none" ); DECLM (WXmToggleButton, up_left, panner_menu, "up_left" ); DECLM (WXmToggleButton, up_right, panner_menu, "up_right" ); @@ -327,8 +328,8 @@ GraphicAgent::create_ui() // NOTE: some code in this module depends upon the exact ordering of items // view menu will only be sensitive for scalable graphics - DECL (WXmCascadeButton, view, menu_bar, "view" ); - DECLM (WXmPulldownMenu, view_menu, menu_bar, "view_menu" ); + DECL (WXmCascadeButton, view, menu_bar, "view" ); + DECLMC(WXmPulldownMenu, view_menu, menu_bar, "view_menu" ); DECLM (WXmPushButton, fit_gr_to_win, view_menu, "fit_window" ); DECLM (WXmPushButton, fit_win_to_gr, view_menu, "fit_graphic" ); @@ -386,7 +387,7 @@ GraphicAgent::create_ui() f_view_menu = (WXmPulldownMenu*)(Widget)view_menu ; DECLM (WXmCascadeButton, help, menu_bar, "help" ); - DECLM (WXmPulldownMenu, help_menu, menu_bar, "help_menu" ); + DECLMC(WXmPulldownMenu, help_menu, menu_bar, "help_menu" ); DECLM (WXmPushButton, on_window, help_menu, "on_window" ); DECLM (WXmPushButton, on_help, help_menu, "on_help" ); @@ -480,8 +481,8 @@ GraphicAgent::create_ui() SET_CALLBACK_D (z_200,ValueChanged,zoom_callback,200); SET_CALLBACK_D (z_custom,ValueChanged,zoom_callback,0); - help_agent().add_activate_help (on_window, "graphic_on_window"); - help_agent().add_activate_help (on_help, "graphic_on_help"); + help_agent().add_activate_help (on_window, (char*)"graphic_on_window"); + help_agent().add_activate_help (on_help, (char*)"graphic_on_help"); view.Manage(); @@ -815,7 +816,7 @@ GraphicAgent::set_panner(WCallback *wcb) WXmToggleButton button(wcb->GetWidget()); if (button.Set()) { - unsigned int state = (unsigned int)wcb->ClientData(); + size_t state = (size_t)wcb->ClientData(); adjust_panner(state); } } @@ -835,7 +836,7 @@ GraphicAgent::zoom_callback(WCallback *wcb) if (button.Set()) { - int scale = (unsigned int) wcb->ClientData(); + size_t scale = (size_t) wcb->ClientData(); if (scale > 0) { set_zoom (scale); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C index f0ca40388..11e9099ca 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/HelpAgent.C @@ -81,7 +81,8 @@ #include
#include
#include -#include +#include +using namespace std; #define CLASS HelpAgent #include "create_macros.hh" @@ -164,7 +165,7 @@ HelpAgent::create_ui() n = 0; XtSetArg(args[n], XmNtitle, "Dtinfo Help"); n++; f_helper = DtCreateHelpDialog(app_shell, - "helpdialog", + (char*)"helpdialog", args, n); } @@ -399,13 +400,13 @@ HelpAgent::get_locator_id(const Widget w) { XtResource res; //res.resource_name = (resourceName ? (String)resourceName : "helpcard"); - res.resource_name = "helpcard"; + res.resource_name = (char*)"helpcard"; res.resource_class = XtCString; res.resource_type = XtRString; res.resource_size = sizeof(String); res.resource_offset = 0; res.default_type = XtRString; - res.default_addr = NULL_LOCATORID; + res.default_addr = (void*)NULL_LOCATORID; char *wname = XtName(w); // Just for gdb String string; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/Imakefile b/cde/programs/dtinfo/dtinfo/src/Agents/Imakefile index 8c14d01e2..5ea3c320d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Agents/Imakefile @@ -1,11 +1,14 @@ XCOMM $XConsortium: Imakefile /main/8 1996/08/21 15:41:09 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Agents +NormalCplusplusObjectRule() + #ifdef DoLicenseManagement INCLUDES=$(BROWSER_INCLUDES) $(MMDB_INCLUDES) $(LICENSE_L_INCLUDES) EXTRA_DEFINES=-DLICENSE_MANAGEMENT @@ -23,8 +26,12 @@ make_msgs($(LIBNAME), $(MSGS)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif #if defined(HPArchitecture)||defined(UXPArchitecture) diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C index aa5bbdb3d..a26c6eff5 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/LibraryAgentMotif.C @@ -51,8 +51,9 @@ #include -#include -#include +#include +#include +using namespace std; #define C_xList #define L_Support @@ -85,6 +86,7 @@ #define C_MessageMgr #define C_PrefMgr #define C_EnvMgr +#define C_GraphicsMgr #define L_Managers @@ -361,7 +363,7 @@ LibraryAgent::create_ui() n = 0; XtSetArg(args[n], XmNscrolledWindowChildType, XmMENU_BAR); n++; - Widget menu_bar = XmCreateMenuBar(mainw, "menu_bar", args, n); + Widget menu_bar = XmCreateMenuBar(mainw, (char*)"menu_bar", args, n); n = 0; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; @@ -375,7 +377,7 @@ LibraryAgent::create_ui() mainw, args, n); // Menus - Widget fileM = XmCreatePulldownMenu(menu_bar, "file_menu", 0, 0); + Widget fileM = XmCreatePulldownMenu(menu_bar, (char*)"file_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, fileM); n++; @@ -456,7 +458,7 @@ LibraryAgent::create_ui() NULL); // edit menu - Widget editM = XmCreatePulldownMenu(menu_bar, "edit_menu", 0, 0); + Widget editM = XmCreatePulldownMenu(menu_bar, (char*)"edit_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, editM); n++; @@ -504,7 +506,7 @@ LibraryAgent::create_ui() NULL); // options menu - Widget optionsM = XmCreatePulldownMenu(menu_bar, "options_menu", 0, 0); + Widget optionsM = XmCreatePulldownMenu(menu_bar, (char*)"options_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, optionsM); n++; @@ -572,7 +574,7 @@ LibraryAgent::create_ui() NULL); // windows menu - Widget windowsM = XmCreatePulldownMenu(menu_bar, "windows_menu", 0, 0); + Widget windowsM = XmCreatePulldownMenu(menu_bar, (char*)"windows_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, windowsM); n++; @@ -637,7 +639,7 @@ LibraryAgent::create_ui() *CATGETS(Set_AgentLabel, 47, ""), NULL); - Widget helpM = XmCreatePulldownMenu(menu_bar, "help_menu", 0, 0); + Widget helpM = XmCreatePulldownMenu(menu_bar, (char*)"help_menu", 0, 0); // create help menu n = 0; @@ -731,17 +733,17 @@ LibraryAgent::create_ui() // WXmPushButtonGadget tmp_pbg(tmp); // help_agent().add_activate_help (tmp_pbg, "doc_list_help"); WXmPushButtonGadget on_overview_pbg(on_overview); - help_agent().add_activate_help (on_overview, "on_overview"); + help_agent().add_activate_help (on_overview, (char*)"on_overview"); WXmPushButtonGadget on_tasks_pbg(on_tasks); - help_agent().add_activate_help (on_tasks, "on_tasks"); + help_agent().add_activate_help (on_tasks, (char*)"on_tasks"); WXmPushButtonGadget on_reference_pbg(on_reference); - help_agent().add_activate_help (on_reference, "on_reference"); + help_agent().add_activate_help (on_reference, (char*)"on_reference"); WXmPushButtonGadget on_item_pbg(on_item); help_agent().add_context_help (on_item); WXmPushButtonGadget on_help_pbg(on_help); - help_agent().add_activate_help (on_help, "on_help"); + help_agent().add_activate_help (on_help, (char*)"on_help"); WXmPushButtonGadget on_about_pbg(on_about); - help_agent().add_activate_help (on_about, "on_about"); + help_agent().add_activate_help (on_about, (char*)"on_about"); // Tools f_view2 = XtCreateManagedWidget("view", xmPushButtonWidgetClass, @@ -864,11 +866,11 @@ LibraryAgent::create_ui() XtVaSetValues(f_status_text, XmNvalue, string, NULL); // Search area - widget = XmCreatePulldownMenu(search_area, "scope_menu", 0, 0); + widget = XmCreatePulldownMenu(search_area, (char*)"scope_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, widget); n++; - XtManageChild(widget = XmCreateOptionMenu(search_area, "scope", args, n)); + XtManageChild(widget = XmCreateOptionMenu(search_area, (char*)"scope", args, n)); XtVaSetValues(widget, XmNlabelString, (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 59, "Search:")), @@ -1013,7 +1015,7 @@ LibraryAgent::quick_helpEH (Widget w, XtPointer client_data, if (event->type == EnterNotify || event->type == FocusIn) XmTextFieldSetString(agent->f_status_text, (char*)client_data); else if (event->type == LeaveNotify || event->type != FocusOut) - XmTextFieldSetString(agent->f_status_text, ""); + XmTextFieldSetString(agent->f_status_text, (char*)""); } @@ -1052,7 +1054,7 @@ LibraryAgent::search_help (Widget, XtPointer client_data, if (event->type == LeaveNotify || event->type == FocusOut) { - XmTextFieldSetString(agent->f_status_text, ""); + XmTextFieldSetString(agent->f_status_text, (char*)""); return; } @@ -1170,7 +1172,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) } UAS_Pointer d = NULL ; - try { + mtry { // (precise locator format parsing to be done in the UAS layer) if( strchr( newLib, ':' ) && strchr( newLib, '/' ) ) { @@ -1232,7 +1234,7 @@ LibraryAgent::add_library(char* newLib, Widget parent) #endif sts = NOT_FOUND ; } - } catch_any () { + } mcatch_any () { // one case that will reach here, but get no MMDB interface error // is if a (close to) fully qualified locator format is entered, // but with keyword error. @@ -1545,6 +1547,7 @@ LibraryAgent::track_to (UAS_Pointer &node_ptr) OutlineList &rootList = *(f_doc_tree_view->list()); bool in_subtree = FALSE; UAS_Pointer doc_root = node_ptr; + int inum; // Trace up to the root. free_tracking_hierarchy(); @@ -1554,6 +1557,7 @@ LibraryAgent::track_to (UAS_Pointer &node_ptr) for (int i = 0; i < rootList.length(); i ++) { if (doc_root == ((TOC_Element *) rootList[i])->toc()) { in_subtree = TRUE; + inum = i; break; } } @@ -1563,7 +1567,8 @@ LibraryAgent::track_to (UAS_Pointer &node_ptr) if (in_subtree) { ON_DEBUG (printf ("Found node <%s> in my doc list subtree <%s>\n", - node_ptr->title(), my_root->title())); + (char*)node_ptr->title(), + (char*)((TOC_Element *) rootList[inum])->toc()->title())); // Track to the element, scrolling if necessary. track (TRUE); } @@ -1619,7 +1624,8 @@ LibraryAgent::track (bool scroll) // If the entry is expanded, it MUST have children. Xassert (oe->has_children()); OutlineList &kids = *(oe->children()); - for (int i = 0; i < kids.length(); i++) + int i; + for (i = 0; i < kids.length(); i++) { // Keep track of how many expanded items we skip over. list_location++; @@ -1742,7 +1748,8 @@ void LibraryAgent::library_removed (UAS_Pointer lib) { OutlineList &rootList = *(f_doc_tree_view->list()); - for (int i = rootList.length() - 1; i >= 0; i --) { + int i; + for (i = rootList.length() - 1; i >= 0; i --) { TOC_Element *te = (TOC_Element *) rootList[i]; if (te->toc()->get_library() == lib) { if (f_tracking_hierarchy && f_tracking_hierarchy->f_toc == lib) { @@ -1974,13 +1981,13 @@ LibraryAgent::transferCB(Widget w, XtPointer client_data, XtPointer call_data) url = url + file; UAS_Pointer pIL; - try { + mtry { pIL = UAS_Common::create ((char*)url); if (! (pIL == (UAS_Pointer)NULL)) { pIL->retrieve(); } } - catch_any() { + mcatch_any() { pIL = NULL; } end_try; @@ -2009,7 +2016,7 @@ LibraryAgent::copy_to_clipbd() //Window window = XtWindowOfObject((Widget)f_shell); Window window = XtWindowOfObject(f_shell); long item_id = 0; - clip_label = XmStringCreateLocalized("Data"); + clip_label = XmStringCreateLocalized((char*)"Data"); Wait_Cursor bob; UAS_String nl("\n"); @@ -2040,7 +2047,7 @@ LibraryAgent::copy_to_clipbd() window_system().display(), window, item_id, - "STRING", + (char*)"STRING", (char*)buf, (long)strlen((char*)buf) + 1, private_id, NULL); } while(status == ClipboardLocked); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C index f3501f607..356e9117d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ListViewMotif.C @@ -166,7 +166,7 @@ ListView::create_ui_objects() // WXmLabelGadget label (form, "label", WAutoManage); WXmSeparator separator (form, "separator", WAutoManage); // NOTE: Fix WWL to have a scrolled list object! - Widget scrolled_list = XmCreateScrolledList (form, "list", NULL, 0); + Widget scrolled_list = XmCreateScrolledList (form, (char*)"list", NULL, 0); f_list = new WXmList (scrolled_list); f_list->Manage(); @@ -256,7 +256,7 @@ ListView::select (WCallback *wcb) void ListView::activate (WCallback *) { - notify (ENTRY_ACTIVATE, (void *) f_selected_item); + notify (ENTRY_ACTIVATE, (void *)(size_t) f_selected_item); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C index 4aa9b648b..266e82f02 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MapAgentMotif.C @@ -120,8 +120,8 @@ MapButton::MapButton (WComposite &parent, f_doc_ptr (doc_ptr), f_expanded (FALSE) { - ON_DEBUG (printf ("MapButton::MapButton (%s)\n", f_doc_ptr->title())); - static expandable_tree = + ON_DEBUG (printf ("MapButton::MapButton (%s)\n", (char*)f_doc_ptr->title())); + static bool expandable_tree = window_system().get_boolean_default ("ExpandableMap"); UAS_List kids (f_doc_ptr->children()); UAS_String t = f_doc_ptr->title(); @@ -483,7 +483,7 @@ MapAgent::create_ui() WXmForm bottomform (rootform, "bottomform"); WXmPushButton close (bottomform, "close", WAutoManage); WXmPushButton help (bottomform, "help", WAutoManage); - help_agent().add_activate_help (help, "map_help"); + help_agent().add_activate_help (help, (char*)"map_help"); XtVaSetValues(close, XmNlabelString, (XmString)XmStringLocalized(CATGETS(Set_AgentLabel, 12, "Close")), NULL); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C index b5360700b..96576c61c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkChooser.C @@ -127,7 +127,7 @@ MarkChooser::create_ui (Widget parent, #endif DECLM (WXmSeparator, sep, f_form, "separator"); - Widget list = XmCreateScrolledList (f_form, "list", NULL, 0); + Widget list = XmCreateScrolledList (f_form, (char*)"list", NULL, 0); f_list = WXmList (list); f_list.Manage(); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C index a19e9c6ca..6b9b72f73 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkIconMotif.C @@ -76,7 +76,8 @@ #include #include -#include +#include +using namespace std; #define CLASS MarkIcon #include "create_macros.hh" @@ -94,7 +95,7 @@ MarkIcon::MarkIcon (Widget parent, Widget chooser_parent, MarkCanvas *mark, int ypos, int scrollbar_offset) -: f_icon_char (NULL), +: f_icon_char (0), f_selected (FALSE), f_y_position (ypos), f_chooser_parent (chooser_parent) @@ -148,8 +149,8 @@ MarkIcon::register_actions() static XtActionsRec actions_list[] = { - {"double_click", &MarkIcon::static_double_click}, - {"single_click", &MarkIcon::static_single_click}, + {(char*)"double_click", &MarkIcon::static_double_click}, + {(char*)"single_click", &MarkIcon::static_single_click}, }; XtAppAddActions (window_system().app_context(), actions_list, XtNumber (actions_list)); @@ -323,7 +324,7 @@ MarkIcon::deselect (MarkCanvas *) void MarkIcon::update_icon (MarkCanvas *) { - Pixmap button_pixmap = NULL; + Pixmap button_pixmap = 0; int multi = mark_count() > 1; int anno = False; @@ -342,18 +343,18 @@ MarkIcon::update_icon (MarkCanvas *) if (anno) { if (multi) - button_pixmap = XmGetPixmap(window_system().screen(), "anno_double", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"anno_double", Foreground(), Background()); else - button_pixmap = XmGetPixmap(window_system().screen(), "anno_single", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"anno_single", Foreground(), Background()); } else { if (multi) - button_pixmap = XmGetPixmap(window_system().screen(), "mark_double", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"mark_double", Foreground(), Background()); else - button_pixmap = XmGetPixmap(window_system().screen(), "mark_single", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"mark_single", Foreground(), Background()); } @@ -593,18 +594,18 @@ MarkIcon::swap_colors() if (anno) { if (multi) - button_pixmap = XmGetPixmap(window_system().screen(), "anno_double", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"anno_double", foreground, background); else - button_pixmap = XmGetPixmap(window_system().screen(), "anno_single", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"anno_single", foreground, background); } else { if (multi) - button_pixmap = XmGetPixmap(window_system().screen(), "mark_double", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"mark_double", foreground, background); else - button_pixmap = XmGetPixmap(window_system().screen(), "mark_single", + button_pixmap = XmGetPixmap(window_system().screen(),(char*)"mark_single", foreground, background); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C index 2264deca8..b7d525b5b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MarkListView.C @@ -93,7 +93,7 @@ MarkListView::MarkListView() MarkListView::~MarkListView() { - if (f_shell != NULL) + if (f_shell != 0) f_shell.Destroy(); free_mark_list(); } @@ -107,7 +107,7 @@ void MarkListView::display() { Wait_Cursor bob; - if (f_shell == NULL) + if (f_shell == 0) create_ui(); if (!f_popped_up) @@ -143,7 +143,7 @@ MarkListView::create_ui() DECLM (WXmPushButton, close, form, "close"); DECLM (WXmPushButton, help, form, "help"); DECLM (WXmSeparator, sep, form, "separator"); - Widget list = XmCreateScrolledList (form, "list", NULL, 0); + Widget list = XmCreateScrolledList (form, (char*)"list", NULL, 0); f_list = WXmList (list); f_list.Manage(); @@ -165,7 +165,7 @@ MarkListView::create_ui() ON_ACTIVATE (f_edit,edit); ON_ACTIVATE (f_delete,remove); ON_ACTIVATE (close,close); - help_agent().add_activate_help (help, "mark_list_help"); + help_agent().add_activate_help (help, (char*)"mark_list_help"); SET_CALLBACK (f_shell,Popdown,popdown); @@ -279,7 +279,7 @@ MarkListView::view() { Wait_Cursor bob_dobbs; - try + mtry { Xassert (f_selected_item > 0); @@ -295,7 +295,7 @@ MarkListView::view() // Now `m' points to the selected Mark. m.item()->view(); } - catch(demoException &, demo) + mcatch(demoException &, demo) { message_mgr().demo_failure(demo); } @@ -392,7 +392,7 @@ MarkListView::receive (MarkDeleted &msg, void* /*client_data*/) i++, m++; } - Xassert (m != NULL); + Xassert (m != 0); // // XXXSWM: Need to check if this is the selected item. @@ -429,7 +429,7 @@ MarkListView::receive (MarkChanged &msg, void* /*client_data*/) i++, m++; } - Xassert (m != NULL); + Xassert (m != 0); // Change the title of the entry, once it is found. WXmString title (msg.f_mark_ptr->name()); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C index ec1096a57..46834a23d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/MessageAgentMotif.C @@ -69,7 +69,8 @@ #include #include #include -#include +#include +using namespace std; #define CLASS MessageAgent #include "create_macros.hh" @@ -91,7 +92,7 @@ MessageAgent::create_ui(Widget parent) { f_popped_up = False; f_dialog = (WXmMessageDialog *)(Widget) - WXmMessageDialog(parent, "MessageDialog"); + WXmMessageDialog(parent, (char*)"MessageDialog"); f_text = (WXmTextField *) XtCreateWidget ("text", xmTextFieldWidgetClass, *f_dialog, NULL, 0); @@ -586,7 +587,7 @@ MessageAgent::get_integer (const char *message, const char* title, // Set the dialog title. WXmDialogShell shell (XtParent(*f_dialog)); - shell.Title (title? (char*)title : "File a Bug"); + shell.Title (title? (char*)title : (char *)"File a Bug"); // Set the dialog buttons. f_dialog->CancelPB().Manage(); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C index 13bb3871e..1d1a26619 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeHistoryAgentMotif.C @@ -49,7 +49,8 @@ * */ -#include +#include +using namespace std; #include "UAS.hh" @@ -89,7 +90,7 @@ NodeHistoryAgent::~NodeHistoryAgent() { - if (f_shell != NULL) + if (f_shell != 0) f_shell.Destroy(); } @@ -101,7 +102,7 @@ NodeHistoryAgent::~NodeHistoryAgent() void NodeHistoryAgent::display() { - if (f_shell == NULL) + if (f_shell == 0) create_ui(); refresh_list(); @@ -152,7 +153,7 @@ NodeHistoryAgent::create_ui() mtfstring = CATGETS(Set_AgentLabel, 185, "Section"); XtVaSetValues(sectionlabel, XmNlabelString, (XmString)mtfstring, NULL); - Widget scrolled_list = XmCreateScrolledList (form, "list", NULL, 0); + Widget scrolled_list = XmCreateScrolledList (form, (char*)"list", NULL, 0); f_list = WXmList (scrolled_list); f_list.Manage(); @@ -174,7 +175,7 @@ NodeHistoryAgent::create_ui() SET_CALLBACK (f_list,DefaultAction,view); ON_ACTIVATE (f_display,view); ON_ACTIVATE (close,close); - help_agent().add_activate_help (help, "node_hist_help"); + help_agent().add_activate_help (help, (char*)"node_hist_help"); global_history_mgr().UAS_Sender::request (this); global_history_mgr().UAS_Sender::request (this); @@ -211,7 +212,7 @@ NodeHistoryAgent::create_ui() void NodeHistoryAgent::refresh_list() { - Xassert (f_list != NULL); + Xassert (f_list != 0); xList > &hist_list = global_history_mgr().history_list(); XmStringTable table = new XmString [hist_list.length()]; @@ -330,7 +331,7 @@ NodeHistoryAgent::compose_entry(UAS_String book, UAS_String section) if (bookString.Width(f_list.FontList()) >= SECTION_OFFSET) { - char* dots = "..."; + char* dots = (char*)"..."; char* ungenerated = (char*)(bookString + WXmString(dots)); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C index 8be2b0dae..e039ac4e1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeListAgentMotif.C @@ -132,24 +132,24 @@ NodeListAgent::create_base_window (char *name) //Widget Class Var Name Parent Widget Name //------------------ --------------- ---------------- ---------------- f_form = new WXmForm (*f_shell, "form"); - f_menu_bar = new WXmMenuBar (*f_form, "menu_bar" /* , WAutoManage */); + f_menu_bar = new WXmMenuBar (*f_form, (char*)"menu_bar" /* , WAutoManage */); WXmCascadeButton file_cascade (*f_menu_bar, "file", AM); - WXmPulldownMenu file_menu (*f_menu_bar, "file_menu" ); + WXmPulldownMenu file_menu (*f_menu_bar, (char*)"file_menu" ); WXmPushButton close (file_menu, "close", AM); WXmCascadeButton edit_cascade (*f_menu_bar, "edit", AM); - WXmPulldownMenu edit_menu (*f_menu_bar, "edit_menu" ); + WXmPulldownMenu edit_menu (*f_menu_bar, (char*)"edit_menu" ); WXmPushButton undo (edit_menu, "undo", AM); /* WXmCascadeButton view_cascade (*f_menu_bar, "view", AM); - WXmPulldownMenu view_menu (*f_menu_bar, "view_menu" ); + WXmPulldownMenu view_menu (*f_menu_bar, (char*)"view_menu" ); WXmCascadeButton sort_cascade (view_menu, "sort", AM); - WXmPulldownMenu sort_menu (*f_menu_bar, "sort_menu" ); + WXmPulldownMenu sort_menu (*f_menu_bar, (char*)"sort_menu" ); WXmPushButton ooo (sort_menu, "ooo", AM); */ WXmCascadeButton help_cascade (*f_menu_bar, "help", AM); - WXmPulldownMenu help_menu (*f_menu_bar, "help_menu" ); + WXmPulldownMenu help_menu (*f_menu_bar, (char*)"help_menu" ); WXmPushButton context (help_menu, "context", AM); WXmPushButton window (help_menu, "window", AM); @@ -173,7 +173,7 @@ NodeListAgent::create_base_window (char *name) f_list_form = (WXmForm*)(Widget)WXmForm(*f_pane, "listform", AM); - Widget scrolled_list = XmCreateScrolledList (*f_list_form, "list", NULL, 0); + Widget scrolled_list = XmCreateScrolledList (*f_list_form, (char*)"list", NULL, 0); f_list = (WXmList*)scrolled_list ; f_list->Manage(); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodePrintAgent.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodePrintAgent.C index 2240698ee..1a5a7c6bb 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodePrintAgent.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodePrintAgent.C @@ -50,7 +50,8 @@ * */ -#include +#include +using namespace std; #define C_FString #define C_List @@ -198,13 +199,13 @@ static char another_g_top_locator[4096] ; */ static XtActionsRec DrawnBActions[] = { - {"DeSelectAll" , _DtHelpDeSelectAll }, - {"SelectAll" , _DtHelpSelectAll }, - {"ActivateLink" , _DtHelpActivateLink }, - {"CopyToClipboard", _DtHelpCopyAction }, - {"PageUpOrDown" , _DtHelpPageUpOrDown }, - {"PageLeftOrRight", _DtHelpPageLeftOrRight}, - {"NextLink" , _DtHelpNextLink } + {(char*)"DeSelectAll" , _DtHelpDeSelectAll }, + {(char*)"SelectAll" , _DtHelpSelectAll }, + {(char*)"ActivateLink" , _DtHelpActivateLink }, + {(char*)"CopyToClipboard", _DtHelpCopyAction }, + {(char*)"PageUpOrDown" , _DtHelpPageUpOrDown }, + {(char*)"PageLeftOrRight", _DtHelpPageLeftOrRight}, + {(char*)"NextLink" , _DtHelpNextLink } }; //------- Functions -------------------------------------------- @@ -224,7 +225,7 @@ _DtHelpCreatePrintArea(Widget parent, string_resolution = XpGetOneAttribute(XtDisplay(parent), l_AppPrintData->f_print_data->print_context, - XPDocAttr, "default-printer-resolution"); + XPDocAttr, (char*)"default-printer-resolution"); resolution = atoi(string_resolution); XFree(string_resolution); @@ -331,7 +332,7 @@ NodePrintAgent::create_ui(Widget parent) // Setup up an outer form to hold the different page elements n = 0; - f_form = XmCreateForm(parent, "outer_page", NULL, n); + f_form = XmCreateForm(parent, (char*)"outer_page", NULL, n); // make sure the DtHelpDialog's actions are declared in order to satisfy // the need of the DisplayArea @@ -346,17 +347,17 @@ NodePrintAgent::create_ui(Widget parent) XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM); n++; // bottom - footer_form = XmCreateForm(f_form, "footer", args, n); + footer_form = XmCreateForm(f_form, (char*)"footer", args, n); // Create a left attached label for the book name - label = XmStringCreate("", XmFONTLIST_DEFAULT_TAG); + label = XmStringCreate((char*)"", XmFONTLIST_DEFAULT_TAG); n = 0; XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++; XtSetArg(args[n], XmNlabelString, label); n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; - footer_book_name = XmCreateLabel(footer_form, "bookname", args, n); + footer_book_name = XmCreateLabel(footer_form, (char*)"bookname", args, n); XmStringFree(label); XtManageChild(footer_book_name); @@ -370,13 +371,13 @@ NodePrintAgent::create_ui(Widget parent) XtSetArg(args[n], XmNlabelString, label); n++; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++; - footer_page_no = XmCreateLabel(footer_form, "page_no", args, n); + footer_page_no = XmCreateLabel(footer_form, (char*)"page_no", args, n); XmStringFree(label); XtManageChild(footer_page_no); XtManageChild(footer_form); - f_help_dsp_area = _DtHelpCreatePrintArea(f_form, "DisplayArea", width, height); + f_help_dsp_area = _DtHelpCreatePrintArea(f_form, (char*)"DisplayArea", width, height); gHelpDisplayArea = f_help_dsp_area ; // Setup Display Area attachments diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C index b4cc6c35c..caa33314f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.C @@ -56,8 +56,9 @@ * */ -#include -#include +#include +#include +using namespace std; #define C_FString #define C_List @@ -142,6 +143,8 @@ #include "OnlineRender/SegClientData.hh" +#include "utility/mmdb_exception.h" + #include #include #include @@ -958,7 +961,7 @@ NodeWindowAgent::create_ui() n = 0; XtSetArg(args[n], XmNscrolledWindowChildType, XmMENU_BAR); n++; - Widget menu_bar = XmCreateMenuBar(mainw, "menu_bar", args, n); + Widget menu_bar = XmCreateMenuBar(mainw, (char*)"menu_bar", args, n); n = 0; XtSetArg(args[n], XmNorientation, XmHORIZONTAL); n++; @@ -972,7 +975,7 @@ NodeWindowAgent::create_ui() mainw, args, n); // Menus - Widget fileM = XmCreatePulldownMenu(menu_bar, "file_menu", 0, 0); + Widget fileM = XmCreatePulldownMenu(menu_bar, (char*)"file_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, fileM); n++; @@ -1031,7 +1034,7 @@ NodeWindowAgent::create_ui() XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // search menu - Widget searchM = XmCreatePulldownMenu(menu_bar, "search_menu", 0, 0); + Widget searchM = XmCreatePulldownMenu(menu_bar, (char*)"search_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, searchM); n++; @@ -1111,7 +1114,7 @@ NodeWindowAgent::create_ui() XtVaSetValues(f_search_next, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // go menu - Widget goM = XmCreatePulldownMenu(menu_bar, "go_menu", 0, 0); + Widget goM = XmCreatePulldownMenu(menu_bar, (char*)"go_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, goM); n++; widget = XtCreateManagedWidget("go", xmCascadeButtonGadgetClass, @@ -1182,7 +1185,7 @@ NodeWindowAgent::create_ui() XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // marks menu - Widget markM = XmCreatePulldownMenu(menu_bar, "marks_menu", 0, 0); + Widget markM = XmCreatePulldownMenu(menu_bar, (char*)"marks_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, markM); n++; @@ -1286,7 +1289,7 @@ NodeWindowAgent::create_ui() XtGetValues(f_create_bmrk, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(f_create_bmrk, args, n); @@ -1296,7 +1299,7 @@ NodeWindowAgent::create_ui() XtGetValues(f_create_anno, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(f_create_anno, args, n); @@ -1306,7 +1309,7 @@ NodeWindowAgent::create_ui() XtGetValues(f_move_mark, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(f_move_mark, args, n); @@ -1315,7 +1318,7 @@ NodeWindowAgent::create_ui() XtGetValues(list_marks, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(list_marks, args, n); @@ -1324,7 +1327,7 @@ NodeWindowAgent::create_ui() XtGetValues(f_edit_mark, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(f_edit_mark, args, n); @@ -1333,13 +1336,13 @@ NodeWindowAgent::create_ui() XtGetValues(f_delete_mark, args, n); n = 0; XtSetArg(args[n], XmNlabelString, - XmStringConcat(XmStringCreate(icon, OLIAS_FONT), + XmStringConcat(XmStringCreate(icon, (char*)OLIAS_FONT), string)); n++; XtSetValues(f_delete_mark, args, n); } // options menu - Widget optionsM = XmCreatePulldownMenu(menu_bar, "options_menu", 0, 0); + Widget optionsM = XmCreatePulldownMenu(menu_bar, (char*)"options_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, optionsM); n++; @@ -1393,7 +1396,7 @@ NodeWindowAgent::create_ui() XtVaSetValues(search_areaT, XmNlabelString, (XmString)mtfstring, XmNmnemonic, mnemonic, NULL); // windows menu - Widget windowsM = XmCreatePulldownMenu(menu_bar, "windows_menu", 0, 0); + Widget windowsM = XmCreatePulldownMenu(menu_bar, (char*)"windows_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, windowsM); n++; @@ -1423,7 +1426,7 @@ NodeWindowAgent::create_ui() // help menu - Widget helpM = XmCreatePulldownMenu(menu_bar, "help_menu", 0, 0); + Widget helpM = XmCreatePulldownMenu(menu_bar, (char*)"help_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, helpM); n++; widget = XtCreateManagedWidget("help", xmCascadeButtonGadgetClass, @@ -1513,13 +1516,13 @@ NodeWindowAgent::create_ui() #endif - help_agent().add_activate_help ((Widget)on_overview, "on_overview"); - help_agent().add_activate_help ((Widget)on_tasks, "on_tasks"); - help_agent().add_activate_help ((Widget)on_reference, "on_reference"); - help_agent().add_activate_help ((Widget)on_reference, "on_reference"); + help_agent().add_activate_help ((Widget)on_overview, (char*)"on_overview"); + help_agent().add_activate_help ((Widget)on_tasks, (char*)"on_tasks"); + help_agent().add_activate_help ((Widget)on_reference, (char*)"on_reference"); + help_agent().add_activate_help ((Widget)on_reference, (char*)"on_reference"); help_agent().add_context_help ((Widget)on_item); - help_agent().add_activate_help ((Widget)on_help, "on_help"); - help_agent().add_activate_help ((Widget)on_about, "on_about"); + help_agent().add_activate_help ((Widget)on_help, (char*)"on_help"); + help_agent().add_activate_help ((Widget)on_about, (char*)"on_about"); // Tools @@ -1682,11 +1685,11 @@ NodeWindowAgent::create_ui() f_form = XtCreateWidget("form", xmFormWidgetClass, mainw, args, n); - f_title_menu = (WXmPulldownMenu*)(Widget)WXmPulldownMenu((WComposite&)f_form, "title_menu"); + f_title_menu = (WXmPulldownMenu*)(Widget)WXmPulldownMenu((WComposite&)f_form, (char*)"title_menu"); n = 0; XtSetArg(args[n], XmNsubMenuId, (Widget) f_title_menu); n++; f_title_option = (WXmOptionMenu*)(Widget) - WXmOptionMenu ((WComposite&)f_form, "title", AM, args, n); + WXmOptionMenu ((WComposite&)f_form, (char*)"title", AM, args, n); help_agent().add_help_cb ((Widget)*f_title_option); f_tab_area = (WXmRowColumn*)(Widget) WXmRowColumn (f_form, "tab_area"); @@ -1714,8 +1717,8 @@ NodeWindowAgent::create_ui() #ifdef DEBUG #ifdef MONITOR - WXmCascadeButton windows_cascade (menu_bar, "windows" , AM); - WXmPulldownMenu windows_menu (menu_bar, "windows_menu" ); + WXmCascadeButton windows_cascade (menu_bar, "windows" , AM); + WXmPulldownMenu windows_menu (menu_bar, (char*)"windows_menu" ); WXmPushButton(windows_menu, "monitor", AM). SetActivateCallback(this, (WWL_FUN)&NodeWindowAgent::monitor, (void*)1); @@ -1725,9 +1728,9 @@ NodeWindowAgent::create_ui() #endif #endif -#ifdef DEBUG +#ifdef NODEBUG WXmCascadeButton debug_cascade (menu_bar, "debug" ); - WXmPulldownMenu debug_menu (menu_bar, "debug_menu" ); + WXmPulldownMenu debug_menu (menu_bar, (char*)"debug_menu" ); WXmToggleButton command_processor (debug_menu, "command_processor", AM); WXmPushButton document_id (debug_menu, "document_id", AM); #endif @@ -1742,7 +1745,7 @@ NodeWindowAgent::create_ui() f_help_dsp_area = (DtHelpDispAreaStruct*) _DtHelpCreateDisplayArea(WXmForm(*f_frame, "inform", WAutoManage),//parent - "display_area", // name + (char*)"display_area", // name _DtHelpSTATIC, // vert flag _DtHelpAS_NEEDED, // horz flag FALSE, // traversal flag @@ -1763,20 +1766,20 @@ NodeWindowAgent::create_ui() // create detach graphic popup menu f_detach_menu = XmCreatePopupMenu( - f_help_dsp_area->dispWid, "detach_graphic", NULL, 0); - f_detach_button = XmCreatePushButton(f_detach_menu, "Detach Graphic", NULL, 0); + f_help_dsp_area->dispWid, (char*)"detach_graphic", NULL, 0); + f_detach_button = XmCreatePushButton(f_detach_menu, (char*)"Detach Graphic", NULL, 0); XtAddCallback(f_detach_button, XmNactivateCallback, detach_grCB, this); XtManageChild(f_detach_button); mtfstring = CATGETS(Set_AgentLabel, 124, "Detach Graphic"); XtVaSetValues(f_detach_button, XmNlabelString, (XmString)mtfstring, NULL); - f_attach_button = XmCreatePushButton(f_detach_menu, "Attach Graphic", NULL, 0); + f_attach_button = XmCreatePushButton(f_detach_menu, (char*)"Attach Graphic", NULL, 0); XtAddCallback(f_attach_button, XmNactivateCallback, attach_grCB, this); XtManageChild(f_attach_button); mtfstring = CATGETS(Set_AgentLabel, 265, "Attach Graphic"); XtVaSetValues(f_attach_button, XmNlabelString, (XmString)mtfstring, NULL); - f_raise_button = XmCreatePushButton(f_detach_menu, "Raise Graphic", NULL, 0); + f_raise_button = XmCreatePushButton(f_detach_menu, (char*)"Raise Graphic", NULL, 0); XtAddCallback(f_raise_button, XmNactivateCallback, raise_grCB, this); XtManageChild(f_raise_button); mtfstring = CATGETS(Set_AgentLabel, 264, "Raise Graphic"); @@ -1787,22 +1790,22 @@ NodeWindowAgent::create_ui() // create link preview popup menu f_preview_menu = XmCreatePopupMenu( - f_help_dsp_area->dispWid, "preview_menu", NULL, 0); + f_help_dsp_area->dispWid, (char*)"preview_menu", NULL, 0); - f_preview_label = XmCreateLabel(f_preview_menu, "pre_label", NULL, 0); + f_preview_label = XmCreateLabel(f_preview_menu, (char*)"pre_label", NULL, 0); XtManageChild(f_preview_label); - widget = XmCreateSeparator(f_preview_menu, "sep", NULL, 0); + widget = XmCreateSeparator(f_preview_menu, (char*)"sep", NULL, 0); XtVaSetValues(widget, XmNseparatorType, XmDOUBLE_LINE, NULL); XtManageChild(widget); - widget = XmCreatePushButton(f_preview_menu, "widget", NULL, 0); + widget = XmCreatePushButton(f_preview_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, go_to_linkCB, this); XtManageChild(widget); mtfstring = CATGETS(Set_AgentLabel, 168, "Display Link"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); - widget = XmCreatePushButton(f_preview_menu, "widget", NULL, 0); + widget = XmCreatePushButton(f_preview_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, open_new_nodeCB, this); XtManageChild(widget); mtfstring = CATGETS(Set_AgentLabel, 64, "New Window"); @@ -1810,33 +1813,33 @@ NodeWindowAgent::create_ui() // create default popup menu f_default_menu = XmCreatePopupMenu( - f_help_dsp_area->dispWid, "default_menu", NULL, 0); + f_help_dsp_area->dispWid, (char*)"default_menu",NULL, 0); - f_node_next3 = XmCreatePushButton(f_default_menu, "f_node_next3", NULL, 0); + f_node_next3 = XmCreatePushButton(f_default_menu, (char*)"f_node_next3", NULL, 0); XtAddCallback(f_node_next3, XmNactivateCallback, node_nextCB, this); XtManageChild(f_node_next3); mtfstring = CATGETS(Set_AgentLabel, 96, "Next Section"); XtVaSetValues(f_node_next3, XmNlabelString, (XmString)mtfstring, NULL); - f_node_prev3 = XmCreatePushButton(f_default_menu, "f_node_prev3", NULL, 0); + f_node_prev3 = XmCreatePushButton(f_default_menu, (char*)"f_node_prev3", NULL, 0); XtAddCallback(f_node_prev3, XmNactivateCallback, node_previousCB, this); XtManageChild(f_node_prev3); mtfstring = CATGETS(Set_AgentLabel, 94, "Previous Section"); XtVaSetValues(f_node_prev3, XmNlabelString, (XmString)mtfstring, NULL); - widget = XmCreateSeparator(f_default_menu, "sep", NULL, 0); + widget = XmCreateSeparator(f_default_menu, (char*)"sep", NULL, 0); XtManageChild(widget); - widget = XmCreatePushButton(f_default_menu, "widget", NULL, 0); + widget = XmCreatePushButton(f_default_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, show_locatorCB, this); XtManageChild(widget); mtfstring = CATGETS(Set_AgentLabel, 68, "Show Locator"); XtVaSetValues(widget, XmNlabelString, (XmString)mtfstring, NULL); - widget = XmCreateSeparator(f_default_menu, "sep", NULL, 0); + widget = XmCreateSeparator(f_default_menu, (char*)"sep", NULL, 0); XtManageChild(widget); - widget = XmCreatePushButton(f_default_menu, "widget", NULL, 0); + widget = XmCreatePushButton(f_default_menu, (char*)"widget", NULL, 0); XtAddCallback(widget, XmNactivateCallback, printCB, this); XtManageChild(widget); mtfstring = CATGETS(Set_AgentLabel, 70, "Print"); @@ -1953,11 +1956,11 @@ NodeWindowAgent::create_ui() // Search area - widget = XmCreatePulldownMenu(search_area, "scope_menu", 0, 0); + widget = XmCreatePulldownMenu(search_area, (char*)"scope_menu", 0, 0); n = 0; XtSetArg(args[n], XmNsubMenuId, widget); n++; - XtManageChild(widget = XmCreateOptionMenu(search_area, "scope", args, n)); + XtManageChild(widget = XmCreateOptionMenu(search_area, (char*)"scope", args, n)); help_agent().add_help_cb (widget); textstore = new UAS_String(CATGETS(Set_AgentQHelp, 60, @@ -2004,7 +2007,7 @@ NodeWindowAgent::create_ui() XtSetArg(args[n], XmNrightWidget, widget); n++; XtSetValues(*f_search_text, args, n); -#ifdef DEBUG +#ifdef NODEBUG /* -------- Debugging setup. Should be a function. -------- */ bool debugging = window_system().get_boolean_app_resource("debug"); @@ -2271,7 +2274,7 @@ NodeWindowAgent::search_help (Widget, XtPointer client_data, // clear quick help if (event->type == LeaveNotify || event->type == FocusOut) { - XmTextFieldSetString(agent->f_status_text, ""); + XmTextFieldSetString(agent->f_status_text, (char*)""); return; } @@ -2997,7 +3000,7 @@ NodeWindowAgent::unpreview() else { // If the timeout has already happened, just clear the preview area. - XmTextFieldSetString(f_status_text, ""); + XmTextFieldSetString(f_status_text, (char*)""); } } @@ -3079,7 +3082,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) #endif _DtCvSegPts **segs = NULL ; - try + mtry { int ret_x, ret_y ; // find the selection segment and offset @@ -3125,7 +3128,8 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) unsigned int length = 0; unsigned int offset = 0; - for (int i = 0; segs[i]; i++) + int i; + for (i = 0; segs[i]; i++) { _DtCvSegPts* segpts = segs[i]; @@ -3227,7 +3231,7 @@ NodeWindowAgent::make_bookmark (Boolean edit, MarkCanvas* refmark) else throw(CASTEXCEPT Exception()); } - catch_any() + mcatch_any() { if (! refmark) message_mgr().error_dialog ((char*)UAS_String(CATGETS(Set_Messages, 10, @@ -3506,14 +3510,14 @@ void NodeWindowAgent::delete_mark() { Xassert (MarkCanvas::selected_mark() != NULL); - try + mtry { MarkCanvas::selected_mark()->mark_ptr()->remove(); XtSetSensitive(f_create_bmrk, False); XtSetSensitive(f_create_anno, False); } - catch_any() + mcatch_any() { message_mgr().error_dialog ( (char*)UAS_String(CATGETS(Set_Messages, 11, @@ -3556,7 +3560,7 @@ NodeWindowAgent::move_markCB(Widget, XtPointer client_data, XtPointer) UAS_Pointer mark_ptr = MarkTml::selected_mark()->mark_ptr(); Wait_Cursor bob; // Create a new mark based on the old one at the new location. - try + mtry { f_viewport_agent->mark_creator (this); // 94/10/27 yuji bug fix for TC-530 UAS_Pointer d; @@ -3564,7 +3568,7 @@ NodeWindowAgent::move_markCB(Widget, XtPointer client_data, XtPointer) AnchorCanvas (f_viewport_agent->selection_range()), mark_ptr); } - catch_any() + mcatch_any() { message_mgr().error_dialog ( (char*)UAS_String(CATGETS(Set_Messages, 12, @@ -3624,7 +3628,7 @@ NodeWindowAgent::detach_graphic() // Display an instructional dialog. WXmMessageDialog - info_dialog ((Widget)f_shell, "detach_msg", + info_dialog ((Widget)f_shell, (char*)"detach_msg", WArgList (XmNdialogType, XmDIALOG_INFORMATION, NULL)); WXmDialogShell shell (info_dialog.Parent()); // set window title @@ -3829,7 +3833,7 @@ NodeWindowAgent::display (UAS_Pointer &node_ptr) int sameNode = f_node_view_info && f_node_view_info->node_ptr() == node_ptr; if (sameNode && !g_style_sheet_update && !f_history_display) { - extern char g_top_locator[]; +// extern char g_top_locator[]; #ifdef JBM // need to change this to pass in the locator to SetTopic so the // Canvas knows where to scroll to when it displays @@ -3988,12 +3992,12 @@ NodeWindowAgent::do_bookmarks(bool move_to_mark) #endif while (i) { - try { + mtry { MarkCanvas *mc = add_mark (i.item()); if (g_view_mark() == i.item()) jump_to = mc ; } - catch_any() + mcatch_any() { #ifdef BOOKMARK_DEBUG cerr << "error adding bookmark " << i.item()->name() << endl; @@ -4293,7 +4297,7 @@ NodeWindowAgent::quick_helpEH (Widget w, XtPointer client_data, if (event->type == EnterNotify || event->type == FocusIn) XmTextFieldSetString(agent->f_status_text, (char*)client_data); else if (event->type == LeaveNotify || event->type != FocusOut) - XmTextFieldSetString(agent->f_status_text, ""); + XmTextFieldSetString(agent->f_status_text, (char*)""); } @@ -4368,7 +4372,7 @@ NodeWindowAgent::re_display() bool lock_flag = f_locked ; f_locked = False ; // have to force it to happen regardless of lock - try + mtry { node_mgr().set_preferred_window(this); // make re-display happen in this window @@ -4377,7 +4381,7 @@ NodeWindowAgent::re_display() f_locked = lock_flag ; } - catch_any() + mcatch_any() { delete anchor ; g_history_anchor = save_anchor ; @@ -4558,7 +4562,8 @@ NodeWindowAgent::create_canvas_mark(_DtCvHandle canvas, UAS_List marks_loc_list; marks_loc_list = marks_loc.splitFields(','); - for (int i = 0; i < marks_loc_list.length(); i++) + int i; + for (i = 0; i < marks_loc_list.length(); i++) { UAS_String& mark_loc = *marks_loc_list[i]; unsigned int vcc, offset, length; @@ -5073,7 +5078,7 @@ MarkViewer::receive (ViewMark &message, void* /*client_data*/) // Slight hack... Set a global that tells the ViewportAgent to // select and jump to the specified mark when the corresponding // node is displayed (see "jump_to" below). 15:17 02-Dec-93 DJB - try + mtry { g_view_mark() = message.f_mark_ptr; @@ -5083,14 +5088,14 @@ MarkViewer::receive (ViewMark &message, void* /*client_data*/) section->retrieve(); } - catch_noarg(demoException &) + mcatch_noarg(demoException &) { // this is a hack. what should happen, is that the catch_any below this // should only be catching a specific (or set of) exception so that others // can pass through - 14:32 06/ 1/94 - jbm rethrow ; } - catch_any() + mcatch_any() { message_mgr().info_dialog ( (char*)UAS_String(CATGETS(Set_Messages, 15, diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh index efecee3ce..9821259df 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/NodeWindowAgentMotif.hh @@ -62,6 +62,9 @@ class MarkCreated; class MarkDeleted; class MarkCanvas ; class MarkIcon ; +// class DetachGraphic; +// class ReAttachGraphic; +// class DisplayGraphic; class GraphicsHandler ; // self is used by some MACROS somewhere, but the X include files use diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C index acdeceda1..af237935d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/OutlineListViewMotif.C @@ -72,7 +72,8 @@ #include #include -#include +#include +using namespace std; #include #include @@ -110,7 +111,7 @@ OutlineListView::OutlineListView (const WComposite &parent, const char *name, f_tracking_element (NULL), f_library_agent (NULL) { - static serial_number = 1; + static int serial_number = 1; // Assign a unique serial number to this outline list. f_serial_number = serial_number++; @@ -186,7 +187,7 @@ icon_width(Widget w) else string[0] = OLIAS_PLACEHOLDER_ICON; string[1] = '\0'; - XmString thing = XmStringCreate (string, OLIAS_FONT); + XmString thing = XmStringCreate (string, (char*)OLIAS_FONT); Dimension rval = XmStringWidth(defaultList, thing); XmStringFree (thing); @@ -385,7 +386,7 @@ OutlineListView::create_xm_string (OutlineElement *oe, int base_level, else s[oe->level() - base_level + 1 + track] = '\0'; - next = XmStringCreate (s, OLIAS_FONT); + next = XmStringCreate (s, (char*)OLIAS_FONT); #ifdef NotDefined // Concat the parts @@ -798,8 +799,8 @@ OutlineListView::register_actions() static XtActionsRec actions_list[] = { - {"OutlineListBeginSelect", OutlineListView::_select_start}, - {"OutlineListEndSelect", OutlineListView::_select_end}, + {(char*)"OutlineListBeginSelect", OutlineListView::_select_start}, + {(char*)"OutlineListEndSelect", OutlineListView::_select_end}, }; @@ -1184,7 +1185,7 @@ OutlineListView::activate (WCallback *wcb) if ((oe->type() == TOC_Element::TOC_ElementClass) && !expanded) { - try { + mtry { UAS_ObjectType type = ((TOC_Element *) oe)->toc()->type(); switch (type) { @@ -1223,7 +1224,7 @@ OutlineListView::activate (WCallback *wcb) break; } } - catch_any() + mcatch_any() { message_mgr().error_dialog( (char*)UAS_String(CATGETS( Set_UrlAgent, 5, "Document not found." )) ) ; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C index 0609b2e52..6da545687 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/PrefAgentMotif.C @@ -284,7 +284,7 @@ void PrefAgent::display() { Wait_Cursor bob; - if (f_shell == NULL) + if (f_shell == 0) create_ui(); // Always reset on new popup. @@ -321,8 +321,8 @@ PrefAgent::create_ui() NULL); DECL (WXmForm, form, f_shell, "form"); - DECLM (WXmOptionMenu, options, form, "options"); - DECL (WXmPulldownMenu, options_menu, form, "options_menu"); + DECLMC(WXmOptionMenu, options, form, "options"); + DECLC (WXmPulldownMenu, options_menu, form, "options_menu"); mtfstring = CATGETS(Set_AgentLabel, 186, "Preferences for"); XtVaSetValues(options, XmNlabelString, (XmString)mtfstring, NULL); @@ -348,7 +348,7 @@ PrefAgent::create_ui() SET_CALLBACK (f_apply,Activate,apply); SET_CALLBACK (f_reset,Activate,reset); SET_CALLBACK (cancel,Activate,cancel); - help_agent().add_activate_help (help, "preferences_help"); + help_agent().add_activate_help (help, (char*)"preferences_help"); DECLM (WXmFrame, frame, form, "frame"); DECL (WXmForm, container, frame, "container"); @@ -1064,13 +1064,13 @@ PrefAgent::get_geometry (WCallback *wcb) WXmTextField text_field ((Widget)wcb->ClientData()); char *shell_name; if (text_field == f_map_geo) - shell_name = "map"; + shell_name = (char*)"map"; else if (text_field == f_browse_geo) - shell_name = "nodeview"; + shell_name = (char*)"nodeview"; // Display an instructional dialog. WXmMessageDialog - info_dialog ((Widget)f_shell, "geometry_msg", + info_dialog ((Widget)f_shell, (char*)"geometry_msg", WArgList (XmNdialogType, XmDIALOG_INFORMATION, NULL)); WXmDialogShell shell (info_dialog.Parent()); // set window title diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C index fa6ec1bed..210ed792a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/PrintPanelAgentMotif.C @@ -97,7 +97,8 @@ #include #include #include -#include +#include +using namespace std; #define CLASS PrintPanelAgent @@ -476,7 +477,7 @@ CreatePrintShell(Widget widget, AppPrintData* p) p->f_print_shell = XmPrintSetup(widget, XpGetScreenOfContext(p->f_print_data->print_display, p->f_print_data->print_context), - "PrintShell", NULL, 0); + (char*)"PrintShell", NULL, 0); // set the global variable to this value so that the create_ui function in @@ -598,17 +599,17 @@ CreatePrintSetup(Widget parent, AppPrintData* p) // resources common to silent and noisy printing cases - XtSetArg(args[n], DtNcopies, window_system().videoShell()->copies); n++; + XtSetArg(args[n], (char*)DtNcopies, window_system().videoShell()->copies); n++; // set print to file if file name given if ((char *)window_system().videoShell()->file_name != NULL) { - XtSetArg(args[n], DtNfileName, (char *)window_system().videoShell()->file_name); n++; - XtSetArg(args[n], DtNprintDestination, DtPRINT_TO_FILE); n++; + XtSetArg(args[n], (char*)DtNfileName, (char *)window_system().videoShell()->file_name); n++; + XtSetArg(args[n], (char*)DtNprintDestination, DtPRINT_TO_FILE); n++; } // printer name if ((char *)window_system().videoShell()->printer != NULL) { - XtSetArg(args[n], DtNprinterName, (char *)window_system().videoShell()->printer); n++; + XtSetArg(args[n], (char*)DtNprinterName, (char *)window_system().videoShell()->printer); n++; } // if silent printing we won't need a dialog @@ -620,11 +621,11 @@ CreatePrintSetup(Widget parent, AppPrintData* p) if (XtIsApplicationShell(parent)) { p->f_print_dialog = - DtCreatePrintSetupBox(parent, "PrintSetup", args, n); + DtCreatePrintSetupBox(parent, (char*)"PrintSetup", args, n); } else { p->f_print_dialog = - DtCreatePrintSetupBox(XtParent(parent), "PrintSetup", args, n); + DtCreatePrintSetupBox(XtParent(parent), (char*)"PrintSetup", args, n); } } @@ -638,18 +639,18 @@ CreatePrintSetup(Widget parent, AppPrintData* p) CATGETS(Set_PrintPanelAgent, 1, "Dtinfo: Print")); XtSetArg(args[n], XmNdialogTitle, title); n++; - XtSetArg(args[n], DtNworkAreaLocation, DtWORK_AREA_BOTTOM); n++; + XtSetArg(args[n], (char*)DtNworkAreaLocation, DtWORK_AREA_BOTTOM); n++; // if parent widget is an application shell, use it, otherwise use // the grandparent if (XtIsApplicationShell(parent)) { p->f_print_dialog = - DtCreatePrintSetupDialog(parent, "PrintSetup", args, n); + DtCreatePrintSetupDialog(parent, (char*)"PrintSetup", args, n); } else { p->f_print_dialog = - DtCreatePrintSetupDialog(XtParent(parent), "PrintSetup", args, n); + DtCreatePrintSetupDialog(XtParent(parent), (char*)"PrintSetup", args, n); } // XmStringFree(title); } @@ -672,7 +673,7 @@ CreatePrintSetup(Widget parent, AppPrintData* p) // add context help for dialog - help_agent().add_activate_help(p->f_print_dialog, "print_panel_help"); + help_agent().add_activate_help(p->f_print_dialog, (char*)"print_panel_help"); } // update message area diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.C b/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.C index c69438cd8..8ce103ddf 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/ScopeMenu.C @@ -128,7 +128,7 @@ ScopeMenu::fill_menu() ON_DEBUG(cerr << "Scope Popup" << endl); int first = TRUE; - for (; s != NULL; s++) + for (; s != 0; s++) { // in case we are not using Current Section @@ -136,7 +136,7 @@ ScopeMenu::fill_menu() f_current_scope = s.item(); ON_DEBUG(cerr << "\t" << f_current_scope->name() << endl); - ON_DEBUG(f_current_scope->dump_items()); +// ON_DEBUG(f_current_scope->dump_items()); // Add a separator when they change from read only to changable. if (old_read_only != s.item()->read_only()) @@ -227,7 +227,7 @@ ScopeMenu::receive (ScopeCreated &msg, void *client_data) else { // Scan the current menu to find the correct insertion position. - for (; s != NULL; s++, position++) + for (; s != 0; s++, position++) { scope = s.item(); if (need_sep != scope->read_only()) @@ -284,7 +284,8 @@ ScopeMenu::receive (ScopeDeleted &msg, void *client_data) XtSetArg(args[n], XmNchildren, &kids); n++; XtGetValues(f_pull_menu, args, n); - for (int i = 0; i < num_kids; i++) + int i; + for (i = 0; i < num_kids; i++) { if (XmIsSeparator (kids[i])) { @@ -345,7 +346,8 @@ ScopeMenu::receive (ScopeRenamed &msg, void *client_data) XtSetArg(args[n], XmNchildren, &kids); n++; XtGetValues(f_pull_menu, args, n); - for (int i = 0; i < num_kids; i++) + int i; + for (i = 0; i < num_kids; i++) { if (XmIsPushButtonGadget (kids[i]) && msg.f_search_scope == @@ -363,7 +365,7 @@ ScopeMenu::receive (ScopeRenamed &msg, void *client_data) List_Iterator s (scope_list); // find the new position in the list - for (; s != NULL; s++) + for (; s != 0; s++) { if (s.item() == msg.f_search_scope) continue; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C index 077977901..99e2d5eed 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchHistoryListViewMotif.C @@ -47,7 +47,8 @@ * */ -#include "iostream.h" +#include "iostream" +using namespace std; #include "UAS.hh" @@ -112,7 +113,7 @@ SearchHistoryListView::display_value(FolioObject *object) if ((allowance = scope_field_width - scopeString.Width(fontlist)) < 0) { - char* dots = "..."; + char* dots = (char*)"..."; // need to free ungenerated at the end char* ungenerated = (char*)(scopeString + WXmString(dots)); @@ -210,7 +211,7 @@ SearchHistoryListView::child_create_ui_pre(WXmForm &form) if (matchString.Width(header_font) >= scope_offset) { - char* dots = "..."; + char* dots = (char*)"..."; char* ungenerated = (char*)(matchString + WXmString(dots)); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C index 1ad384632..4cd165853 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.C @@ -74,7 +74,8 @@ #include "Managers/WString.hh" #include -#include +#include +using namespace std; #include "Registration.hh" @@ -137,7 +138,7 @@ SearchResultsAgent::form_result_string (UAS_Pointer re) relevancy[0] += (char) ((re->relevance() * 8 ) / f_scale); - WXmString rel (relevancy, OLIAS_FONT); + WXmString rel (relevancy, (char*)OLIAS_FONT); WXmString book; WXmString name; @@ -171,7 +172,7 @@ SearchResultsAgent::form_result_string (UAS_Pointer re) } else { - char* dots = "..."; + char* dots = (char*)"..."; WXmString temp_xmstring = book + WXmString(dots); char *temp_str = (char*)temp_xmstring; @@ -379,7 +380,8 @@ SearchResultsAgent::fill_list(UAS_List& rlist) XmString *t = string_table; int string_count = 0 ; - for (int i = 0; i < rlist.length(); i ++) { + int i; + for (i = 0; i < rlist.length(); i ++) { string_count++ ; *t++ = form_result_string (rlist[i]); } @@ -445,7 +447,7 @@ SearchResultsAgent::fill_list(UAS_List& rlist) void SearchResultsAgent::create_window() { - create_base_window ("results"); + create_base_window ((char*)"results"); XmStringLocalized mtfstring; String string; @@ -453,7 +455,7 @@ SearchResultsAgent::create_window() string = CATGETS(Set_SearchResultsAgent, 1, "Dtinfo: Search Results"); XtVaSetValues((Widget)*f_shell, XmNtitle, string, NULL); - help_agent().add_activate_help(f_help, "results_help"); + help_agent().add_activate_help(f_help, (char*)"results_help"); #define AM WAutoManage // NOTE: need form to contain things in the same row 'cause of resizing @@ -486,7 +488,7 @@ SearchResultsAgent::create_window() mtfstring = CATGETS(Set_AgentLabel, 221, "Query:"); XtVaSetValues(query_label, XmNlabelString, (XmString)mtfstring, NULL); - Widget textw = XmCreateScrolledText (*f_pane, "query_text", NULL, 0); + Widget textw = XmCreateScrolledText (*f_pane, (char*)"query_text", NULL, 0); f_query_text = new WXmText (textw); f_query_text->Manage(); // WXmPushButton editq (*f_panel, "edit_query", AM); @@ -527,7 +529,7 @@ SearchResultsAgent::create_window() header.FontList(header_font); } - int offset = WXmString(relevancy, OLIAS_FONT).Width(f_list->FontList()); + int offset = WXmString(relevancy,(char*)OLIAS_FONT).Width(f_list->FontList()); header.LeftOffset(offset); WXmPrimitive prim(XtParent(*f_list)); diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.hh b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.hh index 96b78339a..1b2fe58da 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchResultsAgentMotif.hh @@ -93,6 +93,6 @@ protected: // variables inline SearchResultsAgent::SearchResultsAgent() -: f_work_proc_id (NULL), f_popped_up(FALSE) +: f_work_proc_id (0), f_popped_up(FALSE) { } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C index 4b9f1da88..d91a8c126 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeAgentMotif.C @@ -105,7 +105,8 @@ #endif #include -#include +#include +using namespace std; #include #define CLASS SearchScopeAgent @@ -419,7 +420,7 @@ void SearchScopeAgent::display() { Wait_Cursor bob; - if (f_shell == NULL) + if (f_shell == 0) { create_ui(); } @@ -459,7 +460,7 @@ SearchScopeAgent::fill_option_menu() WComposite menu (f_scope_option.SubMenuId()); ON_DEBUG (printf ("There are %d user scopes:\n", f_scope_list.length())); - for (; i != NULL; i++) + for (; i != 0; i++) { if (i.item()->read_only()) continue; @@ -490,11 +491,11 @@ SearchScopeAgent::create_ui() XtVaSetValues((Widget)f_shell, XmNtitle, string, NULL); DECL (WXmForm, form, f_shell, "form"); - DECL (WXmPulldownMenu, scope_menu, form, "scope_menu"); + DECLC (WXmPulldownMenu, scope_menu, form, "scope_menu"); Arg args[1]; int n = 0; XtSetArg(args[n], XmNsubMenuId, (Widget) scope_menu); n++; - f_scope_option = WXmOptionMenu (form, "scope_option", WAutoManage, args, n); + f_scope_option = WXmOptionMenu (form, (char*)"scope_option", WAutoManage, args, n); ASSN (WXmPushButton, f_unnamed, scope_menu, "unnamed"); mtfstring = CATGETS(Set_AgentLabel, 212, "Scope Name"); @@ -546,7 +547,7 @@ SearchScopeAgent::create_ui() ON_ACTIVATE (f_delete,delete_scope); ON_ACTIVATE (f_reset,reset); ON_ACTIVATE (close,close); - help_agent().add_activate_help (help, "scope_editor_help"); + help_agent().add_activate_help (help, (char*)"scope_editor_help"); form.ShadowThickness (0); form.Manage(); @@ -711,10 +712,10 @@ SearchScopeAgent::scope_name_prompt() // Check for name in use. List_Iterator s (f_scope_list); if (strcasecmp (scope_name, "unnamed") != 0) - for (; s != NULL; s++) + for (; s != 0; s++) if (strcmp (scope_name, s.item()->name()) == 0) break; - if (s != NULL) + if (s != 0) { message_mgr().error_dialog ( (char*)UAS_String(CATGETS(Set_Messages, 21, @@ -797,7 +798,7 @@ SearchScopeAgent::create_scope (const char *name, { // this flag should be defined elsewhere-this could // become a command-line option - if (f_shell == NULL) + if (f_shell == 0) { create_ui(); } @@ -962,7 +963,7 @@ SearchScopeAgent::rename_scope() int position = 1, old_position = -1; List_Iterator s (f_scope_list); - for (; s != NULL; s++) + for (; s != 0; s++) { if (s.item()->read_only()) continue; @@ -989,7 +990,7 @@ SearchScopeAgent::rename_scope() f_scope_list.remove_handle(f_current_scope); f_scope_list.remove (f_current_scope); ON_DEBUG (printf ("ScopeAgent: Inserting before <%s>\n", - s != NULL ? s.item()->name() : "LAST")); + s != 0 ? s.item()->name() : "LAST")); // add handle and scope back in appropriate location f_scope_list.add_handle(data_handle, position-1); f_scope_list.insert_before (s, f_current_scope); @@ -1106,7 +1107,7 @@ SearchScopeAgent::save_unnamed_scope (const char *name) // Scan the current menu to find the correct insertion position. List_Iterator s (f_scope_list); - for (; s != NULL; s++, position++) + for (; s != 0; s++, position++) { if (s.item()->read_only()) continue; @@ -1606,7 +1607,8 @@ SearchScopeAgent::add_infolib(UAS_Pointer &lib) // See if infolib is already in list--if it's there, // don't add it again. - for (int i = 0; i < ol->length(); i++) + int i; + for (i = 0; i < ol->length(); i++) { oe = ((OutlineElement *) (*ol)[i]); if (((TOC_Element *)oe)->toc() == lib) @@ -1685,7 +1687,8 @@ SearchScopeAgent::remove_infolib(UAS_Pointer &lib) BitHandle handle = f_infolib_list->data_handle(); f_infolib_list->clear(); - for (int i = 0; i < ol->length(); i ++) + int i; + for (i = 0; i < ol->length(); i ++) ((OutlineElement *) (*ol)[i])->set_expanded (handle); f_infolib_list->set_list (ol, handle); @@ -1815,7 +1818,7 @@ SearchScopeAgent::rebuild_scope_list() // Delete all named scopes so list can be rebuilt. List_Iterator si (f_scope_list); - for (; si != NULL; si++) + for (; si != 0; si++) { scope = si.item(); @@ -1933,7 +1936,7 @@ SearchScopeAgent::update_option_menu(UAS_String &scope_name) UAS_List SearchScopeAgent::list() { - if (f_shell == NULL) + if (f_shell == 0) { create_ui(); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C index 9a9c9fee2..455ea6a13 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/SearchScopeList.C @@ -82,7 +82,8 @@ #endif #include -#include +#include +using namespace std; #include "Other/XmStringLocalized.hh" #include "Managers/CatMgr.hh" @@ -149,7 +150,7 @@ SearchScopeList::save() Buffer buffer, temp_buffer; // for each search scope do - for (; i != NULL; i++) + for (; i != 0; i++) { scope = i.item(); if (scope->deleted() || scope->read_only()) @@ -224,7 +225,7 @@ SearchScopeList::save() // Now dump the name of each of the scopes. buffer.reset(); const char *name; - for (i.reset(); i != NULL; i++) + for (i.reset(); i != 0; i++) { if (i.item()->read_only()) continue; @@ -532,13 +533,14 @@ SearchScopeList::remove_handle(UAS_SearchScope *scope) { // first, find index into search scope list List_Iterator s (this); - for (int i = 0; s != NULL && s.item() != scope; s++, i++); + int i; + for (i = 0; s != 0 && s.item() != scope; s++, i++); // if can't find scope in list then something is hosed if (s == NULL) return; // next, find the bit handle located at this index in handle list List_Iterator h (f_handle_list); - for (int j = 0; j < i && h != NULL; j++, h++); + for (int j = 0; j < i && h != 0; j++, h++); // if this happens then something is hosed if (h == NULL) return; @@ -554,7 +556,8 @@ SearchScopeList::lookup_handle(UAS_SearchScope *scope) // first, find index into search scope list List_Iterator s (this); - for (int i = 0; s != NULL && s.item() != scope; s++, i++); + int i; + for (i = 0; s != 0 && s.item() != scope; s++, i++); // if can't find scope in list then something is hosed if (s == NULL) return 0; @@ -562,7 +565,7 @@ SearchScopeList::lookup_handle(UAS_SearchScope *scope) // next, find the bit handle located at this index in handle list List_Iterator h (f_handle_list); - for (int j = 0; j < i && h != NULL; j++, h++); + for (int j = 0; j < i && h != 0; j++, h++); // if this happens then something is hosed if (h == NULL) return 0; diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C b/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C index 655a31cb5..dccfa465e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Agents/UrlAgentMotif.C @@ -86,7 +86,7 @@ UrlAgent::~UrlAgent () { void UrlAgent::display (NodeWindowAgent *prefWindow) { - if (fShell == NULL) + if (fShell == 0) create_ui (); //f_form.Manage(); XmProcessTraversal( (Widget)fTextField, XmTRAVERSE_CURRENT ); @@ -126,7 +126,7 @@ UrlAgent::document( char *locator, } UAS_Pointer d = NULL ; - try + mtry { // perform basic syntax tests, but rely on the // precise format parsing to be done in the UAS layer @@ -171,7 +171,7 @@ UrlAgent::document( char *locator, d->retrieve(); } } - catch_any() + mcatch_any() { message_mgr().error_dialog( (char*)UAS_String(CATGETS( Set_UrlAgent, ERR_LOCATOR_RESOLUTION, @@ -253,7 +253,7 @@ UrlAgent::print_document(char *locator) } UAS_Pointer d = NULL ; - try + mtry { // perform basic syntax tests, but rely on the // precise format parsing to be done in the UAS layer @@ -332,7 +332,7 @@ UrlAgent::print_document(char *locator) } } } - catch_any() + mcatch_any() { if ((!window_system().videoShell()->silent)) { @@ -407,7 +407,7 @@ UrlAgent::create_ui () { ON_ACTIVATE (fApply,displayDocument); ON_ACTIVATE (close,close); ON_ACTIVATE (fClear,clear); - help_agent().add_activate_help (help, "open_url_help"); + help_agent().add_activate_help (help, (char*)"open_url_help"); // // A few clean up things... @@ -475,7 +475,7 @@ UrlAgent::displayDocument () { // "Invalid access method in url."))); // } // } -// catch_any() { +// mcatch_any() { // message_mgr().error_dialog ((char*) // UAS_String(CATGETS(Set_Messages, 71, // "Document creation failed."))); @@ -508,6 +508,6 @@ UrlAgent::modifyVerify (WCallback *wcb) { void UrlAgent::clear () { - XmTextFieldSetString (fTextField, ""); + XmTextFieldSetString (fTextField, (char*)""); valueChanged (); } diff --git a/cde/programs/dtinfo/dtinfo/src/Agents/create_macros.hh b/cde/programs/dtinfo/dtinfo/src/Agents/create_macros.hh index 14e29d2ea..be27a6147 100644 --- a/cde/programs/dtinfo/dtinfo/src/Agents/create_macros.hh +++ b/cde/programs/dtinfo/dtinfo/src/Agents/create_macros.hh @@ -3,7 +3,9 @@ #define _create_macros_hh #define DECL(TYPE,VAR,PARENT,NAME) TYPE VAR (PARENT, NAME) +#define DECLC(TYPE,VAR,PARENT,NAME) TYPE VAR (PARENT, (char*)NAME) #define DECLM(TYPE,VAR,PARENT,NAME) TYPE VAR (PARENT, NAME, WAutoManage) +#define DECLMC(TYPE,VAR,PARENT,NAME) TYPE VAR (PARENT, (char*)NAME, WAutoManage) #define ASSN(TYPE,VAR,PARENT,NAME) VAR = TYPE (PARENT, NAME) #define ASSNM(TYPE,VAR,PARENT,NAME) VAR = TYPE (PARENT, NAME, WAutoManage) diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/Atomizer.hh b/cde/programs/dtinfo/dtinfo/src/Basic/Atomizer.hh index 56dcea073..4f79b6c11 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/Atomizer.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/Atomizer.hh @@ -37,9 +37,9 @@ public: // functions // them and they can be eliminated. #ifndef __osf__ - int value() { return ((int) f_value); } + size_t value() { return ((size_t) f_value); } operator int () - { return ((int) f_value); } + { return ((size_t) f_value); } #endif operator const char * () diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/BitField.C b/cde/programs/dtinfo/dtinfo/src/Basic/BitField.C index 1d952bca9..635b430e8 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/BitField.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/BitField.C @@ -146,7 +146,8 @@ BitField::get_handle() // find first free bit // first find first free word - for (int word = 0 ; word < f_num_words ; word++ ) + int word; + for (word = 0 ; word < f_num_words ; word++ ) if ( word_has_zero_bit(f_bits_in_use[word]) ) break; @@ -179,7 +180,8 @@ BitField::get_handle() // now find first free byte in word - for (int byte = 0 ; byte < bytes_per_word ; byte++ ) + int byte; + for (byte = 0 ; byte < bytes_per_word ; byte++ ) if (byte_has_zero_bit(get_byte(byte, f_bits_in_use[word]))) break; @@ -187,7 +189,8 @@ BitField::get_handle() (f_bits_in_use[word] >> (byte * bits_per_byte)) & 0xFF ; // now check byte for zero bit - for (int bit = 0 ; bit < bits_per_byte ; bit++ ) + int bit; + for (bit = 0 ; bit < bits_per_byte ; bit++ ) if ((the_byte & mask[bit]) == 0) break ; diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/BitField.hh b/cde/programs/dtinfo/dtinfo/src/Basic/BitField.hh index f901018cc..1d198b7b8 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/BitField.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/BitField.hh @@ -57,7 +57,7 @@ public: #ifdef DEBUG bool is_used(BitHandle); - ostream &BitField::dump(ostream &); + ostream &dump(ostream &); #endif private: diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/Buffer.hh b/cde/programs/dtinfo/dtinfo/src/Basic/Buffer.hh index 4af99dfbf..fd1c4af32 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/Buffer.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/Buffer.hh @@ -54,8 +54,8 @@ public: void write (const int integer); #ifndef __osf__ - void write (const unsigned int integer) - { write ((int) ((void *) integer)); } + void write (const size_t integer) + { write ((size_t) ((void *) integer)); } #else void write (const unsigned int integer) { write ((int) integer); } diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/FString.C b/cde/programs/dtinfo/dtinfo/src/Basic/FString.C index fc351e512..a646a5ebc 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/FString.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/FString.C @@ -56,7 +56,7 @@ extern "C" { - extern int strlen(const char *); + extern size_t strlen(const char *); extern char *strcpy(char *, const char *); } diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/FolioObject.hh b/cde/programs/dtinfo/dtinfo/src/Basic/FolioObject.hh index bd1b19805..a5ae2a05b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/FolioObject.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/FolioObject.hh @@ -38,7 +38,7 @@ typedef void (FolioObject::* notify_handler_t) static ClassType C##Class #define INIT_CLASS(C) \ ClassType C::type() const { return (C##Class); } \ - ClassType C::C##Class = (ClassType) &C::C##Class + ClassType C::C##Class = (size_t) &C::C##Class #else #define DEF_CLASS(C) \ virtual ClassType type() const; \ diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/Imakefile b/cde/programs/dtinfo/dtinfo/src/Basic/Imakefile index 944a1f413..884a9d29a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Basic/Imakefile @@ -1,11 +1,14 @@ XCOMM $XConsortium: Imakefile /main/6 1996/08/21 15:41:35 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Basic +NormalCplusplusObjectRule() + #if defined(UseWideChars) && defined(SunArchitecture) && (OSMajorVersion == 4) INCLUDES=$(BROWSER_INCLUDES) $(MMDB_INCLUDES) -I/VOB/olias/library/Xwchar/src -I/VOB/olias/library/binstall/include #else @@ -24,8 +27,12 @@ SpecialCPlusPlusObjectRule(NodeDisplayDataTml.o NodeViewInfo.o,,$(LICENSE_L_INCL #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/List.C b/cde/programs/dtinfo/dtinfo/src/Basic/List.C index c2b73ab1d..5243f23e4 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/List.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/List.C @@ -147,7 +147,7 @@ List::append (FolioObject &element) abort(); f_list_element[f_length] = &element; f_length++; - notify (APPENDED, (void *) (f_length - 1)); + notify (APPENDED, (void *)(size_t) (f_length - 1)); } @@ -200,7 +200,7 @@ List::insert (unsigned int location, FolioObject *element) // Insert the new element in the list. f_list_element[location] = element; f_length++; - notify (INSERTED, (void *) location); + notify (INSERTED, (void *)(size_t) location); } diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/Long_Lived.hh b/cde/programs/dtinfo/dtinfo/src/Basic/Long_Lived.hh index b41338777..d0fd88c51 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/Long_Lived.hh +++ b/cde/programs/dtinfo/dtinfo/src/Basic/Long_Lived.hh @@ -39,14 +39,14 @@ private: // Macros to easily create access functions. -#define LONG_LIVED_HH(CLASS,FUNC) \ - friend CLASS &FUNC(); \ - static CLASS * CONCAT(g_,FUNC) +#define LONG_LIVED_HH(CLASS,FUNC) friend CLASS &FUNC(); \ + static CLASS * CONCAT(g_,FUNC) -#define LONG_LIVED_CC(CLASS,FUNC) \ - CLASS * CLASS::CONCAT(g_,FUNC); \ - CLASS &FUNC() { \ - if (CLASS::CONCAT(g_,FUNC) == NULL) \ - CLASS::CONCAT(g_,FUNC) = new CLASS(); \ - return (*CLASS::CONCAT(g_,FUNC)); \ - } +#define LONG_LIVED_HH2(CLASS,FUNC) CLASS &FUNC(); + +#define LONG_LIVED_CC(CLASS,FUNC) CLASS * CLASS::CONCAT(g_,FUNC); \ + CLASS &FUNC() { \ + if (CLASS::CONCAT(g_,FUNC) == NULL) \ + CLASS::CONCAT(g_,FUNC) = new CLASS(); \ + return (*CLASS::CONCAT(g_,FUNC)); \ + } diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C b/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C index 96e5902fe..ef417d7f0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/NodeViewInfo.C @@ -117,7 +117,7 @@ cleanup(_DtCvSegment *segment) break; case _DtCvSTRING: if (segment->handle.string.string) - delete (segment->handle.string.string); + delete (char*)(segment->handle.string.string); if (segment->client_use) { delete (SegClientData*)segment->client_use; segment->client_use = NULL; @@ -188,7 +188,8 @@ NodeViewInfo::~NodeViewInfo() while (gli) { #ifdef DEBUG - printf( "delete UAS_Pointer gli.item() = %p\n", gli.item() ); + printf( "delete UAS_Pointer gli.item() = %p\n", + (void*)gli.item() ); #endif f_pixmap_list.remove(gli) ; } @@ -204,14 +205,14 @@ NodeViewInfo::add_graphic(UAS_Pointer &pg) f_pixmap_list.append(pg); #ifdef DEBUG - printf( "NodeViewInfo: add UAS_Pointer %p\n", pg ); + printf( "NodeViewInfo: add UAS_Pointer %p\n", (void*)pg ); if (f_pixmap_list != NULL) { List_Iterator > gli (f_pixmap_list) ; printf( "graphics list is now: " ); while (gli) { - printf( " %p ", gli.item() ); + printf( " %p ", (void*)gli.item() ); gli++; } printf( "\n" ); @@ -530,7 +531,7 @@ highlight_search_hit(_DtCvSegment* seg, unsigned int vcc, unsigned int len) if (sibling->handle.string.string) free (sibling->handle.string.string); if (sibling->client_use) { - delete sibling->client_use; + delete (SegClientData*)sibling->client_use; sibling->client_use = NULL; } diff --git a/cde/programs/dtinfo/dtinfo/src/Basic/TOC_Element.C b/cde/programs/dtinfo/dtinfo/src/Basic/TOC_Element.C index 4319a0ffb..2509f7998 100644 --- a/cde/programs/dtinfo/dtinfo/src/Basic/TOC_Element.C +++ b/cde/programs/dtinfo/dtinfo/src/Basic/TOC_Element.C @@ -53,7 +53,8 @@ #include "Prelude.h" -#include +#include +using namespace std; INIT_CLASS (TOC_Element); diff --git a/cde/programs/dtinfo/dtinfo/src/Graphics/Imakefile b/cde/programs/dtinfo/dtinfo/src/Graphics/Imakefile index fd6f9f594..4abbd8639 100644 --- a/cde/programs/dtinfo/dtinfo/src/Graphics/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Graphics/Imakefile @@ -1,11 +1,14 @@ XCOMM $XConsortium: Imakefile /main/5 1996/08/21 15:41:55 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Graphics +NormalCplusplusObjectRule() + INCLUDES=$(BROWSER_INCLUDES) $(MMDB_INCLUDES) #ifdef DoLicenseManagement @@ -21,8 +24,12 @@ make_libfiles($(LIBNAME), $(CLASSES)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.C b/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.C index 175b96724..dc3183b75 100644 --- a/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.C +++ b/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.C @@ -80,11 +80,11 @@ PixmapGraphic::PixmapGraphic(Pixmap pixmap, Dimension width, Dimension height, f_width (width), f_height (height), f_flag (flag), - f_colormap(NULL), + f_colormap(0), f_num_colors(0), f_colors(NULL), f_tiff_context(NULL), - f_agent(NULL) + f_agent(0) { } diff --git a/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.hh b/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.hh index 4667f183d..96e0596f1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.hh +++ b/cde/programs/dtinfo/dtinfo/src/Graphics/PixmapGraphic.hh @@ -20,6 +20,7 @@ */ #include "UAS.hh" +// #include "Managers/GraphicsMgr.hh" class GraphicsMgr; class GraphicAgent ; diff --git a/cde/programs/dtinfo/dtinfo/src/Imakefile b/cde/programs/dtinfo/dtinfo/src/Imakefile index e9300b57a..fd839ee4a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Imakefile @@ -1,11 +1,14 @@ XCOMM $TOG: Imakefile /main/48 1998/08/10 15:52:48 mgreess $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES PROGRAM_NAME=dtinfo MAKEFILEDEPS=Classlist.mk +NormalCplusplusObjectRule() + #if defined(RsArchitecture) || defined(AIXArchitecture) LOCAL_LDFLAGS=-blibpath:/usr/dt/lib:/X11/lib:/usr/lib/threads:/usr/lib:/lib #endif @@ -22,6 +25,13 @@ SUBDIRS=Widgets $(CLASSLIBS) Messages cgm #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CXXDEBUGFLAGS=$(CXXDEBUGFLAGS)' +XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir +#undef TopLevelProject +#define TopLevelProject DtInfo +IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' + DependSubdirs($(SUBDIRS)) #if defined(SVR4) && defined(i386) @@ -32,6 +42,8 @@ SYS_LIBRARIES=-lm -liconv /usr/lib/libpthreads.a -blibpath:/usr/dt/lib:/X11/lib: SYS_LIBRARIES=-lm -lfs #elif defined(HPArchitecture) SYS_LIBRARIES=$(DYNAMIC) -lm +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) +SYS_LIBRARIES=-lm -L$(XPROJECTROOT)/lib #else SYS_LIBRARIES=-lm #endif @@ -299,7 +311,7 @@ all:: Prelude.h dfiles messages Dtinfo includes:: Prelude.h dfiles messages -#if defined(HPArchitecture) ||defined (AIXArchitecture) || defined(UXPArchitecture) || (defined(SunArchitecture) && CplusplusCompilerMajorVersion < 4) || defined(AlphaArchitecture) || defined(USLArchitecture) +#if defined(HPArchitecture) ||defined (AIXArchitecture) || defined(UXPArchitecture) || (defined(SunArchitecture) && CplusplusCompilerMajorVersion < 4) || defined(AlphaArchitecture) || defined(USLArchitecture) || defined(FreeBSDArchitecture) # ifndef Dont_Use_Templates_Repository # define Dont_Use_Templates_Repository UAS_INCLUDES=-I./UAS/Base @@ -324,6 +336,9 @@ SpecialCPlusPlusObjectRule(Templates.o,,-ptf $(SUBDIR_TEMPL_INCLUDES)) SpecialCPlusPlusExpandRule(Templates..c,,-ptf -DMakeOperatorNewPublic) #elif defined(DoLicenseManagement) SpecialCPlusPlusObjectRule(Templates.o,,-ptf $(LICENSE_L_INCLUDES)) +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +SpecialCPlusPlusObjectRule(Templates.o,,$(SUBDIR_TEMPL_INCLUDES)) +SpecialCPlusPlusExpandRule(Templates..c,,-DMakeOperatorNewPublic) #else SpecialCPlusPlusObjectRule(Templates.o,,-ptf $(SUBDIR_TEMPL_INCLUDES)) SpecialCPlusPlusExpandRule(Templates..c,,-ptf -DMakeOperatorNewPublic) @@ -460,4 +475,8 @@ InstallNonExecFile(Olias.hlp,$(INSTALL_HELP_DIR)/C) #endif InstallNonExecFile($(PROGRAM_NAME).cat,$(INSTALL_MSG_CAT_DIR)/C) +XCOMM Variables to switch on debug mode temporarily +XCOMM CDEBUGFLAGS = -g -DDEBUG +XCOMM CXXDEBUGFLAGS = -g -DDEBUG + DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C index 55be5ba42..30825dd69 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.C @@ -30,7 +30,8 @@ #include #include -#include +#include +using namespace std; #include
#include
@@ -66,9 +67,9 @@ CatMgr::CatMgr() : f_msg(NULL), f_default(NULL) else { #ifdef DEBUG cerr << "(WARNING) catopen failed." << '\n' << flush; - static char* cat_not_found = "default message not found."; + static char* cat_not_found = (char*)"default message not found."; #else - static char* cat_not_found = ""; + static char* cat_not_found = (char*)""; #endif f_default = new char[strlen(cat_not_found) + 1]; strcpy(f_default, cat_not_found); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh index b1f2d7777..56a6cbcf9 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/CatMgr.hh @@ -11,10 +11,6 @@ #define CATALOG_PREFIX "dtinfo" -#ifndef NULL -#define NULL (char*)0 -#endif - class CatMgr { public: @@ -23,7 +19,7 @@ class CatMgr ~CatMgr(); static CatMgr& msg_catalog_mgr() { return *f_msg_catalog_mgr; } - char* catgets(int set, int msg, const char* def = NULL); + char* catgets(int set, int msg, const char* def = (char*)0); static int is_open(nl_catd catd) { return ((catd != (nl_catd)-1) ? 1 : 0); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/ClientEventMgrX.hh b/cde/programs/dtinfo/dtinfo/src/Managers/ClientEventMgrX.hh index 203140897..0332d467e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/ClientEventMgrX.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/ClientEventMgrX.hh @@ -14,3 +14,5 @@ private: LONG_LIVED_HH(ClientEventMgr, client_event_manager); }; + +LONG_LIVED_HH2(ClientEventMgr, client_event_manager); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/DatabaseMgrLEND.hh b/cde/programs/dtinfo/dtinfo/src/Managers/DatabaseMgrLEND.hh index 7d07a1b58..5a2f7141f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/DatabaseMgrLEND.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/DatabaseMgrLEND.hh @@ -15,6 +15,8 @@ private: LONG_LIVED_HH(DatabaseMgr,database_mgr); }; +LONG_LIVED_HH2(DatabaseMgr,database_mgr); + inline olias_server * olias_db() { diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C index d4c9487fc..486926287 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.C @@ -42,7 +42,8 @@ */ #include -#include +#include +using namespace std; #include #include @@ -69,6 +70,7 @@ #ifdef UseSessionMgmt #define C_SessionMgr #endif +#define C_GraphicsMgr #define L_Managers #include "Managers/CatMgr.hh" @@ -144,7 +146,7 @@ EnvMgr::EnvMgr() : f_argv(NULL), if(!check_user_path()) { create_user_path(); - help_agent().display_help ("doc_list_help"); + help_agent().display_help ((char*)"doc_list_help"); } UAS_Collection::request( @@ -216,7 +218,7 @@ EnvMgr::init(int argc_i, char** argv_i) { // link up indirect paths to mmdb code... ;-) static char buffer[256]; - sprintf (buffer, "MMDB_PATH=%s", f_infolibsStr ); + sprintf (buffer, "MMDB_PATH=%s", (char *)f_infolibsStr ); putenv (buffer); char *where = getenv ("DTINFO_MARKSPECPATH"); @@ -935,7 +937,7 @@ EnvMgr::mkdirs(char *pathname) { c = strrchr(buffer, '/'); if (c != NULL) - *c = NULL; + *c = 0; (void)mkdirs(buffer); if (c != NULL) *c = '/'; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh index eb67bed8e..ffa585c4f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/EnvMgr.hh @@ -113,3 +113,5 @@ private: // data private: LONG_LIVED_HH( EnvMgr, env ); }; + +LONG_LIVED_HH2( EnvMgr, env ) ; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.C index fbae44d47..cc004e6b1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.C @@ -46,7 +46,8 @@ * Campbell, CA 95008 * */ -#include +#include +using namespace std; #include "UAS.hh" #define C_GlobalHistoryMgr @@ -163,7 +164,7 @@ GlobalHistoryMgr::add (UAS_Pointer &node_ptr) for (i = 0; hl; hl++, i++) { - ON_DEBUG (printf ("%2d: Checking <%s>\n", i, hl.item()->title())); + ON_DEBUG (printf ("%2d: Checking <%s>\n", i, (char*)hl.item()->title())); if (hl.item() == node_ptr) break; } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh index 425ad4373..5d04af160 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/GlobalHistoryMgr.hh @@ -57,6 +57,8 @@ private: LONG_LIVED_HH (GlobalHistoryMgr,global_history_mgr); }; +LONG_LIVED_HH2 (GlobalHistoryMgr,global_history_mgr); + struct HistoryDelete : public Destructable { diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.C index 22af86aa0..00e7cb91e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.C @@ -70,7 +70,8 @@ #include "Prelude.h" -#include +#include +using namespace std; extern "C" { #include "../cgm/spec.h" @@ -111,7 +112,7 @@ GraphicsMgr::get_graphic (UAS_Pointer &gr) if (window_system().printing()) { string_resolution = XpGetOneAttribute(window_system().printDisplay(), l_AppPrintData->f_print_data->print_context, - XPDocAttr, "default-printer-resolution") ; + XPDocAttr, (char*)"default-printer-resolution") ; resolution = atoi(string_resolution); XFree(string_resolution); } @@ -162,7 +163,7 @@ GraphicsMgr::get_graphic (const UAS_String &imdata, if(!initialized) { - _DtGrRegisterConverter("CGM", processCGM, NULL, NULL, NULL); + _DtGrRegisterConverter((char*)"CGM", processCGM, NULL, NULL, NULL); initialized = 1; } @@ -172,7 +173,7 @@ GraphicsMgr::get_graphic (const UAS_String &imdata, // if content_type is a NULL string, image type is unknown if (content_type == "") { - image_type = "unknown"; + image_type = (char*)"unknown"; } else { @@ -254,17 +255,17 @@ GraphicsMgr::get_graphic (const UAS_String &imdata, if (!strcasecmp (image_type, "XBM")) { // match up infolib name for XBM to DtGr library - image_type = "BM"; + image_type = (char*)"BM"; } if (!strcasecmp (image_type, "XPM")) { // match up infolib name for XPM to DtGr library - image_type = "PM"; + image_type = (char*)"PM"; } #ifdef XWD_TEST if (!image_type || !strcasecmp (image_type, "unknown")) - image_type = "XWD" ; + image_type = (char*)"XWD" ; #endif // Context struct is required for TIFF data type only @@ -577,80 +578,3 @@ GraphicsMgr::init_gr(UAS_Pointer &gr) //ga->set_graphic(gr); } -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// -// Graphic implementation -// -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -Graphic::Graphic (UAS_Pointer &doc, const UAS_String &locator): - fPixmap (0), - fDetachedPixmap (0), - fDetached (0), - fObj (doc->create_embedded_object (locator)) { -} - -Graphic::~Graphic () { - //graphics_mgr().uncache(this); - //graphics_mgr().remove_detached(this); -#ifdef DEBUG - printf( "for Graphic %p, delete PixmapGraphic %p\n", this, fPixmap ); -#endif - delete fPixmap; - delete fDetachedPixmap; -} - - -// If this one is called instead of the null arg version, the resulting -// PixmapGraphic instance is not tracked nor recorded by this instance -PixmapGraphic * -Graphic::pixmap_graphic (UAS_String& imdata, - unsigned int imlen, - UAS_String& imtype, unsigned short scale) { - PixmapGraphic *the_pixmap; - //UAS_Pointer tmp(this); - //if (fPixmap) - // delete fPixmap; - - the_pixmap = graphics_mgr().get_graphic (imdata, imlen, imtype, scale); - return the_pixmap; -} - -PixmapGraphic * -Graphic::pixmap_graphic () { - UAS_Pointer tmp(this); - // fPixmap records the PixmapGraphic & pixmap once created (and only - // if created via this method) for this instance of Graphic - if (!fPixmap) - fPixmap = graphics_mgr().get_graphic (tmp); - return fPixmap; -} - -PixmapGraphic * -Graphic::detached_graphic () { - if (!fDetachedPixmap) - fDetachedPixmap = graphics_mgr().detached_graphic(); - return fDetachedPixmap; -} - -UAS_String Graphic::title() -{ - return fObj->title(); -} - -UAS_String Graphic::content_type() -{ - return fObj->content_type(); -} - -UAS_String Graphic::locator() -{ - return fObj->locator() ; -} - -UAS_String Graphic::id() -{ - return fObj->id() ; -} diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.hh index 8110cbd1b..a745f2136 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/GraphicsMgr.hh @@ -26,6 +26,9 @@ class PixmapGraphic; class DetachGraphic; +class ReAttachGraphic; +class GraphicAgent; +class DisplayGraphic; #if defined(SVR4) || defined(hpux) @@ -78,6 +81,8 @@ private: LONG_LIVED_HH(GraphicsMgr,graphics_mgr); }; +LONG_LIVED_HH2(GraphicsMgr,graphics_mgr); + // // Now (as of CDE development), instead of using the Graphic class // (which was changed to UAS_EmbeddedObject), we use this Graphic @@ -89,8 +94,23 @@ private: class Graphic: public UAS_Base { public: - Graphic (UAS_Pointer &, const UAS_String &); - ~Graphic (); + Graphic (UAS_Pointer &doc, const UAS_String &locator): + fPixmap (0), + fDetachedPixmap (0), + fDetached (0), + fObj (doc->create_embedded_object (locator)) { + } + + ~Graphic () { + //graphics_mgr().uncache(this); + //graphics_mgr().remove_detached(this); +#ifdef DEBUG + printf("for Graphic %p, delete PixmapGraphic %p\n", this, fPixmap ); +#endif + delete fPixmap; + delete fDetachedPixmap; + } + public: unsigned int is_detached () const { return fDetached; } @@ -98,9 +118,35 @@ class Graphic: public UAS_Base { PixmapGraphic *graphic () { return is_detached () ? detached_graphic() : pixmap_graphic(); } - PixmapGraphic *pixmap_graphic (); - PixmapGraphic *pixmap_graphic (UAS_String&, unsigned int, UAS_String&, unsigned short); - PixmapGraphic *detached_graphic(); + + PixmapGraphic *pixmap_graphic () { + UAS_Pointer tmp(this); + // fPixmap records the PixmapGraphic & pixmap once created (and only + // if created via this method) for this instance of Graphic + if (!fPixmap) + fPixmap = graphics_mgr().get_graphic (tmp); + return fPixmap; + } + + // If this one is called instead of the null arg version, the resulting + // PixmapGraphic instance is not tracked nor recorded by this instance + PixmapGraphic *pixmap_graphic (UAS_String& imdata, + unsigned int imlen, + UAS_String& imtype, unsigned short scale) { + PixmapGraphic *the_pixmap; + //UAS_Pointer tmp(this); + //if (fPixmap) + // delete fPixmap; + + the_pixmap = graphics_mgr().get_graphic(imdata,imlen,imtype,scale); + return the_pixmap; + } + + PixmapGraphic *detached_graphic () { + if (!fDetachedPixmap) + fDetachedPixmap = graphics_mgr().detached_graphic(); + return fDetachedPixmap; + } // // Pass-throughs for UAS_EmbeddedObject (and all of its @@ -116,10 +162,15 @@ class Graphic: public UAS_Base { } void cancel_retrieval () { fObj->cancel_retrieval (); } void flush () { fObj->flush(); } - UAS_String locator (); - UAS_String content_type(); - UAS_String title (); - UAS_String id (); + + UAS_String locator() { return fObj->locator(); } + + UAS_String content_type() { return fObj->content_type(); } + + UAS_String title() { return fObj->title(); } + + UAS_String id() { return fObj->id(); } + UAS_ObjectType type () { return fObj->type (); } unsigned int llx () { return fObj->llx(); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/Imakefile b/cde/programs/dtinfo/dtinfo/src/Managers/Imakefile index b2fb93b0c..56e05641b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Managers/Imakefile @@ -1,7 +1,8 @@ XCOMM $XConsortium: Imakefile /main/9 1996/08/21 15:42:26 drk $ XCOMM NodeMgr.o and PrintMgr.o need STYLE_SHEET_INCLUDES. -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(STYLE_SHEET_INCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) $(STYLE_SHEET_INCLUDES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES DEFINES=-DCDE_NEXT $(BYTE_ORDER_DEFINES) @@ -20,6 +21,8 @@ MAKEFILEDEPS=Classlist.mk LIBNAME=Managers +NormalCplusplusObjectRule() + INCLUDES=$(BROWSER_INCLUDES) $(COMMON_CLASS_INCLUDES) #include "Classlist.mk" @@ -43,8 +46,12 @@ make_msgs($(LIBNAME), $(MSGS)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/InputMgrX.C b/cde/programs/dtinfo/dtinfo/src/Managers/InputMgrX.C index 1fa94b652..4d986142f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/InputMgrX.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/InputMgrX.C @@ -46,7 +46,8 @@ #define L_Other # include -# include +# include +using namespace std; InputMgrX::InputMgrX () { diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.C index 2a4a933db..4815ede3f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.C @@ -40,7 +40,9 @@ * 1315 Dell Avenue, Campbell, CA 95008 * */ -#include +#include +#include +using namespace std; #define C_LibraryMgr #define C_NodeMgr @@ -57,7 +59,8 @@ #define L_Support #include "Prelude.h" -#include + +#include "utility/mmdb_exception.h" LONG_LIVED_CC(LibraryMgr,library_mgr); @@ -170,7 +173,8 @@ LibraryMgr::display (UAS_Pointer &toc) // First, check to see if the object to display is already // in our list. // - for (int i = 0; i < fObjList.length(); i ++) + int i; + for (i = 0; i < fObjList.length(); i ++) { if (fObjList[i] == toc) { @@ -419,7 +423,7 @@ LibraryMgr::init(UAS_List &infolibpaths) UAS_List locList = UAS_Common::rootLocators (); for (i = 0; i < locList.length(); i ++) { - try + mtry { UAS_Pointer d = UAS_Common::create (*(UAS_String*)locList[i]); @@ -435,7 +439,7 @@ LibraryMgr::init(UAS_List &infolibpaths) else message_mgr().error_dialog(window_system().get_message ("NoDocument")); } - catch(demoException &, demo) + mcatch(demoException &, demo) { message_mgr().demo_failure(demo); } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.hh index 173068f3e..b092b9033 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/LibraryMgr.hh @@ -66,3 +66,5 @@ private: // variables private: LONG_LIVED_HH(LibraryMgr,library_mgr); }; + +LONG_LIVED_HH2(LibraryMgr,library_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.C index 769bfcafa..379dad5af 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/LocalHistoryMgr.C @@ -120,7 +120,8 @@ LocalHistoryMgr::truncate() void LocalHistoryMgr::append (UAS_Pointer &doc_ptr) { - ON_DEBUG (printf ("&&&&& APPENDING <%s> to history\n", doc_ptr->title())); + ON_DEBUG (printf ("&&&&& APPENDING <%s> to history\n", + (char*)doc_ptr->title())); LocalHistoryEntry *entry = new LocalHistoryEntry (doc_ptr); truncate(); entry->f_previous = f_current; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MapMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MapMgr.hh index f264f71ed..9f9c0eeb2 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MapMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MapMgr.hh @@ -43,3 +43,5 @@ protected: // variables private: LONG_LIVED_HH(MapMgr,map_mgr); }; + +LONG_LIVED_HH2(MapMgr,map_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MarkListMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MarkListMgr.hh index fb7f90769..8cac10cc6 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MarkListMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MarkListMgr.hh @@ -44,3 +44,4 @@ private: LONG_LIVED_HH(MarkListMgr,mark_list_mgr); }; +LONG_LIVED_HH2(MarkListMgr,mark_list_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C index 720e13926..4006c60bb 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.C @@ -51,7 +51,8 @@ */ #include -#include +#include +using namespace std; #include "UAS.hh" @@ -239,7 +240,7 @@ MarkMgr::create_mark (UAS_Pointer &doc_ptr, const Anchor &anchor, List_Iterator b (f_base_list); - assert (b != NULL); + assert (b != 0); // Trim leading and trailing space and check for an empty name. #ifdef UseWideChars @@ -328,7 +329,7 @@ MarkMgr::move_mark (UAS_Pointer &doc_ptr, const Anchor &anchor, List_Iterator b (f_base_list); - assert (b != NULL); + assert (b != 0); MarkMoved move_message; move_message.f_new_mark_ptr = b.item()-> diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh index 42a40e000..24791fec0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MarkMgr.hh @@ -72,3 +72,5 @@ private: LONG_LIVED_HH (MarkMgr,mark_mgr); }; + +LONG_LIVED_HH2 (MarkMgr,mark_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C index c66a18b7c..2b5d24675 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.C @@ -60,7 +60,8 @@ #include "Other/XmStringLocalized.hh" #include -#include +#include +using namespace std; LONG_LIVED_CC (MessageMgr,message_mgr); @@ -257,7 +258,7 @@ MessageMgr::create_dialog (unsigned char dialog_type, parent = window_system().toplevel(); } - dialog = XmCreateMessageDialog(parent, "dialog", NULL, 0); + dialog = XmCreateMessageDialog(parent, (char*)"dialog", NULL, 0); WXmString wxms = message_text; XtVaSetValues(dialog, @@ -470,7 +471,7 @@ MessageMgr::question_dialog (char *message_text, Widget parent) { if(parent == NULL) parent = (Widget)window_system().toplevel(); - Widget dialog = XmCreateInformationDialog(parent, "dialog", NULL, 0); + Widget dialog = XmCreateInformationDialog(parent, (char*)"dialog", NULL, 0); XtUnmanageChild(XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON)); WXmString wxms = message_text; XtVaSetValues(dialog, @@ -559,7 +560,7 @@ File \"%s,\" line %d.", f_booklist_message.displayError (buffer, window_system().toplevel()); else f_nodeview_message.displayError (buffer, parent); - quit_dialog ("We strongly suggest you quit now, Ok?", parent); + quit_dialog ((char*)"We strongly suggest you quit now, Ok?", parent); } // ///////////////////////////////////////////////////////////////////////// diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh index f4004a938..e1bab10d1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/MessageMgr.hh @@ -89,12 +89,14 @@ private: LONG_LIVED_HH(MessageMgr,message_mgr); }; +LONG_LIVED_HH2(MessageMgr,message_mgr); + #ifdef __STDC__ #define Xassert(STMT) \ if (!(STMT)) { \ - message_mgr().assert_failed (#STMT, __FILE__, __LINE__); \ + message_mgr().assert_failed ((char*)#STMT, (char*)__FILE__, __LINE__); \ return; \ }; #else diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C index a288fb571..4b0164663 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.C @@ -66,6 +66,7 @@ #define C_NodeWindowMgr #define C_StyleSheetMgr #define C_LibraryMgr +#define C_GraphicsMgr #define L_Managers #define C_xList @@ -90,7 +91,7 @@ #include "../OnlineRender/CanvasRenderer.hh" #endif -#include +#include class NodeWindowAgent; class NodeHandle; @@ -110,7 +111,7 @@ void DisplayNode::receive (UAS_DocumentRetrievedMsg &message, void *client_data) { ON_DEBUG (cerr <<"Got Node display message!" << endl); - int cd = (int)client_data; + size_t cd = (size_t)client_data; // 0 == display request @@ -340,11 +341,11 @@ NodeMgr::load(UAS_Pointer &node_ptr) styleparse(); } #else - try + mtry { style_sheet_mgr().initOnlineStyleSheet(node_ptr); } - catch_noarg (StyleSheetSyntaxError) + mcatch_noarg (StyleSheetSyntaxError) { message_mgr().error_dialog( (char*)UAS_String(CATGETS(Set_Messages, 39, "File a Bug"))); @@ -361,9 +362,9 @@ NodeMgr::load(UAS_Pointer &node_ptr) } #endif - istrstream input((char *) node_ptr->data()); + istringstream input((char *) node_ptr->data()); - try + mtry { #ifdef FONT_SCALE_DEBUG cerr << "PrefMgr::FontScale: " << @@ -376,7 +377,7 @@ NodeMgr::load(UAS_Pointer &node_ptr) DocParser docparser(resolver); docparser.parse(input); } - catch_any() + mcatch_any() { ON_DEBUG(cerr << "NodeMgr::load...exception thrown" << endl); delete gNodeViewInfo ; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.hh index 2f6777583..7ed575cb9 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/NodeMgr.hh @@ -81,4 +81,5 @@ private: // variables LONG_LIVED_HH(NodeMgr,node_mgr); }; +LONG_LIVED_HH2(NodeMgr,node_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.C index 541313221..53fe92b38 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.C @@ -122,13 +122,13 @@ PrefMgr::display() void PrefMgr::sync() { - try + mtry { UserPreference::flush_preferences(); } - catch_any() + mcatch_any() { - message_mgr().error_dialog ("Unable to save preferences."); + message_mgr().error_dialog ((char*)"Unable to save preferences."); } end_try; } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.hh index f8cecddd6..9b78a44c6 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrefMgr.hh @@ -87,6 +87,8 @@ private: LONG_LIVED_HH(PrefMgr,pref_mgr); }; +LONG_LIVED_HH2(PrefMgr,pref_mgr); + inline PrefMgr::PrefMgr() : f_pref_agent (NULL), f_last_symbol (NULL), f_last_preference (NULL) diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C index fe5f10584..81929e7cc 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.C @@ -66,6 +66,7 @@ #define C_NodeWindowMgr #define C_StyleSheetMgr #define C_LibraryMgr +#define C_GraphicsMgr #define L_Managers #include "Prelude.h" @@ -105,7 +106,7 @@ PrintNode::receive (UAS_DocumentRetrievedMsg &message, void *client_data) { RCS_DEBUG("PrintNode::receive called."); - int cd = (int)client_data; + size_t cd = (size_t)client_data; // 1 == print request if (cd == 1) { @@ -206,11 +207,11 @@ PrintMgr::load(UAS_Pointer &node_ptr) extern void stylerestart(FILE *); extern NodeViewInfo *gNodeViewInfo; - try + mtry { style_sheet_mgr().initPrintStyleSheet(node_ptr); } - catch_noarg (StyleSheetSyntaxError) + mcatch_noarg (StyleSheetSyntaxError) { message_mgr().error_dialog( (char*)UAS_String(CATGETS(Set_Messages, 39, @@ -219,9 +220,9 @@ PrintMgr::load(UAS_Pointer &node_ptr) } end_try ; - istrstream input((char *) node_ptr->data()); + istringstream input((char *) node_ptr->data()); - try + mtry { window_system().setPrinting(True); // assign node_ptr to global variable that TmlRenderer can pick up @@ -232,7 +233,7 @@ PrintMgr::load(UAS_Pointer &node_ptr) docparser.parse(input); window_system().setPrinting(False); } - catch_any() + mcatch_any() { ON_DEBUG(cerr << "PrintMgr::load...exception thrown" << endl); delete gNodeViewInfo ; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh index 62336d0d5..e4c981df5 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/PrintMgr.hh @@ -80,4 +80,5 @@ private: LONG_LIVED_HH(PrintMgr,print_mgr); }; +LONG_LIVED_HH2(PrintMgr,print_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C index b679ed08e..8d2d88f6e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.C @@ -44,7 +44,8 @@ * */ -#include +#include +using namespace std; #include "Registration.hh" @@ -76,8 +77,6 @@ #include "Managers/CatMgr.hh" -#include - LONG_LIVED_CC(SearchMgr,search_mgr) // Reconfigure search engine @@ -184,7 +183,7 @@ SearchMgr::history_entry_activate (FolioObject *, u_int, void *notify_data, void *) { Wait_Cursor bob; - u_int which_item = (int) notify_data; + size_t which_item = (size_t) notify_data; ResultID *rid = (ResultID *) f_search_history_list[which_item]; @@ -206,7 +205,8 @@ SearchMgr::search_history_list_view() if (f_search_history_list_view == NULL) { f_search_history_list_view = - new SearchHistoryListView (&f_search_history_list, "search_history"); + new SearchHistoryListView (&f_search_history_list, + (char*)"search_history"); f_search_history_list_view->AddDependent ((notify_handler_t) &SearchMgr::history_entry_activate, ListView::ENTRY_ACTIVATE); @@ -253,16 +253,16 @@ SearchMgr::parse_and_search (char *query, UAS_SearchScope *scope) { if (f_search_section.length()) { scope->search_zones().section ((char*)f_search_section); } - try + mtry { tmp_results = search_engine().search (query, *scope); } - catch (UAS_Exception&, e) + mcatch (UAS_Exception&, e) { - message_mgr().error_dialog ((char*)e->message()); + message_mgr().error_dialog ((char*)e.message()); return; } - catch_any () + mcatch_any () { } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.hh index ac3d29e99..781346d9b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchMgr.hh @@ -57,7 +57,7 @@ public: // functions } UAS_Pointer > current_hits (); -friend SearchMgr &search_mgr(); +// friend SearchMgr &search_mgr(); private: friend class SeReconfigure; @@ -81,5 +81,6 @@ private: LONG_LIVED_HH(SearchMgr,search_mgr); }; +LONG_LIVED_HH2(SearchMgr,search_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchResultsMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/SearchResultsMgr.hh index 09c18ab65..42e909c86 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchResultsMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchResultsMgr.hh @@ -41,3 +41,5 @@ protected: // functions protected: //variables LONG_LIVED_HH(SearchResultsMgr,search_results_mgr); }; + +LONG_LIVED_HH2(SearchResultsMgr,search_results_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.C index b90ec3036..52f55f1b1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.C @@ -67,7 +67,8 @@ #include "Prelude.h" -#include +#include +using namespace std; LONG_LIVED_CC(SearchScopeMgr,search_scope_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.hh index 2ff03043c..484c91412 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SearchScopeMgr.hh @@ -54,4 +54,5 @@ private: LONG_LIVED_HH(SearchScopeMgr,search_scope_mgr); }; +LONG_LIVED_HH2(SearchScopeMgr,search_scope_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C index 8da527d4d..411f4ffa4 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.C @@ -133,13 +133,13 @@ ServiceMgr::create_atoms() { enum { XA_OLIAS_WINDOW_ID_ATOM, XA_OLIAS_EVENT_ATOM, XA_OLIAS_REPLY_ATOM, NUM_ATOMS }; - static char *atom_names[] = { OLIAS_WINDOW_ID_ATOM, OLIAS_EVENT_ATOM, - OLIAS_REPLY_ATOM }; + static const char *atom_names[] = { OLIAS_WINDOW_ID_ATOM, + OLIAS_EVENT_ATOM, OLIAS_REPLY_ATOM }; Atom atoms[XtNumber(atom_names)]; - XInternAtoms (window_system().display(), atom_names, - XtNumber(atom_names), False, atoms); + XInternAtoms (window_system().display(), (char**)atom_names, + XtNumber((char**)atom_names), False, atoms); _XA_OLIAS_WINDOW_ID = atoms[XA_OLIAS_WINDOW_ID_ATOM]; _XA_OLIAS_EVENT = atoms[XA_OLIAS_EVENT_ATOM]; @@ -265,7 +265,7 @@ ServiceMgr::process_olias_event (Window client, locator = (char *) stream; UAS_Pointer d; - try + mtry { if (strchr (locator, ':')) { @@ -285,11 +285,11 @@ ServiceMgr::process_olias_event (Window client, delete [] buffer; } } - catch (demoException&, demo) + mcatch (demoException&, demo) { message_mgr().demo_failure(demo); } - catch_any() + mcatch_any() { d = NULL; } @@ -408,7 +408,7 @@ olias_send_event (Widget, OliasEvent *event) case OLIAS_DISPLAY_EVENT: locator = ((OliasDisplayEvent *) event)->locator; ON_DEBUG (printf (">>> external-api display <%s>\n", locator)); - try + mtry { if (strchr (locator, ':')) { @@ -433,11 +433,11 @@ olias_send_event (Widget, OliasEvent *event) } } } - catch (demoException&, demo) + mcatch (demoException&, demo) { message_mgr().demo_failure(demo); } - catch_any() + mcatch_any() { d = NULL; } diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.hh b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.hh index e9f58ca49..c1d7548a9 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/ServiceMgrX.hh @@ -54,5 +54,6 @@ private: LONG_LIVED_HH(ServiceMgr,service_manager); }; +LONG_LIVED_HH2(ServiceMgr,service_manager); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/SessionMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/SessionMgr.hh index da11f5421..74f17d861 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/SessionMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/SessionMgr.hh @@ -47,6 +47,8 @@ class SessionMgr : public Long_Lived char *prior_session ; // prior session state file name, if any } ; +LONG_LIVED_HH2( SessionMgr, session ) ; + // class SessionMgrX : public SessionMgr // { diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.C index f7ca9f123..d14ff81a8 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.C @@ -47,7 +47,8 @@ * */ -#include +#include +using namespace std; // NOTE: this is just for the Xassert #define C_MessageMgr @@ -101,14 +102,14 @@ StyleSheetMgr::font_preference_modified() // scale is only updated when a new node is displayed. This is // managed by having NodeMgr create a CanvasRenderer and passing in // the current font scale value - try + mtry { g_style_sheet_update = TRUE; // load new style sheet node_mgr().re_display_all(); g_style_sheet_update = FALSE; } - catch_any() + mcatch_any() { Xassert(0 == "StyleSheetMgr::font_preference_modified()"); g_style_sheet_update = FALSE ; @@ -146,7 +147,7 @@ StyleSheetMgr::initOnlineStyleSheet (UAS_Pointer &doc) { fLastSS = onlineSS; fCurrent = new StyleSheet; UAS_String sstextStr = fLastSS->data(); - istrstream input ((char *) sstextStr); + istringstream input ((char *) sstextStr); g_stylein = &input; #ifdef DUMP_STYLESHEETS { @@ -159,17 +160,17 @@ StyleSheetMgr::initOnlineStyleSheet (UAS_Pointer &doc) { stylerestart (0); fStyleSheetRead = 1; - try { + mtry { styleparse (); } - catch_noarg (StyleSheetSyntaxError) { + mcatch_noarg (StyleSheetSyntaxError) { fLastSS = 0; delete fCurrent; { // Don't remove these curlies. For destructors before rethrow fCurrent = new StyleSheet; const char *def = "* { wrap: \"word\", break: \"line\", margin: { left: 20, right: 20} }"; - istrstream definput(def); + istringstream definput(def); input.unsetf (ios::skipws); g_stylein = &definput; stylerestart(0); @@ -204,7 +205,7 @@ StyleSheetMgr::initPrintStyleSheet (UAS_Pointer &doc) { fLastSS = printSS; fCurrent = new StyleSheet; UAS_String sstextStr = fLastSS->data(); - istrstream input ((char *) sstextStr); + istringstream input ((char *) sstextStr); g_stylein = &input; #ifdef DUMP_STYLESHEETS { @@ -217,17 +218,17 @@ StyleSheetMgr::initPrintStyleSheet (UAS_Pointer &doc) { stylerestart (0); fStyleSheetRead = 1; - try { + mtry { styleparse (); } - catch_noarg (StyleSheetSyntaxError) { + mcatch_noarg (StyleSheetSyntaxError) { fLastSS = 0; delete fCurrent; { // Don't remove these curlies. For destructors before rethrow fCurrent = new StyleSheet; const char *def = "* { wrap: \"word\", break: \"line\", margin: { left: 20, right: 20} }"; - istrstream definput(def); + istringstream definput(def); input.unsetf (ios::skipws); g_stylein = &definput; stylerestart(0); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.hh index ab5d2818e..639c9d91a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/StyleSheetMgr.hh @@ -49,4 +49,5 @@ private: LONG_LIVED_HH(StyleSheetMgr,style_sheet_mgr); }; +LONG_LIVED_HH2(StyleSheetMgr,style_sheet_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C index 5fde53ed1..ceb950e33 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.C @@ -142,7 +142,7 @@ LogToolTalkMessage ( statmsg = tt_status_message(status); errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2); if (! strlen(errfmt)) - errfmt = "%s"; + errfmt = (char*)"%s"; sprintf(errmsg, errfmt, statmsg); DtMsgLogMessage ("Dtinfo", msg_type, errfmt, errmsg); @@ -182,7 +182,7 @@ TtIpcMgr::TtIpcMgr() { errmsg = LogToolTalkMessage (DtMsgLogError, ERR_TT_DISPLAY_AS_SESSION, - DFLTXT_DISPLAY_AS_SESSION, + (char*)DFLTXT_DISPLAY_AS_SESSION, tt_state); message_mgr().error_dialog( (char*)UAS_String(errmsg) ) ; XtFree (errmsg); @@ -222,7 +222,7 @@ TtIpcMgr::TtIpcMgr() errmsg = LogToolTalkMessage (DtMsgLogError, ERR_TT_PTYPE_DECLARE, - DFLTXT_PTYPE_DECLARE, + (char*)DFLTXT_PTYPE_DECLARE, tt_state); message_mgr().error_dialog( (char*)UAS_String(errmsg) ); XtFree(errmsg); @@ -232,7 +232,7 @@ TtIpcMgr::TtIpcMgr() { errmsg = LogToolTalkMessage (DtMsgLogError, ERR_TT_OPEN, - DFLTXT_OPEN, + (char*)DFLTXT_OPEN, tt_state); message_mgr().error_dialog( (char*)UAS_String(errmsg) ); XtFree(errmsg); @@ -242,7 +242,7 @@ TtIpcMgr::TtIpcMgr() { errmsg = LogToolTalkMessage (DtMsgLogError, ERR_TT_DEFAULT_AS_SESSION, - DFLTXT_DEFAULT_AS_SESSION, + (char*)DFLTXT_DEFAULT_AS_SESSION, tt_state); message_mgr().error_dialog( (char*)UAS_String(errmsg) ); XtFree(errmsg); @@ -827,7 +827,7 @@ locale_of_desktop() #ifdef DEBUG if (!WM_LOCALE_NAME) printf( "Atom WM_LOCALE_NAME not interned\n" ); -#endif DEBUG +#endif if (!WM_LOCALE_NAME) return (char *)NULL; @@ -838,7 +838,7 @@ locale_of_desktop() #ifdef DEBUG if (!_DT_SM_WINDOW_INFO) printf( "Atom _DT_SM_WINDOW_INFO not interned\n" ); -#endif DEBUG +#endif if (!_DT_SM_WINDOW_INFO) return (char *)NULL; @@ -856,8 +856,8 @@ locale_of_desktop() printf( "null value from Atom _DT_SM_WINDOW_INFO for SM window ID\n" ); else - printf( "dtsession window is %x\n", *sm_prop_window ); -#endif DEBUG + printf( "dtsession window is %lx\n", *sm_prop_window ); +#endif if (!sm_prop_window) return (char *)NULL; @@ -872,7 +872,7 @@ locale_of_desktop() #ifdef DEBUG printf( "desktop's locale is %s\n", dt_locale ) ; -#endif DEBUG +#endif if (!dt_locale) return (char *)NULL; else return dt_locale; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh index 86a11f4fc..be507fb60 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.hh @@ -83,5 +83,5 @@ class TtIpcMgr : public Long_Lived Tt_status tt_state ; } ; - +LONG_LIVED_HH2( TtIpcMgr, tt_manager ) ; diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.msg b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.msg index aa8592df0..fd270da64 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.msg +++ b/cde/programs/dtinfo/dtinfo/src/Managers/TtIpcMgr.msg @@ -1,5 +1,4 @@ $ $XConsortium: TtIpcMgr.msg /main/4 1996/08/14 14:30:36 rcs $ -$ $XConsortium: TtIpcMgr.msg /main/4 1996/08/14 14:30:36 rcs $ $ $ (c) Copyright 1996 Digital Equipment Corporation. $ (c) Copyright 1996 Hewlett-Packard Company. diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/UrlMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/UrlMgr.hh index 24363b942..753fdb44f 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/UrlMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/UrlMgr.hh @@ -17,3 +17,5 @@ class UrlMgr: public Long_Lived { LONG_LIVED_HH(UrlMgr,url_mgr); }; + +LONG_LIVED_HH2(UrlMgr,url_mgr); diff --git a/cde/programs/dtinfo/dtinfo/src/Managers/WorkspaceMgr.hh b/cde/programs/dtinfo/dtinfo/src/Managers/WorkspaceMgr.hh index 11b9f1369..91ebc8280 100644 --- a/cde/programs/dtinfo/dtinfo/src/Managers/WorkspaceMgr.hh +++ b/cde/programs/dtinfo/dtinfo/src/Managers/WorkspaceMgr.hh @@ -61,5 +61,6 @@ class WorkspaceMgr : public Long_Lived // servicing of request (dynamic) } ; +LONG_LIVED_HH2( WorkspaceMgr, workspace ) ; diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/Imakefile b/cde/programs/dtinfo/dtinfo/src/Marks/Imakefile index 1d1daa77d..50eab7ce0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Marks/Imakefile @@ -1,6 +1,9 @@ XCOMM $XConsortium: Imakefile /main/6 1996/08/21 15:42:50 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES + +NormalCplusplusObjectRule() MAKEFILEDEPS=Classlist.mk @@ -18,8 +21,12 @@ make_libfiles($(LIBNAME), $(CLASSES)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/Mark.C b/cde/programs/dtinfo/dtinfo/src/Marks/Mark.C index f27ec4b86..86b3facaa 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/Mark.C +++ b/cde/programs/dtinfo/dtinfo/src/Marks/Mark.C @@ -74,7 +74,7 @@ Mark::~Mark() { ON_DEBUG (printf ("Mark::~Mark() @ 0x%p\n", this)); if (f_reference_count != 0) - message_mgr().error_dialog ("Attempt to delete mark with references!"); + message_mgr().error_dialog((char*)"Attempt to delete mark with references!"); } @@ -95,7 +95,7 @@ Mark::save() { if (f_deleted) { - message_mgr().error_dialog ("Cannot save changes to deleted mark."); + message_mgr().error_dialog((char*)"Cannot save changes to deleted mark."); } else { diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase_mmdb.C b/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase_mmdb.C index e3cfb308a..149d079b1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase_mmdb.C +++ b/cde/programs/dtinfo/dtinfo/src/Marks/MarkBase_mmdb.C @@ -47,7 +47,8 @@ * */ -#include +#include +using namespace std; #define C_xList @@ -98,11 +99,11 @@ MarkBase_mmdb::open (const char *filename, bool read_only) mark_base *base; user_base::rw_flag_t mode = read_only ? user_base::READ : user_base::WRITE; - try + mtry { base = new mark_base (filename, "mark_base", "", mode); } - catch_any() + mcatch_any() { return (NULL); } @@ -128,7 +129,7 @@ MarkBase_mmdb::create (const char *filename, bool read_only) mark_base *base; user_base::rw_flag_t mode = read_only ? user_base::READ : user_base::WRITE; - try + mtry { if (!read_only) { @@ -152,7 +153,7 @@ MarkBase_mmdb::create (const char *filename, bool read_only) } } } - catch_any() + mcatch_any() { return (NULL); } @@ -261,12 +262,12 @@ MarkBase_mmdb::get_marks (UAS_Pointer &doc_ptr, // Assure that the oid_t has not been deleted. qfc 7-6-93 if (id.eq (oid_t (c_code_t(0), 0)) == false) { - try + mtry { Mark_mmdb *m = find_mark (id, doc_ptr); list.append (m); } - catch_any() + mcatch_any() { // ignore failure for now! DJB } @@ -291,12 +292,12 @@ MarkBase_mmdb::get_all_marks (xList > &list) for (i = f_mark_base->first(); i != 0; f_mark_base->next(i)) { oid_t id = f_mark_base->get_mark_oid (i); - try + mtry { m = find_mark (id, null_doc); list.append (m); } - catch_any() + mcatch_any() { // ignore any errors for now -- DJB } diff --git a/cde/programs/dtinfo/dtinfo/src/Marks/Mark_mmdb.C b/cde/programs/dtinfo/dtinfo/src/Marks/Mark_mmdb.C index 2383551ef..5f3eb27cd 100644 --- a/cde/programs/dtinfo/dtinfo/src/Marks/Mark_mmdb.C +++ b/cde/programs/dtinfo/dtinfo/src/Marks/Mark_mmdb.C @@ -227,12 +227,12 @@ Mark_mmdb::restore() int sz; char *str; - try + mtry { sz = f_user_mark->mark_value()->size(); str = f_user_mark->mark_value()->get(); } - catch_any() + mcatch_any() { delete this; rethrow; diff --git a/cde/programs/dtinfo/dtinfo/src/OliasSearch/Imakefile b/cde/programs/dtinfo/dtinfo/src/OliasSearch/Imakefile index fac1154ff..335e9f2c5 100644 --- a/cde/programs/dtinfo/dtinfo/src/OliasSearch/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/OliasSearch/Imakefile @@ -1,6 +1,12 @@ XCOMM $XConsortium: Imakefile /main/4 1996/08/21 15:42:57 drk $ + +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES + MAKEFILEDEPS=Classlist.mk LIBNAME=OliasSearch + +NormalCplusplusObjectRule() + INCLUDES=$(BROWSER_INCLUDES) #include "Classlist.mk" @@ -11,8 +17,12 @@ make_libfiles($(LIBNAME), $(CLASSES)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C index f5ea39dc2..1aced9ebc 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.C @@ -1029,7 +1029,7 @@ CanvasRenderer::handle_olias_attributes(ElementFeatures &features, pGS->pix = graphic->pixmap(); pGS->width = graphic->width() ; pGS->height = graphic->height(); - pGS->mask = NULL ; + pGS->mask = 0 ; pGS->pixels = NULL ; pGS->num_pixels = 0 ; @@ -1565,7 +1565,7 @@ CanvasRenderer::really_insert_string (_DtCvSegment *container, cerr << " indx: " << ret_indx << " " << font << endl; #endif } - strseg->handle.string.font = (_DtCvPointer) ret_indx ; + strseg->handle.string.font = (_DtCvPointer)(size_t) ret_indx ; // copy data into new memory to hand over to the canvas char *string = new char[size + 1]; @@ -2159,7 +2159,8 @@ TGDefn::find_format(const char *name, int* index) CC_TPtrSlistIterator cf_cursor (f_colformats); - for (int nth = 0; ++cf_cursor; nth++) + int nth; + for (nth = 0; ++cf_cursor; nth++) { if (cf_cursor.key()->name() == NULL) continue; @@ -2329,10 +2330,10 @@ TGDefn::build() #endif ColDefn* colcell; - try { + mtry { colcell = columns.at(kept); } - catch_any() { + mcatch_any() { abort(); // consider it as fatal } end_try; @@ -2392,10 +2393,10 @@ TGDefn::build() fprintf(stderr, "[vc,kept,count]=[%d,%d,%d]\n", vc, kept, count); #endif ColDefn* colcell; - try { + mtry { colcell = columns.at(kept); } - catch_any() { + mcatch_any() { abort(); } end_try; @@ -2448,7 +2449,8 @@ TGDefn::build() } // temp for now deal with blank spots in the table - for (unsigned r = 0 ; r < num_rows ; r++) + unsigned r; + for (r = 0 ; r < num_rows ; r++) for (unsigned c = 0; c < num_columns ; c++) { if (grid[r][c] == NULL) diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.msg b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.msg index d49335a95..2bb4ec3ca 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.msg +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/CanvasRenderer.msg @@ -4,4 +4,5 @@ $set Set_CanvasRenderer $ $ messages specific to CanvasRenderer (dtinfo I/F to DtCanvas/DtHelp) $ +1 "Dtinfo: Canvas Renderer" diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C index e8c8c7331..182fc47bc 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FeatureSupport.C @@ -52,7 +52,8 @@ #include "FeatureValue.h" #include "StyleSheetExceptions.h" #include -#include +#include +using namespace std; #include
#include "CanvasRenderer.hh" @@ -607,7 +608,7 @@ CanvasRenderer::_dofont(const FeatureSet &fs, Symbol** symbols) // if we still can't find one go with whatever. else { - xlfd = "-*-*-*-*-*-*-*-*-*-*-*-*-*"; + xlfd = (char*)"-*-*-*-*-*-*-*-*-*-*-*-*-*"; } #ifdef FONT_DEBUG fprintf(stderr, "resulting in \"%s\".\n", xlfd); @@ -811,7 +812,7 @@ CanvasRenderer::domargin(ElementFeatures &return_features, int top = 0; int bottom= 0; - try + mtry { //const Feature *f = marginset->lookup(symbols[FIRST]); const Feature *l = marginset->lookup(symbols[LEFT]); @@ -833,7 +834,7 @@ CanvasRenderer::domargin(ElementFeatures &return_features, bottom_margin = bottom; } - catch_noarg (StyleSheetException &) + mcatch_noarg (StyleSheetException &) { #ifdef DEBUG cerr << "MarginFPtml: style sheet exception" << endl; @@ -1573,7 +1574,7 @@ CanvasRenderer::docolformat(ElementFeatures &return_features, ColFormat *colf = new ColFormat ; - try + mtry { const Feature *widthF = set->lookup (symbols[WIDTH]) ; if (widthF) @@ -1616,7 +1617,7 @@ CanvasRenderer::docolformat(ElementFeatures &return_features, colf->justify (justify); } } - catch_any() + mcatch_any() { abort(); } @@ -1738,11 +1739,11 @@ CanvasRenderer::dorow (ElementFeatures &return_features, const FeatureSet* features; - try + mtry { features = *local.lookup(symbols[ROW])->value(); } - catch_any() + mcatch_any() { features = NULL; } diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.C b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.C index 89edb689a..e071bf0a3 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.C +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.C @@ -40,7 +40,8 @@ #include "FontCache.hh" #if defined DEBUG || defined SMALL_DEBUG || defined FONT_DEBUG -#include +#include +using namespace std; #endif #define C_List @@ -132,6 +133,7 @@ FontEntry::hash() const f_charset.hash() + f_ptsize ; } +bool FontEntry::operator==(const FontEntry &fe) const { return diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.hh b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.hh index c4d4c1a29..e59dbdb21 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.hh +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/FontCache.hh @@ -49,7 +49,7 @@ public: FontEntry(const FontEntry &); ~FontEntry(); - operator ==(const FontEntry &) const; + bool operator ==(const FontEntry &) const; unsigned hash() const; diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/Imakefile b/cde/programs/dtinfo/dtinfo/src/OnlineRender/Imakefile index e1632bdd7..76437b8aa 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/Imakefile @@ -1,9 +1,12 @@ XCOMM $XConsortium: Imakefile /main/8 1996/08/21 15:43:09 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES LIBNAME=OnlineRender +NormalCplusplusObjectRule() + INCLUDES=$(BROWSER_INCLUDES) $(MMDB_INCLUDES) $(STYLE_SHEET_INCLUDES) \ $(COMMON_CLASS_INCLUDES) DEFINES=-DCDE_NEXT @@ -30,7 +33,9 @@ dfiles: #ifdef UXPArchitecture SpecialCPlusPlusObjectRule(ORTemplates.o,, +Tall_tmpls -DEXPAND_TEMPLATES) SpecialCPlusPlusExpandRule(ORTemplates..c,ORTemplates.C,+Tall_tmpls -DEXPAND_TEMPLATES) -#else +#elif defined(LinuxArchitecture) || defined(FreeBSDArchitecture) +SpecialCPlusPlusObjectRule(ORTemplates.o,,-DEXPAND_TEMPLATES) +SpecialCPlusPlusExpandRule(ORTemplates..c,ORTemplates.C,-DEXPAND_TEMPLATES) #endif #if defined(UseWideChars) && defined(SunArchitecture) && (OSMajorVersion == 4) WC_FLAGS=-I/VOB/olias/library/Xwchar/src @@ -45,9 +50,13 @@ SpecialCPlusPlusObjectRule($(WC_OBJS),,$(WC_FLAGS)) RealLibrary($(LIBNAME),$(OBJS),$(LIBDIR)) #else #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 -SimpleLibraryT($(LIBNAME),$(OBJS),$(LIBDIR)) +SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else -SimpleLibrary($(LIBNAME),$(OBJS),$(LIBDIR)) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif #endif diff --git a/cde/programs/dtinfo/dtinfo/src/OnlineRender/TableDefn.hh b/cde/programs/dtinfo/dtinfo/src/OnlineRender/TableDefn.hh index 14ddfb40f..1af83d882 100644 --- a/cde/programs/dtinfo/dtinfo/src/OnlineRender/TableDefn.hh +++ b/cde/programs/dtinfo/dtinfo/src/OnlineRender/TableDefn.hh @@ -32,7 +32,7 @@ public: int rowsep() { return f_rowsep; } void rowsep(int v) { f_rowsep = v; } - operator==(const ColFormat &c) const + bool operator==(const ColFormat &c) const { return &c == this ; } private: @@ -84,7 +84,7 @@ public: void colend(char *e) { f_colend = e; } const char* colend() { return f_colend; } - operator==(const ColDefn &c) const + bool operator==(const ColDefn &c) const { return &c == this ; } _DtCvFrmtOption justify() { return f_justify; } @@ -126,7 +126,7 @@ public: CC_TPtrSlist &columns() { return f_columns ; } - operator==(const RowDefn &r) const + bool operator==(const RowDefn &r) const { return &r == this ; } _DtCvFrmtOption vjustify () @@ -163,7 +163,7 @@ public: void setup_cell(_DtCvSegment*, ColDefn*, RowDefn*, ColFormat*, ColFormat*); - operator==(const TGDefn& t) const + bool operator==(const TGDefn& t) const { return &t == this ; } _DtCvFrmtOption justify() { return f_justify; } diff --git a/cde/programs/dtinfo/dtinfo/src/Other/Imakefile b/cde/programs/dtinfo/dtinfo/src/Other/Imakefile index f63690ad2..499ef5b53 100644 --- a/cde/programs/dtinfo/dtinfo/src/Other/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Other/Imakefile @@ -1,6 +1,6 @@ XCOMM $XConsortium: Imakefile /main/8 1996/08/21 15:43:18 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) CDEBUGFLAGS=-g @@ -8,6 +8,8 @@ MAKEFILEDEPS=Classlist.mk LIBNAME=Other +NormalCplusplusObjectRule() + INCLUDES = $(BROWSER_INCLUDES) #include "Classlist.mk" @@ -18,9 +20,13 @@ make_libfiles($(LIBNAME), $(CLASSES)) make_msgs($(LIBNAME), $(MSGS)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 +SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C index 5dc01ef95..7025be704 100644 --- a/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C +++ b/cde/programs/dtinfo/dtinfo/src/Other/WindowSystemMotif.C @@ -49,6 +49,7 @@ * */ +#include #include #include #include @@ -170,7 +171,7 @@ static unsigned char anno_double_bits[] = { 0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xea, 0x2f, 0x0a, 0x20, 0xfa, 0x3f, 0x02, 0x08, 0xfe, 0x0f, 0x00, 0x00}; -#ifdef SVR4 +#if defined(SVR4) || defined(linux) || defined(CSRG_BASED) #include #else #include @@ -193,26 +194,26 @@ extern "C" { extern Boolean print_server_error; static String fallbacks[] = { -"Dtinfo.Print*background:white", -"Dtinfo.Print*renderTable:-dt-application-bold-r-normal-serif-0-0-0-0-p-0-iso8859-1", -"Dtinfo.Print*shadowThickness:0", -"Dtinfo.Print*highlightThickness:0", -"Dtinfo.Print*pform.marginHeight: 1in", -"Dtinfo.Print*pform.marginWidth: 1in", -"Dtinfo.Print*ptext.Attachment:attach_form", +(char*)"Dtinfo.Print*background:white", +(char*)"Dtinfo.Print*renderTable:-dt-application-bold-r-normal-serif-0-0-0-0-p-0-iso8859-1", +(char*)"Dtinfo.Print*shadowThickness:0", +(char*)"Dtinfo.Print*highlightThickness:0", +(char*)"Dtinfo.Print*pform.marginHeight: 1in", +(char*)"Dtinfo.Print*pform.marginWidth: 1in", +(char*)"Dtinfo.Print*ptext.Attachment:attach_form", NULL }; static XtActionsRec DrawnBActions[] = { - {"DeSelectAll" , _DtHelpDeSelectAll }, - {"SelectAll" , _DtHelpSelectAll }, - {"ActivateLink" , _DtHelpActivateLink }, - {"CopyToClipboard", _DtHelpCopyAction }, - {"PageUpOrDown" , _DtHelpPageUpOrDown }, - {"PageLeftOrRight", _DtHelpPageLeftOrRight}, - {"NextLink" , _DtHelpNextLink } + {(char*)"DeSelectAll" , _DtHelpDeSelectAll }, + {(char*)"SelectAll" , _DtHelpSelectAll }, + {(char*)"ActivateLink" , _DtHelpActivateLink }, + {(char*)"CopyToClipboard", _DtHelpCopyAction }, + {(char*)"PageUpOrDown" , _DtHelpPageUpOrDown }, + {(char*)"PageLeftOrRight", _DtHelpPageLeftOrRight}, + {(char*)"NextLink" , _DtHelpNextLink } }; @@ -244,11 +245,11 @@ public: WindowSystem::WindowSystem (int &argc, char *argv[]) : f_shell_list (20), - f_default_pixmap (NULL), + f_default_pixmap (0), f_defpix_width (0), f_defpix_height (0), f_printing(False), - f_detached_pixmap(NULL), + f_detached_pixmap(0), f_cursor_stack_pos(-1), f_dtinfo_font(NULL), f_dtinfo_space_font(NULL) @@ -283,9 +284,9 @@ WindowSystem::WindowSystem (int &argc, char *argv[]) if (count && names) { f_dtinfo_font = XmFontListEntryLoad(f_display, *names, - XmFONT_IS_FONT, "olias"); + XmFONT_IS_FONT, (char*)"olias"); f_dtinfo_space_font = XmFontListEntryLoad(f_display, *names, - XmFONT_IS_FONT, "ospace"); + XmFONT_IS_FONT, (char*)"ospace"); XFreeFontNames(names); } } @@ -409,43 +410,43 @@ extern "C" { void tml_dp_set_font_display(Display *); } // include "dbg" so we can use the startup script -debug flag independently XrmOptionDescRec options[] = { - {"-debug", "*debug", XrmoptionNoArg, "True"}, - {"-dbg", "*debug", XrmoptionNoArg, "True"}, - {"-author", "*author", XrmoptionNoArg, "True"}, - {"-readonly", "*readonly", XrmoptionNoArg, "True"}, - {"-ro", "*readonly", XrmoptionNoArg, "True"}, - {"-autohelp", "*AutomaticHelp", XrmoptionNoArg, "On"}, - {"-nofonts", "*NoFonts", XrmoptionNoArg, "True"}, - {"-print", "printOnly", XrmoptionNoArg, "True"}, - {"-hierarchy", "hierarchy", XrmoptionNoArg, "True"}, - {"-printer", "printer", XrmoptionSepArg, NULL}, - {"-copies", "copies", XrmoptionSepArg, NULL}, - {"-paperSize", "paperSize", XrmoptionSepArg, NULL}, - {"-silent", "silent", XrmoptionNoArg, "True"}, - {"-outputFile", "outputFile", XrmoptionSepArg, NULL} + {(char*)"-debug", (char*)"*debug", XrmoptionNoArg, (char*)"True"}, + {(char*)"-dbg", (char*)"*debug", XrmoptionNoArg, (char*)"True"}, + {(char*)"-author", (char*)"*author", XrmoptionNoArg, (char*)"True"}, + {(char*)"-readonly", (char*)"*readonly", XrmoptionNoArg, (char*)"True"}, + {(char*)"-ro", (char*)"*readonly", XrmoptionNoArg, (char*)"True"}, + {(char*)"-autohelp", (char*)"*AutomaticHelp",XrmoptionNoArg, (char*)"On"}, + {(char*)"-nofonts", (char*)"*NoFonts", XrmoptionNoArg, (char*)"True"}, + {(char*)"-print", (char*)"printOnly", XrmoptionNoArg, (char*)"True"}, + {(char*)"-hierarchy", (char*)"hierarchy", XrmoptionNoArg, (char*)"True"}, + {(char*)"-printer", (char*)"printer", XrmoptionSepArg, NULL}, + {(char*)"-copies", (char*)"copies", XrmoptionSepArg, NULL}, + {(char*)"-paperSize", (char*)"paperSize", XrmoptionSepArg, NULL}, + {(char*)"-silent", (char*)"silent", XrmoptionNoArg, (char*)"True"}, + {(char*)"-outputFile",(char*)"outputFile", XrmoptionSepArg, NULL} }; static XtResource VideoResources[] = { - {"printOnly", "PrintOnly", XmRBoolean, sizeof (Boolean), + {(char*)"printOnly", (char*)"PrintOnly", XmRBoolean, sizeof (Boolean), XtOffsetOf (VideoShell, print_only), XmRImmediate, (XtPointer)False, }, - {"outputFile", "OutputFile", XmRString, sizeof (char *), + {(char*)"outputFile", (char*)"OutputFile", XmRString, sizeof (char *), XtOffsetOf (VideoShell, file_name), XmRImmediate, (XtPointer)NULL, }, - {"hierarchy", "Hierarchy", XmRBoolean, sizeof (Boolean), + {(char*)"hierarchy", (char*)"Hierarchy", XmRBoolean, sizeof (Boolean), XtOffsetOf (VideoShell, hierarchy), XmRImmediate, (XtPointer)False, }, - {"printer", "Printer", XmRString, sizeof (char *), + {(char*)"printer", (char*)"Printer", XmRString, sizeof (char *), XtOffsetOf (VideoShell, printer), XmRImmediate, (XtPointer)NULL, }, - {"copies", "Copies", XmRInt, sizeof (int), + {(char*)"copies", (char*)"Copies", XmRInt, sizeof (int), XtOffsetOf (VideoShell, copies), XmRImmediate, (XtPointer)1, }, - {"paperSize", "PaperSize", XmRString, sizeof (char *), + {(char*)"paperSize", (char*)"PaperSize", XmRString, sizeof (char *), XtOffsetOf (VideoShell, paper_size), XmRImmediate, (XtPointer)NULL, }, - {"silent", "Silent", XmRBoolean, sizeof (Boolean), + {(char*)"silent", (char*)"Silent", XmRBoolean, sizeof (Boolean), XtOffsetOf (VideoShell, silent), XmRImmediate, (XtPointer)False, }, }; @@ -521,7 +522,7 @@ xevent_error_aborter(Display *display, XErrorEvent* error_event) // log error _DtPrintDefaultErrorSafe(display, error_event, error_msg, _DTINFO_BUFSIZE); - _DtSimpleError("dtinfo", DtWarning, NULL, error_msg, NULL); + _DtSimpleError((char*)"dtinfo", DtWarning, NULL, error_msg, NULL); // if the error occured on the print display we're going to set // a variable so that and when the job is done, right before calling @@ -566,7 +567,8 @@ WindowSystem::init() if (f_display == (Display*)NULL) { - fprintf(stderr, CATGETS(Set_WindowSystem, 3, "Unable to open display.\n")); + fprintf(stderr, "%s", + CATGETS(Set_WindowSystem, 3, "Unable to open display.\n")); exit(1); } @@ -586,7 +588,7 @@ WindowSystem::init() f_toplevel = f_video_shell->widget; if (DtAppInitialize( f_application_context, - f_display, f_toplevel, f_argv[0], CLASS_NAME) == False) + f_display, f_toplevel, f_argv[0], (char*)CLASS_NAME) == False) { /* DtAppInitialize() has already logged an appropriate error msg */ exit(-1); @@ -606,8 +608,8 @@ WindowSystem::init() #endif // Create atom used elsewhere by agents - f_wm_delete_window = XmInternAtom (f_display, "WM_DELETE_WINDOW", False); - XA_WM_STATE = XmInternAtom (f_display, "WM_STATE", False); + f_wm_delete_window = XmInternAtom (f_display, (char*)"WM_DELETE_WINDOW", False); + XA_WM_STATE = XmInternAtom (f_display, (char*)"WM_STATE", False); // -------- Add some converters -------- // @@ -633,9 +635,9 @@ WindowSystem::init() f_screen = XtScreen(f_toplevel); f_nofonts = get_boolean_default ("NoFonts"); - f_locked_pixmap = NULL; - f_semilocked_pixmap = NULL; - f_unlocked_pixmap = NULL; + f_locked_pixmap = 0; + f_semilocked_pixmap = 0; + f_unlocked_pixmap = 0; XImage *mark_single = XCreateImage(f_display, DefaultVisualOfScreen(f_screen), @@ -669,10 +671,10 @@ WindowSystem::init() anno_double->bitmap_bit_order = LSBFirst; anno_double->bitmap_unit = 8; - XmInstallImage(mark_single, "mark_single"); - XmInstallImage(mark_double, "mark_double"); - XmInstallImage(anno_single, "anno_single"); - XmInstallImage(anno_double, "anno_double"); + XmInstallImage(mark_single, (char*)"mark_single"); + XmInstallImage(mark_double, (char*)"mark_double"); + XmInstallImage(anno_single, (char*)"anno_single"); + XmInstallImage(anno_double, (char*)"anno_double"); } Pixmap @@ -686,7 +688,7 @@ WindowSystem::locked_pixmap(Widget w) XmNbackground, &bg, NULL); - f_locked_pixmap = XmGetPixmap (f_screen, "locked.xbm", fg, bg); + f_locked_pixmap = XmGetPixmap (f_screen, (char*)"locked.xbm", fg, bg); if (f_locked_pixmap == XmUNSPECIFIED_PIXMAP) { fprintf(stderr, "Couldn't load locked.xbm.\n"); } @@ -707,7 +709,7 @@ WindowSystem::unlocked_pixmap(Widget w) XmNbackground, &bg, NULL); - f_unlocked_pixmap = XmGetPixmap (f_screen, "unlocked.xbm", fg, bg); + f_unlocked_pixmap = XmGetPixmap (f_screen, (char*)"unlocked.xbm", fg, bg); if (f_unlocked_pixmap == XmUNSPECIFIED_PIXMAP) { fprintf(stderr, "Couldn't load locked.xbm.\n"); } @@ -727,7 +729,7 @@ WindowSystem::semilocked_pixmap(Widget w) XmNbackground, &bg, NULL); - f_semilocked_pixmap = XmGetPixmap (f_screen, "semilocked.xbm", fg, bg); + f_semilocked_pixmap = XmGetPixmap (f_screen, (char*)"semilocked.xbm", fg, bg); if (f_semilocked_pixmap == XmUNSPECIFIED_PIXMAP) { fprintf(stderr, "Couldn't load locked.xbm.\n"); } @@ -1010,7 +1012,7 @@ WindowSystem::core_dump_handler (int signal_number) { if ((XtWindow ((Widget)window_system().toplevel())) != 0) { - WXmMessageDialog byebye (window_system().toplevel(), "core_dump"); + WXmMessageDialog byebye (window_system().toplevel(), (char*)"core_dump"); XtVaSetValues((Widget)byebye, XmNmessageString, (XmString)XmStringLocalized(CATGETS(Set_WindowSystem, 2, "Bombing...")), NULL); @@ -1102,7 +1104,7 @@ WindowSystem::default_pixmap (Dimension *width, Dimension *height) status = XmeXpmCreatePixmapFromData(f_display, XtWindow((Widget)toplevel()), - graphic_unavailable_data, + (char**)graphic_unavailable_data, &temp_pixmap, NULL, &xpm_attr); temp_width = xpm_attr.width; @@ -1162,7 +1164,7 @@ WindowSystem::detached_pixmap(Dimension *width, Dimension *height) int status = XmeXpmCreatePixmapFromData(f_display, XtWindow((Widget)toplevel()), - detached_pixmap_data, + (char**)detached_pixmap_data, &f_detached_pixmap, NULL, &xpm_attr); f_detached_width = xpm_attr.width ; @@ -1206,7 +1208,7 @@ WindowSystem::read_pixmap(const char *pname, #endif if (status != XpmSuccess) { - pixmap = NULL; + pixmap = 0; *width = 0; *height = 0; @@ -1233,7 +1235,7 @@ WindowSystem::get_boolean_default (const char *name) resource[0].resource_class = (char *) name; resource[0].resource_type = XtRBoolean; resource[0].resource_size = sizeof(Boolean); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRImmediate; resource[0].default_addr = False; @@ -1253,7 +1255,7 @@ WindowSystem::get_int_default (const char *name) resource[0].resource_class = (char *) name; resource[0].resource_type = XtRInt; resource[0].resource_size = sizeof(int); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRImmediate ; resource[0].default_addr = 0; @@ -1272,9 +1274,9 @@ WindowSystem::get_string_default (const char *name) resource[0].resource_class = (char *) name; resource[0].resource_type = XtRString; resource[0].resource_size = sizeof(String); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRString; - resource[0].default_addr = ""; + resource[0].default_addr = (void *) ""; XtGetApplicationResources(toplevel(), &string, resource, 1, NULL, 0); @@ -1292,9 +1294,9 @@ WindowSystem::get_geometry_default (const char *name) resource[0].resource_class = (char *) name; resource[0].resource_type = XtRString; resource[0].resource_size = sizeof(String); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRString; - resource[0].default_addr = "0x0"; + resource[0].default_addr = (void *) "0x0"; XtGetApplicationResources(toplevel(), &string, resource, 1, NULL, 0); @@ -1318,7 +1320,7 @@ WindowSystem::get_color_default(const char *name) resource[0].resource_class = (char *) name; resource[0].resource_type = XtRPixel; resource[0].resource_size = sizeof(Pixel); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRImmediate ; resource[0].default_addr = (XtPointer) WhitePixelOfScreen(DefaultScreenOfDisplay(f_display)); @@ -1337,10 +1339,10 @@ WindowSystem::get_message (const char *message_name) static char default_message[256]; resource[0].resource_name = (char *) message_name; - resource[0].resource_class = "Message"; + resource[0].resource_class = (char*)"Message"; resource[0].resource_type = XtRString; resource[0].resource_size = sizeof(String); - resource[0].resource_offset = NULL; + resource[0].resource_offset = 0; resource[0].default_type = XtRString; resource[0].default_addr = default_message; @@ -1411,7 +1413,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE32 ; space_array[i] = 0 ; } - WXmString string_32(space_array, OLIAS_SPACE_FONT) ; + WXmString string_32(space_array, (char*)OLIAS_SPACE_FONT) ; space_array[0] = 0 ; @@ -1420,7 +1422,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE16 ; space_array[i] = 0 ; } - WXmString string_16(space_array, OLIAS_SPACE_FONT) ; + WXmString string_16(space_array, (char*)OLIAS_SPACE_FONT) ; space_array[0] = 0 ; if (eight != 0){ @@ -1428,7 +1430,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE08 ; space_array[i] = 0 ; } - WXmString string_8(space_array, OLIAS_SPACE_FONT) ; + WXmString string_8(space_array, (char*)OLIAS_SPACE_FONT) ; space_array[0] = 0 ; if (four != 0){ @@ -1436,7 +1438,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE04 ; space_array[i] = 0 ; } - WXmString string_4(space_array, OLIAS_SPACE_FONT) ; + WXmString string_4(space_array, (char*)OLIAS_SPACE_FONT) ; space_array[0] = 0 ; if (two != 0){ @@ -1444,7 +1446,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE02 ; space_array[i] = 0 ; } - WXmString string_2(space_array, OLIAS_SPACE_FONT) ; + WXmString string_2(space_array, (char*)OLIAS_SPACE_FONT) ; space_array[0] = 0 ; if (one != 0){ @@ -1452,7 +1454,7 @@ WindowSystem::make_space (int space_to_fill, Widget w) space_array[i] = OLIAS_SPACE01 ; space_array[i] = 0 ; } - WXmString string_1(space_array, OLIAS_SPACE_FONT) ; + WXmString string_1(space_array, (char*)OLIAS_SPACE_FONT) ; WXmString space = string_32 + string_16 + string_8 + string_4 + string_2 + string_1 ; diff --git a/cde/programs/dtinfo/dtinfo/src/Other/detached_bw.xpm b/cde/programs/dtinfo/dtinfo/src/Other/detached_bw.xpm index 421b9f239..97f6e5811 100644 --- a/cde/programs/dtinfo/dtinfo/src/Other/detached_bw.xpm +++ b/cde/programs/dtinfo/dtinfo/src/Other/detached_bw.xpm @@ -1,6 +1,6 @@ /* XPM */ /* $XConsortium: detached_bw.xpm /main/2 1996/07/24 16:07:03 drk $ */ -static char *detached_pixmap_data[] = { +static char const* detached_pixmap_data[] = { /* width height ncolors chars_per_pixel */ "84 109 2 1", /* colors */ diff --git a/cde/programs/dtinfo/dtinfo/src/Other/graphic_unavailable.xpm b/cde/programs/dtinfo/dtinfo/src/Other/graphic_unavailable.xpm index d70f0dfea..228413b7e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Other/graphic_unavailable.xpm +++ b/cde/programs/dtinfo/dtinfo/src/Other/graphic_unavailable.xpm @@ -1,6 +1,6 @@ /* XPM */ /* $XConsortium: graphic_unavailable.xpm /main/2 1996/07/24 16:07:25 drk $ */ -static char *graphic_unavailable_data[] = { +static char const* graphic_unavailable_data[] = { /* width height ncolors chars_per_pixel */ "173 28 2 1", /* colors */ diff --git a/cde/programs/dtinfo/dtinfo/src/Preferences/Imakefile b/cde/programs/dtinfo/dtinfo/src/Preferences/Imakefile index 8d41a8c4d..f0c56e47a 100644 --- a/cde/programs/dtinfo/dtinfo/src/Preferences/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Preferences/Imakefile @@ -1,12 +1,14 @@ XCOMM $XConsortium: Imakefile /main/6 1996/08/21 15:43:25 drk $ #define CplusplusSource YES -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) MAKEFILEDEPS=Classlist.mk LIBNAME=Preferences +NormalCplusplusObjectRule() + INCLUDES=$(BROWSER_INCLUDES) @@ -16,7 +18,13 @@ OBJS=$(SRCS:.C=.o) make_libfiles($(LIBNAME), $(CLASSES)) +#if defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +#else +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +#endif LOCAL_LIBRARIES=$(EXCLIB) -lPreferences diff --git a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C index 1d74cc188..b4148fe3e 100644 --- a/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C +++ b/cde/programs/dtinfo/dtinfo/src/Preferences/UserPreference.C @@ -63,7 +63,7 @@ #include #include #include -#if !defined(hpux) && !defined(__osf__) && !defined(USL) +#if !defined(hpux) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED) #include #endif #include @@ -132,6 +132,7 @@ PreferenceRecord::form_filename() void revert_from_backup (const char *filename) { + int ret; // Failed, so look for the backup file. char backup[256], original[256]; sprintf (backup, "%s.bak", filename); @@ -141,7 +142,7 @@ revert_from_backup (const char *filename) S_ISREG(file_info.st_mode)) { unlink (filename); - link (backup, filename); + ret = link (backup, filename); } } @@ -149,14 +150,16 @@ revert_from_backup (const char *filename) int read_version (FILE *stream) { + size_t ret1; + int ret2; // Make sure the file is valid. char V = '-'; - fread (&V, 1, 1, stream); + ret1 = fread (&V, 1, 1, stream); if (V != 'V') return (0); // Nab the version from the file. int version = 0; - fscanf (stream, "%d", &version); + ret2 = fscanf (stream, "%d", &version); return (version); } @@ -164,10 +167,11 @@ read_version (FILE *stream) int read_update_count (FILE *stream) { + char *ret; char buffer[256], *p; int update_count; - fgets (buffer, 256, stream); + ret = fgets (buffer, 256, stream); p = buffer; while (*p != ',' && *p != '\0') p++; @@ -276,7 +280,7 @@ PreferenceRecord::write_prefs() if (update_count != g_update_count) { bool doit = message_mgr(). - question_dialog ("Preferences have changed on disk.\nOverwrite?"); + question_dialog ((char*)"Preferences have changed on disk.\nOverwrite?"); if (!doit) return; } @@ -347,14 +351,14 @@ PreferenceRecord::lookup (const char *key) { if (g_update_count == -1) { - try + mtry { read_prefs(); } - catch_any() + mcatch_any() { // This will only happen the first time through. - message_mgr().error_dialog ("Unable to read preferences."); + message_mgr().error_dialog ((char*)"Unable to read preferences."); g_update_count = 0; } end_try; diff --git a/cde/programs/dtinfo/dtinfo/src/Preferences/WindowGeometryPref.hh b/cde/programs/dtinfo/dtinfo/src/Preferences/WindowGeometryPref.hh index 31beebac7..eea4ec038 100644 --- a/cde/programs/dtinfo/dtinfo/src/Preferences/WindowGeometryPref.hh +++ b/cde/programs/dtinfo/dtinfo/src/Preferences/WindowGeometryPref.hh @@ -32,7 +32,7 @@ public: WindowGeometry() : ulx(0), uly(0), width(100), height(100) { } - operator == (const WindowGeometry &wg) + bool operator == (const WindowGeometry &wg) { return (ulx == wg.ulx && uly == wg.uly && width == wg.width && height == wg.height); } int ulx, uly; diff --git a/cde/programs/dtinfo/dtinfo/src/Query/Imakefile b/cde/programs/dtinfo/dtinfo/src/Query/Imakefile index 4e7610b49..beb330bf7 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Query/Imakefile @@ -1,11 +1,13 @@ XCOMM $XConsortium: Imakefile /main/7 1996/08/21 15:43:32 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Query +NormalCplusplusObjectRule() INCLUDES=$(BROWSER_INCLUDES) $(COMMON_CLASS_INCLUDES) @@ -36,8 +38,12 @@ make_msgs($(LIBNAME), $(MSGS)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif clean:: diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C index bf2b91771..77f0d342c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryEditor.C @@ -85,11 +85,14 @@ #include #include -#include +#include +using namespace std; #define CLASS QueryEditor #include "../Agents/create_macros.hh" +#include "utility/mmdb_exception.h" + //static bool g_allow_query_text_change; QueryEditor *QueryEditor::f_query_editor; @@ -126,7 +129,7 @@ QueryEditor::display() { static int count = 0; if (count++ == 0) { - if (f_shell == NULL) + if (f_shell == 0) create_ui(); if (f_query == NULL) @@ -243,7 +246,7 @@ QueryEditor::edit_query (QueryGroup *query) } //g_allow_query_text_change = TRUE; - f_query_text.Value (""); + f_query_text.Value ((char*)""); //g_allow_query_text_change = FALSE; // Move the input focus to the term view. @@ -277,20 +280,20 @@ QueryEditor::create_ui() // Main form and menu bar. WXmForm form (f_shell, "form" ); - WXmMenuBar menu_bar (form, "menu_bar" ); + WXmMenuBar menu_bar (form, (char*)"menu_bar" ); - WXmPulldownMenu scope_menu (form, "scope_menu"); + WXmPulldownMenu scope_menu (form, (char*)"scope_menu" ); Arg args[1]; int n = 0; XtSetArg(args[n], XmNsubMenuId, (Widget) scope_menu); n++; - f_scope_option = WXmOptionMenu (form, "scope_option", AM, args, n); + f_scope_option = WXmOptionMenu (form, (char*)"scope_option", AM, args, n); mtfstring = CATGETS(Set_AgentLabel, 212, "Scope Name"); XtVaSetValues(f_scope_option, XmNlabelString, (XmString)mtfstring, NULL); // Menu definitions. how about using AddPushButton (name, obj, fun)?? WXmCascadeButton edit_cascade (menu_bar, "edit", AM); - WXmPulldownMenu edit_menu (menu_bar, "edit_menu" ); + WXmPulldownMenu edit_menu (menu_bar, (char*)"edit_menu" ); f_cut_btn = WXmPushButton (edit_menu, "cut", AM); f_copy_btn = WXmPushButton (edit_menu, "copy", AM); f_paste_btn = WXmPushButton (edit_menu, "paste", AM); @@ -346,7 +349,7 @@ QueryEditor::create_ui() mtfstring = CATGETS(Set_AgentLabel, 48, "Help"); XtVaSetValues(help, XmNlabelString, (XmString)mtfstring, NULL); - help_agent().add_activate_help (help, "query_editor_help"); + help_agent().add_activate_help (help, (char*)"query_editor_help"); // Main "work" area WXmPanedWindow pane (form, "pane" ); @@ -356,7 +359,7 @@ QueryEditor::create_ui() mtfstring = CATGETS(Set_AgentLabel, 230, "Query"); XtVaSetValues(qlabel, XmNlabelString, (XmString)mtfstring, NULL); - f_query_text = WXmScrolledText (qform, "qtext", AM); + f_query_text = WXmScrolledText (qform, (char*)"qtext", AM); // f_query_text.SetEditable(False); f_query_area = WXmScrolledWindow (pane, "query_area", AM); XtUnmanageChild (f_query_area.HorizontalScrollBar()); @@ -430,11 +433,11 @@ QueryEditor::search_activate() UAS_SearchScope *scope = (UAS_SearchScope *) WXmPushButton (f_scope_option.MenuHistory()).UserData(); - try { + mtry { // Search manager owns query from this point on. Don't delete it here. search_mgr().parse_and_search (human_readable, scope); } - catch (demoException &, demo) { + mcatch (demoException &, demo) { message_mgr().demo_failure(demo); } end_try; @@ -557,7 +560,7 @@ QueryEditor::fill_menu() List_Iterator s (scope_list); bool old_read_only = TRUE; - for (; s != NULL; s++) + for (; s != 0; s++) { // Add a separator when they change from read only to changable. if (old_read_only != s.item()->read_only()) @@ -628,7 +631,7 @@ QueryEditor::receive (ScopeCreated &msg, void* /*client_data*/) { // Scan the current menu to find the correct insertion position. UAS_SearchScope *scope; - for (; s != NULL; s++, position++) + for (; s != 0; s++, position++) { scope = s.item(); if (scope->read_only() != need_sep) @@ -671,7 +674,8 @@ QueryEditor::receive (ScopeDeleted &msg, void* /*client_data*/) WidgetList kids = WComposite(f_scope_option.SubMenuId()).Children(); int num_kids = WComposite(f_scope_option.SubMenuId()).NumChildren(); int separator_pos = -1; - for (int i = 0; i < num_kids; i++) + int i; + for (i = 0; i < num_kids; i++) { if (XmIsSeparator (kids[i])) separator_pos = i + 1; @@ -706,7 +710,8 @@ QueryEditor::receive (ScopeRenamed &msg, void* /*client_data*/) // First find renamed button in our list. WidgetList kids = WComposite(f_scope_option.SubMenuId()).Children(); int num_kids = WComposite(f_scope_option.SubMenuId()).NumChildren(); - for (int i = 0; i < num_kids; i++) + int i; + for (i = 0; i < num_kids; i++) { if (msg.f_search_scope == ((UAS_SearchScope *) WXmPushButton (kids[i]).UserData())) @@ -723,7 +728,7 @@ QueryEditor::receive (ScopeRenamed &msg, void* /*client_data*/) List_Iterator s (scope_list); // find the new position in the list - for (; s != NULL; s++) + for (; s != 0; s++) { if (s.item() == msg.f_search_scope) continue; diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C index bebbf9047..aea5d34c0 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroup.C @@ -72,7 +72,7 @@ static int operator_precedence[] = -1, 0, 0, 1, 2, 2 }; -static char *fulcrum_formats[] = +static const char *fulcrum_formats[] = { "", // NONE "\\Cu %s %s \\C}", // OR "\\Ct\\Cu %s %s \\C} \\Cx\\Ct %s %s \\C}\\C}", // XOR @@ -86,7 +86,7 @@ static char *fulcrum_formats[] = "%s\\C-w", // COMPLETION "\\C0p %s \\C}" }; // PHRASE -static char *infix_formats[] = +static const char *infix_formats[] = #ifdef DtinfoClient { "", "(%s | %s)", "(%s ^ %s)", "(%s & %s)", "(%s % %s%%s)", "(%s < %s%%s)", // %%s is loc to insert proximity @@ -99,14 +99,14 @@ static char *infix_formats[] = "%s weight %%s", "%s scope %s", "not %s", "%s*", "\"%s\"" }; #endif -static char *infix_pformats[] = +static const char *infix_pformats[] = { "", "(%s or %s%)", "(%s xor %s%)", "(%s and %s)", "(%s near %s%%s)", "(%s before %s%%s)", // %%s is loc to insert proximity " within %s", // proximity string to insert "%%s weight %s", "%s scope %s", "not %s", "%s*", "\"%s\"" }; // Order of these correspond to query_type_t enum in QueryGroup.hh -static char **formats[] = { fulcrum_formats, infix_formats }; +static const char **formats[] = { fulcrum_formats, infix_formats }; // The buffer is used to format the query. As each term is processed // a NULL-terminated string is tacked on to the end of the buffer. @@ -381,7 +381,7 @@ QueryGroup::gen_query_internal (query_type_t query_type) int QueryGroup::format (query_type_t query_type, QueryTerm *term) { - char *s = "\001s", *tmp; + char *s = (char*)"\001s", *tmp; // Need two buffers for alternating writes. // Allocate a buffer with enough room for term plus operators. static char *buf[2]; @@ -489,7 +489,7 @@ QueryGroup::reduce (query_type_t query_type, char *proximity = proximity_stack.pop (); if (*proximity == '\0') { - proximity = "32"; // NOTE: Hard coded proximity. 12:39 02/09/93 DJB + proximity = (char*)"32"; // NOTE: Hard coded proximity. 12:39 02/09/93 DJB } connective_t opt = (connective_t) operator_stack.pop(); diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroupView.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroupView.C index 7e02fc047..61bc68a14 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryGroupView.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryGroupView.C @@ -130,7 +130,7 @@ QueryGroupView::QueryGroupView (QueryGroup *group, Widget parent) (XtEventHandler) &QueryGroupView::resize, (Widget) f_restraint); // Store the min width in UserData... - f_restraint.UserData ((XtPointer) f_restraint.Width()); + f_restraint.UserData ((XtPointer)(size_t) f_restraint.Width()); } // Make sure the restraint widget isn't too narrow. else @@ -192,7 +192,7 @@ QueryGroupView::resize (Widget, Widget w, return; WRestraint restraint (w); - Dimension min_width = (Dimension) (int) restraint.UserData(); + Dimension min_width = (Dimension) (size_t) restraint.UserData(); ON_DEBUG(printf ("Group Form Resized: (event %d)\n", event->type)); diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.C index eaaaf56ac..783662a79 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.C @@ -81,7 +81,7 @@ #endif #include -#ifdef USL +#if defined(USL) || defined(linux) || defined(CSRG_BASED) #include #endif diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh index 8573ab06b..60576b7ba 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTerm.hh @@ -76,7 +76,7 @@ public: void proximity (char *s) { free (f_proximity); f_proximity = s; } char *scope() - { return (""); } + { return ((char*)""); } static unsigned int avail_caps() { return f_caps; } static void avail_caps(unsigned int caps) { f_caps = caps; } diff --git a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C index 6318714bd..0f9e4be01 100644 --- a/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C +++ b/cde/programs/dtinfo/dtinfo/src/Query/QueryTermView.C @@ -77,10 +77,7 @@ #include #include -#ifdef SVR4 -#include -#endif -#ifdef SYSV +#if defined(SVR4) || defined(SYSV) || defined(linux) || defined(CSRG_BASED) #include #endif @@ -173,11 +170,11 @@ QueryTermView::create_ui() ASSN (WXmForm, f_form, f_form, "qterm_view" ); // What is this widget used for? - 6/28/94 kamiya ASSN (WXmToggleButton, f_select_toggle, f_form, "select" ); - DECL (WXmPulldownMenu, prefix_menu, f_form, "prefix_menu" ); + DECLC (WXmPulldownMenu, prefix_menu, f_form, "prefix_menu" ); n = 0; XtSetArg(args[n], XmNsubMenuId, (Widget) prefix_menu); n++; - f_prefix = WXmOptionMenu (f_form, "prefix", WAutoManage, args, n); + f_prefix = WXmOptionMenu (f_form, (char*)"prefix", WAutoManage, args, n); DECLM (WXmPushButtonGadget, contains, prefix_menu, "contains" ); DECLM (WXmPushButtonGadget, not_contains, prefix_menu, "not_contains" ); @@ -199,11 +196,11 @@ QueryTermView::create_ui() mtfstring = CATGETS(Set_AgentLabel, 235, "Doesn\'t Start With"); XtVaSetValues(not_starts, XmNlabelString, (XmString)mtfstring, NULL); } - DECL (WXmPulldownMenu, connect_menu, f_form, "connect_menu" ); + DECLC (WXmPulldownMenu, connect_menu, f_form, "connect_menu" ); n = 0; XtSetArg(args[n], XmNsubMenuId, (Widget) connect_menu); n++; - f_connective = WXmOptionMenu (f_form, "connective", WAutoManage, args, n); + f_connective = WXmOptionMenu (f_form, (char*)"connective", WAutoManage, args, n); DECLM (WXmPushButtonGadget, none, connect_menu, " " ); DECLM (WXmPushButtonGadget, orgad, connect_menu, "or" ); @@ -369,7 +366,7 @@ QueryTermView::register_actions() static XtActionsRec actions_list[] = { - { "TermSelect", QueryTermView::_select }, + { (char*)"TermSelect", QueryTermView::_select }, }; XtAppAddActions (window_system().app_context(), @@ -414,7 +411,7 @@ QueryTermView::invert_colors() for (i = 0; i < num; i++) SET_COLORS (children[i]); - if (f_weight_field != NULL) + if (f_weight_field != 0) { SET_COLORS (f_weight_field); #ifndef UseQSearch @@ -432,7 +429,7 @@ QueryTermView::invert_colors() void QueryTermView::set_prefix (WCallback *wcb) { - f_query_term->prefix ((u_int) wcb->ClientData()); + f_query_term->prefix ((size_t) wcb->ClientData()); #ifdef UseQSearch if (f_weight_field) if ( (int)wcb->ClientData() == QueryTerm::PFX_CONTAIN) { @@ -477,7 +474,7 @@ QueryTermView::set_connective (WCallback *wcb) new QueryTermView (term, f_parent, this, f_next); } // Set it in the term. - f_query_term->connective ((u_int) wcb->ClientData()); + f_query_term->connective ((size_t) wcb->ClientData()); query_editor().query_changed(); } @@ -489,7 +486,7 @@ QueryTermView::set_connective (WCallback *wcb) void QueryTermView::pw_activate (WCallback *) { - if (f_pws_form == NULL) + if (f_pws_form == 0) create_fields(); // change attachments of some widgets - 6/28/94 kamiya @@ -591,7 +588,7 @@ QueryTermView::create_fields() // sensitivity is stored in the label object. 11:53 01/14/93 DJB // this shouldn't cause a 64 bit conversion problem - rCs - int proximity_sensitive = (int) (Widget) f_proximity_label; + size_t proximity_sensitive = (size_t) (Widget) f_proximity_label; ASSN (WXmForm, f_pws_form, f_form, "pws_form" ); ASSNM (WXmLabelGadget, f_proximity_label, f_pws_form, "proximity_label" ); @@ -793,7 +790,7 @@ QueryTermView::prev_connective_changed() { case C_NEAR: case C_BEFORE: - if (f_pws_form != NULL) + if (f_pws_form != 0) { f_proximity_label.SetSensitive (True); f_proximity_field.SetSensitive (True); } @@ -802,7 +799,7 @@ QueryTermView::prev_connective_changed() break; default: - if (f_pws_form != NULL) + if (f_pws_form != 0) { f_proximity_label.SetSensitive (False); f_proximity_field.SetSensitive (False); diff --git a/cde/programs/dtinfo/dtinfo/src/Support/Imakefile b/cde/programs/dtinfo/dtinfo/src/Support/Imakefile index 0a46ce1d3..786629dfb 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Support/Imakefile @@ -1,12 +1,15 @@ XCOMM $XConsortium: Imakefile /main/5 1996/08/21 15:43:45 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Support LIBDIR=../lib +NormalCplusplusObjectRule() + INCLUDES=-I.. $(EXCEPTIONS_INCLUDES) $(UAS_INCLUDES) #include "Classlist.mk" @@ -18,6 +21,9 @@ make_libfiles($(LIBNAME), $(CLASSES)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 NotSoSimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR), $(OTHEROBJS)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +NotSoSimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR), $(OTHEROBJS)) #else NotSoSimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR), $(OTHEROBJS)) #endif diff --git a/cde/programs/dtinfo/dtinfo/src/Support/InputNotifier.C b/cde/programs/dtinfo/dtinfo/src/Support/InputNotifier.C index 7ced94d07..6c90b8b20 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/InputNotifier.C +++ b/cde/programs/dtinfo/dtinfo/src/Support/InputNotifier.C @@ -25,7 +25,8 @@ # define C_InputNotifier # include -# include +# include +using namespace std; #define CLASS InputNotifier diff --git a/cde/programs/dtinfo/dtinfo/src/Support/List_base.hh b/cde/programs/dtinfo/dtinfo/src/Support/List_base.hh index bde1e8c56..f3c02b66c 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/List_base.hh +++ b/cde/programs/dtinfo/dtinfo/src/Support/List_base.hh @@ -93,7 +93,7 @@ protected: { return (f_current); } #ifndef DEC int operator!=(int i) - { return (f_current != (Link_base *)i); } + { return (f_current != (Link_base *)(size_t)i); } #endif // For internal List_base usage. diff --git a/cde/programs/dtinfo/dtinfo/src/Support/Sender.C b/cde/programs/dtinfo/dtinfo/src/Support/Sender.C index ed493e794..ddfac1547 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/Sender.C +++ b/cde/programs/dtinfo/dtinfo/src/Support/Sender.C @@ -52,7 +52,8 @@ #include "Receiver.hh" -#include +#include +using namespace std; // ///////////////////////////////////////////////////////////////// // class destructor - remove this sender from all receiver's lists diff --git a/cde/programs/dtinfo/dtinfo/src/Support/UtilityFunctions.C b/cde/programs/dtinfo/dtinfo/src/Support/UtilityFunctions.C index 8f0f4f9f2..a9bb53207 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/UtilityFunctions.C +++ b/cde/programs/dtinfo/dtinfo/src/Support/UtilityFunctions.C @@ -21,7 +21,8 @@ * Floor, Boston, MA 02110-1301 USA */ // $XConsortium: UtilityFunctions.cc /main/4 1996/06/11 16:35:41 cde-hal $ -#include +#include +using namespace std; # include "UtilityFunctions.hh" UAS_List diff --git a/cde/programs/dtinfo/dtinfo/src/Support/message_test.C b/cde/programs/dtinfo/dtinfo/src/Support/message_test.C index b32bb70c1..5268383b1 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/message_test.C +++ b/cde/programs/dtinfo/dtinfo/src/Support/message_test.C @@ -54,7 +54,8 @@ #define EXPAND_TEMPLATES #include "Prelude.h" -#include +#include +using namespace std; struct Message { diff --git a/cde/programs/dtinfo/dtinfo/src/Support/xList.hh b/cde/programs/dtinfo/dtinfo/src/Support/xList.hh index 83658e2ab..1acea26c3 100644 --- a/cde/programs/dtinfo/dtinfo/src/Support/xList.hh +++ b/cde/programs/dtinfo/dtinfo/src/Support/xList.hh @@ -49,7 +49,7 @@ private: }; template -#if defined(__uxp__) || defined(_IBMR2) || defined(__osf__) || defined(USL) || defined(linux) +#if defined(__uxp__) || defined(_IBMR2) || defined(__osf__) || defined(USL) || defined(linux) || defined(CSRG_BASED) class xList : public List_base #else class xList : private List_base @@ -60,7 +60,7 @@ class xList : private List_base #ifdef SC3 friend class List_Iterator; #else -#if !defined(_IBMR2) && !defined(__osf__) && !defined(USL) && !defined(linux) +#if !defined(_IBMR2) && !defined(__osf__) && !defined(USL) && !defined(linux) && !defined(CSRG_BASED) template friend class List_Iterator; #endif #endif @@ -96,7 +96,7 @@ public: template -#if defined(_IBMR2) || defined(__osf__) || defined(linux) +#if defined(_IBMR2) || defined(__osf__) || defined(linux) || defined(CSRG_BASED) class List_Iterator : public List_Iterator_base #else class List_Iterator : private List_Iterator_base diff --git a/cde/programs/dtinfo/dtinfo/src/Templates.C b/cde/programs/dtinfo/dtinfo/src/Templates.C index 3319678df..376645c2b 100644 --- a/cde/programs/dtinfo/dtinfo/src/Templates.C +++ b/cde/programs/dtinfo/dtinfo/src/Templates.C @@ -84,7 +84,9 @@ class ColFormat; class RowDefn; class UpdateMenu; +#ifndef EXPAND_TEMPLATES #define EXPAND_TEMPLATES +#endif #ifndef TEMPL_DEBUG #ifdef DEBUG #undef DEBUG diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/Base/Imakefile index a5f3e1ce4..c87de5312 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/Imakefile @@ -1,12 +1,15 @@ XCOMM $XConsortium: Imakefile /main/7 1996/08/21 15:44:17 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=Base LIBDIR=../lib +NormalCplusplusObjectRule() + INCLUDES=-I. -I.. -I../.. -I../Support $(EXCEPTIONS_INCLUDES) $(COMMON_CLASS_INCLUDES) make_libfiles($(LIBNAME),) @@ -19,8 +22,12 @@ OBJS=$(SRCS:.C=.o) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C index 363d3ad63..e2c21d870 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_BookcaseEntry.C @@ -22,6 +22,8 @@ */ // $TOG: UAS_BookcaseEntry.C /main/5 1998/04/17 11:40:44 mgreess $ #include "UAS_BookcaseEntry.hh" +#include "UAS_Exceptions.hh" +#include "UAS_Collection.hh" #include diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.C index 5d4a9ab2e..a9f7644d3 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.C @@ -21,9 +21,9 @@ * Floor, Boston, MA 02110-1301 USA */ // $XConsortium: UAS_Buffer.cc /main/3 1996/06/11 16:36:44 cde-hal $ -#include "UAS_Buffer.hh" #include #include +#include "UAS_Buffer.hh" // If necessary in the future, we can rework UAS_Buffer class to provide // global buffer by default and private buffers on request. SWM @@ -112,7 +112,7 @@ static int g_int; static char *const g_intbuf = (char *) &g_int; void -UAS_Buffer::write (const int integer) +UAS_Buffer::write (const ssize_t integer) { char *inbuf = (char *) &integer; @@ -146,7 +146,7 @@ UAS_Buffer::read (int *integer) void UAS_Buffer::write (const char *string) { - int length = strlen (string); + ssize_t length = strlen (string); write (length); write (string, sizeof (char), length + 1); } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.hh index f100f7e05..e1fb41f3c 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Buffer.hh @@ -30,9 +30,9 @@ public: void reset() { f_point = f_start; } - void write (const int integer); + void write (const ssize_t integer); void write (const unsigned int integer) - { write ((int) ((void *) integer)); } + { write ((ssize_t) ((void *)(ssize_t) integer)); } void write (const char *string); void write (const char *bytes, unsigned int size, unsigned int length); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Common.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Common.C index 93ac535c4..ce84fe3a1 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Common.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Common.C @@ -21,13 +21,15 @@ * Floor, Boston, MA 02110-1301 USA */ // $TOG: UAS_Common.C /main/10 1998/04/17 11:41:00 mgreess $ -# include +# include +using namespace std; # include "UAS_Common.hh" # include "UAS_Factory.hh" # include "UAS_Exceptions.hh" # include "UAS_SearchEngine.hh" # include "UAS_Collection.hh" # include "UAS_StyleSheet.hh" +# include "UAS_EmbeddedObject.hh" # define CLASS UAS_Common diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Exceptions.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Exceptions.hh index 7a4c70a7b..d597d9422 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Exceptions.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Exceptions.hh @@ -5,11 +5,7 @@ #include "Exceptions.hh" #include "UAS_String.hh" -#if defined(linux) -#define CASTUASEXCEPT (UAS_Exception*) -#else #define CASTUASEXCEPT -#endif class UAS_Exception: public Exception { protected: diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C index 88d054a34..65376c31f 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Factory.C @@ -21,13 +21,16 @@ * Floor, Boston, MA 02110-1301 USA */ // $XConsortium: UAS_Factory.C /main/9 1996/10/04 12:33:17 cde-hal $ -# include +# include +using namespace std; # include # include "UAS_Pointer.hh" # include "UAS_String.hh" # include "UAS_Factory.hh" # include "UAS_Common.hh" # include "UAS_Exceptions.hh" +# include "UAS_Collection.hh" +# include "UAS_EmbeddedObject.hh" #include "Managers/CatMgr.hh" #include "Registration.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C index e34d6bb7f..94f95e5bd 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_OQLParser.C @@ -24,12 +24,13 @@ /* Copyright (c) 1995 FUJITSU LIMITED */ /* All Rights Reserved */ -#if defined(__uxp__) || defined(USL) +#if defined(__uxp__) || defined(USL) || defined(linux) #include #else #include #endif -#include +#include +using namespace std; #include #include "Exceptions.hh" @@ -119,11 +120,11 @@ UAS_OQLParser::parse(const char *oql) // initialize input parameters f_input_ptr = oql; - try { + mtry { GetSymbol(); ERecognize(); } - catch_any() + mcatch_any() { #ifdef DEBUG fprintf(stderr, "(WARNING) OQLParser could not parse expression\n"); @@ -609,109 +610,109 @@ UAS_OQLParser::determine_caps() unsigned int caps = 0; caps |= 0x01 << OQL_AND; - try { + mtry { se_construct(AND, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_AND); } end_try; caps |= 0x01 << OQL_OR; - try { + mtry { se_construct(OR, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_OR); } end_try; caps |= 0x01 << OQL_XOR; - try { + mtry { se_construct(XOR, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_XOR); } end_try; caps |= 0x01 << OQL_NOT; - try { + mtry { se_construct(NOT, word, "", ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_NOT); } end_try; caps |= 0x01 << OQL_WEIGHT; - try { + mtry { se_construct(WEIGHT, word, digits, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_WEIGHT); } end_try; caps |= 0x01 << OQL_COMPLETION; - try { + mtry { se_construct(COMPLETION, word, "", ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_COMPLETION); } end_try; caps |= 0x01 << OQL_PHRASE; - try { + mtry { se_construct(PHRASE, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_PHRASE); } end_try; caps |= 0x01 << OQL_QUOTED_PHRASE; - try { + mtry { se_construct(QUOTED_PHRASE, quoted_phrase, "", ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_QUOTED_PHRASE); } end_try; caps |= 0x01 << OQL_NEAR; - try { + mtry { se_construct(NEAR, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_NEAR); } end_try; caps |= 0x01 << OQL_BEFORE; - try { + mtry { se_construct(BEFORE, word, word, ""); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_BEFORE); } end_try; caps |= 0x01 << OQL_NEAR_WITHIN; - try { + mtry { se_construct(NEAR_WITHIN, word, word, digits); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_NEAR_WITHIN); } end_try; caps |= 0x01 << OQL_BEFORE_WITHIN; - try { + mtry { se_construct(BEFORE_WITHIN, word, word, digits); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed caps &= ~(0x01 << OQL_BEFORE_WITHIN); } end_try; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Path.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Path.C index cfece5794..97d78bbe9 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Path.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_Path.C @@ -22,6 +22,8 @@ */ // $XConsortium: UAS_Path.cc /main/3 1996/06/11 16:38:39 cde-hal $ # include "UAS_Path.hh" +# include "UAS_Collection.hh" +# include "UAS_Exceptions.hh" UAS_Pointer UAS_Path::first () { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C index 7bd8a94ee..5762392fc 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.C @@ -77,7 +77,7 @@ T * UAS_PtrList::item (int i) const { if (i < 0 || i >= fNumItems) throw (UAS_Exception ( - (char*)UAS_String(CATGETS(Set_UAS_Base, 4, "File a Bug")))); + (char*)UAS_String(CATGETS(Set_UAS_Base, 4, "File a Bug")))); return fItems[i]; } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.hh index 506f926ea..3fb4a3120 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_PtrList.hh @@ -2,6 +2,9 @@ #ifndef _UAS_PtrList_hh_ #define _UAS_PtrList_hh_ +class UAS_Exception; +class UAS_String; + template class UAS_PtrList { public: UAS_PtrList (); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchEngine.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchEngine.C index 5dd7d5b1d..670113120 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchEngine.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchEngine.C @@ -23,7 +23,7 @@ // $XConsortium: UAS_SearchEngine.cc /main/4 1996/06/11 16:39:22 cde-hal $ # include "UAS_Exceptions.hh" #include "UAS_SearchEngine.hh" - +#include "UAS_Collection.hh" #include "UAS_OQLParser.hh" #define CLASS UAS_SearchEngine diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResults.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResults.C index 5b5c0c99e..e3eb1b726 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResults.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResults.C @@ -22,3 +22,5 @@ */ // $XConsortium: UAS_SearchResults.cc /main/3 1996/06/11 16:39:32 cde-hal $ #include "UAS_SearchResults.hh" +#include "UAS_Exceptions.hh" +#include "UAS_Collection.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResultsEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResultsEntry.C index 8c83b6b5c..64e336e8c 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResultsEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchResultsEntry.C @@ -22,6 +22,8 @@ */ // $XConsortium: UAS_SearchResultsEntry.cc /main/3 1996/06/11 16:39:43 cde-hal $ # include "UAS_SearchResultsEntry.hh" +# include "UAS_Exceptions.hh" +# include "UAS_Collection.hh" UAS_SearchResultsEntry::UAS_SearchResultsEntry (const char *id, const char *book, diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.C index 2d7385510..8a04dd5e5 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.C @@ -23,9 +23,12 @@ // $XConsortium: UAS_SearchScope.C /main/6 1996/09/14 13:10:00 cde-hal $ #include "UAS_Exceptions.hh" #include "UAS_SearchScope.hh" +#include "UAS_Collection.hh" #include -#include +#include +#include +using namespace std; #define CLASS UAS_SearchScope STATIC_SENDER_CC (ScopeCreated); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.hh index 29945634a..6206d3427 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchScope.hh @@ -15,7 +15,7 @@ #define FALSE 0 #endif -typedef unsigned char bool; +//typedef unsigned char bool; class UAS_SearchScope; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh index abac18fc5..504dc1fc4 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh @@ -6,7 +6,7 @@ #include "UAS_String.hh" -typedef unsigned char bool; +//typedef unsigned char mbool; class UAS_SearchZones { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_String.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_String.C index c42f682c3..0375d14b1 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_String.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_String.C @@ -196,7 +196,8 @@ UAS_String::splitFields (const char separator) const { UAS_List rval; UAS_Pointer cur; int start = 0; - for (int i = 0; i < fStringRep->fDataSize; i ++) { + int i; + for (i = 0; i < fStringRep->fDataSize; i ++) { if (fStringRep->fData[i] == separator) { cur = new UAS_String(&(fStringRep->fData[start]), i - start, UAS_OWNER); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_TextRun.C b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_TextRun.C index 65e0dafaa..154feb0b3 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_TextRun.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_TextRun.C @@ -22,6 +22,9 @@ */ // $XConsortium: UAS_TextRun.cc /main/3 1996/06/11 16:40:55 cde-hal $ #include "UAS_TextRun.hh" +#include "UAS_Exceptions.hh" +#include "UAS_SearchEngine.hh" +#include "UAS_Collection.hh" UAS_TextRun::UAS_TextRun (unsigned int off, unsigned int len) :f_offset(off), f_length(len) diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_BookcaseEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_BookcaseEntry.C index 07c47034d..5ba3a691f 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_BookcaseEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_BookcaseEntry.C @@ -27,7 +27,8 @@ #include #include -#include +#include +using namespace std; #include "config.h" #include "Basic/Error.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C index 47e9dbd26..ccf467379 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.C @@ -27,7 +27,8 @@ #include #include -#include +#include +using namespace std; #include "UAS_String.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.hh b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.hh index c05f0d367..66314dedd 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_Parser.hh @@ -13,7 +13,7 @@ class DtSR_Parser : public UAS_OQLParser { public: - DtSR_Parser::DtSR_Parser(); + DtSR_Parser(); int stemming_suggested() { return f_completion_specified; } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C index 7c19626b0..fef2f6ff2 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchEngine.C @@ -29,7 +29,9 @@ #include #include -#include +#include +#include +using namespace std; #include "Registration.hh" #include "Managers/CatMgr.hh" @@ -189,7 +191,7 @@ UpdateConfigFile(UAS_PtrList *bcases, UAS_String ocf_path) return 0; ofstream dtiocf((char*)ocf_path, - ios::out | ios::trunc | ios::nocreate); + ios::out | ios::trunc); if (! dtiocf) { // could not open ocf_path in specified mode #ifdef DEBUG fprintf(stderr, "(ERROR) could not open %s\n", (char*)ocf_path); @@ -268,13 +270,13 @@ DtSR_SearchEngine::~DtSR_SearchEngine() DtSR_SearchEngine::DtSR_SearchEngine() : f_dbnames(NULL), f_dbcount(0), f_valid_bc_map(0) { - char* ocf_path = tempnam(NULL, ".DtSR_"); + char* ocf_path = mktemp((char*)".DtSR_XXXXXX"); f_config_path = ocf_path; if (ocf_path) free(ocf_path); - ofstream dtiocf((char*)f_config_path, ios::out | ios::noreplace); + ofstream dtiocf((char*)f_config_path, ios::out); // TODO if (! dtiocf) // could not open ocf_path in specified mode throw(CASTEXCEPT Exception()); @@ -302,7 +304,7 @@ DtSR_SearchEngine::init(UAS_PtrList *bcases) #ifdef DEBUG fprintf(stderr, "(DEBUG) DtSearch is being initialized.\n"); #endif - status = DtSearchInit("DtSearch", NULL, 0, (char*)f_config_path, + status = DtSearchInit((char*)"DtSearch", NULL, 0, f_config_path, NULL, &f_dbnames, &f_dbcount); } else { @@ -548,10 +550,10 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope& scope, } UAS_String aus_query; - try { + mtry { aus_query = f_oql_parser->parse((char*)oql); } - catch_any() { // OQL parse failed + mcatch_any() { // OQL parse failed rethrow; } end_try; @@ -641,7 +643,8 @@ DtSR_SearchEngine::search(UAS_String oql, UAS_SearchScope& scope, Dict bookid_dict(NULL, False); UAS_ObjList &books = targets[n]->book_list(); // register bookids in Dict - for (int i = 0; i < books.numItems(); i++) { + int i; + for (i = 0; i < books.numItems(); i++) { UAS_Pointer bcase(bookcases[index]->bcase()); UAS_String bookid = resolve_bookid(bcase, books[i]); if ((char*)bookid == (int)NULL || *(char*)bookid == '\0') diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C index 4dc862327..94b3fb8cb 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.C @@ -140,7 +140,8 @@ DtSR_SearchResults::merge(UAS_Pointer & res) if (! (position < ndocs)) break; - for (int j = position; j < ndocs; j++) { + int j; + for (j = position; j < ndocs; j++) { if (f_results[j]->relevance() > res->f_results[i]->relevance()) continue; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.hh b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.hh index cf56d6824..ea6c837c3 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResults.hh @@ -3,6 +3,7 @@ #define _DTSR_SEARCHRESULTS_HH_ #include "UAS_SearchResults.hh" +#include "UAS_Collection.hh" #include "DtSR_SearchResultsEntry.hh" #include "DtSR_Stems.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C index 245ca2bbe..51e259406 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/DtSR_SearchResultsEntry.C @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -272,11 +272,12 @@ DtSR_SearchResultsEntry::create_matches() } #endif - try + mtry { style_sheet_mgr().initOnlineStyleSheet(doc); } - catch_noarg (StyleSheetSyntaxError) +// catch_noarg (StyleSheetSyntaxError) + mcatch_any() { #ifdef JOE_HATES_THIS message_mgr().error_dialog( @@ -287,10 +288,10 @@ DtSR_SearchResultsEntry::create_matches() } end_try; - istrstream input((char *)doc->data()); - ostrstream output; + istringstream input((char *)doc->data()); + ostringstream output; - try + mtry { Tml_TextRenderer renderer(output, f_search_res->search_zones()); Resolver resolver(*gPathTab, renderer); @@ -298,15 +299,15 @@ DtSR_SearchResultsEntry::create_matches() docparser.parse(input); } - catch_any() + mcatch_any() { ON_DEBUG(cerr << "DtSR_SearchResultsEntry::create_matches...exception thrown" << '\n' << flush); rethrow; } end_try; - char* text = output.str(); - *(text + output.pcount()) = '\0'; + char* text = (char*)output.str().c_str(); + *(text + output.str().size()) = '\0'; #ifdef DUMP_NODES { @@ -345,12 +346,12 @@ DtSR_SearchResultsEntry::create_matches() if (f_language == DtSrLaJPN) { // do not trust DtSearchHighlight! int count = f_search_res->stems(f_dbn)->count(); - ostrstream stemsbuf; + ostringstream stemsbuf; for (int i = 0; i < count; i++) { stemsbuf << (f_search_res->stems(f_dbn)->stems())[i] << '\n'; } - char* stems = stemsbuf.str(); - *(stems + stemsbuf.pcount()) = '\0'; + char* stems = (char*)stemsbuf.str().c_str(); + *(stems + stemsbuf.str().size()) = '\0'; parseout = StringParser::hilite(text, count, stems); @@ -374,7 +375,7 @@ DtSR_SearchResultsEntry::create_matches() } #ifdef DEBUG - fprintf(stderr, "(DEBUG) %d hit found in %s\n", n_kwics, (char*)f_id); + fprintf(stderr, "(DEBUG) %ld hit found in %s\n", n_kwics, (char*)f_id); #endif } @@ -383,11 +384,11 @@ DtSR_SearchResultsEntry::create_matches() // convert kwics to textrun if (parseout == NULL && kwics) { - ostrstream textrunbuf; + ostringstream textrunbuf; for (int i = 0; i < n_kwics; i++) textrunbuf << kwics[i].offset << '\t' << kwics[i].length << '\n'; - parseout = textrunbuf.str(); - *(parseout + textrunbuf.pcount()) = '\0'; + parseout = (char*)textrunbuf.str().c_str(); + *(parseout + textrunbuf.str().size()) = '\0'; } else if (parseout == NULL) { @@ -400,7 +401,7 @@ DtSR_SearchResultsEntry::create_matches() fprintf(stderr, "(DEBUG) byte offset and length\n%s", parseout); #endif - istrstream textruns(parseout); + istringstream textruns(parseout); char linebuf[128]; while (textruns.get(linebuf, 128, '\n')) { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Imakefile index cd7d34e13..09c2939dd 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Imakefile @@ -1,6 +1,7 @@ XCOMM $XConsortium: Imakefile /main/8 1996/08/21 15:44:56 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk @@ -12,6 +13,8 @@ UTIL_CLASSES_INCLUDES=-I./Util_Classes DEFINES=-DCDE_NEXT +NormalCplusplusObjectRule() + INCLUDES=-I../.. $(EXCEPTIONS_INCLUDES) $(UAS_INCLUDES) $(DTSEARCH_INCLUDES) $(UTIL_CLASSES_INCLUDES) $(COMMON_CLASS_INCLUDES) #include "Classlist.mk" @@ -22,8 +25,12 @@ make_msgs($(LIBNAME), $(MSGS)) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C index 021b954b8..72c9d9bcd 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextParser.C @@ -29,7 +29,8 @@ #include #include -#include +#include +using namespace std; #include "TextParser.hh" @@ -57,7 +58,7 @@ StringParser::brute_force(const char* text_in, int n_of_pats, int npat; for (npat = 0; *patterns && n_of_pats > 0; npat++, n_of_pats--) { - char* del = strchr(patterns, '\n'); + char* del = (char *)strchr(patterns, '\n'); if (del != NULL) { // more pattern specified pat_tbl[npat] = new char[del - patterns + 1]; strncpy(pat_tbl[npat], patterns, del - patterns); @@ -160,18 +161,18 @@ StringParser::brute_force(const char* text_in, int n_of_pats, *p = *p - 0x20; } } - ostrstream capitalized; + ostringstream capitalized; for (p = (unsigned char*)text_in; *p; p++) { if (*p < 0x7B && *p > 0x60) // a ... z capitalized << (char)(*p - 0x20); // capitalize else capitalized << *p; } - text_in = caped_text = capitalized.str(); - *(char*)(text_in + capitalized.pcount()) = '\0'; + text_in = caped_text = (char *)capitalized.str().c_str(); + *(char*)(text_in + capitalized.str().size()) = '\0'; } - ostrstream text_run; + ostringstream text_run; for (int index = 0; index < text_len;) { unsigned int candidate = (1 << npat) - 1; @@ -235,7 +236,7 @@ StringParser::brute_force(const char* text_in, int n_of_pats, if (caped_text) delete[] caped_text; - char* ret_text = text_run.str(); + char* ret_text = (char *)text_run.str().c_str(); if (ret_text == NULL) return NULL; @@ -254,7 +255,7 @@ StringParser::project_textrun(const char* org_textrun) if (org_textrun == NULL || *org_textrun == '\0') return NULL; - istrstream textrun(org_textrun); + istringstream textrun(org_textrun); char line[128]; textrun.get(line, 128, '\n'); @@ -279,7 +280,7 @@ StringParser::project_textrun(const char* org_textrun) return NULL; } - ostrstream ret_text; + ostringstream ret_text; while (textrun.get(line, 128, '\n')) { if (textrun.get() != '\n') { @@ -321,7 +322,7 @@ StringParser::project_textrun(const char* org_textrun) ret_text << off << '\t' << len << '\n' << '\0'; - return ret_text.str(); + return (char *)ret_text.str().c_str(); } char * diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C index a2fba4154..e4e6e048f 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextRun.C @@ -28,7 +28,8 @@ #include #include -#include +#include +using namespace std; main(int argc, char** argv) { @@ -49,13 +50,13 @@ main(int argc, char** argv) return 1; } - ostrstream text; + ostringstream text; char ch; while (cin.get(ch)) text << ch; - char* buf = text.str(); - *(buf + text.pcount()) = '\0'; + char* buf = (char *)text.str().c_str(); + *(buf + text.str().size()) = '\0'; char* p = buf; if (buf == NULL || *buf == '\0') { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C index ce7f06028..83194e52b 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/TextTest.C @@ -29,8 +29,9 @@ #include #include -#include -#include +#include +#include +using namespace std; #include "TextParser.hh" @@ -57,13 +58,13 @@ main(int argc, char** argv) sprintf(patterns, "%s%s\n", patterns, argv[i]); } - ostrstream text; + ostringstream text; char ch; while (cin.get(ch)) text << ch; - char* buf = text.str(); - *(buf + text.pcount()) = '\0'; + char* buf = (char *)text.str().c_str(); + *(buf + text.str().size()) = '\0'; char* match = StringParser::brute_force(buf, npat, patterns); diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.C index 8f31ec4c6..3e559b7b4 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.C @@ -31,7 +31,7 @@ #include "StyleSheet/FeatureValue.h" -Tml_TextRenderer::Tml_TextRenderer(ostrstream &ostr, UAS_SearchZones &zones) : +Tml_TextRenderer::Tml_TextRenderer(ostringstream &ostr, UAS_SearchZones &zones) : f_ostr(ostr), f_zones(zones) { } diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.hh b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.hh index 0803e8bfb..b0b9b72a6 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Tml_TextRenderer.hh @@ -9,7 +9,8 @@ #include #include -#include +#include +using namespace std; #include "dti_cc/CC_Stack.h" @@ -29,7 +30,7 @@ class Tml_TextRenderer : public Renderer { public: - Tml_TextRenderer(ostrstream &, UAS_SearchZones &); + Tml_TextRenderer(ostringstream &, UAS_SearchZones &); ~Tml_TextRenderer(); FeatureSet * initialize(); @@ -50,7 +51,7 @@ class Tml_TextRenderer : public Renderer int effective_zone(UAS_SearchZones::uas_zones); - ostrstream &f_ostr; + ostringstream &f_ostr; UAS_SearchZones &f_zones; int f_current_level; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/Imakefile index d9748dbb9..700747c5d 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/Imakefile @@ -1,6 +1,8 @@ XCOMM $XConsortium: Imakefile /main/3 1996/06/11 16:42:48 cde-hal $ Libs = ../../libUAS.a $(EXCLIB) $(MMDB_LIBS) $(MISC_LIB) -lm +NormalCplusplusObjectRule() + INCLUDES=-g -I../.. $(EXCEPTIONS_INCLUDES) SimpleCPlusPlusProgram(dict_driver, dict_driver.o Dict_Templates.o, $(Libs)) diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/dict_driver.C b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/dict_driver.C index 4c25509a5..12001f694 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/dict_driver.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/DtSR/Util_Classes/dict_driver.C @@ -23,7 +23,8 @@ // $XConsortium: dict_driver.cc /main/3 1996/06/11 16:42:53 cde-hal $ #include -#include +#include +using namespace std; #include "Exceptions.hh" #include "UAS_Exceptions.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/Imakefile index 958009533..37b3e4fd0 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Imakefile @@ -6,6 +6,13 @@ LIBNAME=UAS #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' 'CXXDEBUGFLAGS=$(CXXDEBUGFLAGS)' +XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir +#undef TopLevelProject +#define TopLevelProject DtInfo +IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' + DependSubdirs($(SUBDIRS)) #ifdef UseDtSearch @@ -19,6 +26,10 @@ Base \ MMDB \ $(SEARCH_SUBDIR) +XCOMM Variables to switch on debug mode temporarily +XCOMM CDEBUGFLAGS = -g -DDEBUG +XCOMM CXXDEBUGFLAGS = -g -DDEBUG + make_libfiles($(LIBNAME),) makelibT(Base) diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/Imakefile index 6a8abba8e..3666e23e3 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/Imakefile @@ -1,12 +1,15 @@ XCOMM $XConsortium: Imakefile /main/9 1996/08/21 15:45:19 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES MAKEFILEDEPS=Classlist.mk LIBNAME=MMDB LIBDIR=../lib +NormalCplusplusObjectRule() + #ifdef UseDtSearch SEARCHENG_INCLUDES=$(DTSEARCH_INCLUDES) #else @@ -26,8 +29,12 @@ OBJS=$(SRCS:.C=.o) #if defined(SunArchitecture) && CplusplusCompilerMajorVersion > 3 SimpleLibraryT($(LIBNAME), $(OBJS), $(LIBDIR)) +#elif defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #else SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) #endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C index 60ba83424..58fffcbe1 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB.C @@ -21,13 +21,15 @@ * Floor, Boston, MA 02110-1301 USA */ // $TOG: MMDB.C /main/8 1998/04/17 11:42:22 mgreess $ -#include +#include +using namespace std; #include "MMDB.hh" #include "UAS_Exceptions.hh" #include "UAS_Buffer.hh" #include "UAS_Common.hh" #include "UAS_Msgs.hh" #include "MMDB_Factory.hh" +#include "UAS_Collection.hh" #include "Managers/CatMgr.hh" #include "Registration.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_BookCase.hh b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_BookCase.hh index 87aac6719..bdc7adfd7 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_BookCase.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_BookCase.hh @@ -3,6 +3,8 @@ # define _MMDB_BookCase_hh_ # include "UAS_Common.hh" +# include "UAS_Collection.hh" +# include "UAS_Exceptions.hh" # include "MMDB_Common.hh" class MMDB_BookCase: public UAS_Common, public MMDB_Common { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_EmbeddedObject.hh b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_EmbeddedObject.hh index d200ce66d..1899dc8fa 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_EmbeddedObject.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_EmbeddedObject.hh @@ -3,6 +3,8 @@ # define _MMDB_EmbeddedObject_hh_ # include "UAS_EmbeddedObject.hh" +# include "UAS_Collection.hh" +# include "UAS_Exceptions.hh" # include "MMDB_Common.hh" class MMDB_EmbeddedObject: public UAS_EmbeddedObject, public MMDB_Common { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C index 0fccf7383..f4146c127 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Factory.C @@ -18,10 +18,11 @@ * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA + */ // $TOG: MMDB_Factory.C /main/15 1998/04/17 11:42:43 mgreess $ -# include +# include +using namespace std; # include "UAS_Exceptions.hh" # include "MMDB_Factory.hh" # include "UAS_Exceptions.hh" @@ -76,10 +77,10 @@ MMDB_Factory::createMMDB (const UAS_String &infoLibPath) { UAS_Common::send_message (badPath); return rval; } - try { + mtry { rval = new MMDB (infoLibPath); fMMDBList.append (rval); - } catch_any() { + } mcatch_any() { #if 0 char buf[BUFSIZ]; (void) sprintf (buf, CATGETS(Set_UAS_MMDB, 3, diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C index 0c7207cd5..9acfec81a 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Library.C @@ -117,7 +117,8 @@ MMDB_Library::name () { if (f_name == "") { UAS_List kids = children(); - for (int i = 0; i < kids.length(); i++) + int i; + for (i = 0; i < kids.length(); i++) { if (kids[i]->type() == UAS_BOOKCASE) break; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Section.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Section.C index 800a905d5..35657f2b0 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Section.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_Section.C @@ -30,6 +30,8 @@ #endif # include "MMDB_StyleSheet.hh" # include "MMDB_Factory.hh" +# include "UAS_Collection.hh" +# include "UAS_SearchEngine.hh" char* g_mmdb_section_label; diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.C b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.C index 05b7d2cd4..df8ea6186 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.C @@ -21,7 +21,8 @@ * Floor, Boston, MA 02110-1301 USA */ // $XConsortium: MMDB_StyleSheet.C /main/4 1996/09/04 01:36:27 cde-hal $ -# include +# include +using namespace std; # include "MMDB_StyleSheet.hh" MMDB_StyleSheet::MMDB_StyleSheet (MMDB &theMMDB, diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.hh b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.hh index a17d0d0cc..86949f587 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/MMDB/MMDB_StyleSheet.hh @@ -3,6 +3,8 @@ #define _MMDB_StyleSheet_hh_ # include "UAS_StyleSheet.hh" +# include "UAS_Collection.hh" +# include "UAS_Exceptions.hh" # include "MMDB_Common.hh" class MMDB_StyleSheet: public UAS_StyleSheet, public MMDB_Common { diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Test/Fulcrum_Templates.C b/cde/programs/dtinfo/dtinfo/src/UAS/Test/Fulcrum_Templates.C index 2cfa3fc01..0ceeb056b 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Test/Fulcrum_Templates.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Test/Fulcrum_Templates.C @@ -23,7 +23,8 @@ // $XConsortium: Fulcrum_Templates.cc /main/3 1996/06/11 16:44:22 cde-hal $ # define EXPAND_TEMPLATES -# include +# include +using namespace std; # include "Exceptions.hh" # include "UAS_Exceptions.hh" # include "UAS_PtrList.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Test/Imakefile b/cde/programs/dtinfo/dtinfo/src/UAS/Test/Imakefile index ca2870134..2d968a0ad 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Test/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Test/Imakefile @@ -5,6 +5,10 @@ SEARCHENG=DtSearch SEARCHENG=Fulcrum #endif +CXXEXTRA_DEFINES = -DEXPAND_TEMPLATES + +NormalCplusplusObjectRule() + #ifdef UseDtSearch DTSEARCH_LIBS=-L/VOB/olias/library/dtsearch/solaris -lDtSr -lDtvis @@ -32,9 +36,16 @@ PREF_LIB_OBJS = $(PREF_LIB_SRCS:.C=.o) make_libfiles($(LIBNAME),) +#if defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) SimpleLibrary($(PREF_LIB_NAME), $(PREF_LIB_OBJS), $(LIBDIR)) - SimpleLibraryT(uasdrv, uasdrv.o,) +#else +SimpleLibrary($(PREF_LIB_NAME), $(PREF_LIB_OBJS), $(LIBDIR)) +SimpleLibraryT(uasdrv, uasdrv.o,) +XCOMM RealLibrary($(PREF_LIB_NAME), $(PREF_LIB_OBJS), $(LIBDIR)) +XCOMM RealLibraryT(uasdrv, uasdrv.o,) +#endif SimpleCPlusPlusProgram(sdrv, sdrv.o dlstub.o UAS_Templates.o, $(Libs)) SimpleCPlusPlusProgram(uasdrv, uasdrv.o dlstub.o libuasdrvT.a, $(Libs)) diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Test/UAS_Templates.C b/cde/programs/dtinfo/dtinfo/src/UAS/Test/UAS_Templates.C index ba9ce2afd..b97447e3d 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Test/UAS_Templates.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Test/UAS_Templates.C @@ -23,7 +23,8 @@ // $XConsortium: UAS_Templates.cc /main/3 1996/06/11 16:44:45 cde-hal $ # define EXPAND_TEMPLATES -# include +# include +using namespace std; # include "Exceptions.hh" # include "UAS_Exceptions.hh" # include "UAS_Common.hh" diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Test/sdrv.C b/cde/programs/dtinfo/dtinfo/src/UAS/Test/sdrv.C index 050bd6520..49d709748 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Test/sdrv.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Test/sdrv.C @@ -22,7 +22,8 @@ */ // $XConsortium: sdrv.C /main/5 1996/09/27 19:02:52 drk $ #include -#include +#include +using namespace std; #include #include #include diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Test/uasdrv.C b/cde/programs/dtinfo/dtinfo/src/UAS/Test/uasdrv.C index 8f9d0d79c..b767b2905 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Test/uasdrv.C +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Test/uasdrv.C @@ -21,7 +21,8 @@ * Floor, Boston, MA 02110-1301 USA */ // $XConsortium: uasdrv.cc /main/4 1996/06/11 16:45:11 cde-hal $ -# include +# include +using namespace std; # include diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Imakefile b/cde/programs/dtinfo/dtinfo/src/Widgets/Imakefile index 85acacf6e..1894211b6 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Imakefile @@ -1,6 +1,6 @@ XCOMM $XConsortium: Imakefile /main/6 1996/08/21 15:45:28 drk $ -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) LIBNAME= Widgets LIBDIR = ../lib @@ -23,10 +23,17 @@ OBJS2 = $(SRCS2:.C=.o) SRCS = $(SRCS1) $(SRCS2) OBJS = $(OBJS1) $(OBJS2) +NormalCplusplusObjectRule() NormalLibraryObjectRule() INCLUDES=$(CDEINCLUDES) $(WWL_INCLUDES) $(EXCEPTIONS_INCLUDES) +#if defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture) || \ + defined(LinuxArchitecture) SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +#else +SimpleLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +XCOMM RealLibrary($(LIBNAME), $(OBJS), $(LIBDIR)) +#endif DependTarget() diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Pixmap.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Pixmap.c index 46c3e30dc..96b684a54 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Pixmap.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Pixmap.c @@ -117,7 +117,7 @@ Cardinal *nargs ; XtVaGetValues(XtParent(new), XtNwidth, &width, XtNheight, &height, - 0); + (char*)0); if (new->core.width == 0) new->core.width = width ; @@ -214,7 +214,9 @@ XtWidgetGeometry *proposed, *answer; return XtGeometryYes ; } +#ifndef DEBUG #define DEBUG +#endif static void ReDisplay(w, event) diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Restraint.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Restraint.c index 5fb9446ed..866daabf5 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Restraint.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Restraint.c @@ -54,6 +54,7 @@ #endif #include +#include #include #include "RestraintP.h" @@ -289,7 +290,7 @@ ChangeManaged (RestraintWidget w) ON_DEBUG(printf ("Restraint::ChangeManaged: my size = %d x %d\n", w->core.width, w->core.height)); ON_DEBUG(printf (" Num children = %d, child = 0x%p\n", - w->composite.num_children, child)); + w->composite.num_children, (void*)child)); /* If this is our first child, compute initial sizing. */ /* Tried using !XtIsRealized (w) to do this stuff when were @@ -297,7 +298,7 @@ ChangeManaged (RestraintWidget w) widget being realized before it has a child. This code will handle both cases correctly. */ ON_DEBUG(printf (" Checking for width calc\n child = 0x%p, first = %d\n", - child, w->restraint.had_child)); + (void*)child, w->restraint.had_child)); if (child != NULL && w->restraint.had_child == False) { compute_width (w, child); diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c b/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c index 9f68d840e..bd033102d 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/Simple.c @@ -129,7 +129,7 @@ SimpleClassRec simpleClassRec = { /* extension */ NULL }, { /* simple fields */ - /* change_sensitive */ ChangeSensitive + /* change_sensitive */ (Bool (*)(Widget))ChangeSensitive } }; @@ -167,7 +167,7 @@ static void ClassPartInitialize(class) "%s Widget: The Simple Widget class method 'change_sensitive' is undefined.\nA function must be defined or inherited.", c->core_class.class_name); XtWarning(buf); - c->simple_class.change_sensitive = ChangeSensitive; + c->simple_class.change_sensitive = (Bool (*)(Widget))ChangeSensitive; } if (c->simple_class.change_sensitive == XtInheritChangeSensitive) diff --git a/cde/programs/dtinfo/dtinfo/src/Widgets/TabButton.c b/cde/programs/dtinfo/dtinfo/src/Widgets/TabButton.c index 15ba97a8b..e3d73aedd 100644 --- a/cde/programs/dtinfo/dtinfo/src/Widgets/TabButton.c +++ b/cde/programs/dtinfo/dtinfo/src/Widgets/TabButton.c @@ -43,6 +43,7 @@ #include "TabButtonP.h" #include +#include /* ************************************************************** * constant and type declarations @@ -185,7 +186,7 @@ static XtResource resources[] = XmRImmediate, (XtPointer) True }, { XmNarmColor, XmCArmColor, XmRPixel, sizeof (Pixel), XtOffsetOf (struct _XyzTabButtonRec, tab.arm_color), - XmRCallProc, (XtPointer) _XmSelectColorDefault }, + XmRCallProc, (XtPointer)(size_t) _XmSelectColorDefault }, { XmNarmPixmap, XmCArmPixmap, XmRPrimForegroundPixmap, sizeof (Pixmap), XtOffsetOf (struct _XyzTabButtonRec, tab.arm_pixmap), XmRImmediate, (XtPointer) XmUNSPECIFIED_PIXMAP }, diff --git a/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile b/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile index 95e4bd7ff..4ee78585e 100644 --- a/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/cgm/Imakefile @@ -55,6 +55,7 @@ SRCS1= cgmcmds.c \ getcgm.c +NormalCplusplusObjectRule() NormalLibraryObjectRule() NormalLibraryTarget(cgm, $(OBJS1)) diff --git a/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c b/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c index 64e0f1e58..f8f90d957 100644 --- a/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c +++ b/cde/programs/dtinfo/dtinfo/src/cgm/cgmcmds.c @@ -1468,7 +1468,7 @@ static void getRLPixels(unsigned char *dat_ptr, cgm_s_type *cgm_s, } /* end of row */ /* may have to skip to end of row */ if (bitOffset) ++dat_ptr; /* incomplete byte */ - if (((int) dat_ptr - (int) rowPtr) % 2) ++dat_ptr; /* need to round up */ + if (((size_t) dat_ptr - (size_t) rowPtr) % 2) ++dat_ptr; /* need round up */ } /* end of cell array */ } diff --git a/cde/programs/dtinfo/dtinfo/src/config.h b/cde/programs/dtinfo/dtinfo/src/config.h index 0c68b04a3..89c0b190c 100644 --- a/cde/programs/dtinfo/dtinfo/src/config.h +++ b/cde/programs/dtinfo/dtinfo/src/config.h @@ -81,7 +81,7 @@ char *gettext(char *text) // definitely defined in other include files #define TRUE 1 #define FALSE 0 -typedef unsigned char bool; +//typedef unsigned char bool; typedef char int8; typedef short int16; @@ -145,7 +145,8 @@ typedef unsigned char u_char; // for debugging statements if desired #ifdef DEBUG -#include +#include +using namespace std; #include #endif diff --git a/cde/programs/dtinfo/dtinfo/src/external-api/Imakefile b/cde/programs/dtinfo/dtinfo/src/external-api/Imakefile index f44bb0a1b..ce259cc19 100644 --- a/cde/programs/dtinfo/dtinfo/src/external-api/Imakefile +++ b/cde/programs/dtinfo/dtinfo/src/external-api/Imakefile @@ -13,6 +13,7 @@ OBJS = \ init.o \ comm.o +NormalCplusplusObjectRule() NormalLibraryObjectRule() NormalLibraryTarget(olias,$(OBJS)) diff --git a/cde/programs/dtinfo/dtinfo/src/main.C b/cde/programs/dtinfo/dtinfo/src/main.C index 591ad0806..f05c2745a 100644 --- a/cde/programs/dtinfo/dtinfo/src/main.C +++ b/cde/programs/dtinfo/dtinfo/src/main.C @@ -153,7 +153,7 @@ Boolean DisplayNode_wp( XtPointer locator ) { UrlAgent::document( (char *)locator, 1 ); // arg2 = force new window - delete [] locator; + delete [] (char *)locator; return (Boolean)True ; // must always return True } @@ -209,7 +209,7 @@ Boolean PrintNode_wp( XtPointer locator ) { UrlAgent::print_document( (char *)locator); - delete [] locator; + delete [] (char *)locator; return (Boolean)True ; // must always return True } @@ -281,7 +281,7 @@ main(int argc, char **argv) if (env().init(argc, argv) < 0) exit(1); - try + mtry { // don't set up for session management or tooltalk if @@ -315,12 +315,16 @@ main(int argc, char **argv) window_system.run(); } - catch (Exception &, e) + mcatch (Exception &, e) { char buffer[256]; sprintf (buffer, "Internal Error: Exception got away.\nFile: %s, Line: %d", +#ifdef C_API e.file(), e.line()); +#else + __FILE__, __LINE__); +#endif message_mgr().error_dialog (buffer); exit (1); } diff --git a/cde/programs/dtinfo/dtinfo/wwl/Imakefile b/cde/programs/dtinfo/dtinfo/wwl/Imakefile index 13d22ab7a..e2a61a92f 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/Imakefile +++ b/cde/programs/dtinfo/dtinfo/wwl/Imakefile @@ -4,5 +4,12 @@ XCOMM $TOG: Imakefile /main/8 1998/08/10 15:54:24 mgreess $ SUBDIRS=src +XCOMM redefine TopLevelProject to build DtInfo with standard CDE config dir +#undef TopLevelProject +#define TopLevelProject DtInfo +IMAKE_DEFINES = -DTopLevelProject=TopLevelProject \ + -DProjectTmplFile='' \ + -DProjectRulesFile='' + MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h index 9ad5f9dae..61beed942 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WArgList.h @@ -45,9 +45,9 @@ #define WArgList_h // Allow setting of resources by name in arg list -#if defined(linux) +#if defined(linux) || defined(CSRG_BASED) #define CASTRNAM (char*) -#define CASTVAL (void*) +#define CASTVAL (void*)(size_t) #else #define CASTRNAM #define CASTVAL diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WObject.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WObject.h index d96006bf9..cf55e3104 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WObject.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WObject.h @@ -76,8 +76,8 @@ inline WObject (const WObject& w) { inline operator Widget () const { return widget; } #ifndef DEC -inline int operator== (int i) { return (Widget)i == widget; } -inline int operator!= (int i) { return (Widget)i != widget; } +inline int operator== (int i) { return (Widget)(size_t)i == widget; } +inline int operator!= (int i) { return (Widget)(size_t)i != widget; } #endif inline WObject &operator = (const Widget w) { widget = w; return *this; } inline WidgetClass Class () const { return XtClass (widget); } diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmGadget.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmGadget.h index 0fd197c84..609bb33a6 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmGadget.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmGadget.h @@ -102,115 +102,115 @@ public : DEFINE_GETTER_SETTER (SkipAdjust, Boolean, "skipAdjust") inline void LeftAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "leftPosition"; + a.name = CASTRNAM "leftPosition"; } else { - a.name = "leftOffset"; + a.name = CASTRNAM "leftOffset"; } a.value = (XtArgVal)poffset; _Set(a); } inline void LeftAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "rightPosition"; + a.name = CASTRNAM "rightPosition"; } else { - a.name = "rightOffset"; + a.name = CASTRNAM "rightOffset"; } a.value = (XtArgVal)poffset; _Set(a); } inline void RightAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "topPosition"; + a.name = CASTRNAM "topPosition"; } else { - a.name = "topOffset"; + a.name = CASTRNAM "topOffset"; } a.value = (XtArgVal)poffset; _Set(a); } inline void TopAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "bottomPosition"; + a.name = CASTRNAM "bottomPosition"; } else { - a.name = "bottomOffset"; + a.name = CASTRNAM "bottomOffset"; } a.value = (XtArgVal)poffset; _Set(a); } inline void BottomAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); } }; diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmManager.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmManager.h index fcab222c3..c36bfd81f 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmManager.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmManager.h @@ -105,119 +105,119 @@ public : DEFINE_GETTER_SETTER (SkipAdjust, Boolean, "skipAdjust") inline void LeftAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "leftPosition"; + a.name = CASTRNAM "leftPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "leftOffset"; + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void LeftAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "rightPosition"; + a.name = CASTRNAM "rightPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "rightOffset"; + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void RightAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "topPosition"; + a.name = CASTRNAM "topPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "topOffset"; + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void TopAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "bottomPosition"; + a.name = CASTRNAM "bottomPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "bottomOffset"; + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void BottomAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); } diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmPrimitive.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmPrimitive.h index 25f82072c..14e390f94 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmPrimitive.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/WXmPrimitive.h @@ -114,24 +114,24 @@ public : DEFINE_GETTER_SETTER (SkipAdjust, Boolean, "skipAdjust") inline void LeftAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "leftWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "leftWidget"; a.value = (XtArgVal)w; _Set(a); } inline void LeftAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "leftPosition"; + a.name = CASTRNAM "leftPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "leftOffset"; + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)poffset; _Set(a); } } @@ -141,96 +141,96 @@ public : inline void LeftAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "leftPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "leftOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "leftAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "leftPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "leftOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "rightWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "rightWidget"; a.value = (XtArgVal)w; _Set(a); } inline void RightAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "rightPosition"; + a.name = CASTRNAM "rightPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "rightOffset"; + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void RightAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "rightPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "rightOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "rightAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "rightPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "rightOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "topWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "topWidget"; a.value = (XtArgVal)w; _Set(a); } inline void TopAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "topPosition"; + a.name = CASTRNAM "topPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "topOffset"; + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void TopAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "topPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "topOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "topAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "topPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "topOffset"; a.value = (XtArgVal)offset; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, Widget w, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); - a.name = "bottomWidget"; a.value = (XtArgVal)w; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + a.name = CASTRNAM "bottomWidget"; a.value = (XtArgVal)w; _Set(a); } inline void BottomAttachment( unsigned char to_what, int poffset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); if( to_what == XmATTACH_POSITION ) { - a.name = "bottomPosition"; + a.name = CASTRNAM "bottomPosition"; a.value = (XtArgVal)poffset; _Set(a); } else { - a.name = "bottomOffset"; + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)poffset; _Set(a); } } inline void BottomAttachment( unsigned char to_what, int position, int offset ) { - Arg a; a.name = "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); - a.name = "bottomPosition"; a.value = (XtArgVal)position; _Set(a); - a.name = "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); + Arg a; a.name = CASTRNAM "bottomAttachment"; a.value = (XtArgVal)to_what; _Set(a); + a.name = CASTRNAM "bottomPosition"; a.value = (XtArgVal)position; _Set(a); + a.name = CASTRNAM "bottomOffset"; a.value = (XtArgVal)offset; _Set(a); } }; diff --git a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h index 44e4cbb17..c78668fa3 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h +++ b/cde/programs/dtinfo/dtinfo/wwl/include/WWL/wwl.h @@ -52,7 +52,12 @@ // /__ \/ F-91405 ORSAY Cedex +33 (1) 69 41 66 29 #include +#if !defined(linux) && !defined(CSRG_BASED) #include +#else +#define name2(__n1,__n2) __paste2(__n1,__n2) +#define __paste2(__p1,__p2) __p1##__p2 +#endif #include #include "WXmString.h" @@ -73,24 +78,24 @@ class WComposite; typedef void (* XtProc)(); #endif -#define DEFINE_GETTER(rsc,typ,rnam) \ -inline typ rsc() const \ -{ Arg a; typ __value; \ - a.name = rnam; a.value = (XtArgVal)&__value; \ - _Get(a); return __value; } - -#define DEFINE_SETTER(rsc,typ,rnam) \ -inline void rsc(typ val) const \ -{ Arg a; a.name = rnam; a.value = (XtArgVal)val; _Set(a); } - -#if defined(linux) +#if defined(linux) || defined(CSRG_BASED) #define CASTRNAM (char*) -#define CASTVAL (void*) +#define CASTVAL (void*)(size_t) #else #define CASTRNAM #define CASTVAL #endif +#define DEFINE_GETTER(rsc,typ,rnam) \ +inline typ rsc() const \ +{ Arg a; typ __value; \ + a.name = CASTRNAM rnam; a.value = (XtArgVal)&__value; \ + _Get(a); return __value; } + +#define DEFINE_SETTER(rsc,typ,rnam) \ +inline void rsc(typ val) const \ +{ Arg a; a.name = CASTRNAM rnam; a.value = (XtArgVal)val; _Set(a); } + #define DEFINE_ARG(rsc,typ,rnam) \ inline WArgList& rsc(typ val, WArgList& _w) const \ { return _w.Add (CASTRNAM rnam, CASTVAL val); } diff --git a/cde/programs/dtinfo/dtinfo/wwl/src/Imakefile b/cde/programs/dtinfo/dtinfo/wwl/src/Imakefile index 0a8c09eaa..fce9dcb3c 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/src/Imakefile +++ b/cde/programs/dtinfo/dtinfo/wwl/src/Imakefile @@ -8,7 +8,7 @@ XCOMM $XConsortium: Imakefile /main/7 1996/08/21 15:49:34 drk $ #define LibHeaders NO #define CplusplusSource YES -DEPEND_DEFINES = $(CXXDEPENDINCLUDES) +DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES) INCLUDES = -I../include diff --git a/cde/programs/dtinfo/dtinfo/wwl/src/WComposite.C b/cde/programs/dtinfo/dtinfo/wwl/src/WComposite.C index 86d5294ee..c924c274a 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/src/WComposite.C +++ b/cde/programs/dtinfo/dtinfo/wwl/src/WComposite.C @@ -29,7 +29,8 @@ // $CurLog$ (Log at end) // -//#include +//#include +//using namespace std; #ifndef _XtintrinsicP_h #include diff --git a/cde/programs/dtinfo/dtinfo/wwl/src/WObject.C b/cde/programs/dtinfo/dtinfo/wwl/src/WObject.C index 1bdaf30a5..e10a10e7a 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/src/WObject.C +++ b/cde/programs/dtinfo/dtinfo/wwl/src/WObject.C @@ -257,7 +257,8 @@ WObject :: SetCallback (const char* name, WWL* obj, WWL_FUN fun) #else // Not for doc #include -#include +#include +using namespace std; #define NL << '\n'; cout.flush() diff --git a/cde/programs/dtinfo/dtinfo/wwl/src/WXmMenu.C b/cde/programs/dtinfo/dtinfo/wwl/src/WXmMenu.C index a94941a05..34e247d43 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/src/WXmMenu.C +++ b/cde/programs/dtinfo/dtinfo/wwl/src/WXmMenu.C @@ -23,7 +23,8 @@ /* $XConsortium: WXmMenu.cc /main/3 1996/06/11 17:03:45 cde-hal $ */ #ifndef STREAMH -#include +#include +using namespace std; #endif #ifndef _WXmMenu_h diff --git a/cde/programs/dtinfo/dtinfo/wwl/src/WXmRadioBox.C b/cde/programs/dtinfo/dtinfo/wwl/src/WXmRadioBox.C index e426914e9..aefed77e7 100644 --- a/cde/programs/dtinfo/dtinfo/wwl/src/WXmRadioBox.C +++ b/cde/programs/dtinfo/dtinfo/wwl/src/WXmRadioBox.C @@ -23,7 +23,8 @@ /* $XConsortium: WXmRadioBox.cc /main/3 1996/06/11 17:03:50 cde-hal $ */ #ifndef STREAMH -#include +#include +using namespace std; #endif #ifndef _WXmRadioBox_h