Commit Graph

7311 Commits

Author SHA1 Message Date
Jon Skeet
25a2792283 Remove extraneous conversion to byte string 2009-01-27 07:20:53 +00:00
kenton@google.com
2d6daa72ab Push out changes from internal codebase.
All Languages
* Repeated fields of primitive types (types other that string, group, and
  nested messages) may now use the option [packed = true] to get a more
  efficient encoding.  In the new encoding, the entire list is written
  as a single byte blob using the "length-delimited" wire type.  Within
  this blob, the individual values are encoded the same way they would
  be normally except without a tag before each value (thus, they are
  tightly "packed").

C++
* UnknownFieldSet now supports STL-like iteration.
* Message interface has method ParseFromBoundedZeroCopyStream() which parses
  a limited number of bytes from an input stream rather than parsing until
  EOF.

Java
* Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
* Message interface has new method toBuilder() which is equivalent to
  newBuilderForType().mergeFrom(this).
* All enums now implement the ProtocolMessageEnum interface.
* Setting a field to null now throws NullPointerException.
* Fixed tendency for TextFormat's parsing to overflow the stack when
  parsing large string values.  The underlying problem is with Java's
  regex implementation (which unfortunately uses recursive backtracking
  rather than building an NFA).  Worked around by making use of possesive
  quantifiers.

Python
* Updated RPC interfaces to allow for blocking operation.  A client may
  now pass None for a callback when making an RPC, in which case the
  call will block until the response is received, and the response
  object will be returned directly to the caller.  This interface change
  cannot be used in practice until RPC implementations are updated to
  implement it.
