Commit 35d3f81e authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

gphoto2.ds: Remove unneeded casts.

parent 33f10e7f
...@@ -193,17 +193,17 @@ TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) ...@@ -193,17 +193,17 @@ TW_UINT16 GPHOTO2_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
static TW_BOOL GPHOTO2_OneValueSet32 (pTW_CAPABILITY pCapability, TW_UINT32 value) static TW_BOOL GPHOTO2_OneValueSet32 (pTW_CAPABILITY pCapability, TW_UINT32 value)
{ {
pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ONEVALUE)); pCapability->hContainer = GlobalAlloc (0, sizeof(TW_ONEVALUE));
TRACE("-> %ld\n", value); TRACE("-> %ld\n", value);
if (pCapability->hContainer) if (pCapability->hContainer)
{ {
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer);
pVal->ItemType = TWTY_UINT32; pVal->ItemType = TWTY_UINT32;
pVal->Item = value; pVal->Item = value;
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
pCapability->ConType = TWON_ONEVALUE; pCapability->ConType = TWON_ONEVALUE;
return TRUE; return TRUE;
} }
else else
...@@ -212,17 +212,17 @@ static TW_BOOL GPHOTO2_OneValueSet32 (pTW_CAPABILITY pCapability, TW_UINT32 valu ...@@ -212,17 +212,17 @@ static TW_BOOL GPHOTO2_OneValueSet32 (pTW_CAPABILITY pCapability, TW_UINT32 valu
static TW_BOOL GPHOTO2_OneValueSet16 (pTW_CAPABILITY pCapability, TW_UINT16 value) static TW_BOOL GPHOTO2_OneValueSet16 (pTW_CAPABILITY pCapability, TW_UINT16 value)
{ {
pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ONEVALUE)); pCapability->hContainer = GlobalAlloc (0, sizeof(TW_ONEVALUE));
TRACE("-> %d\n", value); TRACE("-> %d\n", value);
if (pCapability->hContainer) if (pCapability->hContainer)
{ {
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer);
pVal->ItemType = TWTY_UINT16; pVal->ItemType = TWTY_UINT16;
pVal->Item = value; pVal->Item = value;
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
pCapability->ConType = TWON_ONEVALUE; pCapability->ConType = TWON_ONEVALUE;
return TRUE; return TRUE;
} }
else else
...@@ -233,25 +233,25 @@ static TW_BOOL GPHOTO2_EnumSet16 (pTW_CAPABILITY pCapability, int nrofvalues, ...@@ -233,25 +233,25 @@ static TW_BOOL GPHOTO2_EnumSet16 (pTW_CAPABILITY pCapability, int nrofvalues,
const TW_UINT16 *values, int current, int def) const TW_UINT16 *values, int current, int def)
{ {
pTW_ENUMERATION pVal; pTW_ENUMERATION pVal;
pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ENUMERATION) + nrofvalues * sizeof(TW_UINT16)); pCapability->hContainer = GlobalAlloc (0, sizeof(TW_ENUMERATION) + nrofvalues * sizeof(TW_UINT16));
if (!pCapability->hContainer) if (!pCapability->hContainer)
return FALSE; return FALSE;
pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pVal = GlobalLock (pCapability->hContainer);
pVal->ItemType = TWTY_UINT16; pVal->ItemType = TWTY_UINT16;
pVal->NumItems = nrofvalues; pVal->NumItems = nrofvalues;
memcpy(pVal->ItemList, values, sizeof(TW_UINT16)*nrofvalues); memcpy(pVal->ItemList, values, sizeof(TW_UINT16)*nrofvalues);
pVal->CurrentIndex = current; pVal->CurrentIndex = current;
pVal->DefaultIndex = def; pVal->DefaultIndex = def;
pCapability->ConType = TWON_ENUMERATION; pCapability->ConType = TWON_ENUMERATION;
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
return TRUE; return TRUE;
} }
static TW_BOOL GPHOTO2_EnumGet16 (pTW_CAPABILITY pCapability, int *nrofvalues, TW_UINT16 **values) static TW_BOOL GPHOTO2_EnumGet16 (pTW_CAPABILITY pCapability, int *nrofvalues, TW_UINT16 **values)
{ {
pTW_ENUMERATION pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pTW_ENUMERATION pVal = GlobalLock (pCapability->hContainer);
if (!pVal) if (!pVal)
return FALSE; return FALSE;
...@@ -259,18 +259,18 @@ static TW_BOOL GPHOTO2_EnumGet16 (pTW_CAPABILITY pCapability, int *nrofvalues, T ...@@ -259,18 +259,18 @@ static TW_BOOL GPHOTO2_EnumGet16 (pTW_CAPABILITY pCapability, int *nrofvalues, T
*values = HeapAlloc( GetProcessHeap(), 0, sizeof(TW_UINT16)*pVal->NumItems); *values = HeapAlloc( GetProcessHeap(), 0, sizeof(TW_UINT16)*pVal->NumItems);
memcpy (*values, pVal->ItemList, sizeof(TW_UINT16)*(*nrofvalues)); memcpy (*values, pVal->ItemList, sizeof(TW_UINT16)*(*nrofvalues));
FIXME("Current Index %ld, Default Index %ld\n", pVal->CurrentIndex, pVal->DefaultIndex); FIXME("Current Index %ld, Default Index %ld\n", pVal->CurrentIndex, pVal->DefaultIndex);
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
return TRUE; return TRUE;
} }
static TW_BOOL GPHOTO2_OneValueGet32 (pTW_CAPABILITY pCapability, TW_UINT32 *pValue) static TW_BOOL GPHOTO2_OneValueGet32 (pTW_CAPABILITY pCapability, TW_UINT32 *pValue)
{ {
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer);
if (pVal) if (pVal)
{ {
*pValue = pVal->Item; *pValue = pVal->Item;
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
return TRUE; return TRUE;
} }
else else
...@@ -279,12 +279,12 @@ static TW_BOOL GPHOTO2_OneValueGet32 (pTW_CAPABILITY pCapability, TW_UINT32 *pVa ...@@ -279,12 +279,12 @@ static TW_BOOL GPHOTO2_OneValueGet32 (pTW_CAPABILITY pCapability, TW_UINT32 *pVa
static TW_BOOL GPHOTO2_OneValueGet16 (pTW_CAPABILITY pCapability, TW_UINT16 *pValue) static TW_BOOL GPHOTO2_OneValueGet16 (pTW_CAPABILITY pCapability, TW_UINT16 *pValue)
{ {
pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer);
if (pVal) if (pVal)
{ {
*pValue = pVal->Item; *pValue = pVal->Item;
GlobalUnlock ((HGLOBAL) pCapability->hContainer); GlobalUnlock (pCapability->hContainer);
return TRUE; return TRUE;
} }
else else
......
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