mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Use g_new0 rather than g_malloc0
Port some of the g_malloc0 users to g_new0.
This commit is contained in:
committed by
Benjamin Berg
parent
d1fb1e26f3
commit
f2b932960e
@@ -806,8 +806,7 @@ dev_open (FpImageDevice *dev)
|
||||
FpDeviceVfs5011 *self;
|
||||
|
||||
self = FPI_DEVICE_VFS5011 (dev);
|
||||
self->capture_buffer =
|
||||
(unsigned char *) g_malloc0 (CAPTURE_LINES * VFS5011_LINE_SIZE);
|
||||
self->capture_buffer = g_new0 (unsigned char, CAPTURE_LINES * VFS5011_LINE_SIZE);
|
||||
|
||||
if (!g_usb_device_claim_interface (fpi_device_get_usb_device (FP_DEVICE (dev)), 0, 0, &error))
|
||||
{
|
||||
|
||||
@@ -426,7 +426,7 @@ fpi_assemble_lines (struct fpi_line_asmbl_ctx *ctx,
|
||||
GSList *row1, *row2;
|
||||
float y = 0.0;
|
||||
int line_ind = 0;
|
||||
int *offsets = (int *) g_malloc0 ((num_lines / 2) * sizeof (int));
|
||||
int *offsets = g_new0 (int, num_lines / 2);
|
||||
unsigned char *output = g_malloc0 (ctx->line_width * ctx->max_height);
|
||||
FpImage *img;
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ fpi_ssm_new (FpDevice *dev,
|
||||
|
||||
BUG_ON (nr_states < 1);
|
||||
|
||||
machine = g_malloc0 (sizeof (*machine));
|
||||
machine = g_new0 (FpiSsm, 1);
|
||||
machine->handler = handler;
|
||||
machine->nr_states = nr_states;
|
||||
machine->dev = dev;
|
||||
|
||||
Reference in New Issue
Block a user