}
/**
+ * Helper function used for freeing list dictionary value object
+ */
+static void drive_file_objfree(void* obj)
+{
+ drive_file_free((DRIVE_FILE*) obj);
+}
+
+/**
* Function description
*
* @return 0 on success, otherwise a Win32 error code
goto out_error;
}
- ListDictionary_ValueObject(drive->files)->fnObjectFree = (OBJECT_FREE_FN) drive_file_free;
+ ListDictionary_ValueObject(drive->files)->fnObjectFree = drive_file_objfree;
drive->IrpQueue = MessageQueue_New(NULL);
if (!drive->IrpQueue)
#include "devman.h"
-void devman_device_free(DEVICE* device)
+static void devman_device_free(void* obj)
{
+ DEVICE* device = (DEVICE*) obj;
+
if (!device)
return;
return NULL;
}
- ListDictionary_ValueObject(devman->devices)->fnObjectFree =
- (OBJECT_FREE_FN) devman_device_free;
+ ListDictionary_ValueObject(devman->devices)->fnObjectFree = devman_device_free;
return devman;
}
PROFILER_PRINT_FOOTER
}
-static void rfx_tile_init(RFX_TILE* tile)
+static void rfx_tile_init(void* obj)
{
+ RFX_TILE* tile = (RFX_TILE*)obj;
if (tile)
{
tile->x = 0;
}
}
-static RFX_TILE* rfx_decoder_tile_new(void)
+static void* rfx_decoder_tile_new(void* val)
{
RFX_TILE* tile = NULL;
+ WINPR_UNUSED(val);
if (!(tile = (RFX_TILE*) calloc(1, sizeof(RFX_TILE))))
return NULL;
return tile;
}
-static void rfx_decoder_tile_free(RFX_TILE* tile)
+static void rfx_decoder_tile_free(void* obj)
{
+ RFX_TILE* tile = (RFX_TILE*)obj;
+
if (tile)
{
if (tile->allocated)
}
}
-static RFX_TILE* rfx_encoder_tile_new(void)
+static void* rfx_encoder_tile_new(void* val)
{
- return (RFX_TILE*)calloc(1, sizeof(RFX_TILE));
+ WINPR_UNUSED(val);
+ return calloc(1, sizeof(RFX_TILE));
}
-static void rfx_encoder_tile_free(RFX_TILE* tile)
+static void rfx_encoder_tile_free(void* obj)
{
- free(tile);
+ free(obj);
}
RFX_CONTEXT* rfx_context_new(BOOL encoder)
goto error_tilePool;
pool = ObjectPool_Object(priv->TilePool);
- pool->fnObjectInit = (OBJECT_INIT_FN) rfx_tile_init;
+ pool->fnObjectInit = rfx_tile_init;
if (context->encoder)
{
- pool->fnObjectNew = (OBJECT_NEW_FN) rfx_encoder_tile_new;
- pool->fnObjectFree = (OBJECT_FREE_FN) rfx_encoder_tile_free;
+ pool->fnObjectNew = rfx_encoder_tile_new;
+ pool->fnObjectFree = rfx_encoder_tile_free;
}
else
{
- pool->fnObjectNew = (OBJECT_NEW_FN) rfx_decoder_tile_new;
- pool->fnObjectFree = (OBJECT_FREE_FN) rfx_decoder_tile_free;
+ pool->fnObjectNew = rfx_decoder_tile_new;
+ pool->fnObjectFree = rfx_decoder_tile_free;
}
/*
extern "C" {
#endif
-/* We don't know if the new function will require an argument.
- * Leave the braces empty, C defines that as variable arguments. */
-typedef void* (*OBJECT_NEW_FN)();
+typedef void* (*OBJECT_NEW_FN)(void* val);
typedef void (*OBJECT_INIT_FN)(void* obj);
typedef void (*OBJECT_UNINIT_FN)(void* obj);
typedef void (*OBJECT_FREE_FN)(void* obj);