Added macros to convert between 32-bit ints and 64-bit ptrs to avoid compiler warnings. (CVS 5378)

FossilOrigin-Name: 6cdb6841ff4683e424ef394733da9c24f5602570
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index e56f6f5..103fd04 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
 *************************************************************************
 ** Internal interface definitions for SQLite.
 **
-** @(#) $Id: sqliteInt.h,v 1.736 2008/07/08 19:34:07 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.737 2008/07/08 22:28:49 shane Exp $
 */
 #ifndef _SQLITEINT_H_
 #define _SQLITEINT_H_
@@ -77,6 +77,22 @@
 # define unlikely(X)  !!(X)
 #endif
 
+/*
+ * This macro is used to "hide" some ugliness in casting an int
+ * value to a ptr value under the MSVC 64-bit compiler.   Casting
+ * non 64-bit values to ptr types results in a "hard" error with 
+ * the MSVC 64-bit compiler which this attempts to avoid.  
+ *
+ * A simple compiler pragma or casting sequence could not be found
+ * to correct this in all situations, so this macro was introduced.
+ *
+ * It could be argued that the intptr_t type could be used in this
+ * case, but that type is not available on all compilers, or 
+ * requires the #include of specific headers which differs between
+ * platforms.
+ */
+#define SQLITE_INT_TO_PTR(X)   ((void*)&((char*)0)[X])
+#define SQLITE_PTR_TO_INT(X)   ((int)(((char*)X)-(char*)0))
 
 /*
 ** These #defines should enable >2GB file support on Posix if the