/ Check-in [1b0ee9d1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improvements to the SQLITE_INT_TO_PTR macro to reduce the number of warnings. For some platforms it might be necessary to compile with the -DHAVE_STDINT_H flag. Ticket #3860. (CVS 6657)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1b0ee9d188c000a2331caae2e9c8b89b0bcbc0b0
User & Date: drh 2009-05-19 14:21:29
Context
2009-05-19
19:04
Changes to select.c to facilitate full coverage testing. (CVS 6658) check-in: f678ed34 user: drh tags: trunk
14:21
Improvements to the SQLITE_INT_TO_PTR macro to reduce the number of warnings. For some platforms it might be necessary to compile with the -DHAVE_STDINT_H flag. Ticket #3860. (CVS 6657) check-in: 1b0ee9d1 user: drh tags: trunk
03:21
Update the showdb.c utility so that it works with databases larger than 4GiB. (CVS 6656) check-in: 9675b622 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
66
67
68
69
70
71
72




73
74

75
76
77
78
79
80
81
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.873 2009/05/18 13:34:38 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_

/*
** Include the configuration header output by 'configure' if we're using the
** autoconf-based build
................................................................................
**
** Ticket #3860:  The llvm-gcc-4.2 compiler from Apple chokes on
** the ((void*)&((char*)0)[X]) construct.  But MSVC chokes on ((void*)(X)).
** So we have to define the macros in different ways depending on the
** compiler.
*/
#if defined(__GNUC__)




# define SQLITE_INT_TO_PTR(X)  ((void*)(X))
# define SQLITE_PTR_TO_INT(X)  ((int)(X))

#else
# define SQLITE_INT_TO_PTR(X)   ((void*)&((char*)0)[X])
# define SQLITE_PTR_TO_INT(X)   ((int)(((char*)X)-(char*)0))
#endif

/*
** These #defines should enable >2GB file support on POSIX if the







|







 







>
>
>
>
|
|
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Internal interface definitions for SQLite.
**
** @(#) $Id: sqliteInt.h,v 1.874 2009/05/19 14:21:29 drh Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_

/*
** Include the configuration header output by 'configure' if we're using the
** autoconf-based build
................................................................................
**
** Ticket #3860:  The llvm-gcc-4.2 compiler from Apple chokes on
** the ((void*)&((char*)0)[X]) construct.  But MSVC chokes on ((void*)(X)).
** So we have to define the macros in different ways depending on the
** compiler.
*/
#if defined(__GNUC__)
# if defined(HAVE_STDINT_H)
#   define SQLITE_INT_TO_PTR(X)  ((void*)(intptr_t)(X))
#   define SQLITE_PTR_TO_INT(X)  ((int)(intptr_t)(X))
# else
#   define SQLITE_INT_TO_PTR(X)  ((void*)(X))
#   define SQLITE_PTR_TO_INT(X)  ((int)(X))
# endif
#else
# define SQLITE_INT_TO_PTR(X)   ((void*)&((char*)0)[X])
# define SQLITE_PTR_TO_INT(X)   ((int)(((char*)X)-(char*)0))
#endif

/*
** These #defines should enable >2GB file support on POSIX if the