Client: php
Patch: Randy Abernethy
The compiler is generating the namespace statement even when there isn't one, which blows up the PHP interpreter. Patch supresses service and type file output of namespace unless there actually is one.
Client: Java Lib
Patch: Paul Magrath
This closes#590
commit c01aff7038adb9fa2098c02d0092757834fd4df4
Author: Paul Magrath <paul@swiftkey.com>
Date: 2015-08-17T17:25:24Z
THRIFT-3300 Reimplement TZlibTransport in Java using streams
Client: c_glib
Patch: Simon South <ssouth@simonsouth.com>
The compiler now correctly generates code for string lists (i.e. variables of type list<string>) that are
- Passed as a parameter to a service method,
- Returned from a service method or
- Assigned a default value.
Added a unit test that covers containers (initially only string lists) used as parameters to and return values from
service methods, and as members with default values inside structs.
This change gently refactors a handful of recently modified
functions to
- Wrap lines at 80 columns,
- Improve readability (making the layout of the compiler's source
code more closely match that of the code it's generating),
- Use more consistently the indent_up/indent_down and
scope_up/scope_down helper functions rather than embedding
formatting characters directly, and
- Improve slightly the formatting of the generated code.
These changes allow the unit tests for C (GLib) to build without
compiler warnings, even with additional warnings enabled. They
include
- Disabling string-function optimizations when glibc is used, as
these produce compiler warnings when a string function is used
within a call to assert ();
- Remove the "LL" suffix (added in C99) from 64-bit integer
literals;
- Replace C++-style ("//") comments with C-style equivalents;
- Remove unused constant declarations that generated warnings;
and
- Mark (or remove, from main ()) unused function parameters.
This change moves variable declarations to the top of code blocks
in the generated code, resolving a number of "ISO C90 forbids mixed
declarations and code" warnings when building the unit tests.
This change
- Enables the same comprehensive set of warnings ("-Wall -Wextra
-pedantic") specified for the unit tests for C++ and
- Changes the use of automake variables (e.g. AM_CPPFLAGS) to more
closely match their intended use, as specified in the automake
documentation.
These changes allow the C (GLib) library to be built without
warnings from the compiler, even with extra compiler warnings
enabled. The changes involve
- Moving variable declarations to the top of every code block,
- Using unions instead of type-punning to follow strict-aliasing
rules,
- Replacing variable-length array declarations with arrays
allocated on the stack (using g_newa and g_alloca),
- Casting void pointers to a suitably sized data type before
performing arithmetic on them,
- Replacing C++-style ("//") comments with C-style equivalents,
and
- Removing an errant semicolon and comma.
This closes#576
Client: c_glib
Simon South <ssouth@simonsouth.com>
This closes#573
Here are additional changes that should really and truly resolve all the warnings generated when building the c_glib tutorial:
Compiler:
- Do not output a trailing comma in exception-enum definitions.
- Move variable declarations to avoid mixing declarations and code in generated code.
- Improve the readability of affected code blocks (and rely on indent_up and indent_down for indentation).
Library
- Use only C-style comments in headers included by clients.
Tutorial
- Move THRIFT_UNUSED_VAR calls to avoid mixing declarations and code.
The current max delay is unstable - when retry_delay == retry_max_delay the
second branch is taken, and retry_delay is set to retry_max_delay *
retry_backoff, which is larger than retry_max_delay.
This causes an oscillation between retry_max_delay and retry_max_delay *
retry_backoff.
This simply fixed it.
Currently retry variables are only initialized after a connection has been
successfully established. When the initial connection fails the retry logic is
broken since the state has not been properly initialized.
To solve this, we need to initialize the retry state before the initial
connect() request.
Client: c_glib
Patch: Simon South <ssouth@simonsouth.com>
This closes#572
Tutorial:
- Silence unused-function warnings
- Remove spurious ";" from GObject type macro
Compiler:
- Suppress unused-var warnings in client initializers
- Omit spurious ";" after GObject type macros