ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch against 3.2.93 for IBM xlC


From: Arnaud Desitter
Subject: patch against 3.2.93 for IBM xlC
Date: Tue, 9 Jan 2001 17:14:01 +0000 ()

Hi Andreas, 

Here is a small patch againt ddd 3.2.93 in order to get it 
compile on AIX with Visual Age xlC 5.0.

Most of it boils down to a conflict related to "string::replicate".
You may want to apply a better fix. 
To some extent, "string" should be renamed to avoid any conflict 
with "std::string".

Cheers,
Arnaud

diff -ur ddd-3.2.93/ddd/DataDisp.C ddd-3.2.93-1/ddd/DataDisp.C
--- ddd-3.2.93/ddd/DataDisp.C   Mon Dec 11 12:21:47 2000
+++ ddd-3.2.93-1/ddd/DataDisp.C Tue Jan  9 12:59:11 2001
@@ -5594,7 +5594,7 @@
     if (s.length() > size)
        s = s.before(int(size));
     else if (s.length() < size)
-       s += replicate(' ', size - s.length());
+       s += replicate(string(' '), size - s.length());
 
     assert(s.length() == size);
     return s;
Only in ddd-3.2.93-1/ddd: DataDisp.C~
diff -ur ddd-3.2.93/ddd/GDBAgent.C ddd-3.2.93-1/ddd/GDBAgent.C
--- ddd-3.2.93/ddd/GDBAgent.C   Mon Dec 11 12:21:47 2000
+++ ddd-3.2.93-1/ddd/GDBAgent.C Tue Jan  9 13:55:29 2001
@@ -381,7 +381,7 @@
     }
 
     s = quote(s);
-    string nl = string("\\n\"\n") + replicate(' ', strlen(prefix)) + "\"";
+    string nl = string("\\n\"\n") + replicate(string(' '), strlen(prefix)) + 
"\"";
     s.gsub("\\n", nl);
 
     if (s_ends_with_nl)
Only in ddd-3.2.93-1/ddd: GDBAgent.C~
diff -ur ddd-3.2.93/ddd/GraphEdge.h ddd-3.2.93-1/ddd/GraphEdge.h
--- ddd-3.2.93/ddd/GraphEdge.h  Thu Aug 19 12:27:30 1999
+++ ddd-3.2.93-1/ddd/GraphEdge.h        Tue Jan  9 12:41:20 2001
@@ -40,6 +40,9 @@
 #include "TypeInfo.h"
 #include "assert.h"
 
