Commit Graph

401 Commits

Author SHA1 Message Date
Andrew Flynn
0b86e55f67 Fix some indenting issues with set__() function
Previously it looked like this:

public final class OuterClass {
  [...]
  public static final class InnerClass extends
      com.google.protobuf.nano.MessageNano {
    [...]
    public void setId(java.lang.String value) {
      if (value == null) {
    throw new java.lang.NullPointerException();
  }
  id_ = value;
      bitfield0_ |= 0x00000001;
    [...]
  }
  [...]
}

Now it looks like this:

public final class OuterClass {
  [...]
  public static final class InnerClass extends
      com.google.protobuf.nano.MessageNano {
    [...]
    public void setId(java.lang.String value) {
      if (value == null) throw new java.lang.NullPointerException();
      id_ = value;
      bitfield0_ |= 0x00000001;
    [...]
  }
  [...]
}

Change-Id: I2a9289b528f785c846210d558206d677aa13e9be
2013-10-08 12:47:35 -07:00
Brian Duff
10107cbc7a Add reftypes field generator option.
This option generates fields as reference types, and serializes
based on nullness.

Change-Id: Ic32e0eebff59d14016cc9a19e15a9bb08ae0bba5
Signed-off-by: Brian Duff <bduff@google.com>
2013-10-07 16:25:55 -07:00
Nicholas Seckar
b3c24e0ed2 Fix roundtrip failure with groups when unknown fields are enabled.
When parsing a group, the group's end tag should not be stored within the
message's unknownFieldData. Not only does this waste space, it is also output
the next time the group is serialized, resulting in two end tags for that group.
The resulting bytes are not always a valid protocol buffer and may fail to
parse.

This change ensures that group end tags do not result in an unknownFieldData
entry, and that messages with groups can be roundtripped without corruption.

Change-Id: I240f858a7217a7652b756598c34aacad5dcc3363

Conflicts:
	java/src/test/java/com/google/protobuf/NanoTest.java
2013-10-04 10:52:08 -07:00
Max Cai
1479c7ab1b Implement enum_style=java option.
This javanano_out command line option creates a container interface
at the normal place where the enum constants would reside, per enum
definition. The java_multiple_files flag would now affect the file-
scope enums with the shells. If the flag is true then file-scope
container interfaces are created in their own files.

Change-Id: Id52258fcff8d3dee9db8f3d8022147a811bf3565
2013-09-25 19:44:27 +01:00
Max Cai
b337f25628 Accessor style for optional fields.
This CL implements the 'optional_field_style=accessors' option.
All optional fields will now be 1 Java field and 1 bit in a shared
bitfield behind get/set/has/clear accessor methods. The setter
performs null check for reference types (Strings and byte[]s).

Also decentralized the clear code generation.

Change-Id: I60ac78329e352e76c2f8139fba1f292383080ad3
2013-09-23 15:27:13 +01:00
Max Cai
ee4410d551 Add some bitfield helper methods from 2.4
Change-Id: Ib9bb549602f71a451d2107fb04de17877553860e
2013-09-20 18:42:11 +01:00
Max Cai
71766127eb Add two codegen parameters to nano.
enum_style = c | java: 'c' to put the enum member int constants
at the parent scope; 'java' to create uninstantiatable shell
classes at the parent scope and put the int constants inside.

optional_field_style = default | accessors: 'default' to create
one public mutable field per optional proto field; 'accessors'
to encapsulate the generated fields behind get, set, has and
clear accessors.

This CL only contains parsing code for these two parameters.

Change-Id: Iec0c3b0f30af8eb7db328e790664306bc90be089
2013-09-18 17:11:28 +01:00
xiaofeng@google.com
172019c40b Add missing #include of <algorithm> for min/max on VS2013 2013-09-17 21:00:11 +00:00
Wink Saville
062d561e31 Merge "Fix outer classname for javamicro/javanano." 2013-08-07 19:57:30 +00:00
Max Cai
06eed37ec6 Fix outer classname for javamicro/javanano.
- File class name is defined as the java_outer_classname option value
  or the file name ToCamelCase; never the single message's ClassName.
- File-scope enums are translated to constants in the file class,
  regardless of java_multiple_files.
- If java_multiple_files=true, and file's class name equals a message's
  class name, no error. This is done by detecting that the outer class
  is not needed and skipping the outer class codegen and clash checks.
  Note: there is a disparity between java[lite] and the previous
  java{micr|nan}o: when generating code for a single-message proto, the
  outer class is omitted by java{micr|nan}o if the file does not have
  java_outer_classname. This change makes java{micr|nan}o align with
  java[lite] codegen and create the outer class, but will print some
  info to warn of potential change of code.
- Also fixed the "is_own_file" detection and made all parseX() methods
  static. Previously, all messages in a java_multiple_files=true file
  are (incorrectly) considered to be in their own files, including
  nested messages, causing them to become inner classes (instance-
  bound) and forcing the parseX() methods to lose the static modifier.
- This change supersedes c/60164 and c/60086, which causes javanano to
  put enum values into enum shell classes if java_multiple_files=true.
  We now always use the parent class to host the enum values. A future
  change will add a command line option to provide more flexibility.
- Elaborated in java/README.txt.

Change-Id: I684932f90e0a028ef37c662b221def5ffa202439
2013-08-05 21:54:58 +01:00
Ulas Kirazci
cebd784d19 Merge "Fixed packed repeated serialization." 2013-07-31 23:11:08 +00:00
Ulas Kirazci
1c277f9c68 Fixed packed repeated serialization.
Remove buggy memoization. Memoization also is too fragile for the api
because the repeated field is public.

Change-Id: I538b8426d274b22df2eeea5935023abbe7df49fe
2013-07-31 14:15:10 -07:00
xiaofeng@google.com
d833126822 Fix a typo. 2013-07-30 18:35:45 +00:00
Ulas Kirazci
e83bbbbe42 Add an option to inspect "has" state upon parse.
If has is set, also always serialize.

Change-Id: I2c8450f7ab9e837d722123dd1042991c0258ede3
2013-07-29 09:35:44 -07:00
xiaofeng@google.com
4f68d92cfa Add support for ThreadSanitizer atomicops API to protobuf - patch from glider@ 2013-07-25 19:55:35 +00:00
Max Cai
4c4d639025 Per-file java_multiple_files flag.
Imported source files may have different values for the 'java_multiple_files'
option to the main source file's. Whether the fully qualified Java name of an
entity should include the outer class name depends on the flag value in the
file defining the referenced entity, not the main file. This CL loads the
flag values from the main and all transitively imported files into the params,
and generates the fully qualified Java names accordingly.

If the generator option 'java_multiple_files' is set, its value overrides any
in-file values in all source/imported files. This is because this generator
option is typically used on either none or all source files.

Change-Id: Id6a4a42426d68961dc669487d38f35530deb7d8e
2013-07-25 19:49:23 +01:00
Chris Smith
d98e9c4d0e Allow NaN/+inf/-inf defaults in micro/nano.
Adds support for default values of NaN, infinity and negative
infinity for floats and doubles in both the nano and micro
java compiler.

Change-Id: Ibc43e5ebb073e51d9a8181f3aa23b72e10015dca
2013-07-23 19:13:36 +01:00
Tom Chao
d4bb971d18 Update nano to serialize java keywords properly.
Change-Id: I7407d0fab609c336ecd73499e725aed0dd50f555
2013-07-19 09:30:56 -07:00
Brian Duff
a9c4e082e0 Make it possible to use MessageNano.mergeFrom without casting.
You can now do:

