Add prototypes for CheckMagic, IsArchive, and IsBytecode.
[oota-llvm.git] / include / Support / StringExtras.h
index 529d86caa205d771fed86918e07dee22e8709b17..2c50c1cd5be39b821e816d608210f298c8fcef89 100644 (file)
@@ -1,11 +1,18 @@
-//===-- Support/StringExtras.h - Useful string functions ---------*- C++ -*--=//
+//===-- Support/StringExtras.h - Useful string functions --------*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file contains some functions that are useful when dealing with strings.
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef SUPPORT_STRING_EXTRAS_H
-#define SUPPORT_STRING_EXTRAS_H
+#ifndef SUPPORT_STRINGEXTRAS_H
+#define SUPPORT_STRINGEXTRAS_H
 
 #include "Support/DataTypes.h"
 #include <string>
@@ -29,7 +36,7 @@ static inline std::string utohexstr(uint64_t X) {
   return std::string(BufPtr);
 }
 
-static inline std::string utostr(uint64_t X, bool isNeg = false) {
+static inline std::string utostr(unsigned long long X, bool isNeg = false) {
   char Buffer[40];
   char *BufPtr = Buffer+39;
 
@@ -54,6 +61,10 @@ static inline std::string itostr(int64_t X) {
 }
 
 
+static inline std::string utostr(unsigned long X, bool isNeg = false) {
+  return utostr((unsigned long long)X, isNeg);
+}
+
 static inline std::string utostr(unsigned X, bool isNeg = false) {
   char Buffer[20];
   char *BufPtr = Buffer+19;
@@ -80,7 +91,7 @@ static inline std::string itostr(int X) {
 
 static inline std::string ftostr(double V) {
   char Buffer[200];
-  snprintf(Buffer, 200, "%e", V);
+  snprintf(Buffer, 200, "%20.6e", V);
   return Buffer;
 }