Internal changes

PiperOrigin-RevId: 544976965
pull/13203/head
Mike Kruskal 2 years ago committed by Copybara-Service
parent fa4f15e320
commit 3688ddb5b3
  1. 4
      objectivec/GPBCodedOutputStream.m
  2. 4
      objectivec/GPBUtilities_PackagePrivate.h

@ -130,14 +130,14 @@ static void GPBWriteTagWithFormat(GPBOutputBufferState *state, uint32_t fieldNum
}
static void GPBWriteRawLittleEndian32(GPBOutputBufferState *state, int32_t value) {
GPBWriteRawByte(state, (value)&0xFF);
GPBWriteRawByte(state, (value) & 0xFF);
GPBWriteRawByte(state, (value >> 8) & 0xFF);
GPBWriteRawByte(state, (value >> 16) & 0xFF);
GPBWriteRawByte(state, (value >> 24) & 0xFF);
}
static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state, int64_t value) {
GPBWriteRawByte(state, (int32_t)(value)&0xFF);
GPBWriteRawByte(state, (int32_t)(value) & 0xFF);
GPBWriteRawByte(state, (int32_t)(value >> 8) & 0xFF);
GPBWriteRawByte(state, (int32_t)(value >> 16) & 0xFF);
GPBWriteRawByte(state, (int32_t)(value >> 24) & 0xFF);

@ -124,7 +124,7 @@ GPB_INLINE int64_t GPBLogicalRightShift64(int64_t value, int32_t spaces) {
// negative values must be sign-extended to 64 bits to be varint encoded,
// thus always taking 10 bytes on the wire.)
GPB_INLINE int32_t GPBDecodeZigZag32(uint32_t n) {
return (int32_t)(GPBLogicalRightShift32((int32_t)n, 1) ^ -((int32_t)(n)&1));
return (int32_t)(GPBLogicalRightShift32((int32_t)n, 1) ^ -((int32_t)(n) & 1));
}
// Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers
@ -132,7 +132,7 @@ GPB_INLINE int32_t GPBDecodeZigZag32(uint32_t n) {
// negative values must be sign-extended to 64 bits to be varint encoded,
// thus always taking 10 bytes on the wire.)
GPB_INLINE int64_t GPBDecodeZigZag64(uint64_t n) {
return (int64_t)(GPBLogicalRightShift64((int64_t)n, 1) ^ -((int64_t)(n)&1));
return (int64_t)(GPBLogicalRightShift64((int64_t)n, 1) ^ -((int64_t)(n) & 1));
}
// Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers

Loading…
Cancel
Save