Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
0750797d
Commit
0750797d
authored
Jul 26, 2016
by
Jisi Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/3.0.0-GA' into 3.0.0-GA
parents
54feb9ac
b6b521b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
14 deletions
+23
-14
Makefile.am
src/Makefile.am
+1
-1
int128.cc
src/google/protobuf/stubs/int128.cc
+3
-3
port.h
src/google/protobuf/stubs/port.h
+11
-9
time_util.cc
src/google/protobuf/util/time_util.cc
+8
-1
No files found.
src/Makefile.am
View file @
0750797d
...
...
@@ -547,7 +547,7 @@ EXTRA_DIST = \
google/protobuf/package_info.h
\
google/protobuf/io/package_info.h
\
google/protobuf/compiler/ruby/ruby_generated_code.proto
\
google/protobuf/compiler/ruby/ruby_generated_code
.rb
\
google/protobuf/compiler/ruby/ruby_generated_code
_pb.rb
\
google/protobuf/compiler/package_info.h
\
google/protobuf/compiler/zip_output_unittest.sh
\
README.md
...
...
src/google/protobuf/stubs/int128.cc
View file @
0750797d
...
...
@@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) {
std
::
streamsize
div_base_log
;
switch
(
flags
&
std
::
ios
::
basefield
)
{
case
std
:
:
ios
::
hex
:
div
=
GOOGLE_ULONGLONG
(
0x1000000000000000
);
// 16^15
div
=
static_cast
<
uint64
>
(
GOOGLE_ULONGLONG
(
0x1000000000000000
)
);
// 16^15
div_base_log
=
15
;
break
;
case
std
:
:
ios
::
oct
:
div
=
GOOGLE_ULONGLONG
(
01000000000000000000000
);
// 8^21
div
=
static_cast
<
uint64
>
(
GOOGLE_ULONGLONG
(
01000000000000000000000
)
);
// 8^21
div_base_log
=
21
;
break
;
default
:
// std::ios::dec
div
=
GOOGLE_ULONGLONG
(
10000000000000000000
);
// 10^19
div
=
static_cast
<
uint64
>
(
GOOGLE_ULONGLONG
(
10000000000000000000
)
);
// 10^19
div_base_log
=
19
;
break
;
}
...
...
src/google/protobuf/stubs/port.h
View file @
0750797d
...
...
@@ -109,15 +109,15 @@ typedef unsigned __int16 uint16;
typedef
unsigned
__int32
uint32
;
typedef
unsigned
__int64
uint64
;
#else
typedef
signed
char
int8
;
typedef
shor
t
int16
;
typedef
int
int32
;
typedef
long
long
int64
;
typedef
u
nsigned
char
uint8
;
typedef
u
nsigned
shor
t
uint16
;
typedef
u
nsigned
in
t
uint32
;
typedef
u
nsigned
long
long
uint64
;
typedef
int8_t
int8
;
typedef
int16_
t
int16
;
typedef
int
32_t
int32
;
typedef
int64_t
int64
;
typedef
u
int8_t
uint8
;
typedef
u
int16_
t
uint16
;
typedef
u
int32_
t
uint32
;
typedef
u
int64_t
uint64
;
#endif
// long long macros to be used because gcc and vc++ use different suffixes,
...
...
@@ -131,8 +131,10 @@ typedef unsigned long long uint64;
#define GOOGLE_ULONGLONG(x) x##UI64
#define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...)
#else
// By long long, we actually mean int64.
#define GOOGLE_LONGLONG(x) x##LL
#define GOOGLE_ULONGLONG(x) x##ULL
// Used to format real long long integers.
#define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also.
#endif
...
...
src/google/protobuf/util/time_util.cc
View file @
0750797d
...
...
@@ -142,6 +142,13 @@ int64 RoundTowardZero(int64 value, int64 divider) {
}
}
// namespace
// Actually define these static const integers. Required by C++ standard (but
// omitting them may still work with some compilers).
const
int64
TimeUtil
::
kTimestampMinSeconds
;
const
int64
TimeUtil
::
kTimestampMaxSeconds
;
const
int64
TimeUtil
::
kDurationMaxSeconds
;
const
int64
TimeUtil
::
kDurationMinSeconds
;
string
TimeUtil
::
ToString
(
const
Timestamp
&
timestamp
)
{
return
FormatTime
(
timestamp
.
seconds
(),
timestamp
.
nanos
());
}
...
...
@@ -174,7 +181,7 @@ string TimeUtil::ToString(const Duration& duration) {
seconds
=
-
seconds
;
nanos
=
-
nanos
;
}
result
+=
S
tringPrintf
(
"%"
GOOGLE_LL_FORMAT
"d"
,
seconds
);
result
+=
S
impleItoa
(
seconds
);
if
(
nanos
!=
0
)
{
result
+=
"."
+
FormatNanos
(
nanos
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment