diff --git a/llvmutil.cpp b/llvmutil.cpp index f7fa041f..e21a0b12 100644 --- a/llvmutil.cpp +++ b/llvmutil.cpp @@ -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); diff --git a/parse.yy b/parse.yy index 30144a67..c4db2fa9 100644 --- a/parse.yy +++ b/parse.yy @@ -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($2); if (st == NULL) { Error(@1, "\"soa\" qualifier is illegal with non-struct type \"%s\".", diff --git a/util.cpp b/util.cpp index 92c1bac1..18c6d58e 100644 --- a/util.cpp +++ b/util.cpp @@ -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 {