Get rid of some crufty macros.

These were macros that were never used, or that were only set to one thing and
could be substituted up front.

I left in code guarded by the HAVE_ENDIAN_H and HAVE_LITTLE_ENDIAN macros even
though those are never defined because they guard a reportedly significantly
faster implementation of some functionality, at least according to a comment
in the source. It would be a good idea to enable that code path and see if it
really does make a big difference before removing it entirely.

BUG=None
TEST=Built for Link, Daisy, and the host with FEATURES=test. Built depthcharge
for Link and booted in normal mode.
BRANCH=None

Change-Id: I934a4dd0da169ac018ba07350d56924ab88b1acc
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/45687
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
Gabe Black
2013-03-16 04:03:40 -07:00
committed by ChromeBot
parent 77f55ca1cd
commit ac8805e7e9
43 changed files with 57 additions and 199 deletions

View File

@@ -80,24 +80,24 @@ static void Uint64ToStringTest(void) {
TestU64ToS(0x9A, 2, 0, "10011010");
TestU64ToS(0x71, 2, 12, "000001110001");
TestU64ToS(
~UINT64_C(0), 2, 0,
~0ULL, 2, 0,
"1111111111111111111111111111111111111111111111111111111111111111");
/* Decimal */
TestU64ToS(0, 10, 0, "0");
TestU64ToS(12345, 10, 0, "12345");
TestU64ToS(67890, 10, 8, "00067890");
TestU64ToS(~UINT64_C(0), 10, 0, "18446744073709551615");
TestU64ToS(~0ULL, 10, 0, "18446744073709551615");
/* Hex */
TestU64ToS(0, 16, 0, "0");
TestU64ToS(0x12345678, 16, 0, "12345678");
TestU64ToS(0x9ABCDEF, 16, 8, "09abcdef");
TestU64ToS(~UINT64_C(0), 16, 0, "ffffffffffffffff");
TestU64ToS(~0ULL, 16, 0, "ffffffffffffffff");
/* Zero pad corner cases */
/* Don't pad if over length */
TestU64ToS(UINT64_C(0x1234567890), 16, 8, "1234567890");
TestU64ToS(0x1234567890ULL, 16, 8, "1234567890");
/* Fail if padding won't fit in buffer */
TEST_EQ(0, Uint64ToString(dest, 8, 123, 10, 8), "Uint64ToString bad pad");
TEST_EQ(0, strcmp(dest, ""), "Uint64ToString bad pad result");
@@ -105,9 +105,6 @@ static void Uint64ToStringTest(void) {
}
/* disable MSVC warnings on unused arguments */
__pragma(warning (disable: 4100))
int main(int argc, char* argv[]) {
int error_code = 0;