  MyMessage foo = MessageNano.mergeFrom(new MyMessage(), bytes);

without having to cast the message returned from mergeFrom.

Change-Id: Ibb2ad327f75855d45352ad304c7f054f20dd29c9
2013-07-08 22:29:51 -07:00
Brian Duff
5659cca8c8 Nano support for extensions and unknown fields.
You can use the processor option store_unknown_fields to switch
this support on:

  aprotoc --javanano_out=store_unknown_fields=true:/tmp/out

A separate option for extensions isn't required. Support
for unknown fields must be turned on to allow storing and
retrieving extensions, because they are just stored as
unknown fields. If unknown fields are switched on, extension
related code will be generated when a proto message includes
an extension range, or an extension is encountered.

By default, store_unknown_fields is false. No additional
code is generated, and the generator will error out if protos
contain extension ranges or extensions.

Change-Id: I1e034c9e8f3305612953f72438189a7da6ed2167
2013-06-24 16:02:12 -07:00
Brian Duff
a220fe61e1 Fix enum field references with java_multiple_files.
When the java_multiple_files option is on, enums are placed in java
class files based on the name of the original enum type. This fixes
field references to such enum values to point to the correct class
name when setting the default.

Change-Id: I51a2e251c0d0ab1e45a182ba849d314232a74bac
2013-06-07 14:00:05 -07:00
Brian Duff
296787577a Fix javanano compiler generating uncompileable java code. This happened
for enums when java_multiple_files=true.

Change-Id: Ia6fe1a51c6a46eb9a2f29527829794076b165cb7
Signed-off-by: Brian Duff <bduff@google.com>
2013-06-05 15:38:33 -07:00
Ficus Kirkpatrick
314a302933 Don't use Arrays.copyOf in generated code.
It didn't appear until API 9 and is thus incompatible with Froyo.
Instead, allocate a new array and System.arraycopy inline.

Change-Id: I2e1cd07a4a762ef8edd5ec06ceaa1d38b302823d
2013-04-08 15:47:56 -07:00
Ulas Kirazci
3234cee5ba Prevent conflicts between local and proto variable names.
Prefix access to proto variable names with "this.". Also remove unused
GenerateMergingCode.

Change-Id: I5f07d3252fc385c4174d9165b64785b40f676e17
2013-04-03 15:53:19 -07:00
Ulas Kirazci
2337023fd9 Nano protobufs.
Like micro protobufs except:

- No setter/getter/hazzer functions.
- Has state is not available. Outputs all fields != their default.
- CodedInputStream can only take byte[] (not InputStream).
- Repeated fields are in arrays, not ArrayList or Vector.
- Unset messages/groups are null, not "defaultInstance()".
- Required fields are always serialized.

To use:

- Link libprotobuf-java-2.3.0-nano runtime.
- Use LOCAL_PROTOC_OPTIMIZE_TYPE := nano

Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80
2013-04-01 14:55:45 -07:00
xiaofeng@google.com
25b2a673ae Fix issue 474 2013-03-05 03:19:15 +00:00
xiaofeng@google.com
7fe28a8973 Update version number in descriptor.pb.h and plugin.pb.h 2013-03-01 19:39:21 +00:00
xiaofeng@google.com
2c9392f8dd Update version number in trunk 2013-02-28 06:12:28 +00:00
xiaofeng@google.com
a36f1b43e7 Exclude a failing test in MingW build. 2013-02-26 17:49:03 +00:00
xiaofeng@google.com
7f372559cc Down-integrate from internal branch 2013-02-25 10:39:39 +00:00
xiaofeng@google.com
de3494fe5c Fix issue 403, issue 456, issue 462 2013-02-25 10:24:11 +00:00
xiaofeng@google.com
e406747cd5 Fix issue 445, issue 449 2013-02-07 07:00:07 +00:00
xiaofeng@google.com
1e5a5e8419 Down-integrate from internal branch 2013-01-31 15:52:58 +00:00
liujisi@google.com
691f6da30b Rollback the export macros on internal classes/functions. 2013-01-15 02:19:41 +00:00
liujisi@google.com
117064c18b add missing dll export macros for msvc. 2013-01-11 10:35:05 +00:00
liujisi@google.com
71caf8c25d Remove "using" directives to disambiguate type_traits for vc2012. 2013-01-11 06:36:35 +00:00
liujisi@google.com
f5b373dfb6 Fix a typo of nacl file name. 2013-01-10 21:37:04 +00:00
liujisi@google.com
e9ee30962f Add missing qnx files. 2013-01-10 21:28:15 +00:00
liujisi@google.com
4d8c2f94fb Add arm_qnx atomic ops support and add missing header files in Makefile.am 2013-01-10 21:24:56 +00:00
liujisi@google.com
98080e8598 Update upb namespace in friendship declaration. 2013-01-10 21:05:26 +00:00
liujisi@google.com
cb77c4c381 Generate a warning for duplicated enum values, when allow_alias option isn't
set.
2012-12-28 23:41:54 +00:00
liujisi@google.com
4770277ec7 Add the missing PNaCl atomicops support. 2012-12-19 03:46:58 +00:00
liujisi@google.com
728aa760fd Down-integrate form internal opensource branch 2012-12-19 02:37:59 +00:00
xiaofeng@google.com
0b30eb8c87 Fix the name of thread safety macros. 2012-12-13 09:09:32 +00:00
liujisi@google.com
5d701498dd Remove unused macros. 2012-12-10 18:58:26 +00:00
liujisi@google.com
5e6539205e Remove the customized operator delete. 2012-12-10 18:54:03 +00:00
liujisi@google.com
2273ee403b Add java options to plugin proto and rollback the r450 2012-12-05 23:47:43 +00:00
liujisi@google.com
0c995c9300 Remove undeeded no-rtti guards. 2012-12-05 23:16:07 +00:00
liujisi@google.com
2bee6e66e8 Fix build warnings for gcc 4.6 2012-12-05 22:29:30 +00:00
liujisi@google.com
6fb956d9db Remove extra semicolons 2012-12-05 06:38:29 +00:00
liujisi@google.com
1e36e1006a Add missing export macro 2012-12-05 06:26:08 +00:00
liujisi@google.com
329d103b3e Set pointers to NULL after shutdown, so the shutdown function can be called for multiple times. 2012-12-05 06:18:10 +00:00
liujisi@google.com
f5d5b4de92 Make custom option able to work for -f-no-rtti; Fix remaining death tests for gtest 1.6 2012-12-05 05:54:48 +00:00
liujisi@google.com
1d32532ead Update gtest to 1.6; Disable death tests when exceptions are enabled. 2012-12-04 23:32:47 +00:00
liujisi@google.com
e719489061 Make PROTOBUF_USE_EXCEPTIONS configurable from CPPFLAGS. 2012-12-04 22:06:04 +00:00
xiaofeng@google.com
caa66db018 Merge from tags/2.5.0rc1 to trunk 2012-12-04 18:44:24 +00:00
xiaofeng@google.com
eaaef0b39b Fix issues: 342, 424, 428, 430, 436 2012-12-04 00:59:40 +00:00
liujisi@google.com
ef9acc464d Update version to 2.5.0-pre 2012-11-30 22:38:00 +00:00
xiaofeng@google.com
9c1c31ff16 Fix compile issues under GCC 3.4.6 2012-11-30 16:29:03 +00:00
xiaofeng@google.com
a4491ea142 Fix issue 412: update protobuf for 64-bit compatibility on Mac OS X - patch from Mark Mentovai 2012-11-14 13:38:10 +00:00
pliard@google.com
75575df086 Generate missing inclusion of common.h.
FileGenerator::GenerateBuildDescriptors() emits
"::google::protobuf::internal::OnShutdown(&$shutdownfilename$);" which is
declared in common.h.

Although Protobuf is very well tested a compilation error was triggered while
rolling Protobuf r423:426. There might be something wrong in the Chromium roll
(still in progress).

It seems safer anyway not to rely on indirect headers inclusion.
2012-10-02 00:15:46 +00:00
xiaofeng@google.com
3d46dad1d2 Use string::size_type instead of int for results of string.find() etc. -- patch from hans 2012-09-27 09:04:02 +00:00
xiaofeng@google.com
fcb8a50b50 Update MSVC project files and fix compilation issues in MSVC. 2012-09-24 06:48:20 +00:00
xiaofeng@google.com
b55a20fa2c Down-integrate from internal branch 2012-09-22 02:40:50 +00:00
pliard@google.com
daced74d77 Add support for NaCl in atomicops.
This does additionally a significant cleanup in platform_macros.h (initially
pulled from v8).
It implemented some subtleties that we don't use like the HOST/TARGET arch
distinction.

Changes related to NaCl support come from Chromium's build/build_config.h.

BUG=392
2012-07-17 15:51:05 +00:00
liujisi@google.com
e7881e8e12 Update atomicops to support new platforms where intptr_t = long.
Fix license headers.
2012-06-05 17:02:25 +00:00
liujisi@google.com
aabd7cf8f8 Fix a NULL/bool conversion. 2012-05-17 04:59:53 +00:00
xiaofeng@google.com
2072421124 Fix issue 378 2012-05-16 05:41:31 +00:00
pliard@google.com
a269a2c48b Update outdated use of GoogleOnceType. 2012-05-10 08:04:04 +00:00
pliard@google.com
6103d4ed13 Don't call AddDesc() at static init time in LITE_RUNTIME mode.
This patch makes the generation of StaticDescriptorInitializer_$filename$
depend on whether LITE_RUNTIME is enabled. Note that this works only when
extensions are not used.

This lets us significantly decrease the number of static initializers generated
by protoc in LITE_RUNTIME mode (used in Chromium).
In LITE_RUNTIME mode, $adddescriptorsname$() is called the first time that
default_instance() is called (rather than being called during static init).

To benefit from this patch in LITE_RUNTIME mode without extensions, compile
with -DGOOGLE_PROTOBUF_NO_STATIC_INIT.

BUG=351
2012-05-04 11:16:09 +00:00
pliard@google.com
7cc257673c Improve GoogleOnceInit() in Protocol Buffers.
It is based on V8's new CallOnce(): http://codereview.chromium.org/9447052/.

This patch includes the following changes:
  - POD (no static initializer generated) and faster implementation on Windows.
  - GoogleOnceInit() can now take an additional parameter which is forwarded to
    the function provided by the user.

This patch is part of the static initializers removal initiative.
2012-04-10 08:15:18 +00:00
pliard@google.com
6a10204df6 Add missing guard in atomicops MSVC cc file 2012-03-08 14:27:30 +00:00
pliard@google.com
72afe6ee3f Fix build error in Mac atomicops. 2012-03-06 08:20:45 +00:00
pliard@google.com
324779ad70 Remove static initializer in wire_format_lite.cc. 2012-03-02 14:00:20 +00:00
pliard@google.com
f5de486b53 Add atomicops from V8. 2012-03-02 13:04:36 +00:00
liujisi@google.com
cb6dd4ef5f A workaround for MSVC 2010 x64 platform bug,
which affects proto compiler in generating field has_bit mask.
2011-07-05 21:05:40 +00:00
liujisi@google.com
2a89d0022d Add missing dll export macros. 2011-07-05 17:16:07 +00:00
liujisi@google.com
295a096023 Remove extra semicolon in primitive repeated field init code. 2011-07-05 06:16:40 +00:00
liujisi@google.com
7a6de0008a Update comments for globally unique extension number for custom options. 2011-05-25 06:25:24 +00:00
liujisi@google.com
02d7015ba8 Allow String to be used as message names. 2011-05-04 06:15:22 +00:00
liujisi@google.com
5c24564811 Update mainline version to 2.4.2-pre. 2011-05-03 07:06:03 +00:00
liujisi@google.com
23f42ceaf8 Define serailVersionUID for generated java class. 2011-04-29 01:57:30 +00:00
liujisi@google.com
9cf65b7dd2 Use fully qualified java.lang.Object in protoc java code. 2011-04-08 03:40:29 +00:00
liujisi@google.com
17d57dbbcd Add an intermediate method to propagate the friendship access to nested classes as a workaround for old compilers (e.g. gcc 3.4) 2011-02-07 19:03:53 +00:00
liujisi@google.com
c345db7d6b Update version number to 2.4.1 in common.h. 2011-02-03 07:22:32 +00:00
liujisi@google.com
57014ffa52 Use Subprocess::Win32ErrorMessage() in command_line_interface_unittest to make the it OS locale independent. 2010-12-21 05:56:35 +00:00
liujisi@google.com
5c20ca1fcc Escape C++ Trigraphs. 2010-12-21 05:33:13 +00:00
liujisi@google.com
6f2c3b8734 Boost version number to 2.4.0-pre, add more test cases for text_format.py about unicode field. 2010-12-09 08:59:21 +00:00
liujisi@google.com
9b7f6c544a Fix issues: 223 224 242. 2010-12-08 03:45:27 +00:00
liujisi@google.com
1fd96c43a0 Add new files for vcprojs, fix issues: 165, 211, 228, 240 2010-12-07 06:23:55 +00:00
liujisi@google.com
5d8d2b0542 Fix issues: 200 202 211 215 237 246. 2010-12-06 06:20:14 +00:00
liujisi@google.com
2726e7a6eb Fix issues: 166 167 172 175 181 188 192 194 195. 2010-12-03 09:12:33 +00:00
liujisi@google.com
0acafda8f4 Fix byte encoding macros. 2010-12-01 04:13:50 +00:00
kenton@google.com
baac9c39fe Add some explicit casts to eliminate some warnings as described in issue 83 comment 17. 2010-11-30 23:54:03 +00:00
liujisi@google.com
33165fe0d5 Submit recent changes from internal branch. See CHANGES.txt for more details. 2010-11-02 13:14:58 +00:00
kenton@google.com
a4a9ef8c8b Roll back revision 313. A similar but far more exensive change was made in our internal branch, which will be integrated soon. 2010-09-17 23:20:04 +00:00
kenton@google.com
15b675eea5 add cast to avoid compiler warning 2010-04-23 19:15:05 +00:00
kenton@google.com
d09ab8538d Allow services with lite runtime when using rpc generator plugin. 2010-04-19 19:15:12 +00:00
kenton@google.com
b3f6a15806 Improve coded_stream.h handling on MSVC. Avoid a bogus runtime check and enable little-endian optimization. Based on patch from Nathan McDaniel. 2010-04-05 23:19:54 +00:00
kenton@google.com
6793c1af26 Use full paths when writing MSVS-style errors. Patch from Oleg Smolsky. 2010-04-05 21:45:45 +00:00
kenton@google.com
eeb8fd7dc8 Fix bug with permanent callbacks that delete themselves when run. Patch from Evan Jones. 2010-02-16 21:59:09 +00:00
kenton@google.com
203637497a Remove comment referring to non-protobuf code. 2010-02-10 00:13:33 +00:00
kenton@google.com
769ab6ff03 Fix missing header issue -- INT_MAX is defined in limits.h. I chose to use a different constant rather than add the #include. 2010-02-09 02:09:08 +00:00
kenton@google.com
c65c04195d Fix issue 162: generated code should #include <algorithm> for std::swap(). 2010-02-01 20:35:34 +00:00
kenton@google.com
daee05168e Optimize Java string serialization. Patch from Evan Jones. 2010-02-01 17:41:59 +00:00
kenton@google.com
ab6950d75d More Java warning tweaks from Evan Jones. 2010-01-28 01:09:11 +00:00
kenton@google.com
4844368346 Add missing include (that apparently didn't break anything on most platforms). 2010-01-20 01:59:22 +00:00
kenton@google.com
08e9036f61 Fix obvious syntax error that somehow works fine on MSVC and GCC 3.x-win32. 2010-01-20 01:54:38 +00:00
kenton@google.com
529a843f2d Fix issues with Windows build: Always use ASCII version of CreateProcess (even if UNICODE is defined) and move GetMessage macro work-around to common.h so that it covers extension_set.h as well. Patch from Nick Carter. 2010-01-15 02:28:48 +00:00
kenton@google.com
c25f833baf Fixes compile on GCC 3.2 according to Sergey Tihansky. 2010-01-13 23:43:19 +00:00
kenton@google.com
2113840aa0 Fix bogus sign-compare warnings in header at request of user. 2010-01-11 18:38:22 +00:00
kenton@google.com
ea75323710 Update version number in trunk to 2.3.1. 2010-01-09 01:02:25 +00:00
kenton@google.com
f9fa0590bc Fix memory leak in CommandLineInterface, not that it really matters. 2010-01-08 05:47:13 +00:00
kenton@google.com
38fcd39227 Minor compatibility tweaks for FreeBSD. 2010-01-08 04:48:19 +00:00
kenton@google.com
7b7a80eae4 Tweak doc comments. 2010-01-08 03:56:03 +00:00
kenton@google.com
2773bdf239 Add missing file to dist. 2010-01-07 04:14:34 +00:00
kenton@google.com
535301894e Address comments from various code reviews. 2010-01-07 02:08:03 +00:00
kenton@google.com
2429e3a0de Monty Taylor claims this helps the drizzle compile for some reason. 2010-01-05 22:30:28 +00:00
kenton@google.com
d78ca9c74f Fixed DLL compile under MSVC. 2010-01-04 21:15:47 +00:00
kenton@google.com
c619a3da2a Fix syntax of function definition in shell script so that it hopefully works on Solaris. 2010-01-04 20:03:09 +00:00
kenton@google.com
d2fcbba230 Improve zip/jar support:
- Don't support par or war since par is not a standard format and outputting to
  war doesn't make sense.
- Add boilerplate manifest when outputting to Jar.
- Remove "XXX check conversion" comments because I don't care.
- Add a test.
2010-01-04 19:47:18 +00:00
kenton@google.com
5066322074 Allow protoc to output directly to zip/jar/par/war files. 2009-12-24 02:12:15 +00:00
kenton@google.com
5f12164f54 Refactor the way output is handled in CommandLineInterface -- now it will be stored in-memory until all code generators have completed, then dumped to disk all at once. While this means that protoc uses more memory, the code is much simpler, and handles insertions much faster. Also, this made it easier to implement a useful feature: insertions will be indented to match the insertion point line. Therefore, when inserting into Python code, you don't have to figure out how much to indent your inserted code. The refactoring should also make it easier to implement output-to-jar at some point. 2009-12-23 07:03:06 +00:00
kenton@google.com
46ed74e8d4 Actually, that last revision can be simpler -- we don't need to parse strings at all, as simply entering 1e1000 as a float literal in Python will be evaluated as infinity. 2009-12-23 02:08:05 +00:00
kenton@google.com
d0047c43d9 In Python, avoid relying on float('inf') and float('nan') as these don't work on Windows with Python pre-2.6. 2009-12-23 02:01:01 +00:00
kenton@google.com
6e8b9e4a4a Make extension identifiers final. This improves security when untrusted code is present in the same class loader. In order to get around initialization ordering issues, I simply made the constructor for extension identifiers take no arguments and deferred initialization to an internalInit() method, which generated code will always call during init. 2009-12-22 23:51:20 +00:00
kenton@google.com
7f4938b244 Mark plugins as experimental for now. 2009-12-22 22:57:39 +00:00
kenton@google.com
d6e84b3ed8 When serializing to an ostream, verify that there were no stream-level errors before returning success. 2009-12-22 19:43:41 +00:00
kenton@google.com
6f12e3e29a Accept form feeds as whitespace. 2009-12-22 18:11:09 +00:00
kenton@google.com
f9c5978f5d Hopefully fix build on Sun Studio. 2009-12-22 18:04:23 +00:00
kenton@google.com
c0ee4d2ed9 Build DLLs on Cygwin and MinGW. 2009-12-22 02:05:33 +00:00
kenton@google.com
d1ce7a2839 Fix build on MSVC. 2009-12-21 21:19:05 +00:00
kenton@google.com
f2a732938e Fix build on GCC 3.3/Linux. 2009-12-21 19:44:57 +00:00
kenton@google.com
0abe9c2143 Argh, this line was not supposed to be submitted. 2009-12-21 19:24:21 +00:00
kenton@google.com
ee7e9420e3 Use unordered_map when available. Changes to stl_hash.m4 provided by Oleg Smolsky. 2009-12-21 18:58:23 +00:00
temporal
8ee1474044 Add a code generator insertion point for Java builders. 2009-12-20 00:09:50 +00:00
kenton@google.com
684d45b2fe Fix build on MinGW/Win32 (including implementing Subprocess using CreateProcess()). 2009-12-19 04:50:00 +00:00
temporal
bdbb863099 Ensure that 'once' objects are declared using the macro. This is either the third or fourth time I've screwed this up when down-integrating, because our internal code does not require the macro (it's not portable) and on Linux a pthread_once_t that is zero-initialized just happens to work. So, I only discover the problem when I test on Mac, then kick myself for making the same mistake yet again. No more! This time, I have renamed GoogleOnceType to ProtobufOnceType, thus making the type name differ from our internal code. As a result, if you don't update the decls to use the macros, they won't compile. Hah! Take that, future self! 2009-12-18 08:21:00 +00:00
kenton@google.com
91218afc67 Fix Cygwin build. 2009-12-18 07:20:43 +00:00
kenton@google.com
5e744ff961 Commit missing files from r251. Sigh. 2009-12-18 04:51:42 +00:00
kenton@google.com
afd32abb75 Set version to 2.3.0-pre. 2009-12-18 02:51:26 +00:00
kenton@google.com
83ad01e35f Point test_plugin at the correct gtest headers. 2009-12-18 02:40:43 +00:00
kenton@google.com
fccb146e3f Massive roll-up of changes. See CHANGES.txt. 2009-12-18 02:11:36 +00:00
kenton@google.com
b221008884 Fix UTF-8 validity checks to not do unaligned reads. 2009-12-11 03:49:28 +00:00
kenton@google.com
de74779454 fix SONAME in trunk 2009-12-11 03:41:58 +00:00
jasonh+personal@google.com
9951233e9a Fix Issue 136: the memoized serialized size for packed fields may not
be properly set. writeTo() may be invoked without a call to
getSerializedSize(), so the generated serialization methods would
write a length of 0 for non-empty packed fields. Just call
getSerializedSize() at the beginning of writeTo(): although this
means that we may compute the byte size needlessly when there
are no packed fields, in practice, getSerializedSize() will
already have been called - all of the writeTo() wrappers in
AbstractMessageLite invoke it.

Tested: new unittest case in WireFormatTest.java now passes
2009-12-01 18:05:21 +00:00
Dan Egnor
95dbaa67a8 The j2me protobuf code is now in vendor/google; remove it here. 2009-11-13 17:14:51 -08:00
kenton@google.com
573989f782 Explicitly call superclass constructor in generated code to avoid pedantic warning. Based on patch from Oleg Smolsky. 2009-10-30 22:02:17 +00:00
kenton@google.com
c91e1fe82b Support MSVC 2010 beta 1. 2009-10-12 19:22:03 +00:00
kenton@google.com
477f799fb6 Improve error message regarding proto_path not matching .proto file. 2009-10-07 21:38:11 +00:00
kenton@google.com
721995d00a Fix cross-compiling when building in a dedicated build directory. Fix pointed out by Pierre Kestener. 2009-09-11 22:08:40 +00:00
kenton@google.com
7fb9ae9df3 Make sure to quality calls to std::swap. Otherwise, if a google::swap() exists (e.g. because the user is using our own dense_hash_map implementation) it will be chosen instead, leading to a compile error. 2009-09-02 02:42:56 +00:00
kenton@google.com
b26684a900 Remove test that had undefined behavior and thus did not pass on some platforms. 2009-09-02 01:42:04 +00:00
kenton@google.com
3aa7a0dafe HPUX patch from Alexander Melnikov. 2009-08-17 20:34:29 +00:00
temporal
ad5672bad7 Update experimental SEBS file to support cross-compiling. 2009-08-17 09:42:47 +00:00
kenton@google.com
0bcfeb9dcd Don't use RTTI in down_cast if GOOGLE_PROTOBUF_NO_RTTI is defined. Patch from Chris Masone (of Google). 2009-08-14 01:21:01 +00:00
kenton@google.com
8169c7fcde Set version number to 2.2.1 in trunk. 2009-08-13 22:41:37 +00:00
kenton@google.com
8aae2a2137 Oops, unittest_enormous_descriptor.proto still needs to be in the dist. 2009-08-11 00:23:25 +00:00
kenton@google.com
e133abd01c Don't build unittest_enormous_decsriptor.proto in C++ because it's very slow on older GCCs. This file was meant for testing Java anyway. 2009-08-11 00:18:23 +00:00
kenton@google.com
09b9e99bd3 Make tests compile on Sun Studio. Patch from Monty Taylor. 2009-08-10 20:23:41 +00:00
temporal
bcb791a9d0 Experimental alternative build definition. 2009-08-10 08:12:18 +00:00
kenton@google.com
323e6321c6 doc comment tweaks 2009-08-08 03:23:04 +00:00
kenton@google.com
75fcd790c4 Silence pedantic warning about unused parameter. 2009-08-07 21:51:30 +00:00
kenton@google.com
7ddfb4c3c7 Remove semi-broken Java thread-local builder freelist 'optimization'. Maybe bring back later in optional form. 2009-08-07 21:19:29 +00:00
kenton@google.com
68996fc874 Gigantic descriptors shouldn't overflow the Java string literal size limit. 2009-08-07 21:02:02 +00:00
kenton@google.com
445f1023e1 Update version number to 2.2.0-pre. 2009-08-06 23:01:43 +00:00
kenton@google.com
1a34c92e73 Make sure GeneratedMessageFactory is deleted on shutdown. 2009-08-06 22:17:26 +00:00
kenton@google.com
58ebb1ccf8 Fix argument order -- I guess this macro is unused... 2009-08-04 01:23:07 +00:00
temporal
43af40dcca Remove @Override annotations that cause compiler errors on Java 1.5. 2009-08-01 07:37:11 +00:00
temporal
f837b0066d Use the nice macro to declare once-init control objects, like good little coders should. Otherwise the initialization routines never run on Mac. TODO: Investigate how this was broken. 2009-08-01 07:30:49 +00:00
kenton@google.com
9270a99d2e Make DLLs work again. 2009-08-01 02:16:55 +00:00
kenton@google.com
c3a24531d1 Hurr, some merge conflict was resolved poorly. Fixed. 2009-08-01 00:44:01 +00:00
kenton@google.com
253a850804 Allow compression level of GzipOutputStream to be configured. 2009-08-01 00:38:45 +00:00
kenton@google.com
1900c536cd Fix compile for GCC 3.4.4. 2009-08-01 00:30:11 +00:00
kenton@google.com
c137750365 Remove two empty source files. This doesn't actually have any effect on code size but might as well get rid of them. 2009-07-29 21:48:13 +00:00
kenton@google.com
4f3491ee5f Decouple strutil from C++ lite library for a further 23k reduction. 2009-07-29 21:33:08 +00:00
kenton@google.com
858a22be11 Define libprotobuf-lite in Makefile.am.
TODO:  Compile conditionally?  Provide a way to omit ExtensionSet?
  Should libprotobuf depend on libprotobuf-lite instead of being a
  stand-alone lib?
2009-07-29 02:21:47 +00:00
kenton@google.com
80b1d62bfc Submit recent changes from internal branch, including "lite mode" for
C++ and Java.  See CHANGES.txt for more details.
2009-07-29 01:13:20 +00:00
kenton@google.com
d2fd0638c3 Down-integrate some code from an internal branch. (More to come.) 2009-07-24 01:00:35 +00:00
kenton@google.com
ceb561d65b Add Swap(), SwapElements(), and RemoveLast() to Reflection. Patch by Scott Stafford. 2009-06-25 19:05:36 +00:00
Adam Bliss
c1a443d486 Adds a few utilities to ProtoBufUtil, integrating over from mainline 2009-06-10 17:40:19 -07:00
Mitsuru Oshima
7e013cacd4 Revert "ProtoBuf update"
This reverts commit 9aaf507646c866ab131bf2bcd973882ff9f553cf.
2009-06-10 16:16:02 -07:00
Mitsuru Oshima
babfb77851 ProtoBuf update
* Added IntMap that uses Hashtable for larger keys
 * Chagned to use IntMap to allow larger tags
 * Changed to use autoboxing for int/longs.
2009-06-10 10:28:53 -07:00
kenton@google.com
f22943c7d0 Fix build problem with -std=gnu++0x. 2009-06-01 18:27:23 +00:00
kenton@google.com
b43727981c Fix final leak (win32 only). 2009-05-18 18:38:56 +00:00
kenton@google.com
1fb3d394e5 Update version number in trunk. 2009-05-13 23:20:03 +00:00
kenton@google.com
1d4df6caa4 Fix compile error on Cygwin, where int32 is typedefed to long instead of int, and the compiler can't figure out which overload of this method to use in that case. 2009-05-06 22:17:46 +00:00
kenton@google.com
63e646b7ad Provide ShutdownProtobufLibrary() which frees all startup-allocated objects. 2009-05-06 19:27:03 +00:00
kenton@google.com
9824eda6b5 enable cross-compiling 2009-05-06 17:49:37 +00:00
kenton@google.com
42c81e1a76 Set better default CXXFLAGS and don't use optimization when compiling tests
(takes too long).
2009-05-06 01:15:06 +00:00
temporal
1589b1d8c1 Fix startup crash when statically linking on Mac. 2009-04-28 08:09:44 +00:00
kenton@google.com
c5ff06cc74 Add second run of cpp_unittest which verifies that descriptors are constructed lazily. This is accomplished by avoiding any use of descriptors while testing a bunch of other operations, then checking at the end that descriptors have not been constructed. 2009-04-28 03:06:41 +00:00
kenton@google.com
503a4dd705 Convert some \u escape sequences to UTF-8 because MSVC interprets them differently. 2009-04-28 02:16:53 +00:00
kenton@google.com
30be0a8758 Don't use dll-export declspec on class-nested extensions. 2009-04-28 02:10:27 +00:00
kenton@google.com
ccc11678c7 Make building libprotobuf as a DLL work again. 2009-04-28 01:48:06 +00:00
kenton@google.com
ef3730c2df Add test verifying that protoc accepts trailing backslashes on Windows, which some users claim doesn't work. Seems to work on my machine. 2009-04-28 00:49:36 +00:00
kenton@google.com
d33e53ad4c That last rev shouldn't have compiled, but apparently did, for some reason. Fixed. 2009-04-28 00:44:15 +00:00
kenton@google.com
db4b583084 Protect a new death test with GTEST_HAS_DEATH_TEST, since MinGW doesn't support it. 2009-04-28 00:42:42 +00:00
kenton@google.com
50ede8ba17 Update MSVC project files for rev 120, and add instructions for compiling with zlib. 2009-04-27 22:28:10 +00:00
kenton@google.com
d37d46dfbc Integrate recent changes from Google-internal code tree. See CHANGES.txt
for details.
2009-04-25 02:53:47 +00:00