libfprint: Use a macro to easily compute TOD padding

This commit is contained in:
Marco Trevisan (Treviño)
2021-10-31 22:22:56 +01:00
parent ec8a9ba0fd
commit 608a9f10df
13 changed files with 68 additions and 42 deletions
+2
View File
@@ -19,6 +19,8 @@
#pragma once
#include "tod/tod-macros.h"
typedef struct _FpDevice FpDevice;
typedef enum {
+10 -17
View File
@@ -43,7 +43,7 @@ struct _FpIdEntryTODV1_90_1
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[16];
TOD_PADDING (16, 0);
};
struct _FpDeviceClassTODV1_90_1
@@ -78,7 +78,7 @@ struct _FpDeviceClassTODV1_90_1
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[32];
TOD_PADDING (32, 0);
};
typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1;
@@ -172,13 +172,9 @@ struct _FpIdEntryTODV1_92_0
/*< private >*/
/* padding for future expansion */
#if GLIB_SIZEOF_VOID_P == 8
gpointer _padding_dummy[13];
#elif GLIB_SIZEOF_VOID_P == 4
gpointer _padding_dummy[11];
#else
G_STATIC_ASSERT("Unexpected pointer size")
#endif
TOD_PADDING_ALIGNED (16, sizeof (guint) * 2 +
sizeof (FpiDeviceUdevSubtypeFlagsTODV1_92_0) +
sizeof (gpointer));
};
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
@@ -217,7 +213,7 @@ struct _FpDeviceClassTODV1_92_0
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[31];
TOD_PADDING (32, sizeof (FpDeviceFeatureTODV1_92_0));
};
typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0;
@@ -266,13 +262,10 @@ struct _FpDeviceClassTODV1_94_0
/*< private >*/
/* padding for future expansion */
#if GLIB_SIZEOF_VOID_P == 8
gpointer _padding_dummy[27];
#elif GLIB_SIZEOF_VOID_P == 4
gpointer _padding_dummy[26];
#else
G_STATIC_ASSERT("Unexpected pointer size")
#endif
TOD_PADDING_ALIGNED8 (32,
sizeof (FpDeviceFeatureTODV1_94_0) +
sizeof (gint32) * 2 +
sizeof (gpointer) * 3)
};
typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0;
+1 -1
View File
@@ -57,5 +57,5 @@ typedef struct _FpImageDeviceClassTODV1_90_1
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[32];
TOD_PADDING (32, 0);
} FpImageDeviceClassTODV1_90_1;
+3 -1
View File
@@ -22,6 +22,8 @@
#include <glib.h>
#include <glib-object.h>
#include "tod/tod-macros.h"
typedef struct _FpImage FpImage;
typedef struct _FpImageTODV1_90_1 FpImageTODV1_90_1;
@@ -58,5 +60,5 @@ struct _FpImageTODV1_90_1
GPtrArray *minutiae;
guint ref_count;
gpointer _padding_dummy[32];
TOD_PADDING (32, 0);
};
+1 -1
View File
@@ -56,5 +56,5 @@ struct _FpiSpiTransferTODV1_92_0
GDestroyNotify free_buffer_rd;
/* padding for future expansion */
gpointer _padding_dummy[32];
TOD_PADDING (32, 0);
};
+1 -2
View File
@@ -75,7 +75,6 @@ struct _FpiUsbTransferTODV1_90_1
/* Data free function */
GDestroyNotify free_buffer;
/*< private >*/
/* padding for future expansion */
gpointer _padding_dummy[32];
TOD_PADDING (32, 0);
};