Commit Graph

659 Commits

Author SHA1 Message Date
Bryan Duxbury
f38b2f10fb THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
Forgot a small chunk of the previous patch.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@999019 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 17:41:40 +00:00
Bryan Duxbury
e59a80fbf9 THRIFT-901. hs: Allow the bindings to compile without -fglasgow-exts and with -Wall -Werror
This patch makes the bindings compile with pedantic warning levels, and individually declares each required language extension.

Patch: Christian Lavoie

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998955 13f79535-47bb-0310-9956-ffa450edef68
2010-09-20 15:21:37 +00:00
Bryan Duxbury
d920765c66 THRIFT-882. java: deep copy of binary fields does not copy ByteBuffer characteristics (arrayOffset, position)
This patch ensures that binary fields are copied correctly.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@998275 13f79535-47bb-0310-9956-ffa450edef68
2010-09-17 19:27:36 +00:00
David Reiss
bdd6261b33 Fix enum value lookups in C++
The recent enum change was causing enums to break if used as constant
values by the C++ generator.  The problem was that we were searching for
the fully-qualified constant name (enum_name.VALUE_NAME) in the enum
values.  This didn't affect Java because it just uses symbolic names in
the generated code.  Fix it by grabbing the base name before doing the
search.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996610 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:14 +00:00
David Reiss
8d7667c27f Don't segfault if t_enum::get_constant_by_name fails
The recent enum change was causing t_enum::get_constant_by_name to fail
in t_const_value::get_integer.  This was causing a difficult-to-debug
segfault.  Check for failure and throw an exeception.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996609 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 17:32:13 +00:00
Bryan Duxbury
d4235e0a47 THRIFT-870. java: Java constants don't get Javadoc comments
Fix a trivial oversight.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996592 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 16:28:53 +00:00
Bryan Duxbury
a7420b6593 THRIFT-894. java: Make default accessors for binary fields return byte[]; provide new accessors to get ByteBuffer version
This patch causes the underlying ByteBuffer that backs a binary field to be hidden behind a default accessor that provides a byte[] interface. This should allow users who skipped 0.4 to update their generated code without breaking any of their other code. A new accessor has been added that allows a way down to the underlying ByteBuffer for those experts who want to take advantage.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996579 13f79535-47bb-0310-9956-ffa450edef68
2010-09-13 15:42:36 +00:00
Bryan Duxbury
76ecb91c3d THRIFT-897. compiler: Don't allow unqualified enum constant access
Fix some confusion in the java generator about adding the class name.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996327 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:29:38 +00:00
Bryan Duxbury
cb0218f5c8 THRIFT-897. compiler: Don't allow unqualified enum constant references
Missed a spot.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996325 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 15:22:21 +00:00
Bryan Duxbury
9f0a786dad THRIFT-897. compiler: Don't allow unqualified constant access to enum values
This patch makes it illegal to refer to enum values by just their names in the IDL. Now, you must also provide the enum type's name as well.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996320 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 14:38:36 +00:00
David Reiss
b6c50e5658 THRIFT-895. cpp: By default, generate enums as class-scoped enums
Most of the other Thrift languages either have enum values that are
scoped to the type or emulate enums in that way.  Now C++ does the same
by default.  "enum Foo" in a .thrift file will be generated as Foo::type
so the values can be called Foo::value1, etc.  The "pure_enums" compiler
option restores the old behavior.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@996015 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 23:00:40 +00:00
Bryan Duxbury
04650afb87 THRIFT-544. erl: multiple enums with the same key generate invalid code
This adds the enum name to the generated constants to avoid collisions.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@995924 13f79535-47bb-0310-9956-ffa450edef68
2010-09-10 18:49:53 +00:00
Bryan Duxbury
bbff4a8e7e Fix to the catch-all namespace commit
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992458 13f79535-47bb-0310-9956-ffa450edef68
2010-09-03 20:36:02 +00:00
David Reiss
fb790d7262 Allow "*" as a catch-all namespace.
In an IDL file, you can can now declare "namespace * foo",
which will apply to any language not explicitly specified.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@992012 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 16:41:45 +00:00
Bryan Duxbury
c377c32168 THRIFT-257. py: Support validation of required fields
Patch: Esteve Fernandez

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991987 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 15:37:19 +00:00
Bryan Duxbury
c43ec6247a THRIFT-634. csharp: C# Compiler Generates Incorrect Code For Fields which begin with an uppercase letter
Added a '_' to the backing field, and changed all the field references to refer to the property instead.

