[llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h

Reid Spencer reid at x10sys.com
Thu Apr 21 19:32:07 PDT 2005



Changes in directory llvm/include/llvm/Support:

CommandLine.h updated: 1.42 -> 1.43
---
Log message:

Change some old-style casts to C++ style casts to avoid warnings in XPS
compilation. This change has been waiting in the wings for a long time but
since Misha just did a global change, I figured now was the time to commit
it.


---
Diffs of the changes:  (+4 -4)

 CommandLine.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Support/CommandLine.h
diff -u llvm/include/llvm/Support/CommandLine.h:1.42 llvm/include/llvm/Support/CommandLine.h:1.43
--- llvm/include/llvm/Support/CommandLine.h:1.42	Thu Apr 21 15:44:59 2005
+++ llvm/include/llvm/Support/CommandLine.h	Thu Apr 21 21:31:56 2005
@@ -294,9 +294,9 @@
 //===----------------------------------------------------------------------===//
 // Enum valued command line option
 //
-#define clEnumVal(ENUMVAL, DESC) #ENUMVAL, (int)ENUMVAL, DESC
-#define clEnumValN(ENUMVAL, FLAGNAME, DESC) FLAGNAME, (int)ENUMVAL, DESC
-#define clEnumValEnd ((void*)0)
+#define clEnumVal(ENUMVAL, DESC) #ENUMVAL, int(ENUMVAL), DESC
+#define clEnumValN(ENUMVAL, FLAGNAME, DESC) FLAGNAME, int(ENUMVAL), DESC
+#define clEnumValEnd (reinterpret_cast<void*>(0))
 
 // values - For custom data types, allow specifying a group of values together
 // as the values that go into the mapping that the option handler uses.  Note
@@ -435,7 +435,7 @@
   typedef DataType parser_data_type;
 
   // Implement virtual functions needed by generic_parser_base
-  unsigned getNumOptions() const { return (unsigned)Values.size(); }
+  unsigned getNumOptions() const { return unsigned(Values.size()); }
   const char *getOption(unsigned N) const { return Values[N].first; }
   const char *getDescription(unsigned N) const {
     return Values[N].second.second;






More information about the llvm-commits mailing list