Commit Graph

6213 Commits

Author SHA1 Message Date
Adam Cozzette
5e37bbf924 Removed unnecessary includes from stubs/common.h 2018-10-15 20:39:44 -07:00
Yilun Chong
5b8a023610 fix 2018-10-15 17:25:02 -07:00
Joshua Haberman
c7352b39f8
Merge pull request #5198 from hesmar/hemsar/cmakeFixProtobufGenerate
Revert "protobuf_generate(): add relative path to output dir"
2018-10-15 13:55:00 -07:00
Yilun Chong
dc81f795c7
Merge pull request #5247 from slovdahl/5139-fix-redundant-cast-java-warning
Remove unnecessary cast to Builder in generated Java code
2018-10-15 12:05:41 -07:00
Sarah Zakarias
969397b719 Add Dart example. 2018-10-15 09:30:34 +02:00
Yilun Chong
ec11d29076 fix function names 2018-10-12 18:17:23 -07:00
Paul Yang
d2d4b403b5
Sync upb for unknown fix (#5240) 2018-10-12 13:46:26 -07:00
Paul Yang
39df66e1f7
Add ruby2.3,2.4.2.5 test on Mac and disable ruby2.1,2.2 test on Linux (#5250) 2018-10-12 12:36:33 -07:00
Adam Cozzette
ebd38c6d9a
Merge pull request #5227 from lopsided98/libatomic-fix
Link to libatomic when necessary (eg. on armv6l)
2018-10-11 16:16:58 -07:00
Sebastian Lövdahl
06bb8e7647 Remove unnecessary cast in generated Java code 2018-10-11 13:11:25 +03:00
Adam Cozzette
2009d45344
Merge pull request #5244 from KennethL/patch-1
Update third_party.md regarding Erlang
2018-10-10 10:12:10 -07:00
Kenneth Lundin
6d2b3c43bf
Update third_party.md regarding Erlang
Removing links to Erlang projects which are no longer maintained.
2018-10-10 16:33:24 +02:00
Adam Cozzette
154b39c23e
Merge pull request #5214 from elharo/parent
remove obsolete parent
2018-10-08 13:41:51 -07:00
Ben Wolsieffer
56b40a8f05 Link to libatomic when necessary (eg. on armv6l) 2018-10-08 16:27:17 -04:00
Paul Yang
a0da84bff4
Fix broken ruby test (#5235)
* Replace assert_true/assert_false with assert, because they are not provided in newer version of test/unit

* Use rescue to handle exception subclass

* Commented out the require that caused gc_test failure.

* Commented out test

* Fix typo
2018-10-08 13:16:56 -07:00
Benjamin Krämer
80e530dabf Ported FieldMaskUtil from Java to C# (#5045)
* Ported FieldMaskUtil from Java to C#

* Merged FieldMaskUtil into FieldMaskPartial

- Removed FieldMaskUtil
- Moved FieldMaskTree to root
- Updated tests

* Improved tests

- Removed internal method FieldMaskTree.GetFieldPaths
- Proof FieldMask.Paths only contains expected values

* Added FieldMaskTreeTest to Makefile

* Added FieldMaskTree to Makefile
2018-10-08 12:54:05 -07:00
michaelbausor
6a51c03823 PHP: Add support for primitive types in setters (#5126)
* Add support for primitive types in setters

* Update to address PR feedback

* Add tests and fixes for repeated fields

* Remove repeated field code, add getters

* Cleanup, test getters and oneofs

* Move boxing logic into separate class

* Add tests for wrapper type constructor args

* Update to add new setXXXValue methods

* Fix tests for invalid values

* Fix c extension for wrapper accessors

* Fix the bug that well known types didn't call Message_construct

* Address PR comments

* Refactoring init message with array logic

* Add include path to protoc

* Add missing TSRM_LS defintion

* Fix TSRM_LS

* Fix dist check
2018-10-07 16:56:41 -07:00
Leon Barrett
9e69594adf Fix parsing empty Struct Values from Json (#5211)
* Fix parsing empty Struct Values from Json

This fixes a bug. When parsing a struct from JSON like
    struct = json_format.Parse('{"k": {}}', Struct())
then the struct's "k" value would end up not initialized, and accessing
the value would raise an error.
    In[1]: struct['k']
    ValueError: Value not set
That seems to be because the Struct field of the Value was not set.
    In[2]: struct
    Out[2]:
    fields {
      key: "k"
      value {
      }
    }

This commit makes sure that the Value's Struct field is initialized even
if the Struct has no values itself.

This commit also extends a test to cover this case.

* Additionally test for empty list
2018-10-05 16:38:16 -07:00
Josh Kelley
8d6f8df1ec ParseFromString returns bytes parsed (#5166)
* ParseFromString returns bytes parsed

ParseFromString is documented as returning the number of bytes parsed,
and the C++ implementation does this, so the Python implementation
should too.

See #5165.

* Fix docstring

* Add a test for ParseFromString length behavior
2018-10-05 11:07:55 -07:00
Sydney Acksman
3f826a6dbf Add method for Any.Is (#5207) 2018-10-05 11:06:58 -07:00
Sydney Acksman
2b0a18b270 Add C# compiler option to add System.SerializableAttribute to generated message classes (#5208) 2018-10-05 11:06:02 -07:00
Kevin James
f50a1f843e fix(python): fix deprecated collections.abc usage (#5195)
Many classes within collections were moved to collections.abc in Python
3.3 -- their usage as imported directly from collections is now
deprecated as of Python 3.7 and will be removed soon.

The fallback import added in this PR can be removed entirely when
support for versions of Python prior to 3.3 is dropped.
2018-10-04 16:06:53 -07:00
Paul Yang
011f67035c
Fix broken tests by #4816 (#5221)
* Fix dist check for ruby

* Fix dist check
2018-10-04 10:29:21 -07:00
Adam Cozzette
b20bc69625
Merge pull request #5218 from cliffburdick/master
Fixed unsigned warning
2018-10-04 10:13:54 -07:00
cburdick
ad47ec5060 Used C++ style casts 2018-10-03 20:11:45 +00:00
Adam Cozzette
c27d6a5646
Merge pull request #5212 from GregTho/win32close
Use ::_close rather than ::close in Win32 stubs.
2018-10-02 15:43:17 -07:00
Cliff Burdick
ccacd40c32 Fixed unsigned warning 2018-10-02 21:00:25 +00:00
Thomas Van Lenten
8c1748f1cd Add tests to confirm strings/bytes are copied. 2018-10-02 13:45:18 -04:00
Thomas Van Lenten
09c001e999 Copy the value when setting message/data fields.
Follow ObjC conventions and how the generated header labels things by
copying NSStrings/NSData fields when setting them.
2018-10-02 13:45:18 -04:00
Thomas Van Lenten
97d03abb85 Turn off ALWAYS_SEARCH_USER_PATHS.
Causes a warning in newer Xcodes.
2018-10-02 13:45:18 -04:00
Thomas Van Lenten
561413523f Remove stray 'return'. 2018-10-02 13:45:18 -04:00
Elliotte Harold
feea49b5b5 remove obsolete parent 2018-10-02 07:11:47 -04:00
GregTho
703f11123a
Use ::_close rather than ::close in Win32 stubs.
The former is the proper converse of _open, which is used in
::google::protobuf::internal::win32::open. This resolves issue #5209.
2018-10-02 12:16:14 +02:00
Adam Cozzette
4265a1d36c
Merge pull request #5210 from jstandish/patch-1
Added VSCode extension link
2018-10-01 13:52:45 -07:00
John Standish
bac4c8ec56
Update third_party.md
Added link to VSCode-Proto3 extension in Other Utilities section
2018-10-01 12:41:19 -07:00
Nazarbek Altybay
887f5e5f39 Fixed typo (#5206) 2018-09-30 20:59:54 -07:00
Markus Heß
1509e8e3b3 Revert "protobuf_generate(): add relative path to output dir"
This reverts commit 93f6b67eb2.

Protoc adds already the relative path to the output directory.
Therefore, we have to remove this again from the output directory
to prevent adding it twice.
2018-09-28 11:00:55 +02:00
Joshua Haberman
19ef4ab1c2
Merge pull request #4816 from hrsht/hrsht/zanker-proto2
Basic Proto2 support for Ruby gem
2018-09-27 15:23:10 -07:00
Harshit Chopra
d0535cc09e Adds support for proto2 syntax for Ruby gem.
This change only adds basic proto2 support without advanced features
like extensions, custom options, maps, etc.

The protoc binary now generates ruby code for proto2 syntax.
However, for now, it is restricted to proto2 files without advanced features
like extensions, in which case it still errors out.

This change also modifies the DSL to add proto messages to the DescriptorPool.
There is a new DSL Builder#add_file to create a new FileDescriptor. With this,
the generated ruby DSL looks something like:

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_file "test.proto" do
    add_message "foo" do
      optional :val, :int32, 1
    end
  end
end
2018-09-27 14:21:16 -04:00
Yilun Chong
dfa53e2fa2 fix comment out 2018-09-26 10:39:13 -07:00
Yilun Chong
cee0447fd9 Add node and php to benchmark dashboard 2018-09-25 16:05:16 -07:00
Adam Cozzette
4426cb5733
Merge pull request #5172 from shields/smear-comments
Smear comments
2018-09-24 13:52:52 -07:00
Sydney Acksman
54176b26a9 C# Proto2 feature : Field presence and default values (#4642)
* Compiler changes

* Generated code changes

* Library changes

* Compiler style changes

* Generated style changes

* Fix Windows build errors

* Implement changes from review

* Reintroduce proto2 check

* Compiler changes (required handling review)

* Generated code changes (required handling review)

* Library changes (required handling review

* Field presence rewrite (compiler changes)

* Field presence rewrite (generated code changes)

* Compiler comment

* IFieldAccessor.HasValue library implementation

* Remove Clear methods and default values from proto3 code (Compiler)

* Remove Clear methods and default values from proto3 code (Generated)

* Remove Clear methods and default values from proto3 code (Library)

* Fix distcheck error

* Rewrite default string values to use base64 and convert

* Library changes (IMessage2)

* Compiler changes (IMessage2)

* Generated changes (IMessage2)

* Rebased and regenerated

* Compiler changes (initialized extension)

* Generated changes (initialized extension)

* Library changes (initialized extension)

* Refactor MessageExtensions.IsRequired

* Move string default value creator and bytes default value creator back to seperate methods

* Dead code cleanup

* Fixed segmentation fault
Removed unused header method declarations
2018-09-24 13:42:24 -07:00
Feng Xiao
fb0a74b660
Merge pull request #5180 from mit-mit/patch-1
Dart build status
2018-09-24 10:51:52 -07:00
Yilun Chong
f1bea7a40f
Merge pull request #5182 from BSBandme/test_benchmark
fix java build by changing mvn to online
2018-09-23 22:52:56 -07:00
Yilun Chong
2b7ee3873e fix java build by changing mvn to online 2018-09-23 17:07:02 -07:00
Paul Yang
9bda1f19bf
Adopt upb change for timestamp and duration json to php (#5106)
* Adopt upb change for timestamp and duration json to php

* Remove unused code

* Re-sync upb

* Fix php implementation timestamp json parsing

* Fix strptime use local timezone on mac.

* Remove succeeding tests

* Resync

* Add tests for values

* Fix php tests

* Fix encoder handlers change default value

Previously, oneofsubmsg_handler and submsg_handler change zval's default value directly.
The fix use REPLACE_ZVAL_VALUE which create a copy of parsed value and assign it to zval.
2018-09-22 18:57:43 -07:00
Jon Skeet
47d33e752e Test locations, and add comment to clarify testing 2018-09-22 09:09:15 +01:00
Jon Skeet
6e39eaad3c Add more detailed comments for declaration properties 2018-09-22 09:09:15 +01:00
Jon Skeet
0b314d745b Add files to Makefile.am to fix dist targets 2018-09-22 09:09:15 +01:00