Patch: Jon S Akhtar

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991960 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:58:51 +00:00
Bryan Duxbury
1316ed9d16 THRIFT-673. py: Generated Python code has whitespace issues
This patch trims several forms of trailing whitespace.

Patch: Ian Eure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991945 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 14:20:01 +00:00
Bryan Duxbury
727d67dcfa THRIFT-721. py: THttpClient ignores url parameters
Respect query string in THttpClient and generated remotes. Also, add an error message on unknown methods.

Patch: Thomas Kho

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991786 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 01:00:19 +00:00
Bryan Duxbury
773b8dbf30 THRIFT-805. cocoa: Don't generate process_XXXX methods for oneway methods
Patch: Brad Taylor

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991783 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:43:16 +00:00
Bryan Duxbury
e02d6118bf THRIFT-838. cocoa: Generated Cocoa classes have useless @dynamic declarations
This patch removes the @dynamic properties.

Patch: Kevin Ballard

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991779 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:29:08 +00:00
Bryan Duxbury
cd9f200b9d THRIFT-884. html: HTML Generator: add Key attribute to the Data Types Tables
This patch adds the Key attribute to the Data Types Tables.

Patch: Roger Meier

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991775 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:12:22 +00:00
Bryan Duxbury
0f4078dbf5 THRIFT-860. ocaml: copy method and reset method
The attached patch provides the class copying and reset-to-default values methods.

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991774 13f79535-47bb-0310-9956-ffa450edef68
2010-09-02 00:07:20 +00:00
David Reiss
5ad126044d THRIFT-874. Include missing time.h in two compiler files
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991255 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:30 +00:00
David Reiss
4563acdd23 THRIFT-865. Make Thrift buildable without libfl
yywrap is only needed if we need one lexer context to traverse multiple
input files.  This feature isn't used by Thrift, so we disable it with
"option noyywrap".  With yywrap disabled, there is no need to link to
libfl if flex is the lex implementation used.

With this patch, release tarballs can be built without lex.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991254 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:29 +00:00
David Reiss
ef5e81b1ac THRIFT-507. Only use Boost for building the C++ library
- Make AX_BOOST_BASE warn instead of fataling if Boost is not found.
- If Boost is not found, disable compilation of the C++ library.
- Do not use CPPFLAGS or LDFLAGS from Boost when building the compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991253 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:28 +00:00
David Reiss
aca320d395 THRIFT-507. Stop using boost::lexical_cast in the compiler
We were using boost::lexical_cast to convert an integer to a string,
but using a stringstream is only slightly more complicated.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991252 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:26 +00:00
David Reiss
38f8959779 THRIFT-507. ruby: Stop using boost::tokenizer
Previously, the Ruby generated used boost::tokenizer to produce a
vector of namespace components from a dot-delimited namespace string.
We can do this manually with only a slight increase in complexity.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991251 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:25 +00:00
David Reiss
bfab32a3b3 THRIFT-507. smalltalk: Remove an unnecessary include (boost/tokenizer)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991250 13f79535-47bb-0310-9956-ffa450edef68
2010-08-31 16:51:24 +00:00
David Reiss
eb207273ea erlang: Make the gen-code return a special value for bogus functions
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990978 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:27 +00:00
David Reiss
f32d0fb900 Rollback a few recent Erlang changes to fix blame data
My combined patch for THRIFT-599 was committed, but it is preferable
commit the individual patches to preserve the more detailed log and
blame data.  I'll recommit r987018 as a sequence of patches and r988722
as its own rev.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990957 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 22:05:00 +00:00
Bryan Duxbury
4d8a9cd569 THRIFT-877. compiler: smalltalk namespace doesn't work
This patch adds a special case to map 'smalltalk' to 'st' when checking for valid namespace declarations.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@990866 13f79535-47bb-0310-9956-ffa450edef68
2010-08-30 17:09:58 +00:00
David Reiss
e3ba3490de Clean up some style from r987565
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@989948 13f79535-47bb-0310-9956-ffa450edef68
2010-08-26 21:49:45 +00:00
Bryan Duxbury
66467a7779 THRIFT-693. java: Thrift compiler generated java code that throws compiler warnings about deprecated methods.
This patch removes the deprecated methods from TBase and makes some generator changes to accommodate.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987805 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 17:48:18 +00:00
Bryan Duxbury
c39817c9a7 THRIFT-859. py: Allow py:twisted to be generated in different namespace than py
This patch adds support for the 'twisted' sub-namespace to the python code generator.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987566 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:45:13 +00:00
Bryan Duxbury
681f5eae6d compiler: make a standard way for language generators to accept sub-namespaces
This patch adds a new method to t_generator that allows the compiler to avoid special cases in checking for sub-namespaces in the Thrift IDL.