+class GraphNode;
+class Graph;
+
 class GraphEdge {
 public:
     DECLARE_TYPE_INFO
Only in ddd-3.2.93-1/ddd: GraphEdge.h~
diff -ur ddd-3.2.93/ddd/GraphNodeI.h ddd-3.2.93-1/ddd/GraphNodeI.h
--- ddd-3.2.93/ddd/GraphNodeI.h Thu Aug 19 12:27:33 1999
+++ ddd-3.2.93-1/ddd/GraphNodeI.h       Tue Jan  9 12:37:40 2001
@@ -40,6 +40,9 @@
 #include "GraphGC.h"
 #include <strstream.h>
 
+class GraphEdge;
+class Graph;
+
 class GraphNode {
 public:
     DECLARE_TYPE_INFO
Only in ddd-3.2.93-1/ddd: GraphNodeI.h~
diff -ur ddd-3.2.93/ddd/HelpCB.C ddd-3.2.93-1/ddd/HelpCB.C
--- ddd-3.2.93/ddd/HelpCB.C     Mon Dec 11 12:21:47 2000
+++ ddd-3.2.93-1/ddd/HelpCB.C   Tue Jan  9 14:02:32 2001
@@ -1077,7 +1077,7 @@
                title.upcase();
 
            // Add title and position
-           titles += replicate(' ', indent * 2) + title;
+           titles += replicate(string(' '), indent * 2) + title;
            positions += source;
 
            // Strip `File: ' line
Only in ddd-3.2.93-1/ddd: HelpCB.C~
diff -ur ddd-3.2.93/ddd/SourceView.C ddd-3.2.93-1/ddd/SourceView.C
--- ddd-3.2.93/ddd/SourceView.C Mon Dec 11 12:21:47 2000
+++ ddd-3.2.93-1/ddd/SourceView.C       Tue Jan  9 14:16:57 2001
@@ -2361,7 +2361,7 @@
 
     String indented_text = XtMalloc(indented_text_length + 1);
 
-    string line_no_s = replicate(' ', indent);
+    string line_no_s = replicate(string(' '), indent);
 
     t = 0;
     char *pos_ptr = indented_text; // Writing position in indented_text
@@ -2890,7 +2890,7 @@
        int indent = indent_amount(code_text_w, pos);
        if (indent > 0)
        {
-           string spaces = replicate(' ', indent);
+           string spaces = replicate(string(' '), indent);
            XmTextReplace(code_text_w, pos, pos + indent, (String)spaces);
        }
     }
@@ -2933,7 +2933,7 @@
        int indent = indent_amount(code_text_w, pos);
        if (indent > 0)
        {
-           insert_string += replicate(' ', indent);
+           insert_string += replicate(string(' '), indent);
            insert_string = insert_string.before(indent);
 
            XmTextReplace(code_text_w, pos, pos + indent, 
@@ -6933,7 +6933,7 @@
 
     const int min_width = 40;
     if (int(line.length()) < min_width)
-       line += replicate(' ', min_width - line.length());
+       line += replicate(string(' '), min_width - line.length());
 }
 
 // Return current JDB frame; 0 if none
@@ -9301,7 +9301,7 @@
        string& line = code_list[i];
        untabify_if_needed(line);
        if (line.length() > 0 && line[0] == '0')
-           line = replicate(' ', indent_amount(code_text_w)) + line;
+           line = replicate(string(' '), indent_amount(code_text_w)) + line;
        indented_code += line + '\n';
     }
     delete[] code_list;
Only in ddd-3.2.93-1/ddd: SourceView.C~
diff -ur ddd-3.2.93/ddd/VSLLib.h ddd-3.2.93-1/ddd/VSLLib.h
--- ddd-3.2.93/ddd/VSLLib.h     Mon Dec 11 12:21:48 2000
+++ ddd-3.2.93-1/ddd/VSLLib.h   Tue Jan  9 12:24:28 2001
@@ -163,6 +163,7 @@
 const unsigned allOpts          = ((unsigned)-1) & ~loopMask;
 const unsigned stdOpt           = allOpts | 2;
 
+int VSLLib_parse(void);
 
 // The VSL library
 class VSLLib {
Only in ddd-3.2.93-1/ddd: VSLLib.h~
diff -ur ddd-3.2.93/ddd/annotation.C ddd-3.2.93-1/ddd/annotation.C
--- ddd-3.2.93/ddd/annotation.C Thu Aug 19 12:28:09 1999
+++ ddd-3.2.93-1/ddd/annotation.C       Tue Jan  9 12:44:42 2001
@@ -127,8 +127,8 @@
     {
        for (int p = 0; p < 2; p++)
        {
-           string open  = replicate("([{"[p], depth);
-           string close = replicate(")]}"[p], depth);
+           string open  = replicate(string("([{"[p]), depth);
+           string close = replicate(string(")]}"[p]), depth);
 
            if (_sub1(a, prefix + open + s1 + close, s2))
                return true;
Only in ddd-3.2.93-1/ddd: annotation.C~
diff -ur ddd-3.2.93/ddd/ddd.C ddd-3.2.93-1/ddd/ddd.C
--- ddd-3.2.93/ddd/ddd.C        Mon Dec 11 12:21:48 2000
+++ ddd-3.2.93-1/ddd/ddd.C      Tue Jan  9 12:28:35 2001
@@ -2102,18 +2102,23 @@
     }
 
     // Set up VSL resources
-    if (VSEFlags::parse_vsl(argc, (const char**)argv))
+    {
+      const char** argv_ = (const char**)argv;
+    if (VSEFlags::parse_vsl(argc, argv_))
     {
        // Show VSL usage...
        cout << VSEFlags::explain(true);
        return EXIT_FAILURE;
     }
-
+      argv = (char**)argv_;
+    }
     // All remaining args are passed to the inferior debugger.
     if (argc == 1 && app_data.open_selection)
     {
+      const char** argv_ = (const char**)argv;
        // No args given - try to get one from current selection
-       add_arg_from_selection(toplevel, argc, (const char**)argv);
+       add_arg_from_selection(toplevel, argc, argv_);
+      argv = (char**)argv_;
     }
 
     // Check the X configuration
@@ -5052,7 +5057,7 @@
     // the size of the status window to the length of the very first
     // message, so we give some huge string at the beginning.
     MString short_msg = rm("Hello, world!");
-    MString long_msg = short_msg + rm(replicate(' ', 90));
+    MString long_msg = short_msg + rm(replicate(string(' '), 90));
 
     arg = 0;
     XtSetArg(args[arg], XmNlabelString,      long_msg.xmstring()); arg++;
@@ -5720,7 +5725,7 @@
            const int TAB_WIDTH = 8;
            int column = promptPosition - startOfLine;
            int spaces = TAB_WIDTH - column % TAB_WIDTH;
-           string spacing = replicate(' ', spaces);
+           string spacing = replicate(string(' '), spaces);
        
            XmTextInsert(gdb_w, promptPosition, (String)spacing);
            promptPosition += spacing.length();
Only in ddd-3.2.93-1/ddd: ddd.C.new
Only in ddd-3.2.93-1/ddd: ddd.C~
diff -ur ddd-3.2.93/ddd/fonts.C ddd-3.2.93-1/ddd/fonts.C
--- ddd-3.2.93/ddd/fonts.C      Mon Dec 11 12:21:48 2000
+++ ddd-3.2.93-1/ddd/fonts.C    Tue Jan  9 12:53:30 2001
@@ -374,7 +374,7 @@
     if (title_seen)
        cout << "\n\n";
 
-    cout << s << "\n" << replicate("-", s.length()) << "\n\n";
+    cout << s << "\n" << replicate(string("-"), s.length()) << "\n\n";
 
     title_seen = true;
 }
Only in ddd-3.2.93-1/ddd: fonts.C~
Only in ddd-3.2.93-1/ddd: ii_files
diff -ur ddd-3.2.93/ddd/plotter.C ddd-3.2.93-1/ddd/plotter.C
--- ddd-3.2.93/ddd/plotter.C    Mon Dec 11 12:21:48 2000
+++ ddd-3.2.93-1/ddd/plotter.C  Tue Jan  9 12:56:54 2001
@@ -1467,7 +1467,7 @@
     }
 
     s = quote(s);
-    string nl = string("\\n\"\n") + replicate(' ', strlen(prefix)) + "\"";
+    string nl = string("\\n\"\n") + replicate(string(' '), strlen(prefix)) + 
"\"";
     s.gsub("\\n", nl);
 
     if (s_ends_with_nl)
Only in ddd-3.2.93-1/ddd: plotter.C~
diff -ur ddd-3.2.93/ddd/tabs.C ddd-3.2.93-1/ddd/tabs.C
--- ddd-3.2.93/ddd/tabs.C       Thu Aug 19 12:28:58 1999
+++ ddd-3.2.93-1/ddd/tabs.C     Tue Jan  9 12:34:34 2001
@@ -47,7 +47,7 @@
        if (s[i] == '\t')
        {
            int offset = pos - i;
-           s(i, 1) = replicate(' ', offset);
+           s(i, 1) = replicate(string(' '), offset);
            return;
        }
     }
Only in ddd-3.2.93-1/ddd: tabs.C~
diff -ur ddd-3.2.93/ddd/vsl.C ddd-3.2.93-1/ddd/vsl.C
--- ddd-3.2.93/ddd/vsl.C        Mon Dec 11 12:21:48 2000
+++ ddd-3.2.93-1/ddd/vsl.C      Tue Dec 12 17:36:19 2000
@@ -188,7 +188,11 @@
 int main(int argc, char *argv[])
 {
     // Set flags
-    VSEFlags::parse(argc, (const char**)argv, "vsllib");
+  {
+    const char** argv_ = (const char**)argv;
+    VSEFlags::parse(argc, argv_, "vsllib");
+    argv = (char**)argv_;
+  }
 
     // Init toolkit
     Widget toplevel = XtAppInitialize(&app_con, "Vsl", NULL, ZERO, 
Only in ddd-3.2.93-1/ddd: vsl.C.old



reply via email to

[Prev in Thread] Current Thread [Next in Thread]