Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
c35ac078
Commit
c35ac078
authored
Jun 10, 2015
by
Joshua Haberman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #477 from haberman/upbupdate
Updated upb to latest version (C89).
parents
686db5c3
e3ce451b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
13 deletions
+8
-13
defs.c
ruby/ext/google/protobuf_c/defs.c
+6
-9
extconf.rb
ruby/ext/google/protobuf_c/extconf.rb
+1
-3
map.c
ruby/ext/google/protobuf_c/map.c
+1
-1
upb.c
ruby/ext/google/protobuf_c/upb.c
+0
-0
upb.h
ruby/ext/google/protobuf_c/upb.h
+0
-0
No files found.
ruby/ext/google/protobuf_c/defs.c
View file @
c35ac078
...
...
@@ -546,11 +546,9 @@ upb_fieldtype_t ruby_to_fieldtype(VALUE type) {
rb_raise
(
rb_eArgError
,
"Expected symbol for field type."
);
}
upb_fieldtype_t
upb_type
=
-
1
;
#define CONVERT(upb, ruby) \
if (SYM2ID(type) == rb_intern( # ruby )) { \
upb_type = UPB_TYPE_ ## upb;
\
return UPB_TYPE_ ## upb;
\
}
CONVERT
(
FLOAT
,
float
);
...
...
@@ -567,11 +565,8 @@ upb_fieldtype_t ruby_to_fieldtype(VALUE type) {
#undef CONVERT
if
(
upb_type
==
-
1
)
{
rb_raise
(
rb_eArgError
,
"Unknown field type."
);
}
return
upb_type
;
rb_raise
(
rb_eArgError
,
"Unknown field type."
);
return
0
;
}
VALUE
fieldtype_to_ruby
(
upb_fieldtype_t
type
)
{
...
...
@@ -666,10 +661,12 @@ VALUE FieldDescriptor_label_set(VALUE _self, VALUE label) {
}
upb_label_t
upb_label
=
-
1
;
bool
converted
=
false
;
#define CONVERT(upb, ruby) \
if (SYM2ID(label) == rb_intern( # ruby )) { \
upb_label = UPB_LABEL_ ## upb; \
converted = true; \
}
CONVERT
(
OPTIONAL
,
optional
);
...
...
@@ -678,7 +675,7 @@ VALUE FieldDescriptor_label_set(VALUE _self, VALUE label) {
#undef CONVERT
if
(
upb_label
==
-
1
)
{
if
(
!
converted
)
{
rb_raise
(
rb_eArgError
,
"Unknown field label."
);
}
...
...
ruby/ext/google/protobuf_c/extconf.rb
View file @
c35ac078
...
...
@@ -2,9 +2,7 @@
require
'mkmf'
$CFLAGS
+=
" -O3 -std=c99 -Wno-unused-function "
+
"-Wno-declaration-after-statement -Wno-unused-variable "
+
"-Wno-sign-compare -DNDEBUG "
$CFLAGS
+=
" -std=c99 -O3 -DNDEBUG"
$objs
=
[
"protobuf.o"
,
"defs.o"
,
"storage.o"
,
"message.o"
,
"repeated_field.o"
,
"map.o"
,
"encode_decode.o"
,
"upb.o"
]
...
...
ruby/ext/google/protobuf_c/map.c
View file @
c35ac078
...
...
@@ -120,7 +120,7 @@ static VALUE table_key_to_ruby(Map* self, const char* buf, size_t length) {
}
static
void
*
value_memory
(
upb_value
*
v
)
{
return
(
void
*
)(
&
v
->
val
.
uint64
);
return
(
void
*
)(
&
v
->
val
);
}
// -----------------------------------------------------------------------------
...
...
ruby/ext/google/protobuf_c/upb.c
View file @
c35ac078
This diff is collapsed.
Click to expand it.
ruby/ext/google/protobuf_c/upb.h
View file @
c35ac078
This diff is collapsed.
Click to expand it.
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