Fix MSVC warnings.

This commit is contained in:
Matt Pharr
2012-04-20 10:50:39 -07:00
parent fe83ef7635
commit 4dfc596d38
3 changed files with 8 additions and 8 deletions

View File

@@ -880,7 +880,7 @@ lAllDivBaseEqual(llvm::Value *val, int64_t baseValue, int vectorLength,
// the addConstants[], mod baseValue. If we round that up to the
// next power of 2, we'll have a value that will be no greater than
// baseValue and sometimes less.
int maxMod = addConstants[0] % baseValue;
int maxMod = int(addConstants[0] % baseValue);
for (int i = 1; i < vectorLength; ++i)
maxMod = std::max(maxMod, int(addConstants[i] % baseValue));
int requiredAlignment = lRoundUpPow2(maxMod);

View File

@@ -549,7 +549,7 @@ rate_qualified_type_specifier
if ($2 == NULL)
$$ = NULL;
else {
int soaWidth = $1;
int soaWidth = (int)$1;
const StructType *st = dynamic_cast<const StructType *>($2);
if (st == NULL) {
Error(@1, "\"soa\" qualifier is illegal with non-struct type \"%s\".",

View File

@@ -101,7 +101,7 @@ lHaveANSIColors() {
static const char *
lStartBold() {
if (lHaveANSIColors())
return "\e[1m";
return "\033[1m";
else
return "";
}
@@ -110,7 +110,7 @@ lStartBold() {
static const char *
lStartRed() {
if (lHaveANSIColors())
return "\e[31m";
return "\033[31m";
else
return "";
}
@@ -119,7 +119,7 @@ lStartRed() {
static const char *
lStartBlue() {
if (lHaveANSIColors())
return "\e[34m";
return "\033[34m";
else
return "";
}
@@ -128,7 +128,7 @@ lStartBlue() {
static const char *
lResetColor() {
if (lHaveANSIColors())
return "\e[0m";
return "\033[0m";
else
return "";
}
@@ -192,7 +192,7 @@ static int
lFindIndent(int numColons, const char *buf) {
int indent = 0;
while (*buf != '\0') {
if (*buf == '\e') {
if (*buf == '\033') {
while (*buf != '\0' && *buf != 'm')
++buf;
if (*buf == 'm')
@@ -229,7 +229,7 @@ lPrintWithWordBreaks(const char *buf, int indent, int columnWidth, FILE *out) {
const char *msgPos = buf;
while (true) {
if (*msgPos == '\e') {
if (*msgPos == '\033') {
// handle ANSI color escape: copy it to the output buffer
// without charging for the characters it uses
do {