1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
Author: Andreas Tille <tille@debian.org>
Last-Update: 2026-01-06
Description: These patches are needed to build successfully when
configuring with --with-corba option as recommended in
upstream README (which was obviously not really tested
by upstream.
--- a/src/GenerateCodeJava.cpp
+++ b/src/GenerateCodeJava.cpp
@@ -201,7 +201,7 @@ GenerateCodeJava::writeFunction1 (const
Visibility &) {
#ifdef ENABLE_CORBA
if (getCorba ()) {
- if (ope.getVisibility () != '0') {
+ if ((char)ope.getVisibility () != '0') {
std::cerr << "CORBAValue " << ope.getName ()
<< ": must be public.\n";
}
@@ -369,7 +369,7 @@ GenerateCodeJava::writeClassStart1 (cons
if (!node.getTemplates ().empty ()) {
#ifdef ENABLE_CORBA
if (isCorba) {
- std::cerr << "CORBAValue " << name << ": template ignored.\n";
+ std::cerr << "CORBAValue " << node.getName() << ": template ignored.\n";
} else
#endif
{
--- a/src/GenerateCodeCpp.cpp
+++ b/src/GenerateCodeCpp.cpp
@@ -226,7 +226,7 @@ GenerateCodeCpp::writeFunction (const um
#ifdef ENABLE_CORBA
if (getCorba ()) {
- if (ope.getVisibility () != '0') {
+ if ((char)ope.getVisibility () != '0') {
std::cerr << "CORBAValue " << ope.getName ()
<< ": must be public.\n";
}
@@ -303,7 +303,7 @@ GenerateCodeCpp::writeClassStart (const
if (!node.getTemplates ().empty ()) {
#ifdef ENABLE_CORBA
if (isCorba) {
- std::cerr << "CORBAValue " << name << ": template ignored.\n";
+ std::cerr << "CORBAValue " << node.getName() << ": template ignored.\n";
} else
#endif
{
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
bin_PROGRAMS = dia2code
dia2code_CPPFLAGS = @XML_CFLAGS@
-dia2code_CXXFLAGS = @XML_CFLAGS@ -std=c++11 -Wall -Wextra -Wpacked -Wmissing-format-attribute -fstrict-aliasing -Wstrict-aliasing=3 -Wuninitialized -Wfloat-equal -Wno-comment -Wswitch-enum -Wswitch-default -Wshadow -Wpedantic -Wformat=2 -Wformat-nonliteral -Wformat-security -Winit-self -fstrict-overflow -Wstrict-overflow=5 -Wconversion -Wold-style-cast -Wno-overloaded-virtual -Wwrite-strings -Wcast-qual -Wcast-align -Wredundant-decls -Wlogical-op -Wpointer-arith -g3 -ggdb3 -O0 -pipe -fno-omit-frame-pointer -ftrapv -Wzero-as-null-pointer-constant -ftest-coverage -fprofile-arcs
+dia2code_CXXFLAGS = @XML_CFLAGS@ -std=c++11 -Wall -Wextra -Wpacked -Wmissing-format-attribute -fstrict-aliasing -Wstrict-aliasing=3 -Wuninitialized -Wfloat-equal -Wno-comment -Wswitch-enum -Wswitch-default -Wshadow -Wpedantic -Wformat=2 -Wformat-nonliteral -Wformat-security -Winit-self -fstrict-overflow -Wstrict-overflow=5 -Wconversion -Wno-overloaded-virtual -Wwrite-strings -Wcast-qual -Wcast-align -Wredundant-decls -Wlogical-op -Wpointer-arith -g3 -ggdb3 -O0 -pipe -fno-omit-frame-pointer -ftrapv -Wzero-as-null-pointer-constant -ftest-coverage -fprofile-arcs
dia2code_LDADD = @XML_LIBS@
dia2code_SOURCES = DiaGram.cpp \
GenerateCode.cpp \
--- a/src/DiaGram.cpp
+++ b/src/DiaGram.cpp
@@ -293,7 +293,7 @@ DiaGram::push (umlClassNode * node) {
}
#ifdef ENABLE_CORBA
- if (node->getStereotype ().compare (0, 5, "CORBA") == 0) {
+ if (node->isStereotypeCorba()) {
usecorba = true;
}
#endif
--- a/src/GenerateCode.cpp
+++ b/src/GenerateCode.cpp
@@ -317,17 +317,11 @@ GenerateCode::passByReference (umlClass
#ifdef ENABLE_CORBA
static bool
isOoClass (umlClass &cl) {
- const char *st;
- st = cl.getStereotype ().c_str ();
- if (strlen (st) == 0) {
- return true;
- }
- return (!isConstStereo (st) &&
- !isTypedefStereo (st) &&
- !isEnumStereo (st) &&
- !isStructStereo (st) &&
- !eq (st, "CORBAUnion") &&
- !eq (st, "CORBAException"));
+ return (!cl.isStereotypeConst () &&
+ !cl.isStereotypeTypedef () &&
+ !cl.isStereotypeEnum () &&
+ !cl.isStereotypeStruct () &&
+ !cl.isStereotypeCorba ());
}
#endif
@@ -447,12 +441,12 @@ GenerateCode::genClass (const umlClassNo
for (const umlAttribute & umla : node.getAttributes ()) {
const char *member = umla.getName ().c_str ();
umlClassNode *ref;
- if (umla.getVisibility () != '0') {
+ if ((char)umla.getVisibility () != '0') {
continue;
}
if (umla.isStatic ()) {
std::cerr << "CORBAValue " << name << "/" << member
- << ": static not supported.\n",
+ << ": static not supported.\n";
}
ref = findByName (dia.getUml (), umla.getType ().c_str ());
if (ref != NULL) {
@@ -670,7 +664,7 @@ GenerateCode::genDecl (declaration &d,
#endif
#ifdef ENABLE_CORBA
- if (eq (stype, "CORBANative")) {
+ if (node->isStereotypeCorba()) {
writeComment (std::string ("CORBANative: ") +
node->getName () +
std::string ("\n"));
@@ -696,13 +690,13 @@ GenerateCode::genDecl (declaration &d,
writeStruct (*node);
}
#ifdef ENABLE_CORBA
- else if (eq (stype, "CORBAException")) {
+ else if (node->isStereotypeCorba()) {
std::cerr << name << ": CORBAException not yet implemented.\n";
}
- else if (eq (stype, "CORBAUnion")) {
+ else if (node->isStereotypeCorba()) {
if (umla == node->getAttributes ().end ()) {
- throw std::string ("Attributes not set at union " + name + "\n");
+ throw std::string (std::string("Attributes not set at union ") + name + "\n");
}
std::cerr << name << ": CORBAUnion not yet fully implemented.\n";
if (bOpenBraceOnNewline) {
@@ -719,7 +713,7 @@ GenerateCode::genDecl (declaration &d,
getFile () << spc () << (*umla).getType () << " _d();\n\n";
++umla;
while (umla != node->getAttributes ().end ()) {
- (*umla).check (name);
+ (*umla).check (*node);
getFile () << spc () << cppName ((*umla).getType ()) << " "
<< (*umla).getName () << " ();\n";
getFile () << spc () << "void " << (*umla).getName () << " ("
--- a/src/GenerateCode.hpp
+++ b/src/GenerateCode.hpp
@@ -32,7 +32,7 @@ along with this program. If not, see <h
* Abstract base class for code generators.
*/
class GenerateCode {
- private:
+ protected:
DiaGram & dia; ///< Diagram to generate into code
std::string license; ///< License file
@@ -114,7 +114,7 @@ class GenerateCode {
void genClass (const umlClassNode & node);
- static const char * cppName (std::string name);
+ const char * cppName (std::string name);
const char * fqname (const umlClassNode & node,
bool use_ref_type) const;
--- a/src/umlClass.cpp
+++ b/src/umlClass.cpp
@@ -204,7 +204,7 @@ umlClass::isTypedefStereo (std::string &
#ifdef ENABLE_CORBA
bool
umlClass::isCorbaStereo (std::string & stereo) {
- return (!stereo.compare (0, 5, "CORBA");
+ return (!stereo.compare (0, 5, "CORBA"));
}
#endif
|