warnings: use more 'const' for char *
authorØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 29 Dec 2010 21:07:21 +0000 (22:07 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 29 Dec 2010 21:07:39 +0000 (22:07 +0100)
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
25 files changed:
src/flash/mflash.h
src/flash/nand/core.h
src/flash/nand/driver.h
src/flash/nor/at91sam7.c
src/flash/nor/core.h
src/flash/nor/driver.h
src/flash/nor/lpc288x.c
src/flash/nor/pic32mx.c
src/flash/nor/stellaris.c
src/flash/nor/tms470.c
src/helper/bin2char.c
src/helper/command.c
src/helper/command.h
src/pld/pld.h
src/server/server.c
src/server/server.h
src/target/algorithm.h
src/target/arm9tdmi.c
src/target/arm_disassembler.c
src/target/armv7m.c
src/target/dsp563xx.c
src/target/dsp563xx.h
src/target/etm.h
src/target/register.h
src/target/target_type.h

index bb3cd05ba86c05d3b8ce4bb35f86995d733f9874..0520c5fa9fd6c34078124aebc995e37cd329d765 100644 (file)
@@ -34,7 +34,7 @@ struct mflash_gpio_num
 
 struct mflash_gpio_drv
 {
-       char *name;
+       const char *name;
        int (*set_gpio_to_output) (struct mflash_gpio_num gpio);
        int (*set_gpio_output_val) (struct mflash_gpio_num gpio, uint8_t val);
 };
index a8e7466a4fee2c0a73eaa980b424f4a14b51ddfc..709c37b389142b9c5c48356b3a0e50a79762ddd7 100644 (file)
@@ -59,7 +59,7 @@ struct nand_ecclayout {
 
 struct nand_device
 {
-       char *name;
+       const char *name;
        struct nand_flash_controller *controller;
        void *controller_priv;
        struct nand_manufacturer *manufacturer;
@@ -91,12 +91,12 @@ enum
 struct nand_manufacturer
 {
        int id;
-       char *name;
+       const char *name;
 };
 
 struct nand_info
 {
-       char *name;
+       const char *name;
        int id;
        int page_size;
        int chip_size;
index fe73e906a04ac0afadf342dacf09b0397a75bf76..deb41b2a96bb0414605ddffff9fcf3b9c49b927a 100644 (file)
@@ -35,7 +35,7 @@ struct nand_device;
 struct nand_flash_controller
 {
        /** Driver name that is used to select it from configuration files. */
-       char *name;
+       const char *name;
 
     const struct command_registration *commands;
 
index 3fabe478d683612faf2936cb53196b8e4cce9906..ad6ee6c385e9365eb26475d8055bbd68e6d85646 100644 (file)
@@ -125,7 +125,7 @@ struct at91sam7_flash_bank
        uint16_t cidr_nvpsiz2;
        uint16_t cidr_eproc;
        uint16_t cidr_version;
-       char *target_name;
+       const char *target_name;
 
        /* flash auto-detection */
        uint8_t  flash_autodetection;
index ff14df0a3184852058c7f91a5525ee48a50bdc41..8f7dce882d267b07afef52d7a788bf90eff73550 100644 (file)
@@ -74,7 +74,7 @@ struct flash_sector
  */
 struct flash_bank
 {
-       char *name;
+       const char *name;
 
        struct target *target; /**< Target to which this bank belongs. */
 
index cbf9c5282a2ce61bb2fc97950ba7c4a3c2d09e77..afd05285a2766fcd9f3e586a1d7338a8740b0fc5 100644 (file)
@@ -54,7 +54,7 @@ struct flash_driver
         * Gives a human-readable name of this flash driver,
         * This field is used to select and initialize the driver.
         */
-       char *name;
+       const char *name;
 
        /**
         * An array of driver-specific commands to register.  When called
index d8cecc0b10d1a1fa7e18b9ab76f35234e06f9bdc..589527f735c060f60ecfe12a1872c451b93c10b6 100644 (file)
@@ -91,7 +91,7 @@ struct lpc288x_flash_bank
 
        /* chip id register */
        uint32_t cidr;
-       char * target_name;
+       const char * target_name;
        uint32_t cclk;
 
        uint32_t sector_size_break;
index 4b8d02728487f2c72d4112128d33344f6b639216..6a2770210cdf16231558d5d53f59e185e7b13bdb 100644 (file)
@@ -99,7 +99,7 @@ struct pic32mx_flash_bank
 
 static const struct pic32mx_devs_s {
        uint8_t devid;
-       char *name;
+       const char *name;
 } pic32mx_devs[] = {
        {0x38, "360F512L"},
        {0x34, "360F256L"},
index 12ea15b2099c33e10db0c93d3a8ccb99f191f7bb..851cab3344c00d6cb08c76998b43614834b458d0 100644 (file)
@@ -100,7 +100,7 @@ struct stellaris_flash_bank
        uint32_t dc0;
        uint32_t dc1;
 
-       char * target_name;
+       const char * target_name;
 
        uint32_t sramsiz;
        uint32_t flshsz;
@@ -125,7 +125,7 @@ struct stellaris_flash_bank
 
 static struct {
        uint32_t partno;
-       char *partname;
+       const char *partname;
 }      StellarisParts[] =
 {
        {0x0001,"LM3S101"},
index 4ca6cd8d8f62139013939c2aee50f8e0cae94c54..dd9ff5b414f7fabb9785d86a4e811875d8d9a6b4 100644 (file)
@@ -38,7 +38,7 @@ struct tms470_flash_bank
        uint32_t technology_family;
        uint32_t rom_flash;
        uint32_t part_number;
-       char * part_name;
+       const char * part_name;
 
 };
 
@@ -129,7 +129,7 @@ static int tms470_read_part_info(struct flash_bank *bank)
        uint32_t technology_family;
        uint32_t rom_flash;
        uint32_t part_number;
-       char *part_name;
+       const char *part_name;
 
        /* we shall not rely on the caller in this test, this function allocates memory,
           thus and executing the code more than once may cause memory leak */
index 5bb4a6deebda2be0250a592e0d15999dc87fd14f..a214b63e461aa54703c98b30563139f717b9f189 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
 {
        int c;
        unsigned int n;
-       char *name;
+       const char *name;
 
        if (argc == 1) {
                fprintf(stderr, "bin2char <varname>\n");
index fd5e5f94822a88b0c061b2b5e7a1914ad32b7fda..d5ac34b490f9206d2bb11bf827f57bcd5e9d91c1 100644 (file)
@@ -310,7 +310,7 @@ static void command_free(struct command *c)
        }
 
        if (c->name)
-               free(c->name);
+               free((void *)c->name);
        if (c->help)
                free((void*)c->help);
        if (c->usage)
index 0ee66b09882a44d0732208282569b95233bb9dd9..3d1cdec8608730184e2ad4de6a1487070e608310 100644 (file)
@@ -173,7 +173,7 @@ typedef __COMMAND_HANDLER((*command_handler_t));
 
 struct command
 {
-       char *name;
+       const char *name;
        const char *help;
        const char *usage;
        struct command *parent;
index d306246b704451883e99de034e1d79c8affe8354..3c7e4ffba8283e01baf53dd876c571fbac6dad3e 100644 (file)
@@ -29,7 +29,7 @@ struct pld_device;
 
 struct pld_driver
 {
-       char *name;
+       const char *name;
        __PLD_DEVICE_COMMAND((*pld_device_command));
        const struct command_registration *commands;
        int (*load)(struct pld_device *pld_device, const char *filename);
index 70d9566a3624f4005ff4db85eb223906ab384034..c70a52220fb728d07710109d5fd141775ece9362 100644 (file)
@@ -306,7 +306,7 @@ static int remove_services(void)
                struct service *next = c->next;
 
                if (c->name)
-                       free(c->name);
+                       free((void *)c->name);
 
                if (c->type == CONNECTION_PIPE)
                {
index 2afd7125e363a6531bb405923ce78691d26b8448..34cf1cf0aae2d14439bf98f0c52bd69302371969 100644 (file)
@@ -57,7 +57,7 @@ typedef int (*connection_closed_handler_t)(struct connection *connection);
 
 struct service
 {
-       char *name;
+       const char *name;
        enum connection_type type;
        const char *port;
        unsigned short portnumber;
index abb8ecfc6e2521e60eddc4c1c96598b00d24d671..af1fd91794745f7de8aa2dfc1f84d7147e9266f3 100644 (file)
@@ -37,7 +37,7 @@ struct mem_param
 
 struct reg_param
 {
-       char *reg_name;
+       const char *reg_name;
        uint32_t size;
        uint8_t *value;
        enum param_direction direction;
index fd5070314b30ccd08b94050ad5a6e8272d63b572..5c2fd9d14e5acd67c2bd0f3a33a7f11968d333d5 100644 (file)
@@ -60,7 +60,7 @@ enum arm9tdmi_vector_bit
 };
 
 static const struct arm9tdmi_vector {
-       char *name;
+       const char *name;
        uint32_t value;
 } arm9tdmi_vectors[] = {
        {"reset", ARM9TDMI_RESET_VECTOR},
index f02053fb3f1c36c84927f09c8af12074303b9389..10720f45efe19daf33c384b0ef12e4bc2d8cfc6f 100644 (file)
@@ -2354,7 +2354,7 @@ static int evaluate_add_sp_pc_thumb(uint16_t opcode,
        uint8_t Rd = (opcode >> 8) & 0x7;
        uint8_t Rn;
        uint32_t SP = opcode & (1 << 11);
-       char *reg_name;
+       const char *reg_name;
 
        instruction->type = ARM_ADD;
 
index 03c9c7ace8812bd467ef9c98d3ed21c4be231a78..4fcde16fd4d865ef47c604084fd9aac75844e690 100644 (file)
@@ -82,7 +82,7 @@ struct reg armv7m_gdb_dummy_cpsr_reg =
  */
 static const struct {
        unsigned id;
-       char *name;
+       const char *name;
        unsigned bits;
 } armv7m_regs[] = {
        { ARMV7M_R0, "r0", 32 },
index 9563eea98b719cad44edda17b35037dde5d95ff1..10fd014d4d3ce446e7652dedb8282bd4af21d63c 100644 (file)
@@ -173,7 +173,7 @@ static int dsp563xx_jtag_sendinstr(struct jtag_tap *tap, uint8_t * ir_in, uint8_
 static const struct
 {
        unsigned id;
-       char *name;
+       const char *name;
        unsigned bits;
        uint32_t r_cmd;
        uint32_t w_cmd;
index f8070fa7e8f6c79c2423e9d6ba02c54a3ad59a7e..475e51657022e9c1d47f15eca004a32115b144db 100644 (file)
@@ -53,7 +53,7 @@ struct dsp563xx_common
 struct dsp563xx_core_reg
 {
        uint32_t num;
-       char *name;
+       const char *name;
        uint32_t size;
        uint32_t r_cmd;
        uint32_t w_cmd;
index 8a482c1e5c1ee73fe631dde3cf5d760d3794c281..4224de675b9ad58fab41cfb0b8acd789a2bf47a5 100644 (file)
@@ -139,7 +139,7 @@ struct etm_context;
 
 struct etm_capture_driver
 {
-       char *name;
+       const char *name;
        const struct command_registration *commands;
        int (*init)(struct etm_context *etm_ctx);
        trace_status_t (*status)(struct etm_context *etm_ctx);
index 0cd0ddfe467d91ce8406021204d4e1ecae434ef3..4b45fd3c455791ac3b7d4c47653d1cc0925050b5 100644 (file)
@@ -27,7 +27,7 @@ struct target;
 
 struct reg
 {
-       char *name;
+       const char *name;
        void *value;
        bool dirty;
        bool valid;
@@ -38,7 +38,7 @@ struct reg
 
 struct reg_cache
 {
-       char *name;
+       const char *name;
        struct reg_cache *next;
        struct reg *reg_list;
        unsigned num_regs;
index 7a8ac9c4a89a0f7752c347f7a284b20ced122127..bfa7f9379fb35714aaa0a529a5243feed3b9383b 100644 (file)
@@ -42,7 +42,7 @@ struct target_type
         * Name of this type of target.  Do @b not access this
         * field directly, use target_type_name() instead.
         */
-       char *name;
+       const char *name;
 
        /* poll current target status */
        int (*poll)(struct target *target);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)