Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / lzo / tests / sizes.c
blob3840fe2af67ffedbd25633868bcc908d8a147096
1 /* sizes.c -- print sizes of various types
3 This file is part of the LZO real-time data compression library.
5 Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
6 All Rights Reserved.
8 The LZO library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
13 The LZO library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with the LZO library; see the file COPYING.
20 If not, write to the Free Software Foundation, Inc.,
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 Markus F.X.J. Oberhumer
24 <markus@oberhumer.com>
25 http://www.oberhumer.com/opensource/lzo/
29 #if (defined(_WIN32) || defined(_WIN64)) && defined(_MSC_VER)
30 #ifndef _CRT_NONSTDC_NO_DEPRECATE
31 #define _CRT_NONSTDC_NO_DEPRECATE 1
32 #endif
33 #ifndef _CRT_NONSTDC_NO_WARNINGS
34 #define _CRT_NONSTDC_NO_WARNINGS 1
35 #endif
36 #ifndef _CRT_SECURE_NO_DEPRECATE
37 #define _CRT_SECURE_NO_DEPRECATE 1
38 #endif
39 #ifndef _CRT_SECURE_NO_WARNINGS
40 #define _CRT_SECURE_NO_WARNINGS 1
41 #endif
42 #endif
44 #include "lzo/lzoconf.h"
45 #include <stdio.h>
47 #if (LZO_CC_MSC && (_MSC_VER >= 1300))
48 /* disable warning C4310: cast truncates constant value */
49 # pragma warning(disable: 4310)
50 #endif
53 union _lzo_align1_t
55 char a_char;
58 struct _lzo_align2_t
60 char a_char;
63 struct _lzo_align3_t
65 char a_char;
66 long a_long;
69 struct _lzo_align4_t
71 char a_char;
72 char * a_char_p;
75 struct _lzo_align5_t
77 char a_char1;
78 long a_long;
79 char a_char2;
80 char * a_char_p;
83 union _lzo_align6_t
85 char a_char;
86 long a_long;
87 char * a_char_p;
88 lzo_bytep a_lzobytep;
92 #define print_size(type) \
93 sprintf(s,"sizeof(%s)",#type); \
94 printf("%-30s %2ld\n", s, (long)sizeof(type));
96 #define print_ssize(type,m) \
97 sprintf(s,"sizeof(%s)",#type); \
98 printf("%-30s %2ld %20ld\n", s, (long)sizeof(type), (long)(m));
100 #define print_usize(type,m) \
101 sprintf(s,"sizeof(%s)",#type); \
102 printf("%-30s %2ld %20lu\n", s, (long)sizeof(type), (unsigned long)(m));
105 int main(int argc, char *argv[])
107 char s[80];
109 print_ssize(char,CHAR_MAX);
110 print_usize(unsigned char,UCHAR_MAX);
111 print_ssize(short,SHRT_MAX);
112 print_usize(unsigned short,USHRT_MAX);
113 print_ssize(int,INT_MAX);
114 print_usize(unsigned int,UINT_MAX);
115 print_ssize(long,LONG_MAX);
116 print_usize(unsigned long,ULONG_MAX);
117 printf("\n");
118 print_size(char *);
119 print_size(void (*)(void));
120 printf("\n");
121 print_ssize(lzo_int,LZO_INT_MAX);
122 print_usize(lzo_uint,LZO_UINT_MAX);
123 print_size(lzo_bytep);
124 printf("\n");
125 print_size(union _lzo_align1_t);
126 print_size(struct _lzo_align2_t);
127 print_size(struct _lzo_align3_t);
128 print_size(struct _lzo_align4_t);
129 print_size(struct _lzo_align5_t);
130 print_size(union _lzo_align6_t);
132 if (argc < 0 && argv == NULL) /* avoid warning about unused args */
133 return 0;
134 return 0;
138 /* vim:set ts=4 sw=4 et: */