|
Revision 10643, 2.2 kB
(checked in by olly, 8 months ago)
|
|
Backport change from trunk:
backends/flint/flint_btreeutil.h: Fix some out-of-date comments.
configure.ac: Use AC_CHECK_SIZEOF to define SIZEOF_INT and
SIZEOF_LONG.
backends/flint/flint_types.h: Use SIZEOF_INT and SIZEOF_LONG to
determine the type of uint4 rather than always using unsigned long
(which is 64 bits on most 64 bit Unix platforms). Drop int4 for
the time being, as we don't actually use it.
backends/quartz/quartz_types.h: Adapt flint change for quartz
(required to avoid differing uint4 types which clash in
backends/database.cc).
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | #ifndef OM_HGUARD_FLINT_BTREEUTIL_H |
|---|
| 23 | #define OM_HGUARD_FLINT_BTREEUTIL_H |
|---|
| 24 | |
|---|
| 25 | #include "flint_types.h" |
|---|
| 26 | #include "omassert.h" |
|---|
| 27 | |
|---|
| 28 | #include <string.h> |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | inline int |
|---|
| 39 | getint1(const byte *p, int c) |
|---|
| 40 | { |
|---|
| 41 | Assert(c >= 0); |
|---|
| 42 | Assert(c < 65536); |
|---|
| 43 | return p[c]; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | inline void |
|---|
| 47 | setint1(byte *p, int c, int x) |
|---|
| 48 | { |
|---|
| 49 | Assert(c >= 0); |
|---|
| 50 | Assert(c < 65536); |
|---|
| 51 | p[c] = x; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | inline int |
|---|
| 55 | getint2(const byte *p, int c) |
|---|
| 56 | { |
|---|
| 57 | Assert(c >= 0); |
|---|
| 58 | Assert(c < 65536 - 1); |
|---|
| 59 | return p[c] << 8 | p[c + 1]; |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | inline void |
|---|
| 63 | setint2(byte *p, int c, int x) |
|---|
| 64 | { |
|---|
| 65 | Assert(c >= 0); |
|---|
| 66 | Assert(c < 65536 - 1); |
|---|
| 67 | p[c] = x >> 8; |
|---|
| 68 | p[c + 1] = x; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | inline int |
|---|
| 72 | getint4(const byte *p, int c) |
|---|
| 73 | { |
|---|
| 74 | Assert(c >= 0); |
|---|
| 75 | Assert(c < 65536 - 3); |
|---|
| 76 | return p[c] << 24 | p[c + 1] << 16 | p[c + 2] << 8 | p[c + 3]; |
|---|
| 77 | } |
|---|
| 78 | |
|---|
| 79 | inline void |
|---|
| 80 | setint4(byte *p, int c, int x) |
|---|
| 81 | { |
|---|
| 82 | Assert(c >= 0); |
|---|
| 83 | Assert(c < 65536 - 3); |
|---|
| 84 | p[c] = x >> 24; |
|---|
| 85 | p[c + 1] = x >> 16; |
|---|
| 86 | p[c + 2] = x >> 8; |
|---|
| 87 | p[c + 3] = x; |
|---|
| 88 | } |
|---|
| 89 | |
|---|
| 90 | #endif |
|---|