-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.9
-
Fix Version/s: 0.9.1
-
Component/s: C++ - Library
-
Labels:
-
Environment:
Windows and any Unix
-
Patch Info:Patch Available
The patches allow the current trunk of Thrift C++ to
build without warnings in Visual Studio and GNU gcc.
I introduce THRIFT_SAFE_CAST in Thrift.h, which tests narrowing
conversions for fit. Would-be overflows throw std::runtime_error.
Some functions have been modified or overloaded to allow size_t
parameters. SOCKET is dealt with intelligently.
IMO every public thrift function should have a form accepting normal
types – including e.g. short, int, long, and size_t – and apply casts
as necessary. In particular size_t is important because std
constainers have size() members that usually return something like
size_t.