Skip to content

Instantly share code, notes, and snippets.

@martell
Created February 23, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martell/a0fb3037ad47c3e42489 to your computer and use it in GitHub Desktop.
Save martell/a0fb3037ad47c3e42489 to your computer and use it in GitHub Desktop.
From 76fc2055249da7b03148a7d4197a279e9943f012 Mon Sep 17 00:00:00 2001
From: Martell Malone <martellmalone@gmail.com>
Date: Mon, 8 Dec 2014 18:11:37 +0000
Subject: [PATCH] use size_t for void pointer cast
---
include/cling/Interpreter/Value.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/cling/Interpreter/Value.h b/include/cling/Interpreter/Value.h
index 4ebc32a..22b28fd 100644
--- a/include/cling/Interpreter/Value.h
+++ b/include/cling/Interpreter/Value.h
@@ -10,6 +10,8 @@
#ifndef CLING_VALUE_H
#define CLING_VALUE_H
+#include <stddef.h>
+
namespace llvm {
class raw_ostream;
}
@@ -101,7 +103,7 @@ namespace cling {
case kLongDoubleType:
return (T) V.getAs<long double>();
case kPointerType:
- return (T) (unsigned long) V.getAs<void*>();
+ return (T) (size_t) V.getAs<void*>();
case kUnsupportedType:
V.AssertOnUnsupportedTypeCast();
}
@@ -115,7 +117,7 @@ namespace cling {
EStorageType storageType = V.getStorageType();
switch (storageType) {
case kPointerType:
- return (T*) (unsigned long) V.getAs<void*>();
+ return (T*) (size_t) V.getAs<void*>();
default:
V.AssertOnUnsupportedTypeCast(); break;
}
--
2.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment