Commit 8959de9f authored by zwelch's avatar zwelch
Browse files

- Fixes '+' whitespace

- Replace ')\(+\)(' with ') \1 ('.
- Replace ')\(+\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\(+\)(' with '\1 \2 ('.
- Replace '\(\w\)\(+\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2373 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 84df52f9
......@@ -213,19 +213,19 @@ static void at91sam7_set_flash_mode(flash_bank_t *bank, int mode)
if (at91sam7_info->cidr_arch == 0x60)
{
/* AT91SAM7A3 uses master clocks in 100 ns */
fmcn = (at91sam7_info->mck_freq/10000000ul)+1;
fmcn = (at91sam7_info->mck_freq/10000000ul) + 1;
}
else
{
/* master clocks in 1uS for ARCH 0x7 types */
fmcn = (at91sam7_info->mck_freq/1000000ul)+1;
fmcn = (at91sam7_info->mck_freq/1000000ul) + 1;
}
}
else if (mode == FMR_TIMING_FLASH)
{
/* main clocks in 1.5uS */
fmcn = (at91sam7_info->mck_freq/1000000ul)+
(at91sam7_info->mck_freq/2000000ul)+1;
(at91sam7_info->mck_freq/2000000ul) + 1;
}
/* hard overclocking */
......@@ -282,7 +282,7 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16
fcr = (0x5A << 24) | ((pagen&0x3FF) << 8) | cmd;
target_write_u32(target, MC_FCR[bank->bank_number], fcr);
LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen);
LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number + 1, pagen);
if ((at91sam7_info->cidr_arch == 0x60) && ((cmd == SLB)|(cmd == CLB)))
{
......@@ -641,7 +641,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
fast_check = 1;
for (nSector = 0; nSector<bank->num_sectors; nSector++)
{
retval = target_blank_check_memory(target, bank->base+bank->sectors[nSector].offset,
retval = target_blank_check_memory(target, bank->base + bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank);
if (retval != ERROR_OK)
{
......@@ -665,7 +665,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
for (nSector = 0; nSector<bank->num_sectors; nSector++)
{
bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base+bank->sectors[nSector].offset, 4,
retval = target_read_memory(target, bank->base + bank->sectors[nSector].offset, 4,
bank->sectors[nSector].size/4, buffer);
if (retval != ERROR_OK)
return retval;
......@@ -707,7 +707,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->num_lockbits_on = 0;
for (lock_pos = 0; lock_pos<bank->num_sectors; lock_pos++)
{
if ( ((status >> (16+lock_pos))&(0x0001)) == 1)
if ( ((status >> (16 + lock_pos))&(0x0001)) == 1)
{
at91sam7_info->num_lockbits_on++;
bank->sectors[lock_pos].is_protected = 1;
......@@ -725,7 +725,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->num_nvmbits_on = 0;
for (gpnvm_pos = 0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
{
if ( ((status >> (8+gpnvm_pos))&(0x01)) == 1)
if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1)
{
at91sam7_info->num_nvmbits_on++;
}
......@@ -803,7 +803,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
page_size = atoi(args[11]);
num_nvmbits = atoi(args[12]);
target_name = calloc(strlen(args[7])+1, sizeof(char));
target_name = calloc(strlen(args[7]) + 1, sizeof(char));
strcpy(target_name, args[7]);
/* calculate bank size */
......@@ -1027,7 +1027,7 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o
/* Write one block to the PageWriteBuffer */
buffer_pos = (pagen-first_page)*dst_min_alignment;
wcount = CEIL(count,4);
if ((retval = target_write_memory(target, bank->base+pagen*dst_min_alignment, 4, wcount, buffer+buffer_pos)) != ERROR_OK)
if ((retval = target_write_memory(target, bank->base + pagen*dst_min_alignment, 4, wcount, buffer + buffer_pos)) != ERROR_OK)
{
return retval;
}
......
......@@ -213,7 +213,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset)
{
uint8_t i;
for (i = 0;i<2;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
else
......@@ -235,7 +235,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset)
{
uint8_t i;
for (i = 0;i<4;i++)
target_read_memory(target, flash_address(bank, sector, offset+i), bank->bus_width, 1,
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
else
......
......@@ -274,8 +274,8 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
uint32_t flashErr;
retval = runCode(info,
info->start_address+OFFSET_ERASE,
info->start_address+OFFSET_ERASE+OFFSET_ERASE_SIZE,
info->start_address + OFFSET_ERASE,
info->start_address + OFFSET_ERASE + OFFSET_ERASE_SIZE,
address,
len,
0,
......@@ -307,8 +307,8 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
uint32_t buffer;
retval = runCode(info,
info->start_address+OFFSET_GET_WORKAREA,
info->start_address+OFFSET_GET_WORKAREA+OFFSET_GET_WORKAREA_SIZE,
info->start_address + OFFSET_GET_WORKAREA,
info->start_address + OFFSET_GET_WORKAREA + OFFSET_GET_WORKAREA_SIZE,
0,
0,
0,
......@@ -328,16 +328,16 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
}
int retval;
retval = target_write_buffer(target, buffer, t, ((uint8_t *)data)+i);
retval = target_write_buffer(target, buffer, t, ((uint8_t *)data) + i);
if (retval != ERROR_OK)
return retval;
uint32_t flashErr;
retval = runCode(info,
info->start_address+OFFSET_FLASH,
info->start_address+OFFSET_FLASH+OFFSET_FLASH_SIZE,
info->start_address + OFFSET_FLASH,
info->start_address + OFFSET_FLASH + OFFSET_FLASH_SIZE,
buffer,
address+i,
address + i,
t,
&flashErr,
timeout);
......@@ -410,7 +410,7 @@ static int ecosflash_erase(struct flash_bank_s *bank, int first, int last)
{
struct flash_bank_s *c = bank;
ecosflash_flash_bank_t *info = bank->driver_priv;
return eCosBoard_erase(info, c->base+first*sectorSize, sectorSize*(last-first+1));
return eCosBoard_erase(info, c->base + first*sectorSize, sectorSize*(last-first + 1));
}
static int ecosflash_protect(struct flash_bank_s *bank, int set, int first, int last)
......@@ -422,7 +422,7 @@ static int ecosflash_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t
{
ecosflash_flash_bank_t *info = bank->driver_priv;
struct flash_bank_s *c = bank;
return eCosBoard_flash(info, buffer, c->base+offset, count);
return eCosBoard_flash(info, buffer, c->base + offset, count);
}
static int ecosflash_protect_check(struct flash_bank_s *bank)
......
......@@ -1110,7 +1110,7 @@ int flash_write(target_t *target, image_t *image, uint32_t *written, int erase)
/* see if we need to pad the section */
while (padding[section]--)
(buffer+buffer_size)[size_read++] = 0xff;
(buffer + buffer_size)[size_read++] = 0xff;
buffer_size += size_read;
section_offset += size_read;
......
......@@ -923,7 +923,7 @@ static double mg_do_calc_pll(double XIN, mg_pll_t * p_pll_val, int is_approximat
CLK_OUT = XIN * ((double)M / N) / NO;
if ((int)((CLK_OUT+ROUND) / DIV)
if ((int)((CLK_OUT + ROUND) / DIV)
== (int)(MG_PLL_CLK_OUT / DIV)) {
if (mg_is_valid_pll(XIN, N, CLK_OUT, NO) == ERROR_OK)
{
......
......@@ -294,7 +294,7 @@ typedef enum _mg_vcmd
typedef enum _mg_opmode
{
mg_op_mode_xip = 1, /* TRUE XIP */
mg_op_mode_snd = 2, /* BOOT+Storage */
mg_op_mode_snd = 2, /* BOOT + Storage */
mg_op_mode_stg = 0 /* Only Storage */
} mg_opmode;
......
......@@ -518,9 +518,9 @@ int nand_probe(struct nand_device_s *device)
{
if (device->bus_width == 8)
{
device->controller->read_data(device, id_buff+3);
device->controller->read_data(device, id_buff+4);
device->controller->read_data(device, id_buff+5);
device->controller->read_data(device, id_buff + 3);
device->controller->read_data(device, id_buff + 4);
device->controller->read_data(device, id_buff + 5);
}
else
{
......@@ -1420,7 +1420,7 @@ static int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cm
uint8_t ecc[3];
memset(oob, 0xff, oob_size);
for (i = 0, j = 0; i < page_size; i += 256) {
nand_calculate_ecc(p, page+i, ecc);
nand_calculate_ecc(p, page + i, ecc);
oob[eccpos[j++]] = ecc[0];
oob[eccpos[j++]] = ecc[1];
oob[eccpos[j++]] = ecc[2];
......@@ -1437,7 +1437,7 @@ static int handle_nand_write_command(struct command_context_s *cmd_ctx, char *cm
uint8_t *ecc = oob + oob_size - page_size/512 * 10;
memset(oob, 0xff, oob_size);
for (i = 0; i < page_size; i += 512) {
nand_calculate_ecc_kw(p, page+i, ecc);
nand_calculate_ecc_kw(p, page + i, ecc);
ecc += 10;
}
}
......
......@@ -139,7 +139,7 @@ static int ocl_erase(struct flash_bank_s *bank, int first, int last)
}
/* receive response */
if ((retval = embeddedice_receive(ocl->jtag_info, dcc_buffer+1, 1) != ERROR_OK))
if ((retval = embeddedice_receive(ocl->jtag_info, dcc_buffer + 1, 1) != ERROR_OK))
return retval;
if (dcc_buffer[1] != OCL_CMD_DONE)
......@@ -182,7 +182,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset
}
/* allocate buffer for max. ocl buffer + overhead */
dcc_buffer = malloc(sizeof(uint32_t)*(ocl->buflen/4+3));
dcc_buffer = malloc(sizeof(uint32_t)*(ocl->buflen/4 + 3));
while (count)
{
......
......@@ -43,7 +43,7 @@ void cmd_flash(uint32 cmd)
len = cmd&0xffff;
ofs = adr%flash_page_size;
bi_start = ofs/4;
bi_end = (ofs+len+3)/4;
bi_end = (ofs + len + 3)/4;
if (bi_end>BUFSIZE) {
dcc_wr(OCL_BUFF_OVER);
......@@ -65,12 +65,12 @@ void cmd_flash(uint32 cmd)
result = 0;
pagenum = adr/flash_page_size;
for (bi = 0; bi<bi_end; bi += flash_page_size/4) {
result = flash_page_program(buffer+bi, pagenum++);
result = flash_page_program(buffer + bi, pagenum++);
if (result) break;
}
/* verify written data */
if (!result) result = flash_verify(adr, len, ((uint8 *)buffer)+ofs);
if (!result) result = flash_verify(adr, len, ((uint8 *)buffer) + ofs);
dcc_wr(OCL_CMD_DONE|result);
}
......
......@@ -86,11 +86,11 @@ int flash_page_program(uint32 *data, int page_num)
else efc_ofs = 0;
/* wait until FLASH is ready, just for sure */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
/* calculate page address, only lower 8 bits are used to address the latch,
but the upper part of address is needed for writing to proper EFC */
flash_ptr = (uint32 *)(FLASH_AREA_ADDR+(page_num*flash_page_size));
flash_ptr = (uint32 *)(FLASH_AREA_ADDR + (page_num*flash_page_size));
data_ptr = data;
/* copy data to latch */
......@@ -100,18 +100,18 @@ int flash_page_program(uint32 *data, int page_num)
}
/* page number and page write command to FCR */
outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | MC_KEY | MC_FCMD_WP);
outr(MC_FCR + efc_ofs, ((page_num&0x3ff) << 8) | MC_KEY | MC_FCMD_WP);
/* wait until it's done */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
/* check for errors */
if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
#if 0
/* verify written data */
flash_ptr = (uint32 *)(FLASH_AREA_ADDR+(page_num*flash_page_size));
flash_ptr = (uint32 *)(FLASH_AREA_ADDR + (page_num*flash_page_size));
data_ptr = data;
for (i = flash_page_size/4; i; i--) {
......@@ -129,21 +129,21 @@ int flash_erase_plane(int efc_ofs)
int page_num;
page_num = 0;
lockbits = inr(MC_FSR+efc_ofs) >> 16;
lockbits = inr(MC_FSR + efc_ofs) >> 16;
while (lockbits) {
if (lockbits&1) {
/* wait until FLASH is ready, just for sure */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
outr(MC_FCR+efc_ofs, ((page_num&0x3ff) << 8) | 0x5a000004);
outr(MC_FCR + efc_ofs, ((page_num&0x3ff) << 8) | 0x5a000004);
/* wait until it's done */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
/* check for errors */
if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
}
if ((page_num += flash_lock_pages)>flash_page_count) break;
......@@ -151,20 +151,20 @@ int flash_erase_plane(int efc_ofs)
}
/* wait until FLASH is ready, just for sure */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
/* erase all command to FCR */
outr(MC_FCR+efc_ofs, 0x5a000008);
outr(MC_FCR + efc_ofs, 0x5a000008);
/* wait until it's done */
while ((inr(MC_FSR+efc_ofs)&MC_FRDY) == 0);
while ((inr(MC_FSR + efc_ofs)&MC_FRDY) == 0);
/* check for errors */
if ((inr(MC_FSR+efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR+efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
if ((inr(MC_FSR + efc_ofs)&MC_PROGE)) return FLASH_STAT_PROGE;
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
/* set no erase before programming */
outr(MC_FMR+efc_ofs, inr(MC_FMR+efc_ofs)|0x80);
outr(MC_FMR + efc_ofs, inr(MC_FMR + efc_ofs)|0x80);
return FLASH_STAT_OK;
}
......@@ -188,7 +188,7 @@ int flash_verify(uint32 adr, unsigned int len, uint8 *src)
{
unsigned char *flash_ptr;
flash_ptr = (uint8 *)FLASH_AREA_ADDR+adr;
flash_ptr = (uint8 *)FLASH_AREA_ADDR + adr;
for ( ;len; len--) {
if (*(flash_ptr++)!=*(src++)) return FLASH_STAT_VERIFE;
}
......
......@@ -923,7 +923,7 @@ static int pic32mx_handle_pgm_word_command(struct command_context_s *cmd_ctx, ch
command_print(cmd_ctx, "flash bank '#%s' is out of bounds", args[2]);
return ERROR_OK;
}
if (address < bank->base || address >= (bank->base+bank->size))
if (address < bank->base || address >= (bank->base + bank->size))
{
command_print(cmd_ctx, "flash address '%s' is out of bounds", args[0]);
return ERROR_OK;
......
......@@ -62,9 +62,9 @@ typedef struct pic32mx_flash_bank_s
* Note: These macros only work for KSEG0/KSEG1 addresses.
*/
#define KS1Virt2Phys(vaddr) ((vaddr)-0xA0000000)
#define Phys2KS1Virt(paddr) ((paddr)+0xA0000000)
#define Phys2KS1Virt(paddr) ((paddr) + 0xA0000000)
#define KS0Virt2Phys(vaddr) ((vaddr)-0x80000000)
#define Phys2KS0Virt(paddr) ((paddr)+0x80000000)
#define Phys2KS0Virt(paddr) ((paddr) + 0x80000000)
/* pic32mx configuration register locations */
......
......@@ -309,8 +309,8 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
stellaris_info->did1,
stellaris_info->did1,
"ARMV7M",
(int)((1+((stellaris_info->dc0 >> 16) & 0xFFFF))/4),
(int)((1+(stellaris_info->dc0 & 0xFFFF))*2));
(int)((1 + ((stellaris_info->dc0 >> 16) & 0xFFFF))/4),
(int)((1 + (stellaris_info->dc0 & 0xFFFF))*2));
buf += printed;
buf_size -= printed;
......@@ -396,7 +396,7 @@ static void stellaris_read_clock_info(flash_bank_t *bank)
mainfreq = 200000000; /* PLL out frec */
if (usesysdiv)
stellaris_info->mck_freq = mainfreq/(1+sysdiv);
stellaris_info->mck_freq = mainfreq/(1 + sysdiv);
else
stellaris_info->mck_freq = mainfreq;
......@@ -499,7 +499,7 @@ static int stellaris_read_part_info(struct flash_bank_s *bank)
stellaris_info->did1 = did1;
stellaris_info->num_lockbits = 1 + (stellaris_info->dc0 & 0xFFFF);
stellaris_info->num_pages = 2 *(1+(stellaris_info->dc0 & 0xFFFF));
stellaris_info->num_pages = 2 *(1 + (stellaris_info->dc0 & 0xFFFF));
stellaris_info->pagesize = 1024;
bank->size = 1024 * stellaris_info->num_pages;
stellaris_info->pages_in_lockregion = 2;
......
......@@ -703,7 +703,7 @@ static int str7x_handle_disable_jtag_command(struct command_context_s *cmd_ctx,
flash_cmd = FLASH_SPR;
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd);
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_AR), 0x4010DFBC);
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_DR0), ~(1 << (15+ProtectionLevel)));
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_DR0), ~(1 << (15 + ProtectionLevel)));
flash_cmd = FLASH_SPR | FLASH_WMS;
target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd);
}
......
......@@ -145,7 +145,7 @@ static int str9x_build_block_list(struct flash_bank_s *bank)
if (str9x_info->variant)
str9x_info->sector_bits[num_sectors++] = (1 << i);
else
str9x_info->sector_bits[num_sectors++] = (1 << (i+8));
str9x_info->sector_bits[num_sectors++] = (1 << (i + 8));
}
return ERROR_OK;
......
......@@ -593,7 +593,7 @@ static int tms470_flash_initialize_internal_state_machine(struct flash_bank_s *b
LOG_DEBUG("set fmmaxpp = 50");
/*
* MAXCP = 0xf000+2000
* MAXCP = 0xf000 + 2000
*/
target_write_u32(target, 0xFFE8A084, 0xf000 + 2000);
LOG_DEBUG("set fmmaxcp = 0x%04x", 0xf000 + 2000);
......
......@@ -42,7 +42,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int
{
unsigned int i;
for (i = first; i<first+num; i++)
for (i = first; i<first + num; i++)
{
if (((value >> (i-first))&1) == 1)
buffer[i/8] |= 1 << (i%8);
......@@ -61,7 +61,7 @@ static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, un
uint32_t result = 0;
unsigned int i;
for (i = first; i<first+num; i++)
for (i = first; i<first + num; i++)
{
if (((buffer[i/8]>>(i%8))&1) == 1)
result |= 1 << (i-first);
......
......@@ -495,14 +495,14 @@ int command_run_line(command_context_t *context, char *line)
if (reslen>0)
{
int i;
char buff[256+1];
char buff[256 + 1];
for (i = 0; i < reslen; i += 256)
{
int chunk;
chunk = reslen - i;
if (chunk > 256)
chunk = 256;
strncpy(buff, result+i, chunk);
strncpy(buff, result + i, chunk);
buff[chunk] = 0;
LOG_USER_N("%s", buff);
}
......@@ -599,7 +599,7 @@ static size_t openocd_jim_fwrite(const void *_ptr, size_t size, size_t n, void *
}
/* GRR we must chunk - not null terminated */
while (nbytes) {
char chunk[128+1];
char chunk[128 + 1];
int x;
x = nbytes;
......
......@@ -37,7 +37,7 @@ static char** script_search_dirs;
void add_script_search_dir (const char *dir)
{
num_script_dirs++;
script_search_dirs = (char **)realloc(script_search_dirs, (num_script_dirs+1) * sizeof (char *));
script_search_dirs = (char **)realloc(script_search_dirs, (num_script_dirs + 1) * sizeof (char *));
script_search_dirs[num_script_dirs-1] = strdup(dir);
script_search_dirs[num_script_dirs] = NULL;
......@@ -46,7 +46,7 @@ void add_script_search_dir (const char *dir)
void add_config_command (const char *cfg)
{
num_config_files++;
config_file_names = (char **)realloc(config_file_names, (num_config_files+1) * sizeof (char *));
config_file_names = (char **)realloc(config_file_names, (num_config_files + 1) * sizeof (char *));
config_file_names[num_config_files-1] = strdup(cfg);
config_file_names[num_config_files] = NULL;
......
......@@ -274,7 +274,7 @@ int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args,
chunk = maxChunk;
}
if ((retval == ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
if ((retval == ERROR_OK) && (fwrite(((char *)data) + pos, 1, chunk, f) != chunk))
retval = ERROR_INVALID_ARGUMENTS;
if (retval != ERROR_OK)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment