Fixed compile errors and warnings on linux.
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1088 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/preprocessor/new/Input.cpp b/src/compiler/preprocessor/new/Input.cpp
index 8ff4d9e..c3de95f 100644
--- a/src/compiler/preprocessor/new/Input.cpp
+++ b/src/compiler/preprocessor/new/Input.cpp
@@ -8,6 +8,7 @@
#include <algorithm>
#include <cassert>
+#include <cstring>
namespace pp
{
diff --git a/tests/preprocessor_tests/input_test.cpp b/tests/preprocessor_tests/input_test.cpp
index 8297232..47edb7c 100644
--- a/tests/preprocessor_tests/input_test.cpp
+++ b/tests/preprocessor_tests/input_test.cpp
@@ -44,14 +44,14 @@
TEST(InputTest, NullLength)
{
- char* str[] = {"foo"};
+ const char* str[] = {"foo"};
pp::Input input(1, str, NULL);
EXPECT_EQ(3, input.length(0));
}
TEST(InputTest, NegativeLength)
{
- char* str[] = {"foo"};
+ const char* str[] = {"foo"};
int length[] = {-1};
pp::Input input(1, str, length);
EXPECT_EQ(3, input.length(0));
@@ -59,7 +59,7 @@
TEST(InputTest, ActualLength)
{
- char* str[] = {"foobar"};
+ const char* str[] = {"foobar"};
int length[] = {3};
pp::Input input(1, str, length);
// Note that strlen(str[0]) != length[0].
@@ -69,7 +69,7 @@
TEST(InputTest, String)
{
- char* str[] = {"foo"};
+ const char* str[] = {"foo"};
pp::Input input(1, str, NULL);
EXPECT_STREQ(str[0], input.string(0));
}
@@ -77,7 +77,7 @@
TEST(InputTest, ReadSingleString)
{
int count = 1;
- char* str[] = {"foo"};
+ const char* str[] = {"foo"};
char buf[4] = {'\0', '\0', '\0', '\0'};
int maxSize = 1;
@@ -114,7 +114,7 @@
TEST(InputTest, ReadMultipleStrings)
{
int count = 3;
- char* str[] = {"f", "o", "o"};
+ const char* str[] = {"f", "o", "o"};
char buf[4] = {'\0', '\0', '\0', '\0'};
int maxSize = 1;
@@ -151,7 +151,7 @@
TEST(InputTest, ReadStringsWithLength)
{
int count = 2;
- char* str[] = {"foo", "bar"};
+ const char* str[] = {"foo", "bar"};
// Note that the length for the first string is 2 which is less than
// strlen(str[0]. We want to make sure that the last character is ignored.
int length[] = {2, 3};