oleaut32: Indentation Fix

Andrew Talbot andrew.talbot at talbotville.com
Wed Dec 19 15:53:43 CST 2012


Changelog:
    oleaut32: Indentation Fix.

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index a6108ad..e3a98bd 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -938,13 +938,13 @@ serialize_param(
 
 static HRESULT
 deserialize_param(
-    ITypeInfo		*tinfo,
-    BOOL		readit,
-    BOOL		debugout,
-    BOOL		alloc,
-    TYPEDESC		*tdesc,
-    DWORD		*arg,
-    marshal_state	*buf)
+    ITypeInfo       *tinfo,
+    BOOL            readit,
+    BOOL            debugout,
+    BOOL            alloc,
+    TYPEDESC        *tdesc,
+    DWORD           *arg,
+    marshal_state   *buf)
 {
     HRESULT hres = S_OK;
     VARTYPE vartype;
@@ -956,87 +956,84 @@ deserialize_param(
         vartype = VT_SAFEARRAY;
 
     while (1) {
-	switch (vartype) {
-	case VT_VARIANT: {
-	    if (readit)
-	    {
-		ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
-		unsigned char *buffer;
-		buffer = VARIANT_UserUnmarshal(&flags, buf->base + buf->curoff, (VARIANT *)arg);
-		buf->curoff = buffer - buf->base;
-	    }
-	    return S_OK;
-	}
+        switch (vartype) {
+        case VT_VARIANT:
+            if (readit) {
+                ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
+                unsigned char *buffer;
+                buffer = VARIANT_UserUnmarshal(&flags, buf->base + buf->curoff, (VARIANT *)arg);
+                buf->curoff = buffer - buf->base;
+            }
+            return S_OK;
         case VT_DATE:
         case VT_I8:
         case VT_UI8:
         case VT_R8:
         case VT_CY:
-	    if (readit) {
-		hres = xbuf_get(buf,(LPBYTE)arg,8);
-		if (hres) ERR("Failed to read integer 8 byte\n");
-	    }
-	    if (debugout) TRACE_(olerelay)("%x%x",arg[0],arg[1]);
-	    return hres;
+            if (readit) {
+                hres = xbuf_get(buf,(LPBYTE)arg,8);
+                if (hres) ERR("Failed to read integer 8 byte\n");
+            }
+            if (debugout) TRACE_(olerelay)("%x%x",arg[0],arg[1]);
+            return hres;
         case VT_ERROR:
         case VT_I4:
         case VT_INT:
         case VT_UINT:
         case VT_R4:
         case VT_UI4:
-	    if (readit) {
-		hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
-		if (hres) ERR("Failed to read integer 4 byte\n");
-	    }
-	    if (debugout) TRACE_(olerelay)("%x",*arg);
-	    return hres;
+            if (readit) {
+                hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
+                if (hres) ERR("Failed to read integer 4 byte\n");
+            }
+            if (debugout) TRACE_(olerelay)("%x",*arg);
+            return hres;
         case VT_I2:
         case VT_UI2:
         case VT_BOOL:
-	    if (readit) {
-		DWORD x;
-		hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD));
-		if (hres) ERR("Failed to read integer 4 byte\n");
-		memcpy(arg,&x,2);
-	    }
-	    if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff);
-	    return hres;
+            if (readit) {
+                DWORD x;
+                hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD));
+                if (hres) ERR("Failed to read integer 4 byte\n");
+                memcpy(arg,&x,2);
+            }
+            if (debugout) TRACE_(olerelay)("%04x",*arg & 0xffff);
+            return hres;
         case VT_I1:
-	case VT_UI1:
-	    if (readit) {
-		DWORD x;
-		hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD));
-		if (hres) ERR("Failed to read integer 4 byte\n");
-		memcpy(arg,&x,1);
-	    }
-	    if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff);
-	    return hres;
-	case VT_BSTR: {
-	    if (readit)
-	    {
-		ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
-		unsigned char *buffer;
-		buffer = BSTR_UserUnmarshal(&flags, buf->base + buf->curoff, (BSTR *)arg);
-		buf->curoff = buffer - buf->base;
-		if (debugout) TRACE_(olerelay)("%s",debugstr_w(*(BSTR *)arg));
-	    }
-	    return S_OK;
-	}
-	case VT_PTR: {
-	    DWORD	cookie;
-	    BOOL        derefhere = TRUE;
-
-	    if (tdesc->u.lptdesc->vt == VT_USERDEFINED) {
-		ITypeInfo	*tinfo2;
-		TYPEATTR	*tattr;
-
-		hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.lptdesc->u.hreftype,&tinfo2);
-		if (hres) {
-		    ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
-		    return hres;
-		}
-		ITypeInfo_GetTypeAttr(tinfo2,&tattr);
-		switch (tattr->typekind) {
+        case VT_UI1:
+            if (readit) {
+                DWORD x;
+                hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD));
+                if (hres) ERR("Failed to read integer 4 byte\n");
+                memcpy(arg,&x,1);
+            }
+            if (debugout) TRACE_(olerelay)("%02x",*arg & 0xff);
+            return hres;
+        case VT_BSTR:
+            if (readit) {
+                ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
+                unsigned char *buffer;
+                buffer = BSTR_UserUnmarshal(&flags, buf->base + buf->curoff, (BSTR *)arg);
+                buf->curoff = buffer - buf->base;
+                if (debugout) TRACE_(olerelay)("%s",debugstr_w(*(BSTR *)arg));
+            }
+            return S_OK;
+        case VT_PTR: {
+            DWORD   cookie;
+            BOOL    derefhere = TRUE;
+
+            if (tdesc->u.lptdesc->vt == VT_USERDEFINED) {
+                ITypeInfo   *tinfo2;
+                TYPEATTR    *tattr;
+
+                hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.lptdesc->u.hreftype,&tinfo2);
+                if (hres) {
+                    ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",
+                        tdesc->u.lptdesc->u.hreftype);
+                    return hres;
+                }
+                ITypeInfo_GetTypeAttr(tinfo2,&tattr);
+                switch (tattr->typekind) {
                 case TKIND_ALIAS:
                     if (tattr->tdescAlias.vt == VT_USERDEFINED)
                     {
@@ -1045,183 +1042,178 @@ deserialize_param(
                         ITypeInfo_Release(tinfo2);
                         hres = ITypeInfo_GetRefTypeInfo(tinfo,href,&tinfo2);
                         if (hres) {
-                            ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.lptdesc->u.hreftype);
+                            ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",
+                                tdesc->u.lptdesc->u.hreftype);
                             return hres;
                         }
                         ITypeInfo_GetTypeAttr(tinfo2,&tattr);
                         derefhere = (tattr->typekind != TKIND_DISPATCH && tattr->typekind != TKIND_INTERFACE);
                     }
                     break;
-		case TKIND_ENUM:	/* confirmed */
-		case TKIND_RECORD:	/* FIXME: mostly untested */
-		    break;
-		case TKIND_DISPATCH:	/* will be done in VT_USERDEFINED case */
-		case TKIND_INTERFACE:	/* will be done in VT_USERDEFINED case */
-		    derefhere=FALSE;
-		    break;
-		default:
-		    FIXME("unhandled switch cases tattr->typekind %d\n", tattr->typekind);
-		    derefhere=FALSE;
-		    break;
-		}
-		ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
-		ITypeInfo_Release(tinfo2);
-	    }
-	    /* read it in all cases, we need to know if we have 
-	     * NULL pointer or not.
-	     */
-	    hres = xbuf_get(buf,(LPBYTE)&cookie,sizeof(cookie));
-	    if (hres) {
-		ERR("Failed to load pointer cookie.\n");
-		return hres;
-	    }
-	    if (cookie != 0x42424242) {
-		/* we read a NULL ptr from the remote side */
-		if (debugout) TRACE_(olerelay)("NULL");
-		*arg = 0;
-		return S_OK;
-	    }
-	    if (debugout) TRACE_(olerelay)("*");
-	    if (alloc) {
-		/* Allocate space for the referenced struct */
-		if (derefhere)
-		    *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo));
-	    }
-	    if (derefhere)
-		return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, (LPDWORD)*arg, buf);
-	    else
-		return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, arg, buf);
+                case TKIND_ENUM:    /* confirmed */
+                case TKIND_RECORD:  /* FIXME: mostly untested */
+                    break;
+                case TKIND_DISPATCH:    /* will be done in VT_USERDEFINED case */
+                case TKIND_INTERFACE:   /* will be done in VT_USERDEFINED case */
+                    derefhere=FALSE;
+                    break;
+                default:
+                    FIXME("unhandled switch cases tattr->typekind %d\n", tattr->typekind);
+                    derefhere=FALSE;
+                    break;
+                }
+                ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
+                ITypeInfo_Release(tinfo2);
+            }
+            /* read it in all cases, we need to know if we have 
+             * NULL pointer or not.
+             */
+            hres = xbuf_get(buf,(LPBYTE)&cookie,sizeof(cookie));
+            if (hres) {
+                ERR("Failed to load pointer cookie.\n");
+                return hres;
+            }
+            if (cookie != 0x42424242) {
+                /* we read a NULL ptr from the remote side */
+                if (debugout) TRACE_(olerelay)("NULL");
+                *arg = 0;
+                return S_OK;
+            }
+            if (debugout) TRACE_(olerelay)("*");
+            if (alloc) {
+                /* Allocate space for the referenced struct */
+                if (derefhere)
+                    *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo));
+            }
+            if (derefhere)
+                return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, (LPDWORD)*arg, buf);
+            else
+                return deserialize_param(tinfo, readit, debugout, alloc, tdesc->u.lptdesc, arg, buf);
         }
-	case VT_UNKNOWN:
-	    /* FIXME: UNKNOWN is unknown ..., but allocate 4 byte for it */
-	    if (alloc)
-	        *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DWORD));
-	    hres = S_OK;
-	    if (readit)
-		hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
-	    if (debugout)
-		TRACE_(olerelay)("unk(%p)",arg);
-	    return hres;
-	case VT_DISPATCH:
-	    hres = S_OK;
-	    if (readit)
-		hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg);
-	    if (debugout)
-		TRACE_(olerelay)("idisp(%p)",arg);
-	    return hres;
-	case VT_VOID:
-	    if (debugout) TRACE_(olerelay)("<void>");
-	    return S_OK;
-	case VT_USERDEFINED: {
-	    ITypeInfo	*tinfo2;
-	    TYPEATTR	*tattr;
+        case VT_UNKNOWN:
+            /* FIXME: UNKNOWN is unknown ..., but allocate 4 byte for it */
+            if (alloc)
+                *arg=(DWORD)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(DWORD));
+            hres = S_OK;
+            if (readit)
+                hres = _unmarshal_interface(buf,&IID_IUnknown,(LPUNKNOWN*)arg);
+            if (debugout) TRACE_(olerelay)("unk(%p)",arg);
+            return hres;
+        case VT_DISPATCH:
+            hres = S_OK;
+            if (readit)
+                hres = _unmarshal_interface(buf,&IID_IDispatch,(LPUNKNOWN*)arg);
+            if (debugout) TRACE_(olerelay)("idisp(%p)",arg);
+            return hres;
+        case VT_VOID:
+            if (debugout) TRACE_(olerelay)("<void>");
+            return S_OK;
+        case VT_USERDEFINED: {
+            ITypeInfo   *tinfo2;
+            TYPEATTR    *tattr;
+
+            hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
+            if (hres) {
+                ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.hreftype);
+                return hres;
+            }
+            hres = ITypeInfo_GetTypeAttr(tinfo2,&tattr);
+            if (hres) {
+                ERR("Could not get typeattr in VT_USERDEFINED.\n");
+            } else {
+                switch (tattr->typekind) {
+                case TKIND_DISPATCH:
+                case TKIND_INTERFACE:
+                    if (readit)
+                        hres = _unmarshal_interface(buf,&(tattr->guid),(LPUNKNOWN*)arg);
+                    break;
+                case TKIND_RECORD: {
+                    int i;
 
-	    hres = ITypeInfo_GetRefTypeInfo(tinfo,tdesc->u.hreftype,&tinfo2);
-	    if (hres) {
-		ERR("Could not get typeinfo of hreftype %x for VT_USERDEFINED.\n",tdesc->u.hreftype);
-		return hres;
-	    }
-	    hres = ITypeInfo_GetTypeAttr(tinfo2,&tattr);
-	    if (hres) {
-		ERR("Could not get typeattr in VT_USERDEFINED.\n");
-	    } else {
-		switch (tattr->typekind) {
-		case TKIND_DISPATCH:
-		case TKIND_INTERFACE:
-		    if (readit)
-			hres = _unmarshal_interface(buf,&(tattr->guid),(LPUNKNOWN*)arg);
-		    break;
-		case TKIND_RECORD: {
-		    int i;
-
-		    if (debugout) TRACE_(olerelay)("{");
-		    for (i=0;i<tattr->cVars;i++) {
-			VARDESC *vdesc;
-
-			hres = ITypeInfo_GetVarDesc(tinfo2, i, &vdesc);
-			if (hres) {
-			    ERR("Could not get vardesc of %d\n",i);
-			    ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
-			    ITypeInfo_Release(tinfo2);
-			    return hres;
-			}
-			hres = deserialize_param(
-			    tinfo2,
-			    readit,
-			    debugout,
-			    alloc,
-			    &vdesc->elemdescVar.tdesc,
-			    (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
-			    buf
-			);
+                    if (debugout) TRACE_(olerelay)("{");
+                    for (i=0;i<tattr->cVars;i++) {
+                        VARDESC *vdesc;
+
+                        hres = ITypeInfo_GetVarDesc(tinfo2, i, &vdesc);
+                        if (hres) {
+                            ERR("Could not get vardesc of %d\n",i);
+                            ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
+                            ITypeInfo_Release(tinfo2);
+                            return hres;
+                        }
+                        hres = deserialize_param(
+                            tinfo2,
+                            readit,
+                            debugout,
+                            alloc,
+                            &vdesc->elemdescVar.tdesc,
+                            (DWORD*)(((LPBYTE)arg)+vdesc->u.oInst),
+                            buf);
                         ITypeInfo_ReleaseVarDesc(tinfo2, vdesc);
-		        if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(",");
-		    }
-		    if (debugout) TRACE_(olerelay)("}");
-		    break;
-		}
-		case TKIND_ALIAS:
-		    hres = deserialize_param(tinfo2,readit,debugout,alloc,&tattr->tdescAlias,arg,buf);
-		    break;
-		case TKIND_ENUM:
-		    if (readit) {
-		        hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
-		        if (hres) ERR("Failed to read enum (4 byte)\n");
-		    }
-		    if (debugout) TRACE_(olerelay)("%x",*arg);
-		    break;
-		default:
-		    ERR("Unhandled typekind %d\n",tattr->typekind);
-		    hres = E_FAIL;
-		    break;
-		}
-		ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
-	    }
-	    if (hres)
-		ERR("failed to stuballoc in TKIND_RECORD.\n");
-	    ITypeInfo_Release(tinfo2);
-	    return hres;
-	}
-	case VT_CARRAY: {
-	    /* arg is pointing to the start of the array. */
-            LPBYTE base = (LPBYTE) arg;
-	    ARRAYDESC *adesc = tdesc->u.lpadesc;
-	    int		arrsize,i;
-	    arrsize = 1;
-	    if (adesc->cDims > 1) FIXME("cDims > 1 in VT_CARRAY. Does it work?\n");
-	    for (i=0;i<adesc->cDims;i++)
-		arrsize *= adesc->rgbounds[i].cElements;
+                        if (debugout && (i<tattr->cVars-1)) TRACE_(olerelay)(",");
+                    }
+                    if (debugout) TRACE_(olerelay)("}");
+                    break;
+                }
+                case TKIND_ALIAS:
+                    hres = deserialize_param(tinfo2,readit,debugout,alloc,&tattr->tdescAlias,arg,buf);
+                    break;
+                case TKIND_ENUM:
+                    if (readit) {
+                        hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD));
+                        if (hres) ERR("Failed to read enum (4 byte)\n");
+                    }
+                    if (debugout) TRACE_(olerelay)("%x",*arg);
+                    break;
+                default:
+                    ERR("Unhandled typekind %d\n",tattr->typekind);
+                    hres = E_FAIL;
+                    break;
+                }
+                ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
+            }
+            if (hres) ERR("failed to stuballoc in TKIND_RECORD.\n");
+            ITypeInfo_Release(tinfo2);
+            return hres;
+        }
+        case VT_CARRAY: {
+            /* arg is pointing to the start of the array. */
+            LPBYTE      base = (LPBYTE) arg;
+            ARRAYDESC   *adesc = tdesc->u.lpadesc;
+            int         arrsize, i;
+            arrsize = 1;
+            if (adesc->cDims > 1) FIXME("cDims > 1 in VT_CARRAY. Does it work?\n");
+            for (i=0;i<adesc->cDims;i++)
+                arrsize *= adesc->rgbounds[i].cElements;
             if (_passbyref(&adesc->tdescElem, tinfo))
             {
-	        base = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo) * arrsize);
+                base = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,_xsize(tdesc->u.lptdesc, tinfo) * arrsize);
                 *arg = (DWORD) base;
             }
-	    for (i=0;i<arrsize;i++)
-		deserialize_param(
-		    tinfo,
-		    readit,
-		    debugout,
-		    alloc,
-		    &adesc->tdescElem,
-		    (DWORD*)(base + i*_xsize(&adesc->tdescElem, tinfo)),
-		    buf
-		);
-	    return S_OK;
-	}
-    case VT_SAFEARRAY: {
-	    if (readit)
-	    {
-		ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
-		unsigned char *buffer;
-		buffer = LPSAFEARRAY_UserUnmarshal(&flags, buf->base + buf->curoff, (LPSAFEARRAY *)arg);
-		buf->curoff = buffer - buf->base;
-	    }
-	    return S_OK;
-	}
-	default:
-	    ERR("No handler for VT type %d!\n",tdesc->vt);
-	    return S_OK;
-	}
+            for (i=0;i<arrsize;i++)
+                deserialize_param(
+                    tinfo,
+                    readit,
+                    debugout,
+                    alloc,
+                    &adesc->tdescElem,
+                    (DWORD*)(base + i*_xsize(&adesc->tdescElem, tinfo)),
+                    buf);
+            return S_OK;
+        }
+        case VT_SAFEARRAY:
+            if (readit)
+            {
+                ULONG flags = MAKELONG(MSHCTX_DIFFERENTMACHINE, NDR_LOCAL_DATA_REPRESENTATION);
+                unsigned char *buffer;
+                buffer = LPSAFEARRAY_UserUnmarshal(&flags, buf->base + buf->curoff, (LPSAFEARRAY *)arg);
+                buf->curoff = buffer - buf->base;
+            }
+            return S_OK;
+        default:
+            ERR("No handler for VT type %d!\n",tdesc->vt);
+            return S_OK;
+        }
     }
 }
 
@@ -1631,7 +1623,7 @@ static ULONG WINAPI TMarshalDispatchChannel_Release(LPRPCCHANNELBUFFER iface)
     if (ref)
         return ref;
 
-	IRpcChannelBuffer_Release(This->pDelegateChannel);
+    IRpcChannelBuffer_Release(This->pDelegateChannel);
     HeapFree(GetProcessHeap(), 0, This);
     return 0;
 }
diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index 21a2758..c343578 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -3131,9 +3131,9 @@ HRESULT WINAPI VarAnd(LPVARIANT left, LPVARIANT right, LPVARIANT result)
             LOCALE_USER_DEFAULT, 0, &d)))
             hres = VariantChangeType(&varLeft,&varLeft,
             VARIANT_LOCALBOOL, VT_BOOL);
-            if (SUCCEEDED(hres) && V_VT(&varLeft) != resvt)
-                hres = VariantChangeType(&varLeft,&varLeft,0,resvt);
-            if (FAILED(hres)) goto VarAnd_Exit;
+        if (SUCCEEDED(hres) && V_VT(&varLeft) != resvt)
+            hres = VariantChangeType(&varLeft,&varLeft,0,resvt);
+        if (FAILED(hres)) goto VarAnd_Exit;
     }
 
     if (resvt == VT_I4 && V_VT(&varRight) == VT_UI4)




More information about the wine-patches mailing list