ole32: Fix some pointer cast warnings on 64-bit.

This commit is contained in:
Alexandre Julliard 2009-12-30 21:24:43 +01:00
parent 5da782ac53
commit 2bc9ba758e
1 changed files with 21 additions and 25 deletions

View File

@ -236,7 +236,7 @@ static PROPVARIANT *PropertyStorage_FindProperty(PropertyStorage_impl *This,
{ {
PROPVARIANT *ret = NULL; PROPVARIANT *ret = NULL;
dictionary_find(This->propid_to_prop, (void *)propid, (void **)&ret); dictionary_find(This->propid_to_prop, UlongToPtr(propid), (void **)&ret);
TRACE("returning %p\n", ret); TRACE("returning %p\n", ret);
return ret; return ret;
} }
@ -246,14 +246,14 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
PropertyStorage_impl *This, LPCWSTR name) PropertyStorage_impl *This, LPCWSTR name)
{ {
PROPVARIANT *ret = NULL; PROPVARIANT *ret = NULL;
PROPID propid; void *propid;
if (!name) if (!name)
return NULL; return NULL;
if (This->codePage == CP_UNICODE) if (This->codePage == CP_UNICODE)
{ {
if (dictionary_find(This->name_to_propid, name, (void **)&propid)) if (dictionary_find(This->name_to_propid, name, &propid))
ret = PropertyStorage_FindProperty(This, propid); ret = PropertyStorage_FindProperty(This, PtrToUlong(propid));
} }
else else
{ {
@ -263,9 +263,8 @@ static PROPVARIANT *PropertyStorage_FindPropertyByName(
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
if (dictionary_find(This->name_to_propid, ansiName, if (dictionary_find(This->name_to_propid, ansiName, &propid))
(void **)&propid)) ret = PropertyStorage_FindProperty(This, PtrToUlong(propid));
ret = PropertyStorage_FindProperty(This, propid);
CoTaskMemFree(ansiName); CoTaskMemFree(ansiName);
} }
} }
@ -278,7 +277,7 @@ static LPWSTR PropertyStorage_FindPropertyNameById(PropertyStorage_impl *This,
{ {
LPWSTR ret = NULL; LPWSTR ret = NULL;
dictionary_find(This->propid_to_name, (void *)propid, (void **)&ret); dictionary_find(This->propid_to_name, UlongToPtr(propid), (void **)&ret);
TRACE("returning %p\n", ret); TRACE("returning %p\n", ret);
return ret; return ret;
} }
@ -490,7 +489,7 @@ static HRESULT PropertyStorage_StorePropWithId(PropertyStorage_impl *This,
lcid); lcid);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
dictionary_insert(This->propid_to_prop, (void *)propid, prop); dictionary_insert(This->propid_to_prop, UlongToPtr(propid), prop);
if (propid > This->highestProp) if (propid > This->highestProp)
This->highestProp = propid; This->highestProp = propid;
} }
@ -534,8 +533,8 @@ static HRESULT PropertyStorage_StoreNameWithId(PropertyStorage_impl *This,
TRACE("Adding prop name %s, propid %d\n", TRACE("Adding prop name %s, propid %d\n",
This->codePage == CP_UNICODE ? debugstr_w((LPCWSTR)name) : This->codePage == CP_UNICODE ? debugstr_w((LPCWSTR)name) :
debugstr_a(name), id); debugstr_a(name), id);
dictionary_insert(This->name_to_propid, name, (void *)id); dictionary_insert(This->name_to_propid, name, UlongToPtr(id));
dictionary_insert(This->propid_to_name, (void *)id, name); dictionary_insert(This->propid_to_name, UlongToPtr(id), name);
} }
return hr; return hr;
} }
@ -666,18 +665,16 @@ static HRESULT WINAPI IPropertyStorage_fnDeleteMultiple(
{ {
if (rgpspec[i].ulKind == PRSPEC_LPWSTR) if (rgpspec[i].ulKind == PRSPEC_LPWSTR)
{ {
PROPID propid; void *propid;
if (dictionary_find(This->name_to_propid, if (dictionary_find(This->name_to_propid, rgpspec[i].u.lpwstr, &propid))
(void *)rgpspec[i].u.lpwstr, (void **)&propid)) dictionary_remove(This->propid_to_prop, propid);
dictionary_remove(This->propid_to_prop, (void *)propid);
} }
else else
{ {
if (rgpspec[i].u.propid >= PID_FIRST_USABLE && if (rgpspec[i].u.propid >= PID_FIRST_USABLE &&
rgpspec[i].u.propid < PID_MIN_READONLY) rgpspec[i].u.propid < PID_MIN_READONLY)
dictionary_remove(This->propid_to_prop, dictionary_remove(This->propid_to_prop, UlongToPtr(rgpspec[i].u.propid));
(void *)rgpspec[i].u.propid);
else else
hr = STG_E_INVALIDPARAMETER; hr = STG_E_INVALIDPARAMETER;
} }
@ -787,10 +784,9 @@ static HRESULT WINAPI IPropertyStorage_fnDeletePropertyNames(
{ {
LPWSTR name = NULL; LPWSTR name = NULL;
if (dictionary_find(This->propid_to_name, (void *)rgpropid[i], if (dictionary_find(This->propid_to_name, UlongToPtr(rgpropid[i]), (void **)&name))
(void **)&name))
{ {
dictionary_remove(This->propid_to_name, (void *)rgpropid[i]); dictionary_remove(This->propid_to_name, UlongToPtr(rgpropid[i]));
dictionary_remove(This->name_to_propid, name); dictionary_remove(This->name_to_propid, name);
} }
} }
@ -955,8 +951,8 @@ static void PropertyStorage_PropNameDestroy(void *k, void *d, void *extra)
static int PropertyStorage_PropCompare(const void *a, const void *b, static int PropertyStorage_PropCompare(const void *a, const void *b,
void *extra) void *extra)
{ {
TRACE("(%d, %d)\n", (PROPID)a, (PROPID)b); TRACE("(%d, %d)\n", PtrToUlong(a), PtrToUlong(b));
return (PROPID)a - (PROPID)b; return PtrToUlong(a) - PtrToUlong(b);
} }
static void PropertyStorage_PropertyDestroy(void *k, void *d, void *extra) static void PropertyStorage_PropertyDestroy(void *k, void *d, void *extra)
@ -1513,7 +1509,7 @@ static BOOL PropertyStorage_DictionaryWriter(const void *key,
assert(key); assert(key);
assert(closure); assert(closure);
StorageUtl_WriteDWord((LPBYTE)&propid, 0, (DWORD)value); StorageUtl_WriteDWord((LPBYTE)&propid, 0, PtrToUlong(value));
c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count); c->hr = IStream_Write(This->stm, &propid, sizeof(propid), &count);
if (FAILED(c->hr)) if (FAILED(c->hr))
goto end; goto end;
@ -1781,7 +1777,7 @@ static BOOL PropertyStorage_PropertiesWriter(const void *key, const void *value,
assert(extra); assert(extra);
assert(closure); assert(closure);
c->hr = PropertyStorage_WritePropertyToStream(This, c->propNum++, c->hr = PropertyStorage_WritePropertyToStream(This, c->propNum++,
(DWORD)key, value, c->sectionOffset); PtrToUlong(key), value, c->sectionOffset);
return SUCCEEDED(c->hr); return SUCCEEDED(c->hr);
} }
@ -2398,7 +2394,7 @@ static HRESULT WINAPI IEnumSTATPROPSTG_fnClone(
static BOOL prop_enum_stat(const void *k, const void *v, void *extra, void *arg) static BOOL prop_enum_stat(const void *k, const void *v, void *extra, void *arg)
{ {
enumx_impl *enumx = arg; enumx_impl *enumx = arg;
PROPID propid = (PROPID) k; PROPID propid = PtrToUlong(k);
const PROPVARIANT *prop = v; const PROPVARIANT *prop = v;
STATPROPSTG stat; STATPROPSTG stat;