From c0258e0026b185171d54c7d68338cf366335a644 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Jan 2010 22:11:49 +0000 Subject: [PATCH] constify the parallel port and usb cable drivers git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1721 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 12 ++++++++++-- urjtag/include/urjtag/parport.h | 4 ++-- urjtag/include/urjtag/usbconn.h | 4 ++-- urjtag/src/tap/parport.c | 2 +- urjtag/src/tap/parport.h | 2 +- urjtag/src/tap/parport/direct.c | 2 +- urjtag/src/tap/parport/ppdev.c | 2 +- urjtag/src/tap/parport/ppi.c | 2 +- urjtag/src/tap/usbconn.c | 2 +- urjtag/src/tap/usbconn.h | 2 +- urjtag/src/tap/usbconn/libftd2xx.c | 2 +- urjtag/src/tap/usbconn/libftdi.c | 4 ++-- urjtag/src/tap/usbconn/libusb.c | 2 +- 13 files changed, 25 insertions(+), 17 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index b39e4710..274ff539 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -59,7 +59,7 @@ * src/tap/cable/ft2232.c, src/tap/cable/generic_usbconn.c, src/tap/cable/generic_usbconn.h, src/tap/cable/jlink.c, src/tap/cable/usbblaster.c, src/tap/cable/xpc.c: Constify the usb cable - drivers. + sub drivers. * src/tap/cable/ft2232.c, src/tap/cable/generic_usbconn.h, src/tap/cable/jlink.c, src/tap/cable/usbblaster.c, src/tap/cable/xpc.c, @@ -73,7 +73,15 @@ * src/tap/parport.c, src/tap/parport.h, src/tap/parport_list.h, src/tap/parport/direct.c, src/tap/parport/ppdev.c, src/tap/parport/ppi.c: - Unify the list of parallel port drivers. + Unify the list of parallel port cable drivers. + + * include/urjtag/parport.h, src/tap/parport.c, src/tap/parport/direct.c, + src/tap/parport.h, src/tap/parport/ppdev.c, src/tap/parport/ppi.c: + Constify the parallel port cable drivers. + + * include/urjtag/usbconn.h, src/tap/usbconn.c, src/tap/usbconn.h, + src/tap/usbconn/libftd2xx.c, src/tap/usbconn/libftdi.c, + src/tap/usbconn/libusb.c: Constify the USB cable drivers. 2010-01-22 Mike Frysinger diff --git a/urjtag/include/urjtag/parport.h b/urjtag/include/urjtag/parport.h index 75edc572..385eaf52 100644 --- a/urjtag/include/urjtag/parport.h +++ b/urjtag/include/urjtag/parport.h @@ -62,7 +62,7 @@ urj_parport_driver_t; struct URJ_PARPORT { - urj_parport_driver_t *driver; + const urj_parport_driver_t *driver; void *params; urj_cable_t *cable; }; @@ -78,6 +78,6 @@ int urj_tap_parport_set_control (urj_parport_t *port, const unsigned char data); const char *urj_cable_parport_devtype_string(urj_cable_parport_devtype_t dt); -extern urj_parport_driver_t *urj_tap_parport_drivers[]; +extern const urj_parport_driver_t *urj_tap_parport_drivers[]; #endif /* URJ_PARPORT_H */ diff --git a/urjtag/include/urjtag/usbconn.h b/urjtag/include/urjtag/usbconn.h index 9292f3f8..c5f87775 100644 --- a/urjtag/include/urjtag/usbconn.h +++ b/urjtag/include/urjtag/usbconn.h @@ -60,7 +60,7 @@ urj_usbconn_driver_t; struct URJ_USBCONN { - urj_usbconn_driver_t *driver; + const urj_usbconn_driver_t *driver; void *params; urj_cable_t *cable; }; @@ -73,6 +73,6 @@ int urj_tap_usbconn_close (urj_usbconn_t *conn); int urj_tap_usbconn_read (urj_usbconn_t *conn, uint8_t *buf, int len); int urj_tap_usbconn_write (urj_usbconn_t *conn, uint8_t *buf, int len, int recv); -extern urj_usbconn_driver_t *urj_tap_usbconn_drivers[]; +extern const urj_usbconn_driver_t *urj_tap_usbconn_drivers[]; #endif /* URJ_USBCONN_H */ diff --git a/urjtag/src/tap/parport.c b/urjtag/src/tap/parport.c index 5598bd9f..ba4de4db 100644 --- a/urjtag/src/tap/parport.c +++ b/urjtag/src/tap/parport.c @@ -30,7 +30,7 @@ #include "parport.h" -urj_parport_driver_t *urj_tap_parport_drivers[] = { +const urj_parport_driver_t *urj_tap_parport_drivers[] = { #define _URJ_LIST(item) &urj_tap_parport_##item##_driver, #include "parport_list.h" NULL /* last must be NULL */ diff --git a/urjtag/src/tap/parport.h b/urjtag/src/tap/parport.h index 2e77b485..38ff5b67 100644 --- a/urjtag/src/tap/parport.h +++ b/urjtag/src/tap/parport.h @@ -25,7 +25,7 @@ #ifndef URJ_CABLE_CABLE_H #define URJ_CABLE_CABLE_H -#define _URJ_LIST(item) extern urj_parport_driver_t urj_tap_parport_##item##_driver; +#define _URJ_LIST(item) extern const urj_parport_driver_t urj_tap_parport_##item##_driver; #include "parport_list.h" typedef struct port_node_t port_node_t; diff --git a/urjtag/src/tap/parport/direct.c b/urjtag/src/tap/parport/direct.c index e37fc2b1..a245fdbb 100644 --- a/urjtag/src/tap/parport/direct.c +++ b/urjtag/src/tap/parport/direct.c @@ -305,7 +305,7 @@ direct_set_control (urj_parport_t *parport, unsigned char data) return URJ_STATUS_OK; } -urj_parport_driver_t urj_tap_parport_direct_parport_driver = { +const urj_parport_driver_t urj_tap_parport_direct_parport_driver = { URJ_CABLE_PARPORT_DEV_PARALLEL, direct_connect, direct_parport_free, diff --git a/urjtag/src/tap/parport/ppdev.c b/urjtag/src/tap/parport/ppdev.c index 9732b651..b08a4f8c 100644 --- a/urjtag/src/tap/parport/ppdev.c +++ b/urjtag/src/tap/parport/ppdev.c @@ -241,7 +241,7 @@ ppdev_set_control (urj_parport_t *parport, unsigned char data) return URJ_STATUS_OK; } -urj_parport_driver_t urj_tap_parport_ppdev_parport_driver = { +const urj_parport_driver_t urj_tap_parport_ppdev_parport_driver = { URJ_CABLE_PARPORT_DEV_PPDEV, ppdev_connect, ppdev_parport_free, diff --git a/urjtag/src/tap/parport/ppi.c b/urjtag/src/tap/parport/ppi.c index a652d50d..1f799b06 100644 --- a/urjtag/src/tap/parport/ppi.c +++ b/urjtag/src/tap/parport/ppi.c @@ -227,7 +227,7 @@ ppi_set_control (urj_parport_t *parport, unsigned char data) return URJ_STATUS_OK; } -urj_parport_driver_t urj_tap_parport_ppi_parport_driver = { +const urj_parport_driver_t urj_tap_parport_ppi_parport_driver = { URJ_CABLE_PARPORT_DEV_PPI, ppi_connect, ppi_parport_free, diff --git a/urjtag/src/tap/usbconn.c b/urjtag/src/tap/usbconn.c index 1f420809..e4a6474f 100644 --- a/urjtag/src/tap/usbconn.c +++ b/urjtag/src/tap/usbconn.c @@ -31,7 +31,7 @@ #include "usbconn.h" -urj_usbconn_driver_t *urj_tap_usbconn_drivers[] = { +const urj_usbconn_driver_t *urj_tap_usbconn_drivers[] = { #define _URJ_LIST(item) &urj_tap_usbconn_##item##_driver, #include "usbconn_list.h" NULL /* last must be NULL */ diff --git a/urjtag/src/tap/usbconn.h b/urjtag/src/tap/usbconn.h index 6470c2de..97b3effe 100644 --- a/urjtag/src/tap/usbconn.h +++ b/urjtag/src/tap/usbconn.h @@ -25,7 +25,7 @@ #ifndef URJ_CABLE_USBCONN_H #define URJ_CABLE_USBCONN_H -#define _URJ_LIST(item) extern urj_usbconn_driver_t urj_tap_usbconn_##item##_driver; +#define _URJ_LIST(item) extern const urj_usbconn_driver_t urj_tap_usbconn_##item##_driver; #include "usbconn_list.h" #endif /* URJ_CABLE_USBCONN_H */ diff --git a/urjtag/src/tap/usbconn/libftd2xx.c b/urjtag/src/tap/usbconn/libftd2xx.c index 157d3440..9a198739 100644 --- a/urjtag/src/tap/usbconn/libftd2xx.c +++ b/urjtag/src/tap/usbconn/libftd2xx.c @@ -603,7 +603,7 @@ urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_driver = { usbconn_ftd2xx_write }; -urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver = { +const urj_usbconn_driver_t urj_tap_usbconn_ftd2xx_mpsse_driver = { "ftd2xx-mpsse", usbconn_ftd2xx_mpsse_connect, usbconn_ftd2xx_free, diff --git a/urjtag/src/tap/usbconn/libftdi.c b/urjtag/src/tap/usbconn/libftdi.c index 0f0e63d4..4490a926 100644 --- a/urjtag/src/tap/usbconn/libftdi.c +++ b/urjtag/src/tap/usbconn/libftdi.c @@ -606,7 +606,7 @@ usbconn_ftdi_free (urj_usbconn_t *conn) /* ---------------------------------------------------------------------- */ -urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver = { +const urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver = { "ftdi", usbconn_ftdi_connect, usbconn_ftdi_free, @@ -616,7 +616,7 @@ urj_usbconn_driver_t urj_tap_usbconn_ftdi_driver = { usbconn_ftdi_write }; -urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver = { +const urj_usbconn_driver_t urj_tap_usbconn_ftdi_mpsse_driver = { "ftdi-mpsse", usbconn_ftdi_mpsse_connect, usbconn_ftdi_free, diff --git a/urjtag/src/tap/usbconn/libusb.c b/urjtag/src/tap/usbconn/libusb.c index a11103fa..e4bb1d6d 100644 --- a/urjtag/src/tap/usbconn/libusb.c +++ b/urjtag/src/tap/usbconn/libusb.c @@ -255,7 +255,7 @@ usbconn_libusb_free (urj_usbconn_t *conn) /* ---------------------------------------------------------------------- */ -urj_usbconn_driver_t urj_tap_usbconn_libusb_driver = { +const urj_usbconn_driver_t urj_tap_usbconn_libusb_driver = { "libusb", usbconn_libusb_connect, usbconn_libusb_free,