Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
2a2d82fd
Commit
2a2d82fd
authored
Nov 30, 2014
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 32-bit build.
parent
fd669b11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
10 deletions
+37
-10
schema-loader.c++
c++/src/capnp/schema-loader.c++
+0
-0
schema.c++
c++/src/capnp/schema.c++
+8
-5
schema.h
c++/src/capnp/schema.h
+27
-3
common.c++
c++/src/kj/common.c++
+2
-2
No files found.
c++/src/capnp/schema-loader.c++
View file @
2a2d82fd
This diff is collapsed.
Click to expand it.
c++/src/capnp/schema.c++
View file @
2a2d82fd
...
@@ -402,21 +402,24 @@ Type Schema::BrandArgumentList::operator[](uint index) const {
...
@@ -402,21 +402,24 @@ Type Schema::BrandArgumentList::operator[](uint index) const {
}
}
auto
&
binding
=
bindings
[
index
];
auto
&
binding
=
bindings
[
index
];
Type
result
;
if
(
binding
.
which
==
(
uint
)
schema
::
Type
::
ANY_POINTER
)
{
if
(
binding
.
which
==
(
uint
)
schema
::
Type
::
ANY_POINTER
)
{
if
(
binding
.
scopeId
!=
0
)
{
if
(
binding
.
scopeId
!=
0
)
{
re
turn
Type
::
BrandParameter
{
binding
.
scopeId
,
binding
.
paramIndex
};
re
sult
=
Type
::
BrandParameter
{
binding
.
scopeId
,
binding
.
paramIndex
};
}
else
if
(
binding
.
isImplicitParameter
)
{
}
else
if
(
binding
.
isImplicitParameter
)
{
re
turn
Type
::
ImplicitParameter
{
binding
.
paramIndex
};
re
sult
=
Type
::
ImplicitParameter
{
binding
.
paramIndex
};
}
else
{
}
else
{
re
turn
Type
(
schema
::
Type
::
ANY_POINTER
,
binding
.
listDepth
,
nullptr
)
;
re
sult
=
schema
::
Type
::
ANY_POINTER
;
}
}
}
else
if
(
binding
.
schema
==
nullptr
)
{
}
else
if
(
binding
.
schema
==
nullptr
)
{
// Builtin / primitive type.
// Builtin / primitive type.
re
turn
Type
(
static_cast
<
schema
::
Type
::
Which
>
(
binding
.
which
),
binding
.
listDepth
,
nullptr
);
re
sult
=
static_cast
<
schema
::
Type
::
Which
>
(
binding
.
which
);
}
else
{
}
else
{
binding
.
schema
->
ensureInitialized
();
binding
.
schema
->
ensureInitialized
();
re
turn
Type
(
static_cast
<
schema
::
Type
::
Which
>
(
binding
.
which
),
binding
.
listDepth
,
binding
.
schema
);
re
sult
=
Type
(
static_cast
<
schema
::
Type
::
Which
>
(
binding
.
which
)
,
binding
.
schema
);
}
}
return
result
.
wrapInList
(
binding
.
listDepth
);
}
}
// =======================================================================================
// =======================================================================================
...
...
c++/src/capnp/schema.h
View file @
2a2d82fd
...
@@ -633,6 +633,12 @@ public:
...
@@ -633,6 +633,12 @@ public:
bool
operator
==
(
const
Type
&
other
)
const
;
bool
operator
==
(
const
Type
&
other
)
const
;
inline
bool
operator
!=
(
const
Type
&
other
)
const
{
return
!
(
*
this
==
other
);
}
inline
bool
operator
!=
(
const
Type
&
other
)
const
{
return
!
(
*
this
==
other
);
}
inline
Type
wrapInList
(
uint
depth
=
1
)
const
;
// Return the Type formed by wrapping this type in List() `depth` times.
inline
Type
(
schema
::
Type
::
Which
derived
,
const
_
::
RawBrandedSchema
*
schema
);
// For internal use.
private
:
private
:
schema
::
Type
::
Which
baseType
;
// type not including applications of List()
schema
::
Type
::
Which
baseType
;
// type not including applications of List()
uint8_t
listDepth
;
// 0 for T, 1 for List(T), 2 for List(List(T)), ...
uint8_t
listDepth
;
// 0 for T, 1 for List(T), 2 for List(List(T)), ...
...
@@ -652,11 +658,12 @@ private:
...
@@ -652,11 +658,12 @@ private:
};
};
Type
(
schema
::
Type
::
Which
baseType
,
uint8_t
listDepth
,
const
_
::
RawBrandedSchema
*
schema
)
Type
(
schema
::
Type
::
Which
baseType
,
uint8_t
listDepth
,
const
_
::
RawBrandedSchema
*
schema
)
:
baseType
(
baseType
),
listDepth
(
listDepth
),
schema
(
schema
)
{}
:
baseType
(
baseType
),
listDepth
(
listDepth
),
schema
(
schema
)
{
KJ_IREQUIRE
(
baseType
!=
schema
::
Type
::
ANY_POINTER
);
}
void
requireUsableAs
(
Type
expected
)
const
;
void
requireUsableAs
(
Type
expected
)
const
;
friend
class
Schema
;
friend
class
ListSchema
;
friend
class
ListSchema
;
};
};
...
@@ -826,11 +833,22 @@ struct ListSchema::FromImpl<List<T>> {
...
@@ -826,11 +833,22 @@ struct ListSchema::FromImpl<List<T>> {
inline
Type
::
Type
()
:
baseType
(
schema
::
Type
::
VOID
),
listDepth
(
0
),
schema
(
nullptr
)
{}
inline
Type
::
Type
()
:
baseType
(
schema
::
Type
::
VOID
),
listDepth
(
0
),
schema
(
nullptr
)
{}
inline
Type
::
Type
(
schema
::
Type
::
Which
primitive
)
inline
Type
::
Type
(
schema
::
Type
::
Which
primitive
)
:
baseType
(
primitive
),
listDepth
(
0
),
isImplicitParam
(
false
)
,
scopeId
(
0
)
{
:
baseType
(
primitive
),
listDepth
(
0
),
isImplicitParam
(
false
)
{
KJ_IREQUIRE
(
primitive
!=
schema
::
Type
::
STRUCT
&&
KJ_IREQUIRE
(
primitive
!=
schema
::
Type
::
STRUCT
&&
primitive
!=
schema
::
Type
::
ENUM
&&
primitive
!=
schema
::
Type
::
ENUM
&&
primitive
!=
schema
::
Type
::
INTERFACE
&&
primitive
!=
schema
::
Type
::
INTERFACE
&&
primitive
!=
schema
::
Type
::
LIST
);
primitive
!=
schema
::
Type
::
LIST
);
if
(
primitive
==
schema
::
Type
::
ANY_POINTER
)
{
scopeId
=
0
;
}
else
{
schema
=
nullptr
;
}
}
inline
Type
::
Type
(
schema
::
Type
::
Which
derived
,
const
_
::
RawBrandedSchema
*
schema
)
:
baseType
(
derived
),
listDepth
(
0
),
isImplicitParam
(
false
),
schema
(
schema
)
{
KJ_IREQUIRE
(
derived
==
schema
::
Type
::
STRUCT
||
derived
==
schema
::
Type
::
ENUM
||
derived
==
schema
::
Type
::
INTERFACE
);
}
}
inline
Type
::
Type
(
StructSchema
schema
)
inline
Type
::
Type
(
StructSchema
schema
)
...
@@ -879,6 +897,12 @@ inline bool Type::isAnyPointer() const {
...
@@ -879,6 +897,12 @@ inline bool Type::isAnyPointer() const {
return
baseType
==
schema
::
Type
::
ANY_POINTER
&&
listDepth
==
0
;
return
baseType
==
schema
::
Type
::
ANY_POINTER
&&
listDepth
==
0
;
}
}
inline
Type
Type
::
wrapInList
(
uint
depth
)
const
{
Type
result
=
*
this
;
result
.
listDepth
+=
depth
;
return
result
;
}
}
// namespace capnp
}
// namespace capnp
#endif // CAPNP_SCHEMA_H_
#endif // CAPNP_SCHEMA_H_
c++/src/kj/common.c++
View file @
2a2d82fd
...
@@ -32,10 +32,10 @@ namespace _ { // private
...
@@ -32,10 +32,10 @@ namespace _ { // private
void
inlineRequireFailure
(
const
char
*
file
,
int
line
,
const
char
*
expectation
,
void
inlineRequireFailure
(
const
char
*
file
,
int
line
,
const
char
*
expectation
,
const
char
*
macroArgs
,
const
char
*
message
)
{
const
char
*
macroArgs
,
const
char
*
message
)
{
if
(
message
==
nullptr
)
{
if
(
message
==
nullptr
)
{
Debug
::
Fault
f
(
file
,
line
,
0
,
expectation
,
macroArgs
);
Debug
::
Fault
f
(
file
,
line
,
kj
::
Exception
::
Type
::
FAILED
,
expectation
,
macroArgs
);
f
.
fatal
();
f
.
fatal
();
}
else
{
}
else
{
Debug
::
Fault
f
(
file
,
line
,
0
,
expectation
,
macroArgs
,
message
);
Debug
::
Fault
f
(
file
,
line
,
kj
::
Exception
::
Type
::
FAILED
,
expectation
,
macroArgs
,
message
);
f
.
fatal
();
f
.
fatal
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment