Commit ee150c51 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Use V_* macros.

parent e940f1d2
...@@ -879,8 +879,8 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) ...@@ -879,8 +879,8 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
VariantInit( &vd ); VariantInit( &vd );
VariantInit( &ve ); VariantInit( &ve );
va.vt = VT_BSTR; V_VT(&va) = VT_BSTR;
va.u.bstrVal = bstr; V_UNION(&va,bstrVal) = bstr;
res = VariantClear( &va ); res = VariantClear( &va );
printf( "VariantClear: %x\n", (unsigned int)res ); printf( "VariantClear: %x\n", (unsigned int)res );
printf( "VariantClear: %x\n", (unsigned int)res ); printf( "VariantClear: %x\n", (unsigned int)res );
...@@ -895,65 +895,65 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) ...@@ -895,65 +895,65 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
printf( "VariantClear: %x\n", (unsigned int)res ); printf( "VariantClear: %x\n", (unsigned int)res );
va.vt = VT_R8; V_VT(&va) = VT_R8;
d = 4.123; d = 4.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantCopy( &va, &va ); res = VariantCopy( &va, &va );
printf( "VariantCopy %f -> %f: %x\n", V_R8(&va), V_R8(&va), (unsigned int)res ); printf( "VariantCopy %f -> %f: %x\n", V_R8(&va), V_R8(&va), (unsigned int)res );
va.vt = VT_R8 | VT_BYREF; V_VT(&va) = VT_R8 | VT_BYREF;
d = 31.123; d = 31.123;
va.u.pdblVal = &d; V_UNION(&va,pdblVal) = &d;
res = VariantCopyInd( &va, &va ); res = VariantCopyInd( &va, &va );
printf( "VariantCopyInd %f: %x\n", V_R8(&va), (unsigned int)res ); printf( "VariantCopyInd %f: %x\n", V_R8(&va), (unsigned int)res );
va.vt = VT_R8; V_VT(&va) = VT_R8;
d = 1.123; d = 1.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantCopy( &vb, &va ); res = VariantCopy( &vb, &va );
printf( "VariantCopy %f -> %f: %x\n", V_R8(&va), V_R8(&vb), (unsigned int)res ); printf( "VariantCopy %f -> %f: %x\n", V_R8(&va), V_R8(&vb), (unsigned int)res );
va.vt = VT_R8 | VT_BYREF; V_VT(&va) = VT_R8 | VT_BYREF;
d = 123.123; d = 123.123;
va.u.pdblVal = &d; V_UNION(&va,pdblVal) = &d;
res = VariantCopy( &vb, &va ); res = VariantCopy( &vb, &va );
printf( "VariantCopy %f -> %f: %x\n", *(V_R8REF(&va)), *(V_R8REF(&vb)), (unsigned int)res ); printf( "VariantCopy %f -> %f: %x\n", *(V_R8REF(&va)), *(V_R8REF(&vb)), (unsigned int)res );
va.vt = VT_R8 | VT_BYREF; V_VT(&va) = VT_R8 | VT_BYREF;
d = 111.2; d = 111.2;
va.u.pdblVal = &d; V_UNION(&va,pdblVal) = &d;
res = VariantCopyInd( &vb, &va ); res = VariantCopyInd( &vb, &va );
printf( "VariantCopyInd %f -> %f: %x\n", *(V_R8REF(&va)), V_R8(&vb), (unsigned int)res ); printf( "VariantCopyInd %f -> %f: %x\n", *(V_R8REF(&va)), V_R8(&vb), (unsigned int)res );
va.vt = VT_R8 | VT_BYREF; V_VT(&va) = VT_R8 | VT_BYREF;
d = 1211.123453; d = 1211.123453;
va.u.pdblVal = &d; V_UNION(&va,pdblVal) = &d;
res = VariantChangeTypeEx( &va, &va, 0, 0, VT_I2 ); res = VariantChangeTypeEx( &va, &va, 0, 0, VT_I2 );
printf( "VariantChangeTypeEx %d: %x\n", V_I2(&va), (unsigned int) res ); printf( "VariantChangeTypeEx %d: %x\n", V_I2(&va), (unsigned int) res );
va.vt = VT_INT; V_VT(&va) = VT_INT;
va.u.intVal = 4; V_UNION(&va,intVal) = 4;
res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_BSTR ); res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_BSTR );
printf( "VariantChangeTypeEx %d -> %s: %x\n", V_INT(&va), WtoA(V_BSTR(&vb)), (unsigned int)res ); printf( "VariantChangeTypeEx %d -> %s: %x\n", V_INT(&va), WtoA(V_BSTR(&vb)), (unsigned int)res );
va.vt = VT_DATE; V_VT(&va) = VT_DATE;
va.u.date = 34465.332431; V_UNION(&va,date) = 34465.332431;
res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_BSTR ); res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_BSTR );
printf( "VariantChangeTypeEx %f -> %s: %x\n", V_DATE(&va), WtoA(V_BSTR(&vb)), (unsigned int)res ); printf( "VariantChangeTypeEx %f -> %s: %x\n", V_DATE(&va), WtoA(V_BSTR(&vb)), (unsigned int)res );
bstr = pOleChar[4]; bstr = pOleChar[4];
va.vt = VT_BSTR; V_VT(&va) = VT_BSTR;
va.u.bstrVal = bstr; V_UNION(&va,bstrVal) = bstr;
res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_R8 ); res = VariantChangeTypeEx(&vb, &va, 0, 0, VT_R8 );
printf( "VariantChangeTypeEx %s -> %f: %x\n", WtoA(V_BSTR(&va)), V_R8(&vb), (unsigned int)res ); printf( "VariantChangeTypeEx %s -> %f: %x\n", WtoA(V_BSTR(&va)), V_R8(&vb), (unsigned int)res );
vc.vt = VT_BSTR | VT_BYREF; V_VT(&vc) = VT_BSTR | VT_BYREF;
vc.u.pbstrVal = &bstr; V_UNION(&vc,pbstrVal) = &bstr;
vb.vt = VT_VARIANT | VT_BYREF; V_VT(&vb) = VT_VARIANT | VT_BYREF;
vb.u.pvarVal = &vc; V_UNION(&vb,pvarVal) = &vc;
va.vt = VT_VARIANT | VT_BYREF; V_VT(&va) = VT_VARIANT | VT_BYREF;
va.u.pvarVal = &vb; V_UNION(&va,pvarVal) = &vb;
res = VariantCopyInd( &vd, &va ); res = VariantCopyInd( &vd, &va );
printf( "VariantCopyInd: %x\n", (unsigned int)res ); printf( "VariantCopyInd: %x\n", (unsigned int)res );
...@@ -971,33 +971,33 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) ...@@ -971,33 +971,33 @@ int PASCAL WinMain (HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
if( i == VT_BSTR ) if( i == VT_BSTR )
i = 77; i = 77;
va.vt = i; V_VT(&va) = i;
d = 4.123; d = 4.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantCopyInd( &vb, &va ); res = VariantCopyInd( &vb, &va );
printf( "VariantCopyInd: %d -> %x\n", i, (unsigned int)res ); printf( "VariantCopyInd: %d -> %x\n", i, (unsigned int)res );
va.vt = i | VT_BYREF; V_VT(&va) = i | VT_BYREF;
d = 4.123; d = 4.123;
va.u.pdblVal = &d; V_UNION(&va,pdblVal) = &d;
res = VariantCopyInd( &vb, &va ); res = VariantCopyInd( &vb, &va );
printf( "VariantCopyInd: %d -> %x\n", i, (unsigned int)res ); printf( "VariantCopyInd: %d -> %x\n", i, (unsigned int)res );
va.vt = VT_R8; V_VT(&va) = VT_R8;
d = 4.123; d = 4.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantChangeTypeEx( &vb, &va, 0, 0, i ); res = VariantChangeTypeEx( &vb, &va, 0, 0, i );
printf( "VariantChangeTypeEx: %d -> %x\n", i, (unsigned int)res ); printf( "VariantChangeTypeEx: %d -> %x\n", i, (unsigned int)res );
va.vt = VT_R8; V_VT(&va) = VT_R8;
d = 4.123; d = 4.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantChangeTypeEx( &vb, &va, 0, 0, i | VT_BYREF ); res = VariantChangeTypeEx( &vb, &va, 0, 0, i | VT_BYREF );
printf( "VariantChangeTypeEx: VT_BYREF %d -> %x\n", i, (unsigned int)res ); printf( "VariantChangeTypeEx: VT_BYREF %d -> %x\n", i, (unsigned int)res );
va.vt = 99; V_VT(&va) = 99;
d = 4.123; d = 4.123;
va.u.dblVal = d; V_UNION(&va,dblVal) = d;
res = VariantClear( &va ); res = VariantClear( &va );
printf( "VariantClear: %d -> %x\n", i, (unsigned int)res ); printf( "VariantClear: %d -> %x\n", i, (unsigned int)res );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment