]> git.sur5r.net Git - openocd/commitdiff
fileio_t -> struct fileio
authorZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 11:08:29 +0000 (03:08 -0800)
committerZachary T Welch <zw@superlucidity.net>
Fri, 13 Nov 2009 19:58:04 +0000 (11:58 -0800)
Remove useless structure typedef.

src/flash/flash.c
src/flash/lpc2900.c
src/flash/mflash.c
src/flash/nand.c
src/helper/fileio.c
src/helper/fileio.h
src/target/etm.c
src/target/image.c
src/target/image.h
src/target/target.c
src/target/xscale.c

index f3f0086addfd8329769eece6b932a41dec612e0a..2abd8c43062d3b68254bf1e03d53f6898595df36 100644 (file)
@@ -812,7 +812,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        uint32_t offset;
        uint8_t *buffer;
        uint32_t buf_cnt;
-       fileio_t fileio;
+       struct fileio fileio;
 
        if (argc != 3)
                return ERROR_COMMAND_SYNTAX_ERROR;
index 953a62a142ddb9a8f4d8bdccd4de1fe7b7c1bb31..83593792e69be395c5447cf17b8e7073ea21823a 100644 (file)
@@ -622,7 +622,7 @@ COMMAND_HANDLER(lpc2900_handle_read_custom_command)
        target_write_u32( target, FCTR, FCTR_FS_CS | FCTR_FS_WEB );
 
        /* Try and open the file */
-       fileio_t fileio;
+       struct fileio fileio;
        const char *filename = args[1];
        int ret = fileio_open( &fileio, filename, FILEIO_WRITE, FILEIO_BINARY );
        if( ret != ERROR_OK )
index 5a9b7c355df1e7325b87033e06200147c3459909..54578da3851eb43b9cae702bbd6f667a2d3e2bfb 100644 (file)
@@ -706,7 +706,7 @@ COMMAND_HANDLER(mg_write_cmd)
 {
        uint32_t address, buf_cnt, cnt, res, i;
        uint8_t *buffer;
-       fileio_t fileio;
+       struct fileio fileio;
        int ret;
 
        if (argc != 3) {
@@ -770,7 +770,7 @@ COMMAND_HANDLER(mg_dump_cmd)
 {
        uint32_t address, size_written, size, cnt, res, i;
        uint8_t *buffer;
-       fileio_t fileio;
+       struct fileio fileio;
        int ret;
 
        if (argc != 4) {
index 26eb63ad20ae92bb86ba2f9f49e3059029db623e..44207a823c91cae6c40ad201536d4db5c1ef7793 100644 (file)
@@ -1292,7 +1292,7 @@ COMMAND_HANDLER(handle_nand_write_command)
        uint32_t buf_cnt;
        enum oob_formats oob_format = NAND_OOB_NONE;
 
-       fileio_t fileio;
+       struct fileio fileio;
 
 
        if (argc < 3)
@@ -1469,7 +1469,7 @@ COMMAND_HANDLER(handle_nand_dump_command)
                return ERROR_OK;
        }
 
-       fileio_t fileio;
+       struct fileio fileio;
 
        uint8_t *page = NULL;
        uint32_t page_size = 0;
index 42dae06ef8553ca89b6a2f800ad40909b5d904c9..71cae758150fb5a4d7bbe2d68a18766061fb03cc 100644 (file)
@@ -31,7 +31,7 @@
 #include "configuration.h"
 #include "fileio.h"
 
-static inline int fileio_open_local(fileio_t *fileio)
+static inline int fileio_open_local(struct fileio *fileio)
 {
        char access[4];
 
@@ -98,7 +98,7 @@ static inline int fileio_open_local(fileio_t *fileio)
        return ERROR_OK;
 }
 
-int fileio_open(fileio_t *fileio, const char *url, enum fileio_access access,  enum fileio_type type)
+int fileio_open(struct fileio *fileio, const char *url, enum fileio_access access,     enum fileio_type type)
 {
        int retval = ERROR_OK;
 
@@ -111,7 +111,7 @@ int fileio_open(fileio_t *fileio, const char *url, enum fileio_access access,       en
        return retval;
 }
 
-static inline int fileio_close_local(fileio_t *fileio)
+static inline int fileio_close_local(struct fileio *fileio)
 {
        int retval;
        if ((retval = fclose(fileio->file)) != 0)
@@ -131,7 +131,7 @@ static inline int fileio_close_local(fileio_t *fileio)
        return ERROR_OK;
 }
 
-int fileio_close(fileio_t *fileio)
+int fileio_close(struct fileio *fileio)
 {
        int retval;
 
@@ -143,7 +143,7 @@ int fileio_close(fileio_t *fileio)
        return retval;
 }
 
-int fileio_seek(fileio_t *fileio, uint32_t position)
+int fileio_seek(struct fileio *fileio, uint32_t position)
 {
        int retval;
        if ((retval = fseek(fileio->file, position, SEEK_SET)) != 0)
@@ -155,19 +155,19 @@ int fileio_seek(fileio_t *fileio, uint32_t position)
        return ERROR_OK;
 }
 
-static inline int fileio_local_read(fileio_t *fileio, uint32_t size, uint8_t *buffer, uint32_t *size_read)
+static inline int fileio_local_read(struct fileio *fileio, uint32_t size, uint8_t *buffer, uint32_t *size_read)
 {
        *size_read = fread(buffer, 1, size, fileio->file);
 
        return ERROR_OK;
 }
 
-int fileio_read(fileio_t *fileio, uint32_t size, uint8_t *buffer, uint32_t *size_read)
+int fileio_read(struct fileio *fileio, uint32_t size, uint8_t *buffer, uint32_t *size_read)
 {
        return fileio_local_read(fileio, size, buffer, size_read);
 }
 
-int fileio_read_u32(fileio_t *fileio, uint32_t *data)
+int fileio_read_u32(struct fileio *fileio, uint32_t *data)
 {
        uint8_t buf[4];
        uint32_t size_read;
@@ -180,7 +180,7 @@ int fileio_read_u32(fileio_t *fileio, uint32_t *data)
        return ERROR_OK;
 }
 
-static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buffer)
+static inline int fileio_local_fgets(struct fileio *fileio, uint32_t size, char *buffer)
 {
        if (fgets(buffer, size, fileio->file) == NULL)
                return ERROR_FILEIO_OPERATION_FAILED;
@@ -188,19 +188,19 @@ static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buff
        return ERROR_OK;
 }
 
-int fileio_fgets(fileio_t *fileio, uint32_t size, char *buffer)
+int fileio_fgets(struct fileio *fileio, uint32_t size, char *buffer)
 {
        return fileio_local_fgets(fileio, size, buffer);
 }
 
-static inline int fileio_local_write(fileio_t *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written)
+static inline int fileio_local_write(struct fileio *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written)
 {
        *size_written = fwrite(buffer, 1, size, fileio->file);
 
        return ERROR_OK;
 }
 
-int fileio_write(fileio_t *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written)
+int fileio_write(struct fileio *fileio, uint32_t size, const uint8_t *buffer, uint32_t *size_written)
 {
        int retval;
 
@@ -212,7 +212,7 @@ int fileio_write(fileio_t *fileio, uint32_t size, const uint8_t *buffer, uint32_
        return retval;;
 }
 
-int fileio_write_u32(fileio_t *fileio, uint32_t data)
+int fileio_write_u32(struct fileio *fileio, uint32_t data)
 {
        uint8_t buf[4];
        uint32_t size_written;
index 3f47cb9ba61bfa8cfb42bfd9de606a8e20d0f14d..024ad0832b64673b6697c101419777c6746e6ae3 100644 (file)
@@ -45,29 +45,28 @@ enum fileio_access
        FILEIO_APPENDREAD,      /* open for writing, position at end, allow reading */
 };
 
-typedef struct fileio_s
-{
+struct fileio {
        char *url;
        long long size;
        enum fileio_type type;
        enum fileio_access access;
        FILE *file;
-} fileio_t;
+};
 
-int fileio_open(fileio_t *fileio,
+int fileio_open(struct fileio *fileio,
        const char *url, enum fileio_access access, enum fileio_type type);
-int fileio_close(fileio_t *fileio);
+int fileio_close(struct fileio *fileio);
 
-int fileio_seek(fileio_t *fileio, uint32_t position);
-int fileio_fgets(fileio_t *fileio, uint32_t size, char *buffer);
+int fileio_seek(struct fileio *fileio, uint32_t position);
+int fileio_fgets(struct fileio *fileio, uint32_t size, char *buffer);
 
-int fileio_read(fileio_t *fileio,
+int fileio_read(struct fileio *fileio,
                uint32_t size, uint8_t *buffer, uint32_t *size_read);
-int fileio_write(fileio_t *fileio,
+int fileio_write(struct fileio *fileio,
                uint32_t size, const uint8_t *buffer, uint32_t *size_written);
 
-int fileio_read_u32(fileio_t *fileio, uint32_t *data);
-int fileio_write_u32(fileio_t *fileio, uint32_t data);
+int fileio_read_u32(struct fileio *fileio, uint32_t *data);
+int fileio_write_u32(struct fileio *fileio, uint32_t data);
 
 #define ERROR_FILEIO_LOCATION_UNKNOWN  (-1200)
 #define ERROR_FILEIO_NOT_FOUND                 (-1201)
index a4ff6c5f5626e71d2e056105010eac37a0ec1bb0..6d34f6c9ca89471226f0259643d1dfa2a1e1e2ff 100644 (file)
@@ -1788,7 +1788,7 @@ COMMAND_HANDLER(handle_etm_image_command)
 
 COMMAND_HANDLER(handle_etm_dump_command)
 {
-       fileio_t file;
+       struct fileio file;
        target_t *target;
        struct arm *arm;
        etm_context_t *etm_ctx;
@@ -1856,7 +1856,7 @@ COMMAND_HANDLER(handle_etm_dump_command)
 
 COMMAND_HANDLER(handle_etm_load_command)
 {
-       fileio_t file;
+       struct fileio file;
        target_t *target;
        struct arm *arm;
        etm_context_t *etm_ctx;
index cf7e11ab1c45442ed9106d366e39dfd7d8a659f1..9a9c9553b87f1b66bdb71da7ebf684fb1bdb8a4f 100644 (file)
@@ -47,7 +47,7 @@
 static int autodetect_image_type(image_t *image, const char *url)
 {
        int retval;
-       fileio_t fileio;
+       struct fileio fileio;
        uint32_t read_bytes;
        uint8_t buffer[9];
 
@@ -150,7 +150,7 @@ static int identify_image_type(image_t *image, const char *type_string, const ch
 static int image_ihex_buffer_complete(image_t *image)
 {
        image_ihex_t *ihex = image->type_private;
-       fileio_t *fileio = &ihex->fileio;
+       struct fileio *fileio = &ihex->fileio;
        uint32_t full_address = 0x0;
        uint32_t cooked_bytes;
        int i;
@@ -502,7 +502,7 @@ static int image_elf_read_section(image_t *image, int section, uint32_t offset,
 static int image_mot_buffer_complete(image_t *image)
 {
        image_mot_t *mot = image->type_private;
-       fileio_t *fileio = &mot->fileio;
+       struct fileio *fileio = &mot->fileio;
        uint32_t full_address = 0x0;
        uint32_t cooked_bytes;
        int i;
index 30240d5632c3a801b09c97e417e716353761ae49..a1e24c44c4be081e2f12e8f8fc4cad0c70b6d925 100644 (file)
@@ -69,12 +69,12 @@ typedef struct image_s
 
 typedef struct image_binary_s
 {
-       fileio_t fileio;
+       struct fileio fileio;
 } image_binary_t;
 
 typedef struct image_ihex_s
 {
-       fileio_t fileio;
+       struct fileio fileio;
        uint8_t *buffer;
 } image_ihex_t;
 
@@ -87,7 +87,7 @@ typedef struct image_memory_s
 
 typedef struct fileio_elf_s
 {
-       fileio_t fileio;
+       struct fileio fileio;
        Elf32_Ehdr *header;
        Elf32_Phdr *segments;
        uint32_t segment_count;
@@ -96,7 +96,7 @@ typedef struct fileio_elf_s
 
 typedef struct image_mot_s
 {
-       fileio_t fileio;
+       struct fileio fileio;
        uint8_t *buffer;
 } image_mot_t;
 
index 8cc46ecd665fdf31d9c22efb189a77ba208ff28d..6346ae03dae35da25b399b134f28c7abf7116569 100644 (file)
@@ -2493,7 +2493,7 @@ COMMAND_HANDLER(handle_load_image_command)
 
 COMMAND_HANDLER(handle_dump_image_command)
 {
-       fileio_t fileio;
+       struct fileio fileio;
 
        uint8_t buffer[560];
        int retvaltemp;
index e18d5916a3135b2ae8dc33ad3419904a8d580c47..88914b524c9e30870b03d1b7b82b3e4e006eba08 100644 (file)
@@ -3420,7 +3420,7 @@ COMMAND_HANDLER(xscale_handle_dump_trace_command)
        target_t *target = get_current_target(cmd_ctx);
        struct xscale_common_s *xscale = target_to_xscale(target);
        xscale_trace_data_t *trace_data;
-       fileio_t file;
+       struct fileio file;
        int retval;
 
        retval = xscale_verify_pointer(cmd_ctx, xscale);