Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: webrtc/base/testutils.h

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/base/testclient.cc ('k') | webrtc/base/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 535
536 #define ASSERT_FILEEQ(expected, expected_length, filename) \ 536 #define ASSERT_FILEEQ(expected, expected_length, filename) \
537 ASSERT_PRED_FORMAT3(::testing::CmpHelperFileEq, expected, expected_length, \ 537 ASSERT_PRED_FORMAT3(::testing::CmpHelperFileEq, expected, expected_length, \
538 filename) 538 filename)
539 539
540 /////////////////////////////////////////////////////////////////////////////// 540 ///////////////////////////////////////////////////////////////////////////////
541 // Helpers for initializing constant memory with integers in a particular byte 541 // Helpers for initializing constant memory with integers in a particular byte
542 // order 542 // order
543 /////////////////////////////////////////////////////////////////////////////// 543 ///////////////////////////////////////////////////////////////////////////////
544 544
545 #define BYTE_CAST(x) static_cast<uint8>((x) & 0xFF) 545 #define BYTE_CAST(x) static_cast<uint8_t>((x)&0xFF)
546 546
547 // Declare a N-bit integer as a little-endian sequence of bytes 547 // Declare a N-bit integer as a little-endian sequence of bytes
548 #define LE16(x) BYTE_CAST(((uint16)x) >> 0), BYTE_CAST(((uint16)x) >> 8) 548 #define LE16(x) BYTE_CAST(((uint16_t)x) >> 0), BYTE_CAST(((uint16_t)x) >> 8)
549 549
550 #define LE32(x) BYTE_CAST(((uint32)x) >> 0), BYTE_CAST(((uint32)x) >> 8), \ 550 #define LE32(x) \
551 BYTE_CAST(((uint32)x) >> 16), BYTE_CAST(((uint32)x) >> 24) 551 BYTE_CAST(((uint32_t)x) >> 0), BYTE_CAST(((uint32_t)x) >> 8), \
552 BYTE_CAST(((uint32_t)x) >> 16), BYTE_CAST(((uint32_t)x) >> 24)
552 553
553 #define LE64(x) BYTE_CAST(((uint64)x) >> 0), BYTE_CAST(((uint64)x) >> 8), \ 554 #define LE64(x) \
554 BYTE_CAST(((uint64)x) >> 16), BYTE_CAST(((uint64)x) >> 24), \ 555 BYTE_CAST(((uint64_t)x) >> 0), BYTE_CAST(((uint64_t)x) >> 8), \
555 BYTE_CAST(((uint64)x) >> 32), BYTE_CAST(((uint64)x) >> 40), \ 556 BYTE_CAST(((uint64_t)x) >> 16), BYTE_CAST(((uint64_t)x) >> 24), \
556 BYTE_CAST(((uint64)x) >> 48), BYTE_CAST(((uint64)x) >> 56) 557 BYTE_CAST(((uint64_t)x) >> 32), BYTE_CAST(((uint64_t)x) >> 40), \
558 BYTE_CAST(((uint64_t)x) >> 48), BYTE_CAST(((uint64_t)x) >> 56)
557 559
558 // Declare a N-bit integer as a big-endian (Internet) sequence of bytes 560 // Declare a N-bit integer as a big-endian (Internet) sequence of bytes
559 #define BE16(x) BYTE_CAST(((uint16)x) >> 8), BYTE_CAST(((uint16)x) >> 0) 561 #define BE16(x) BYTE_CAST(((uint16_t)x) >> 8), BYTE_CAST(((uint16_t)x) >> 0)
560 562
561 #define BE32(x) BYTE_CAST(((uint32)x) >> 24), BYTE_CAST(((uint32)x) >> 16), \ 563 #define BE32(x) \
562 BYTE_CAST(((uint32)x) >> 8), BYTE_CAST(((uint32)x) >> 0) 564 BYTE_CAST(((uint32_t)x) >> 24), BYTE_CAST(((uint32_t)x) >> 16), \
565 BYTE_CAST(((uint32_t)x) >> 8), BYTE_CAST(((uint32_t)x) >> 0)
563 566
564 #define BE64(x) BYTE_CAST(((uint64)x) >> 56), BYTE_CAST(((uint64)x) >> 48), \ 567 #define BE64(x) \
565 BYTE_CAST(((uint64)x) >> 40), BYTE_CAST(((uint64)x) >> 32), \ 568 BYTE_CAST(((uint64_t)x) >> 56), BYTE_CAST(((uint64_t)x) >> 48), \
566 BYTE_CAST(((uint64)x) >> 24), BYTE_CAST(((uint64)x) >> 16), \ 569 BYTE_CAST(((uint64_t)x) >> 40), BYTE_CAST(((uint64_t)x) >> 32), \
567 BYTE_CAST(((uint64)x) >> 8), BYTE_CAST(((uint64)x) >> 0) 570 BYTE_CAST(((uint64_t)x) >> 24), BYTE_CAST(((uint64_t)x) >> 16), \
571 BYTE_CAST(((uint64_t)x) >> 8), BYTE_CAST(((uint64_t)x) >> 0)
568 572
569 // Declare a N-bit integer as a this-endian (local machine) sequence of bytes 573 // Declare a N-bit integer as a this-endian (local machine) sequence of bytes
570 #ifndef BIG_ENDIAN 574 #ifndef BIG_ENDIAN
571 #define BIG_ENDIAN 1 575 #define BIG_ENDIAN 1
572 #endif // BIG_ENDIAN 576 #endif // BIG_ENDIAN
573 577
574 #if BIG_ENDIAN 578 #if BIG_ENDIAN
575 #define TE16 BE16 579 #define TE16 BE16
576 #define TE32 BE32 580 #define TE32 BE32
577 #define TE64 BE64 581 #define TE64 BE64
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 << minor_version; 625 << minor_version;
622 LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3)."; 626 LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3).";
623 return false; 627 return false;
624 } 628 }
625 #endif 629 #endif
626 return true; 630 return true;
627 } 631 }
628 } // namespace testing 632 } // namespace testing
629 633
630 #endif // WEBRTC_BASE_TESTUTILS_H__ 634 #endif // WEBRTC_BASE_TESTUTILS_H__
OLDNEW
« no previous file with comments | « webrtc/base/testclient.cc ('k') | webrtc/base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698