cleanup: Use #pragma once everywhere

Remove legacy header guards, and use compiler newer features.
This commit is contained in:
Marco Trevisan (Treviño) 2019-12-16 20:50:04 +01:00
parent 10945f8546
commit 2158c5e2d1
22 changed files with 22 additions and 90 deletions

View File

@ -18,9 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __STORAGE_H
#define __STORAGE_H
#pragma once
int print_data_save (FpPrint *print,
FpFinger finger);
@ -30,5 +28,3 @@ FpPrint * print_create_template (FpDevice *dev,
FpFinger finger);
gboolean print_image_save (FpPrint *print,
const char *path);
#endif /* __STORAGE_H */

View File

@ -18,11 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __UTILITIES_H
#define __UTILITIES_H
#pragma once
FpDevice * discover_device (GPtrArray *devices);
FpFinger finger_chooser (void);
const char * finger_to_string (FpFinger finger);
#endif /* __UTILITIES_H */

View File

@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AES1660_H
#define __AES1660_H
#pragma once
#define AES1660_FRAME_SIZE 0x244
@ -1986,5 +1985,3 @@ static const unsigned char aes1660_start_imaging_cmd[] = {
0x55, 0x07, 0x00, 0x80, 0x42, 0x00, 0x7f, 0x00, 0x00, 0x14,
0x49, 0x03, 0x00, 0x20, 0x00, 0xc8
};
#endif

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AES2501_H
#define __AES2501_H
#pragma once
enum aes2501_regs {
AES2501_REG_CTRL1 = 0x80,
@ -172,5 +171,3 @@ enum aes2501_sensor_gain2 {
#define AES2501_SUM_HIGH_THRESH 1000
#define AES2501_SUM_LOW_THRESH 700
#endif /* __AES2501_H */

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AES2550_H
#define __AES2550_H
#pragma once
/* Registers bits */
@ -110,5 +109,3 @@ enum aes2550_cmds {
#define AES2550_HEARTBEAT_MAGIC 0xdb
#define AES2550_EP_IN_BUF_SIZE 8192
#endif

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AES2660_H
#define __AES2660_H
#pragma once
#define AES2660_FRAME_SIZE 0x354
@ -1960,5 +1959,3 @@ static const unsigned char aes2660_start_imaging_cmd[] = {
0x55, 0x07, 0x00, 0x80, 0x42, 0x00, 0xbf, 0x00, 0x00, 0x18,
0x49, 0x03, 0x00, 0x20, 0x08, 0xc8
};
#endif

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __AESLIB_H__
#define __AESLIB_H__
#pragma once
#include <fprint.h>
@ -45,5 +44,3 @@ unsigned char aes_get_pixel (struct fpi_frame_asmbl_ctx *ctx,
struct fpi_frame *frame,
unsigned int x,
unsigned int y);
#endif

View File

@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __ELAN_H
#define __ELAN_H
#pragma once
#include <glib.h>
@ -224,5 +223,3 @@ static void elan_capture (FpDevice *dev);
static void dev_change_state (FpImageDevice *dev,
FpImageDeviceState state);
#endif

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _BMKT_H_
#define _BMKT_H_
#pragma once
/**< User ID maximum length allowed */
#define BMKT_MAX_USER_ID_LEN 100
@ -228,5 +227,3 @@ typedef struct bmkt_user_id
#ifdef __cplusplus
}
#endif
#endif /* _BMKT_H_ */

View File

@ -16,10 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef BMKT_MESSAGE_H_
#define BMKT_MESSAGE_H_
#pragma once
#define BMKT_MESSAGE_HEADER_ID 0xFE
#define BMKT_MESSAGE_HEADER_LEN (4)
@ -90,4 +87,3 @@ int bmkt_parse_message_header (uint8_t *resp_buf,
bmkt_msg_resp_t *msg_resp);
int bmkt_parse_message_payload (bmkt_msg_resp_t *msg_resp,
bmkt_response_t *resp);
#endif /* BMKT_MESSAGE_H_ */

View File

@ -17,9 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _BMKT_RESPONSE_H_
#define _BMKT_RESPONSE_H_
#pragma once
#include "bmkt.h"
@ -485,5 +483,3 @@ typedef struct bmkt_response
int complete; /**< Operation completion status 1: complete / 0: not completed */
bmkt_response_data_t response; /**< Operation specific response union */
} bmkt_response_t;
#endif /* _BMKT_RESPONSE_H_ */

View File

@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SENSOR_H_
#define _SENSOR_H_
#pragma once
#include "usb_transport.h"
#define BMKT_MAX_PENDING_SESSIONS 2
@ -84,4 +83,3 @@ int bmkt_sensor_handle_response (bmkt_sensor_t *sensor,
bmkt_msg_resp_t *msg_resp);
int bmkt_sensor_send_async_read_command (bmkt_sensor_t *sensor);
#endif /* _SENSOR_H_ */

View File

@ -16,8 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __synaptics_h__
#define __synaptics_h__
#pragma once
#include "fpi-device.h"
#include "fpi-ssm.h"
@ -126,5 +125,3 @@ struct _FpiDeviceSynaptics
struct syna_enroll_resp_data enroll_resp_data;
syna_state_t state;
};
#endif //__synaptics_h__

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __UPEKTC_H
#define __UPEKTC_H
#pragma once
#define UPEKTC_CMD_LEN 0x40
#define IMAGE_WIDTH 208
@ -1936,5 +1935,3 @@ static const unsigned char scan_cmd[0x40] = {
0x05, 0x90, 0xf6, 0x77, 0x84, 0xf5, 0x2f, 0x01,
0x05, 0x90, 0xf6, 0x00, 0xc8, 0x00, 0xec, 0x00
};
#endif

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __UPEKTC_IMG_H
#define __UPEKTC_IMG_H
#pragma once
static const unsigned char upek2020_init_1[] = {
'C', 'i', 'a', 'o',
@ -140,5 +139,3 @@ static const unsigned char upek2020_ack_frame[] = {
0x30,
0xac, 0x5b /* CRC */
};
#endif

View File

@ -1,5 +1,4 @@
#ifndef __VFS5011_PROTO_H
#define __VFS5011_PROTO_H
#pragma once
#define VFS5011_LINE_SIZE 240
#define VFS5011_IMAGE_WIDTH 160
@ -6182,5 +6181,3 @@ static unsigned char vfs5011_prepare_04[] = { /* 2903 B */
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
};
#endif

View File

@ -19,8 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __DRIVERS_API_H__
#define __DRIVERS_API_H__
#pragma once
#include "fpi-assembling.h"
#include "fpi-device.h"
@ -30,5 +29,3 @@
#include "fpi-print.h"
#include "fpi-usb-transfer.h"
#include "fpi-ssm.h"
#endif

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __FPI_ASSEMBLING_H__
#define __FPI_ASSEMBLING_H__
#pragma once
#include <fprint.h>
@ -116,5 +115,3 @@ struct fpi_line_asmbl_ctx
FpImage *fpi_assemble_lines (struct fpi_line_asmbl_ctx *ctx,
GSList *lines,
size_t num_lines);
#endif

View File

@ -19,8 +19,7 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __FPI_BYTE_READER_H__
#define __FPI_BYTE_READER_H__
#pragma once
#include <glib.h>
#include "fpi-byte-utils.h"
@ -676,5 +675,3 @@ fpi_byte_reader_skip_inline (FpiByteReader * reader, guint nbytes)
#endif /* FPI_BYTE_READER_DISABLE_INLINES */
G_END_DECLS
#endif /* __FPI_BYTE_READER_H__ */

View File

@ -21,9 +21,7 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __FP_UTILS_H__
#define __FP_UTILS_H__
#pragma once
#include <glib.h>
@ -485,4 +483,3 @@ FP_WRITE_DOUBLE_BE(guint8 *data, gdouble num)
G_END_DECLS
#endif /* __GTK_DOC_IGNORE__ */
#endif /* __FP_UTILS_H__ */

View File

@ -18,8 +18,7 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef __FPI_BYTE_WRITER_H__
#define __FPI_BYTE_WRITER_H__
#pragma once
#include "fpi-byte-reader.h"
#include <string.h>
@ -409,5 +408,3 @@ fpi_byte_writer_fill_inline (FpiByteWriter * writer, guint8 value, guint size)
#endif
G_END_DECLS
#endif /* __FPI_BYTE_WRITER_H__ */

View File

@ -17,8 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __FPI_LOG_H__
#define __FPI_LOG_H__
#pragma once
/**
* SECTION:fpi-log
@ -94,5 +93,3 @@
* Same as BUG_ON() but is always true.
*/
#define BUG() BUG_ON (1)
#endif