2009-01-22 01:27:00 +00:00
Jon Skeet
dc254e76fc Removed redundant import from tutorial proto 2009-01-21 14:55:14 +00:00
Jon Skeet
a376734115 Changed benchmark namespace and fixed enum issue 2009-01-16 18:06:56 +00:00
Jon Skeet
79c72a9930 Benchmarking 2009-01-16 13:19:31 +00:00
Jon Skeet
343d9f54b4 Upgraded to protoc.exe 2.0.3. Added new build target of clean-build 2009-01-16 11:52:44 +00:00
Jon Skeet
8f8186a30b Benchmarking, dumping and munging 2009-01-16 10:57:40 +00:00
pesho.petrov
87e64e1cee Adding slicing support for repeated scalar fields and get/delete slice for composite fields. 2008-12-24 01:07:22 +00:00
Jon Skeet
0c89aa1fdb Move package declaration 2008-12-15 10:58:48 +00:00
Jon Skeet
b8b7d4fca3 Remove ugly bootstrapping - we don't need it now. 2008-12-15 10:58:12 +00:00
kenton@google.com
d41578239c Update trunk version to 2.0.4-SNAPSHOT. 2008-12-05 22:04:06 +00:00
kenton@google.com
2f3d8de767 Submit script used to post-process dist files. 2008-12-05 18:05:46 +00:00
kenton@google.com
25bc5cdc9c Support "Solaris 10 using recent Sun Studio".
Patch from Monty Taylor <monty.taylor@gmail.com>.
2008-12-04 20:34:50 +00:00
kenton@google.com
1ea526879c Add full-system test for custom enum value options. (Previously, only a
parsing test in parser_unittest.cc existed.)
2008-12-02 20:08:45 +00:00
kenton@google.com
2f669cbe75 * Avoid using pushd/popd in generate_descriptor_proto.sh because they are
bash-only features, and /bin/sh is not a symlink to bash on all systems.
* If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
  the import path only contains "." (or contains "." but does not contain
  the file), protoc incorrectly thought that the file was under ".", because
  it thought that the path was relative (since it didn't start with a slash).
  This has been fixed.
2008-12-02 05:59:15 +00:00
kenton@google.com
eb241fadf2 Fix call to superclass.__init__() to work on newer versions of Python. 2008-12-02 02:33:13 +00:00
kenton@google.com
a001ed0c03 * Update version compatibility stuff -- 2.0.3 is in no way compatible with
2.0.2.
* Minor Tru64 fix.
2008-12-01 23:47:49 +00:00
kenton@google.com
9f1752889c Update CHANGES.txt with stuff from 2.0.3. 2008-11-25 19:37:10 +00:00
Jon Skeet
3f22511100 Added address book example 2008-11-24 16:09:39 +00:00
Jon Skeet
828510cdbd Refactor IsInitialized to match Java version 2008-11-24 11:17:17 +00:00
Jon Skeet
4cf9e3c619 Fix property special-casing 2008-11-24 11:11:28 +00:00
kenton@google.com
26bd9eee6e Integrate changes from internal code.
protoc
* Enum values may now have custom options, using syntax similar to field
  options.
* Fixed bug where .proto files which use custom options but don't actually
  define them (i.e. they import another .proto file defining the options)
  had to explicitly import descriptor.proto.
* Adjacent string literals in .proto files will now be concatenated, like in
  C.

C++
* Generated message classes now have a Swap() method which efficiently swaps
  the contents of two objects.
* All message classes now have a SpaceUsed() method which returns an estimate
  of the number of bytes of allocated memory currently owned by the object.
  This is particularly useful when you are reusing a single message object
  to improve performance but want to make sure it doesn't bloat up too large.
* New method Message::SerializeAsString() returns a string containing the
  serialized data.  May be more convenient than calling
  SerializeToString(string*).
* In debug mode, log error messages when string-type fields are found to
  contain bytes that are not valid UTF-8.
* Fixed bug where a message with multiple extension ranges couldn't parse
  extensions.
* Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
  a message that contained no fields (but possibly contained extensions).
* Fixed ShortDebugString() to not be O(n^2).  Durr.
* Fixed crash in TextFormat parsing if the first token in the input caused a
  tokenization error.

Java
* New overload of mergeFrom() which parses a slice of a byte array instead
  of the whole thing.
* New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
* Improved performance of isInitialized() when optimizing for code size.

Python
* Corrected ListFields() signature in Message base class to match what
  subclasses actually implement.
* Some minor refactoring.
2008-11-21 00:06:27 +00:00
kenton@google.com
a2a32c2043 Support HP C++ on Tru64.
Patch (mostly) by Vincent Choinière <Choiniere.Vincent@hydro.qc.ca>.
2008-11-14 17:29:32 +00:00
Jon Skeet
1d131c98f0 New options now work fine. 2008-11-13 22:29:48 +00:00
Jon Skeet
d6343be707 Refactored options 2008-11-12 23:39:44 +00:00
kenton@google.com
8da400ed12 Fix bugs in zero_copy_stream_impl.
Patch from Frank Chu.
2008-11-07 18:38:13 +00:00
kenton@google.com
32d0c3b853 Only build tests when running "make check", not "make". 2008-11-07 18:06:24 +00:00
kenton@google.com
d0580eafd3 Fixed alignment issue that caused bus errors on platforms like sparc which
require all memory reads to be aligned.  Specifically, it turns out that
sizeof(RepeatedField<bool>) is 20 on 64-bit sparc with GCC 3.4.6.  This is
strange, since one of RepeatedField's members is a pointer, which I thought
meant that it had to be 64-bit aligned, which means its size should be a
multiple of 64 bits.  But, 20 is not a multiple of 8.  I don't understand why
this is the case, but if this is possible, then DynamicMessage's strategy of
sorting fields in descending order by size and then tightly packing doesn't
work.  To fix this, I got rid of the sort step and instead added code that
aligns each field's offset appropriately based on the field's size.

Also in this revision:  Fix an error message that named a flag incorrectly.
2008-11-07 02:07:18 +00:00
kenton@google.com
de75437573 Simplify some template usage so that older compilers can handle it. (Users
report that MSVC 2003 in particular needs this change.)
2008-11-06 21:36:28 +00:00
kenton@google.com
3e91fcdd87 Work around GCC 4.3.0 x86_64 compiler bug (seen on Fedora 9).
Details:

For each message type, protoc generates an array of byte offsets of each of
the fields within the message class.  These offsets are later used by the
reflection implementation.  Prior to this revision, the offset arrays were
allocated as global variables.  Since they were just arrays of ints, they
should have been initialized at compile time.  Unfortunately, GCC 4.3.0
incorrectly decides that they cannot be initialized at compile time because
the values used to initialize the array have type ptrdiff_t, and GCC 4.3.0
does not recognize that it can convert ptrdiff_t to int at compile time.  This
bug did not seem to exist in previous versions of GCC.  Google's compiler
team has submitted a fix for this bug back to the GCC project, but we will
have to work around it anyway since Fedora 9 shipped with GCC 4.3.0.
2008-11-06 04:37:30 +00:00
Jon Skeet
60c059b8f0 Replaced copyright notice 2008-10-23 21:17:56 +01:00
Jon Skeet
20bfd9bf50 Fix bug in GeneratedBuilder.MergeFrom 2008-10-23 21:05:58 +01:00
Jon Skeet
b8c2fc57fc Fixed bug in GeneratedBuilder.MergeFrom - only fields already set in builder would be merged. 2008-10-22 14:19:05 +01:00
Jon Skeet
52a035a4af A few tweaks 2008-10-22 14:11:30 +01:00
Jon Skeet
87d6a3b8f7 Ignore solution cache files 2008-10-22 14:01:37 +01:00
Jon Skeet
6803686bc0 First cut at new layout 2008-10-22 13:30:34 +01:00
Jon Skeet
f0589506c9 Wiping slate clean to start again with new layout. 2008-10-22 13:18:49 +01:00
Jon Skeet
e60ce8bfaf Final commit before changing layout 2008-10-22 07:11:17 +01:00
kenton@google.com
580cf3c47c Update MSVC installation instructions for static linking change. 2008-10-21 17:18:26 +00:00
The Android Open Source Project
35be73bfeb Initial Contribution 2008-10-21 07:00:00 -07:00
kenton@google.com
3bdc135653 Avoid an "unused parameter" warning when using high warning levels. 2008-10-16 23:00:34 +00:00
kenton@google.com
7b29a2695c Update version number to 2.0.3-SNAPSHOT. 2008-10-16 22:56:18 +00:00
kenton@google.com
16b31d2a94 Make Python example output identical to C++ and Java by removing redundant
spaces.
2008-10-07 02:38:12 +00:00
kenton@google.com
a41a9dd532 * Fixed template specialization syntax that MSVC 2005 didn't like. Not sure if
it was valid or not.
* Moved UTF-8 coding directive to the right place in reflection_test.py.
2008-10-03 17:27:48 +00:00
Jon Skeet
7f90d8ee57 Made things a bit more public for the sake of ProtoGen 2008-10-02 21:46:17 +01:00
kenton@google.com
c76caaccb8 Improvements to configure.ac from Jeff Bailey. 2008-09-30 22:11:21 +00:00
kenton@google.com
cf3f638c92 Pass -Wall,no-obsolete to autoreconf. 2008-09-30 22:01:45 +00:00
kenton@google.com
7516a69050 Improve autogen.sh. 2008-09-30 20:55:25 +00:00
kenton@google.com
c7f06b2ad5 Added clarification to license that generated code is owned by the owner of the
input file.
2008-09-30 18:30:23 +00:00
kenton@google.com
9b10f5845a * Fix build on MSVC.
* Switch to statically-linked libraries instead of DLLs on MSVC.
2008-09-30 00:09:40 +00:00