Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Test/JObjectTypes_Test.cpp

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <string.h>
00004 #include <iostream.h>
00005 
00006 #include <j2k/core/JObjectTypes.hpp>
00007 
00008 #define ULONG  long
00009 
00010 struct data_t
00011 {
00012    ULONG x1 : 8;
00013    ULONG x2 : 8;
00014    ULONG x3 : 8;
00015    ULONG x4 : 4;
00016 };
00017 
00018 struct fred_t
00019 {
00020    ULONG x1 : 8;
00021    ULONG x2 : 8;
00022    ULONG x3 : 8;
00023    ULONG x4 : 8;
00024 
00025    ULONG x5 : 8;
00026    ULONG x6 : 8;
00027    ULONG x7 : 8;
00028    ULONG x8 : 8;
00029 
00030    ULONG x9 : 8;
00031    ULONG x10: 8;
00032    ULONG x11: 8;
00033    ULONG x12: 8;
00034 
00035    char c : 8;
00036 };
00037 
00038 struct fred2_t
00039 {
00040     data_t   x;
00041     data_t   y;
00042     data_t   z;
00043     char c;
00044 };
00045 
00046 int main()
00047 {
00048     fred_t st2;
00049     st2.x1  = (char)(0x41);
00050     st2.x2  = (char)(0x42);
00051     st2.x3  = (char)(0x43);
00052     st2.x4  = (char)(0x44);
00053     st2.x5  = (char)(0x45);
00054     st2.x6  = (char)(0x46);
00055     st2.x7  = (char)(0x47);
00056     st2.x8  = (char)(0x48);
00057     st2.x9  = (char)(0x49);
00058     st2.x10 = (char)(0x4A);
00059     st2.x11 = (char)(0x4B);
00060     st2.x12 = (char)(0x4C);
00061     st2.c = 0;
00062 
00063     char* s2 = (char*)(&st2);
00064 
00065     printf( "\n[%s]\n\n", s2 );
00066 
00067     fred2_t str;
00068     str.x.x1  = (char)(0x41);
00069     str.x.x2  = (char)(0x42);
00070     str.x.x3  = (char)(0x43);
00071     str.x.x4  = (char)(0x44);
00072     
00073     str.y.x1  = (char)(0x45);
00074     str.y.x2  = (char)(0x46);
00075     str.y.x3  = (char)(0x47);
00076     str.y.x4  = (char)(0x48);
00077     
00078     str.z.x1  = (char)(0x49);
00079     str.z.x2  = (char)(0x4a);
00080     str.z.x3  = (char)(0x4b);
00081     str.z.x4  = (char)(0x4c);
00082     str.c = 0;
00083 
00084     
00085     char* s = (char*)(&str);
00086 
00087     size_t sz = sizeof( JObjectType_t );
00088 
00089 //    sz = 30000 / 8;
00090 
00091     printf( "\n[%s]\n\n [%u]", s, sz );
00092     
00093     int n;
00094 
00095 
00096 
00097     cin >> n;
00098     
00099  return 0;
00100 }

Generated on Sun Oct 14 18:46:44 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001