Patch: Bruce Lowekamp

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987565 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 16:42:04 +00:00
Bryan Duxbury
d3879f80c6 THRIFT-599. erl: Don't use unnecessary processes in the Erlang transports and clients
The only user-visible changes are to the client. Every thrift call now returns {NewClient, Result} instead of just Result.

Patch: David Reiss (assist to Anthony Molinaro)

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@987018 13f79535-47bb-0310-9956-ffa450edef68
2010-08-19 05:06:02 +00:00
Bryan Duxbury
4d0e2b48bf THRIFT-852. Missing newline causes many compiler warnings
This patch adds a newline to the end of t_generator_registry.h

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985771 13f79535-47bb-0310-9956-ffa450edef68
2010-08-15 22:57:07 +00:00
Bryan Duxbury
66c334792b THRIFT-827. ocaml: OCaml generator to take default values into account
A patch to the OCaml generator which uses default values defined in the .thrift file to initialize the members of the generated class. 

Patch: Lev Walkin

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@985041 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 23:37:47 +00:00
David Reiss
e2350512c9 THRIFT-676. cpp: Move __isset definition for SWIG-compatibility
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984979 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 21:15:04 +00:00
Bryan Duxbury
07b2ed1df5 THRIFT-832. html: HTML generator shows unspecified struct fields as 'required'
This patch causes required/optional/default to reported appropriately.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984868 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 17:21:06 +00:00
Bryan Duxbury
34b530f099 THRIFT-570. Thrift compiler does not error when duplicate method names are present
This patch causes the compiler to throw an exception when duplicate method names are found.

Patch: Bruce Simpson

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@984628 13f79535-47bb-0310-9956-ffa450edef68
2010-08-12 01:48:51 +00:00
Bryan Duxbury
f5abd26858 THRIFT-830. java: Switch binary field implementation from byte[] to ByteBuffer
This patch switches the implementation of binary fields to ByteBuffer in the Java generated code, yielding up to 2.5x speed boost.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982839 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 00:18:25 +00:00
Bryan Duxbury
7f3285eddb THRIFT-434. ruby compiler should warn when a reserved word is used
This patch adds a bunch of new reserved words to the lexer.

Patch: Michael Stockton

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982827 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:28:14 +00:00
Bryan Duxbury
8fc413fbfd THRIFT-554. multiple enums with the same key generate invalid code
This patch causes multiple enums with the same name to trigger a parser error.

Patch: Ben Taitelbaum

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982825 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 23:23:04 +00:00
Bryan Duxbury
20dbec7cfe THRIFT-782. perl: Perl code for writing containers doesn't count length of write*Begin or write*End
This patch adds appropriate accounting of the start and end bytes when writing out container types.
Patch: Conrad Hughes

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982812 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 22:28:13 +00:00
Bryan Duxbury
5226eeaaaa THRIFT-751. java: Add clear() method to TBase
This patch adds a clear() method to the TBase interface and causes the compiler to generate implementations.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982774 13f79535-47bb-0310-9956-ffa450edef68
2010-08-05 20:44:53 +00:00
Bryan Duxbury
c412a2fad4 THRIFT-133. add missing file to makefile.am
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@982359 13f79535-47bb-0310-9956-ffa450edef68
2010-08-04 18:51:57 +00:00
Bryan Duxbury
c687712d18 THRIFT-133. fix a small bug with smalltalk.prefix and smalltalk.package namespaces.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980538 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 18:39:06 +00:00
Bryan Duxbury
e0ac3abd53 THRIFT-133. 'namespace ruby' should error out, or be an alias to 'namespace rb'
This patch causes 'namespace ruby' (or any unrecognized generator name) to produce an error.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@980498 13f79535-47bb-0310-9956-ffa450edef68
2010-07-29 16:24:41 +00:00
David Reiss
95c005a7c6 THRIFT-395. python: Add option to treat strings as UTF-8 unicode
Add the "utf8strings" option to the Python generator.  If set, all
Thrift strings (not binary) will be expected to be unicode objects, not
str.  They will be encoded as UTF-8 before serialization and decoded as
UTF-8 after deserialization.

The accelerator module for TBinaryProtocol is not affected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@959516 13f79535-47bb-0310-9956-ffa450edef68
2010-07-01 05:36:25 +00:00