Merge lp:~zorba-coders/zorba/markos-scratch into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11006
Merged at revision: 11166
Proposed branch: lp:~zorba-coders/zorba/markos-scratch
Merge into: lp:zorba
Diff against target: 117 lines (+29/-12)
3 files modified
src/types/root_typemanager.cpp (+14/-3)
src/types/typeimpl.cpp (+9/-6)
src/types/typeimpl.h (+6/-3)
To merge this branch: bzr merge lp:~zorba-coders/zorba/markos-scratch
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+142307@code.launchpad.net

Commit message

Description of the change

To post a comment you must log in.
Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job markos-scratch-2013-01-08T13-03-49.859Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/types/root_typemanager.cpp'
2--- src/types/root_typemanager.cpp 2012-12-18 15:57:51 +0000
3+++ src/types/root_typemanager.cpp 2013-01-08 13:00:33 +0000
4@@ -384,17 +384,20 @@
5 XS_NMTOKENS_TYPE = new UserDefinedXQType(this,
6 XS_NMTOKENS_QNAME,
7 NULL,
8- NMTOKEN_TYPE_ONE.getp());
9+ NMTOKEN_TYPE_ONE.getp(),
10+ true);
11
12 XS_ENTITIES_TYPE = new UserDefinedXQType(this,
13 XS_ENTITIES_QNAME,
14 NULL,
15- ENTITY_TYPE_ONE.getp());
16+ ENTITY_TYPE_ONE.getp(),
17+ true);
18
19 XS_IDREFS_TYPE = new UserDefinedXQType(this,
20 XS_IDREFS_QNAME,
21 NULL,
22- IDREF_TYPE_ONE.getp());
23+ IDREF_TYPE_ONE.getp(),
24+ true);
25
26 STRUCTURED_ITEM_TYPE_ONE =
27 new StructuredItemXQType(this, TypeConstants::QUANT_ONE, true);
28@@ -577,6 +580,14 @@
29 DELETE_TYPE(ANY_NODE)
30 DELETE_TYPE(STRUCTURED_ITEM)
31
32+ // These must be deallocated first because they may reference other types
33+ delete XS_NMTOKENS_TYPE.getp();
34+ XS_NMTOKENS_TYPE.setNull();
35+ delete XS_ENTITIES_TYPE.getp();
36+ XS_ENTITIES_TYPE.setNull();
37+ delete XS_IDREFS_TYPE.getp();
38+ XS_IDREFS_TYPE.setNull();
39+
40 #ifdef ZORBA_WITH_JSON
41 DELETE_TYPE(JS_NULL)
42
43
44=== modified file 'src/types/typeimpl.cpp'
45--- src/types/typeimpl.cpp 2013-01-08 11:07:41 +0000
46+++ src/types/typeimpl.cpp 2013-01-08 13:00:33 +0000
47@@ -1113,9 +1113,10 @@
48 const xqtref_t& baseType,
49 TypeConstants::quantifier_t quantifier,
50 type_category_t typeCategory,
51- content_kind_t contentKind)
52+ content_kind_t contentKind,
53+ bool builtin)
54 :
55- XQType(manager, USER_DEFINED_KIND, quantifier, false),
56+ XQType(manager, USER_DEFINED_KIND, quantifier, builtin),
57 m_qname(qname),
58 m_baseType(baseType),
59 m_typeCategory(typeCategory),
60@@ -1139,9 +1140,10 @@
61 const TypeManager* manager,
62 store::Item_t qname,
63 const xqtref_t& baseType,
64- const XQType* listItemType)
65+ const XQType* listItemType,
66+ bool builtin)
67 :
68- XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, false),
69+ XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, builtin),
70 m_qname(qname),
71 m_baseType(baseType),
72 m_typeCategory(LIST_TYPE),
73@@ -1160,9 +1162,10 @@
74 store::Item_t qname,
75 const xqtref_t& baseType,
76 TypeConstants::quantifier_t quantifier,
77- const std::vector<xqtref_t>& unionItemTypes)
78+ const std::vector<xqtref_t>& unionItemTypes,
79+ bool builtin)
80 :
81- XQType(manager, USER_DEFINED_KIND, quantifier, false),
82+ XQType(manager, USER_DEFINED_KIND, quantifier, builtin),
83 m_qname(qname),
84 m_baseType(baseType),
85 m_typeCategory(UNION_TYPE),
86
87=== modified file 'src/types/typeimpl.h'
88--- src/types/typeimpl.h 2012-12-28 10:24:59 +0000
89+++ src/types/typeimpl.h 2013-01-08 13:00:33 +0000
90@@ -739,14 +739,16 @@
91 const xqtref_t& baseType,
92 TypeConstants::quantifier_t quantifier,
93 type_category_t typeCategory,
94- content_kind_t contentKind);
95+ content_kind_t contentKind,
96+ bool builtin = false);
97
98 // Constructor for List types
99 UserDefinedXQType(
100 const TypeManager* manager,
101 store::Item_t qname,
102 const xqtref_t& baseType,
103- const XQType* listItemType);
104+ const XQType* listItemType,
105+ bool builtin = false);
106
107 // Constructor for Union types
108 UserDefinedXQType(
109@@ -754,7 +756,8 @@
110 store::Item_t qname,
111 const xqtref_t& baseType,
112 TypeConstants::quantifier_t quantifier,
113- const std::vector<xqtref_t>& unionItemTypes);
114+ const std::vector<xqtref_t>& unionItemTypes,
115+ bool builtin = false);
116
117 virtual ~UserDefinedXQType() {}
118

Subscribers

People subscribed via source and target branches