diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 8e5c8a83..6b98ae76 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -1,3 +1,18 @@ + +2009-04-22 Rutger Hofman + + Check suspicious-looking public symbols whether they shouldn't be in fact + static: + * src/jim/tap.c: make some variables static + * src/jim/intel_28f800b3.c: make some variables static + * src/jim/some_cpu.c + * src/tap/parport/direct.c + * src/bus/ejtag_dma.c + * src/bus/mpc824x.c + * src/bus/bcm1250.c + * src/bus/slsup3.c + * src/flash/amd_flash.c + 2009-04-21 Rutger Hofman Run indent over the code base: all '*.[ch]' files except evidently imported diff --git a/urjtag/src/bus/bcm1250.c b/urjtag/src/bus/bcm1250.c index 92499042..c4c4460d 100644 --- a/urjtag/src/bus/bcm1250.c +++ b/urjtag/src/bus/bcm1250.c @@ -298,8 +298,8 @@ bcm1250_bus_write (bus_t *bus, uint32_t adr, uint32_t data) #else /* #ifndef USE_BCM_EJTAG */ -int addr; -uint64_t base = 0x1fc00000; +static int addr; +static uint64_t base = 0x1fc00000; static int bcm1250_ejtag_do (bus_t *bus, uint64_t ad, uint64_t da, int read, int type, diff --git a/urjtag/src/bus/ejtag_dma.c b/urjtag/src/bus/ejtag_dma.c index 6256d30b..a1efe7a6 100644 --- a/urjtag/src/bus/ejtag_dma.c +++ b/urjtag/src/bus/ejtag_dma.c @@ -145,7 +145,7 @@ reg_value (tap_register *reg) #ifdef PRINT_DATA_DEBUG /* Small debug helper */ -char +static char siz_ (int sz) { switch (sz) diff --git a/urjtag/src/bus/mpc824x.c b/urjtag/src/bus/mpc824x.c index 6e9ab3dc..c27da199 100644 --- a/urjtag/src/bus/mpc824x.c +++ b/urjtag/src/bus/mpc824x.c @@ -61,10 +61,10 @@ typedef struct #define nFOE ((bus_params_t *) bus->params)->nfoe #define D ((bus_params_t *) bus->params)->d -int BUS_WIDTH = 8; -char REVBITS = 0; -char dbgAddr = 0; -char dbgData = 0; +static int BUS_WIDTH = 8; +static char REVBITS = 0; +static char dbgAddr = 0; +static char dbgData = 0; /** diff --git a/urjtag/src/bus/slsup3.c b/urjtag/src/bus/slsup3.c index 2c4c7689..7d6bbe61 100644 --- a/urjtag/src/bus/slsup3.c +++ b/urjtag/src/bus/slsup3.c @@ -39,11 +39,11 @@ #include "buses.h" #include "generic_bus.h" -int databusio[16] = +static int databusio[16] = { 94, 96, 98, 100, 102, 104, 106, 113, 95, 97, 99, 101, 103, 105, 107, 114 }; -int addrbusio[20] = +static int addrbusio[20] = { 93, 88, 87, 86, 85, 84, 83, 63, 64, 65, 66, 67, 68, 74, 75, 76, 77, 82, 81, 78 }; diff --git a/urjtag/src/flash/amd_flash.c b/urjtag/src/flash/amd_flash.c index bf8793f9..e815d9ae 100644 --- a/urjtag/src/flash/amd_flash.c +++ b/urjtag/src/flash/amd_flash.c @@ -66,7 +66,7 @@ #define AMD_BYPASS_UNLOCK_MODE 1 #define AMD_STANDARD_MODE 0 -struct +static struct { unsigned long flash; unsigned short algorithm; diff --git a/urjtag/src/jim/intel_28f800b3.c b/urjtag/src/jim/intel_28f800b3.c index 44b82dea..60246099 100644 --- a/urjtag/src/jim/intel_28f800b3.c +++ b/urjtag/src/jim/intel_28f800b3.c @@ -56,7 +56,7 @@ typedef enum } intel_f28xxxb3_op_state_t; -const char *intel_28fxxx_opstate_name[16] = { +static const char *intel_28fxxx_opstate_name[16] = { "READ_ARRAY", "READ_STATUS", "READ_ID", diff --git a/urjtag/src/jim/some_cpu.c b/urjtag/src/jim/some_cpu.c index 289b2f95..357950e2 100644 --- a/urjtag/src/jim/some_cpu.c +++ b/urjtag/src/jim/some_cpu.c @@ -32,7 +32,7 @@ extern jim_bus_device_t intel_28f800b3b; -jim_attached_part_t some_cpu_attached[] = { +static jim_attached_part_t some_cpu_attached[] = { /* 1. Address offset: base offset [bytes] * 2. Address shift: Distance between address LSB of device and CPU * 3. Data shift: Distance between D0 of device and CPU e.g. 0, 8, 16 or 24 bits diff --git a/urjtag/src/jim/tap.c b/urjtag/src/jim/tap.c index b7e5ce4d..8c10c55a 100644 --- a/urjtag/src/jim/tap.c +++ b/urjtag/src/jim/tap.c @@ -32,7 +32,7 @@ #undef VERBOSE -const tap_state_t next_tap_state[16][2] = { +static const tap_state_t next_tap_state[16][2] = { /* RESET */ {IDLE, RESET}, /* SELECT_DR */ {CAPTURE_DR, SELECT_IR}, /* CAPTURE_DR */ {SHIFT_DR, EXIT1_DR}, diff --git a/urjtag/src/tap/parport/direct.c b/urjtag/src/tap/parport/direct.c index 5ad2b475..30ddad51 100644 --- a/urjtag/src/tap/parport/direct.c +++ b/urjtag/src/tap/parport/direct.c @@ -36,13 +36,13 @@ #if defined(HAVE_INPOUTXX) -HINSTANCE inpout32_dll_handle = NULL; +static HINSTANCE inpout32_dll_handle = NULL; typedef short _stdcall (*inpfuncPtr) (short p); typedef void _stdcall (*outfuncPtr) (short p, short d); -inpfuncPtr Inp32; -outfuncPtr Out32; +static inpfuncPtr Inp32; +static outfuncPtr Out32; #define inb(p) (Inp32)(p) #define outb(d,p) (Out32)(p,d)