ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/liblzf/lzfP.h
(Generate patch)

Comparing liblzf/lzfP.h (file contents):
Revision 1.21 by root, Tue Jun 1 01:15:34 2010 UTC vs.
Revision 1.22 by root, Tue Jun 1 03:17:06 2010 UTC

119 */ 119 */
120#ifndef CHECK_INPUT 120#ifndef CHECK_INPUT
121# define CHECK_INPUT 1 121# define CHECK_INPUT 1
122#endif 122#endif
123 123
124/*
125 * Whether to store pointers or offsets inside the hash table. On
126 * 64 bit architetcures, pointers take up twice as much space,
127 * and might also be slower. Default is to autodetect.
128 */
129/*#define LZF_USER_OFFSETS autodetect */
130
124/*****************************************************************************/ 131/*****************************************************************************/
125/* nothing should be changed below */ 132/* nothing should be changed below */
126 133
127#ifdef __cplusplus 134#ifdef __cplusplus
128# include <cstring> 135# include <cstring>
136# include <climits>
129using namespace std; 137using namespace std;
130#else 138#else
131# include <string.h> 139# include <string.h>
140# include <limits.h>
141#endif
142
143#ifndef LZF_USE_OFFSETS
144# if defined (WIN32)
145# define LZF_USE_OFFSETS defined(_M_X64)
146# else
147# ifdef __cplusplus
148# include <cstdint>
149# else
150# include <stdint.h>
151# endif
152# define LZF_USE_OFFSETS (UINTPTR_MAX > 0xffffffffU)
153# endif
132#endif 154#endif
133 155
134typedef unsigned char u8; 156typedef unsigned char u8;
135 157
158#if LZF_USE_OFFSETS
159# define LZF_HSLOT_BIAS ((const u8 *)in_data)
160 typedef unsigned int LZF_HSLOT;
161#else
162# define LZF_HSLOT_BIAS 0
163 typedef const u8 *LZF_HSLOT;
164#endif
165
136typedef const u8 *LZF_STATE[1 << (HLOG)]; 166typedef LZF_HSLOT LZF_STATE[1 << (HLOG)];
137 167
138#if !STRICT_ALIGN 168#if !STRICT_ALIGN
139/* for unaligned accesses we need a 16 bit datatype. */ 169/* for unaligned accesses we need a 16 bit datatype. */
140# ifdef __cplusplus
141# include <climits>
142# else
143# include <limits.h>
144# endif
145# if USHRT_MAX == 65535 170# if USHRT_MAX == 65535
146 typedef unsigned short u16; 171 typedef unsigned short u16;
147# elif UINT_MAX == 65535 172# elif UINT_MAX == 65535
148 typedef unsigned int u16; 173 typedef unsigned int u16;
149# else 174# else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines