Browse Source

Remove whitespace that occurs before ')'.

- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
tags/v0.2.0
zwelch 13 years ago
parent
commit
dc575dc5bf
72 changed files with 1017 additions and 1017 deletions
  1. +2
    -2
      src/ecosboard.c
  2. +1
    -1
      src/flash/aduc702x.c
  3. +2
    -2
      src/flash/at91sam7.c
  4. +2
    -2
      src/flash/avrf.c
  5. +7
    -7
      src/flash/cfi.c
  6. +1
    -1
      src/flash/davinci_nand.c
  7. +1
    -1
      src/flash/ecos.c
  8. +4
    -4
      src/flash/flash.c
  9. +3
    -3
      src/flash/mflash.c
  10. +2
    -2
      src/flash/nand.c
  11. +3
    -3
      src/flash/ocl/at91sam7x/dcc.c
  12. +24
    -24
      src/flash/pic32mx.c
  13. +31
    -31
      src/flash/stm32x.c
  14. +1
    -1
      src/flash/str7x.c
  15. +6
    -6
      src/flash/str9x.c
  16. +9
    -9
      src/flash/str9xpec.c
  17. +2
    -2
      src/helper/binarybuffer.c
  18. +11
    -11
      src/helper/command.c
  19. +12
    -12
      src/helper/ioutil.c
  20. +164
    -164
      src/helper/jim.c
  21. +70
    -70
      src/helper/jim.h
  22. +1
    -1
      src/helper/log.h
  23. +3
    -3
      src/helper/replacements.h
  24. +3
    -3
      src/jtag/amt_jtagaccel.c
  25. +2
    -2
      src/jtag/bitbang.c
  26. +15
    -15
      src/jtag/bitq.c
  27. +1
    -1
      src/jtag/commands.c
  28. +9
    -9
      src/jtag/core.c
  29. +1
    -1
      src/jtag/driver.c
  30. +7
    -7
      src/jtag/dummy.c
  31. +1
    -1
      src/jtag/ft2232.c
  32. +4
    -4
      src/jtag/gw16012.c
  33. +13
    -13
      src/jtag/interface.c
  34. +1
    -1
      src/jtag/interface.h
  35. +3
    -3
      src/jtag/parport.c
  36. +3
    -3
      src/jtag/rlink/dtc_cmd.h
  37. +67
    -67
      src/jtag/rlink/rlink.c
  38. +90
    -90
      src/jtag/tcl.c
  39. +3
    -3
      src/jtag/vsllink.c
  40. +1
    -1
      src/jtag/zy1000/jtag_minidriver.h
  41. +2
    -2
      src/openocd.c
  42. +1
    -1
      src/pld/virtex2.c
  43. +20
    -20
      src/server/gdb_server.c
  44. +8
    -8
      src/server/httpd.c
  45. +1
    -1
      src/server/server.c
  46. +3
    -3
      src/svf/svf.c
  47. +7
    -7
      src/target/arm11.c
  48. +1
    -1
      src/target/arm720t.c
  49. +2
    -2
      src/target/arm7_9_common.c
  50. +1
    -1
      src/target/arm7tdmi.c
  51. +1
    -1
      src/target/arm966e.c
  52. +1
    -1
      src/target/arm9tdmi.c
  53. +24
    -24
      src/target/arm_adi_v5.c
  54. +3
    -3
      src/target/arm_disassembler.c
  55. +1
    -1
      src/target/armv4_5.c
  56. +2
    -2
      src/target/armv7m.h
  57. +12
    -12
      src/target/cortex_m3.c
  58. +2
    -2
      src/target/etb.c
  59. +3
    -3
      src/target/image.c
  60. +1
    -1
      src/target/mips32.c
  61. +1
    -1
      src/target/mips32_pracc.c
  62. +1
    -1
      src/target/mips32_pracc.h
  63. +1
    -1
      src/target/mips_ejtag.c
  64. +4
    -4
      src/target/mips_m4k.c
  65. +1
    -1
      src/target/register.c
  66. +271
    -271
      src/target/target.c
  67. +2
    -2
      src/target/target.h
  68. +3
    -3
      src/target/target_request.c
  69. +3
    -3
      src/target/target_type.h
  70. +1
    -1
      src/target/trace.c
  71. +3
    -3
      src/target/xscale.c
  72. +44
    -44
      src/xsvf/xsvf.c

+ 2
- 2
src/ecosboard.c View File

@@ -257,7 +257,7 @@ MTAB_ENTRY(romfs_mte1,
"/rom",
"romfs",
"",
(CYG_ADDRWORD) &filedata[0] );
(CYG_ADDRWORD) &filedata[0]);
#endif

void openocd_sleep_prelude(void)
@@ -1156,7 +1156,7 @@ FSTAB_ENTRY(tftpfs_fste, "tftpfs", 0,
// "romfs", // FIlesystem type
// "", // hardware device
// (CYG_ADDRWORD) CYGNUM_FS_ROM_BASE_ADDRESS // Address in ROM
// );
//);


// -------------------------------------------------------------------------


+ 1
- 1
src/flash/aduc702x.c View File

@@ -399,7 +399,7 @@ static int aduc702x_probe(struct flash_bank_s *bank)

static int aduc702x_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
snprintf(buf, buf_size, "aduc702x flash driver info" );
snprintf(buf, buf_size, "aduc702x flash driver info");
return ERROR_OK;
}



+ 2
- 2
src/flash/at91sam7.c View File

@@ -187,7 +187,7 @@ static void at91sam7_read_clock_info(flash_bank_t *bank)
}

/* Prescaler adjust */
if ((((mckr & PMC_MCKR_PRES) >> 2) == 7) || (tmp == 0) )
if ((((mckr & PMC_MCKR_PRES) >> 2) == 7) || (tmp == 0))
{
at91sam7_info->mck_valid = 0;
at91sam7_info->mck_freq = 0;
@@ -613,7 +613,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
at91sam7_protect_check(t_bank);
}

LOG_DEBUG("nvptyp: 0x%3.3x, arch: 0x%4.4x", at91sam7_info->cidr_nvptyp, at91sam7_info->cidr_arch );
LOG_DEBUG("nvptyp: 0x%3.3x, arch: 0x%4.4x", at91sam7_info->cidr_nvptyp, at91sam7_info->cidr_arch);

return ERROR_OK;
}


+ 2
- 2
src/flash/avrf.c View File

@@ -323,7 +323,7 @@ static int avrf_probe(struct flash_bank_s *bank)
return ERROR_FAIL;
}

LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
LOG_INFO("device id = 0x%08" PRIx32 "", device_id);
if (EXTRACT_MFG(device_id) != 0x1F)
{
LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
@@ -402,7 +402,7 @@ static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size)
return ERROR_FAIL;
}

LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
LOG_INFO("device id = 0x%08" PRIx32 "", device_id);
if (EXTRACT_MFG(device_id) != 0x1F)
{
LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);


+ 7
- 7
src/flash/cfi.c View File

@@ -214,7 +214,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,
&data[i*bank->bus_width] );
&data[i*bank->bus_width]);
}
else
target_read_memory(target, flash_address(bank, sector, offset), bank->bus_width, 2, data);
@@ -236,7 +236,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,
&data[i*bank->bus_width] );
&data[i*bank->bus_width]);
}
else
target_read_memory(target, flash_address(bank, sector, offset), bank->bus_width, 4, data);
@@ -1154,7 +1154,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
/* flash write code */
if (!cfi_info->write_algorithm)
{
if (target_code_size > sizeof(target_code) )
if (target_code_size > sizeof(target_code))
{
LOG_WARNING("Internal error - target code buffer to small. Increase CFI_MAX_INTEL_CODESIZE and recompile.");
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
@@ -1206,7 +1206,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
busy_pattern_val = cfi_command_val(bank, 0x80);
error_pattern_val = cfi_command_val(bank, 0x7e);

LOG_INFO("Using target buffer at 0x%08" PRIx32 " and of size 0x%04" PRIx32, source->address, buffer_size );
LOG_INFO("Using target buffer at 0x%08" PRIx32 " and of size 0x%04" PRIx32, source->address, buffer_size);

/* Programming main loop */
while (count > 0)
@@ -1227,7 +1227,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
buf_set_u32(reg_params[5].value, 0, 32, busy_pattern_val);
buf_set_u32(reg_params[6].value, 0, 32, error_pattern_val);

LOG_INFO("Write 0x%04" PRIx32 " bytes to flash at 0x%08" PRIx32 , thisrun_count, address );
LOG_INFO("Write 0x%04" PRIx32 " bytes to flash at 0x%08" PRIx32 , thisrun_count, address);

/* Execute algorithm, assume breakpoint for last instruction */
retval = target_run_algorithm(target, 0, NULL, 7, reg_params,
@@ -1883,7 +1883,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3
write_p = address & ~(bank->bus_width - 1);
if ((align = address - write_p) != 0)
{
LOG_INFO("Fixup %d unaligned head bytes", align );
LOG_INFO("Fixup %d unaligned head bytes", align);

for (i = 0; i < bank->bus_width; i++)
current_word[i] = 0;
@@ -2029,7 +2029,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3
/* handle unaligned tail bytes */
if (count > 0)
{
LOG_INFO("Fixup %" PRId32 " unaligned tail bytes", count );
LOG_INFO("Fixup %" PRId32 " unaligned tail bytes", count);

copy_p = write_p;
for (i = 0; i < bank->bus_width; i++)


+ 1
- 1
src/flash/davinci_nand.c View File

@@ -675,7 +675,7 @@ static int davinci_nand_device_command(struct command_context_s *cmd_ctx,
if (aemif == 0x01e00000 /* dm6446, dm357 */
|| aemif == 0x01e10000 /* dm335, dm355 */
|| aemif == 0x01d10000 /* dm365 */
) {
) {
if (chip < 0x0200000 || chip >= 0x0a000000) {
LOG_ERROR("NAND address %08lx out of range?", chip);
goto fail;


+ 1
- 1
src/flash/ecos.c View File

@@ -281,7 +281,7 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
0,
&flashErr,
timeout
);
);
if (retval != ERROR_OK)
return retval;



+ 4
- 4
src/flash/flash.c View File

@@ -793,7 +793,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm

for (wrote = 0; wrote < (count*wordsize); wrote += cur_size)
{
cur_size = MIN((count*wordsize - wrote), sizeof(chunk) );
cur_size = MIN((count*wordsize - wrote), sizeof(chunk));
flash_bank_t *bank;
bank = get_flash_bank_by_addr(target, address);
if (bank == NULL)
@@ -994,7 +994,7 @@ int flash_erase_address_range(target_t *target, uint32_t addr, uint32_t length)
}
}

if (first == -1 || last == -1 )
if (first == -1 || last == -1)
return ERROR_OK;

return flash_driver_erase(c, first, last);
@@ -1076,7 +1076,7 @@ int flash_write(target_t *target, image_t *image, uint32_t *written, int erase)
run_size += pad_bytes;
padding[section_last] = 0;

LOG_INFO("Padding image section %d with %d bytes", section_last-1, pad_bytes );
LOG_INFO("Padding image section %d with %d bytes", section_last-1, pad_bytes);
}

/* fit the run into bank constraints */
@@ -1127,7 +1127,7 @@ int flash_write(target_t *target, image_t *image, uint32_t *written, int erase)
if (erase)
{
/* calculate and erase sectors */
retval = flash_erase_address_range(target, run_address, run_size );
retval = flash_erase_address_range(target, run_address, run_size);
}

if (retval == ERROR_OK)


+ 3
- 3
src/flash/mflash.c View File

@@ -415,7 +415,7 @@ static int mg_probe_cmd(struct command_context_s *cmd_ctx, char *cmd, char **arg

if (ret == ERROR_OK) {
command_print(cmd_ctx, "mflash (total %" PRIu32 " sectors) found at 0x%8.8" PRIx32 "",
mflash_bank->drv_info->tot_sects, mflash_bank->base );
mflash_bank->drv_info->tot_sects, mflash_bank->base);
}

return ret;
@@ -429,7 +429,7 @@ static int mg_mflash_do_read_sects(void *buff, uint32_t sect_num, uint32_t sect_
uint8_t *buff_ptr = buff;
duration_t duration;

if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, mg_io_cmd_read)) != ERROR_OK )
if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, mg_io_cmd_read)) != ERROR_OK)
return ret;

address = mflash_bank->base + MG_BUFFER_OFFSET;
@@ -502,7 +502,7 @@ static int mg_mflash_do_write_sects(void *buff, uint32_t sect_num, uint32_t sect
uint8_t *buff_ptr = buff;
duration_t duration;

if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, cmd)) != ERROR_OK )
if ((ret = mg_dsk_io_cmd(sect_num, sect_cnt, cmd)) != ERROR_OK)
return ret;

address = mflash_bank->base + MG_BUFFER_OFFSET;


+ 2
- 2
src/flash/nand.c View File

@@ -736,7 +736,7 @@ static int nand_read_plain(struct nand_device_s *device, uint32_t address, uint8

page = malloc(device->page_size);

while (data_size > 0 )
while (data_size > 0)
{
uint32_t thisrun_size = (data_size > device->page_size) ? device->page_size : data_size;
uint32_t page_address;
@@ -773,7 +773,7 @@ static int nand_write_plain(struct nand_device_s *device, uint32_t address, uint

page = malloc(device->page_size);

while (data_size > 0 )
while (data_size > 0)
{
uint32_t thisrun_size = (data_size > device->page_size) ? device->page_size : data_size;
uint32_t page_address;


+ 3
- 3
src/flash/ocl/at91sam7x/dcc.c View File

@@ -26,10 +26,10 @@ uint32 dcc_rd(void)
volatile uint32 dcc_reg;

do {
asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) : );
asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) :);
} while ((dcc_reg&1) == 0);

asm volatile ("mrc p14, 0, %0, C1, C0" : "=r" (dcc_reg) : );
asm volatile ("mrc p14, 0, %0, C1, C0" : "=r" (dcc_reg) :);
return dcc_reg;
}

@@ -40,7 +40,7 @@ int dcc_wr(uint32 data)
volatile uint32 dcc_reg;

do {
asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) : );
asm volatile ("mrc p14, 0, %0, C0, C0" : "=r" (dcc_reg) :);
/* operation controled by master, cancel operation
upon reception of data for immediate response */
if (dcc_reg&1) return -1;


+ 24
- 24
src/flash/pic32mx.c View File

@@ -148,11 +148,11 @@ static uint32_t pic32mx_wait_status_busy(flash_bank_t *bank, int timeout)
/* wait for busy to clear */
while (((status = pic32mx_get_flash_status(bank)) & NVMCON_NVMWR) && (timeout-- > 0))
{
LOG_DEBUG("status: 0x%" PRIx32, status );
LOG_DEBUG("status: 0x%" PRIx32, status);
alive_sleep(1);
}
if (timeout <= 0)
LOG_DEBUG("timeout: status: 0x%" PRIx32, status );
LOG_DEBUG("timeout: status: 0x%" PRIx32, status);

return status;
}
@@ -229,9 +229,9 @@ static int pic32mx_erase(struct flash_bank_s *bank, int first, int last)
{
LOG_DEBUG("Erasing entire program flash");
status = pic32mx_nvm_exec(bank, NVMCON_OP_PFM_ERASE, 50);
if (status & NVMCON_NVMERR )
if (status & NVMCON_NVMERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & NVMCON_LVDERR )
if (status & NVMCON_LVDERR)
return ERROR_FLASH_OPERATION_FAILED;
return ERROR_OK;
}
@@ -245,9 +245,9 @@ static int pic32mx_erase(struct flash_bank_s *bank, int first, int last)

status = pic32mx_nvm_exec(bank, NVMCON_OP_PAGE_ERASE, 10);

if (status & NVMCON_NVMERR )
if (status & NVMCON_NVMERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & NVMCON_LVDERR )
if (status & NVMCON_LVDERR)
return ERROR_FLASH_OPERATION_FAILED;
bank->sectors[i].is_erased = 1;
}
@@ -313,7 +313,7 @@ static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int la
reg = (i / pic32mx_info->ppage_size) / 8;
bit = (i / pic32mx_info->ppage_size) - (reg * 8);

if (set )
if (set)
prot_reg[reg] &= ~(1 << bit);
else
prot_reg[reg] |= (1 << bit);
@@ -327,7 +327,7 @@ static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int la
reg = (i / pic32mx_info->ppage_size) / 8;
bit = (i / pic32mx_info->ppage_size) - (reg * 8);

if (set )
if (set)
prot_reg[reg] &= ~(1 << bit);
else
prot_reg[reg] |= (1 << bit);
@@ -434,12 +434,12 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
}
#endif
status = pic32mx_write_row(bank, address, source->address);
if (status & NVMCON_NVMERR ) {
if (status & NVMCON_NVMERR) {
LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
retval = ERROR_FLASH_OPERATION_FAILED;
break;
}
if (status & NVMCON_LVDERR ) {
if (status & NVMCON_LVDERR) {
LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
retval = ERROR_FLASH_OPERATION_FAILED;
break;
@@ -458,12 +458,12 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
memcpy(&value, buffer, sizeof(uint32_t));

uint32_t status = pic32mx_write_word(bank, address, value);
if (status & NVMCON_NVMERR ) {
if (status & NVMCON_NVMERR) {
LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
retval = ERROR_FLASH_OPERATION_FAILED;
break;
}
if (status & NVMCON_LVDERR ) {
if (status & NVMCON_LVDERR) {
LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
retval = ERROR_FLASH_OPERATION_FAILED;
break;
@@ -564,9 +564,9 @@ static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
memcpy(&value, buffer + bytes_written, sizeof(uint32_t));

status = pic32mx_write_word(bank, address, value);
if (status & NVMCON_NVMERR )
if (status & NVMCON_NVMERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & NVMCON_LVDERR )
if (status & NVMCON_LVDERR)
return ERROR_FLASH_OPERATION_FAILED;

bytes_written += 4;
@@ -580,9 +580,9 @@ static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
memcpy(&value, buffer + bytes_written, bytes_remaining);

status = pic32mx_write_word(bank, address, value);
if (status & NVMCON_NVMERR )
if (status & NVMCON_NVMERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & NVMCON_LVDERR )
if (status & NVMCON_LVDERR)
return ERROR_FLASH_OPERATION_FAILED;
}

@@ -607,10 +607,10 @@ static int pic32mx_probe(struct flash_bank_s *bank)
device_id,
(unsigned)((device_id >> 1)&0x7ff),
(unsigned)((device_id >> 12)&0xff),
(unsigned)((device_id >> 20)&0xfff) );
(unsigned)((device_id >> 20)&0xfff));

if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) {
LOG_WARNING("Cannot identify target as a PIC32MX family." );
LOG_WARNING("Cannot identify target as a PIC32MX family.");
return ERROR_FLASH_OPERATION_FAILED;
}

@@ -626,7 +626,7 @@ static int pic32mx_probe(struct flash_bank_s *bank)
break;
}
if (pic32mx_devs[i].name == NULL) {
LOG_WARNING("Cannot identify target as a PIC32MX family." );
LOG_WARNING("Cannot identify target as a PIC32MX family.");
return ERROR_FLASH_OPERATION_FAILED;
}
}
@@ -646,7 +646,7 @@ static int pic32mx_probe(struct flash_bank_s *bank)
}
#endif

LOG_INFO("flash size = %dkbytes", num_pages );
LOG_INFO("flash size = %dkbytes", num_pages);

/* calculate numbers of pages */
num_pages /= (page_size / 1024);
@@ -847,13 +847,13 @@ static int pic32mx_chip_erase(struct flash_bank_s *bank)

target_write_u32(target, PIC32MX_FLASH_CR, FLASH_LOCK);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
{
LOG_ERROR("pic32mx device protected");
return ERROR_OK;
}

if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
{
LOG_ERROR("pic32mx device programming failed");
return ERROR_OK;
@@ -931,9 +931,9 @@ static int pic32mx_handle_pgm_word_command(struct command_context_s *cmd_ctx, ch

res = ERROR_OK;
status = pic32mx_write_word(bank, address, value);
if (status & NVMCON_NVMERR )
if (status & NVMCON_NVMERR)
res = ERROR_FLASH_OPERATION_FAILED;
if (status & NVMCON_LVDERR )
if (status & NVMCON_LVDERR)
res = ERROR_FLASH_OPERATION_FAILED;

if (res == ERROR_OK)


+ 31
- 31
src/flash/stm32x.c View File

@@ -182,9 +182,9 @@ static int stm32x_erase_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* clear readout protection and complementary option bytes
@@ -218,9 +218,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* write protection byte 1 */
@@ -228,9 +228,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* write protection byte 2 */
@@ -238,9 +238,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* write protection byte 3 */
@@ -248,9 +248,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* write protection byte 4 */
@@ -258,9 +258,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

/* write readout protection bit */
@@ -268,9 +268,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;

target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
@@ -378,9 +378,9 @@ static int stm32x_erase(struct flash_bank_s *bank, int first, int last)

status = stm32x_wait_status_busy(bank, 10);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
return ERROR_FLASH_OPERATION_FAILED;
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
return ERROR_FLASH_OPERATION_FAILED;
bank->sectors[i].is_erased = 1;
}
@@ -445,7 +445,7 @@ static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int las
reg = (i / stm32x_info->ppage_size) / 8;
bit = (i / stm32x_info->ppage_size) - (reg * 8);

if (set )
if (set)
prot_reg[reg] &= ~(1 << bit);
else
prot_reg[reg] |= (1 << bit);
@@ -459,7 +459,7 @@ static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int las
reg = (i / stm32x_info->ppage_size) / 8;
bit = (i / stm32x_info->ppage_size) - (reg * 8);

if (set )
if (set)
prot_reg[reg] &= ~(1 << bit);
else
prot_reg[reg] |= (1 << bit);
@@ -658,12 +658,12 @@ static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t off

status = stm32x_wait_status_busy(bank, 5);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
{
LOG_ERROR("flash memory not erased before writing");
return ERROR_FLASH_OPERATION_FAILED;
}
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
{
LOG_ERROR("flash memory write protected");
return ERROR_FLASH_OPERATION_FAILED;
@@ -684,12 +684,12 @@ static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t off

status = stm32x_wait_status_busy(bank, 5);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
{
LOG_ERROR("flash memory not erased before writing");
return ERROR_FLASH_OPERATION_FAILED;
}
if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
{
LOG_ERROR("flash memory write protected");
return ERROR_FLASH_OPERATION_FAILED;
@@ -720,7 +720,7 @@ static int stm32x_probe(struct flash_bank_s *bank)

/* read stm32 device id register */
target_read_u32(target, 0xE0042000, &device_id);
LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
LOG_INFO("device id = 0x%08" PRIx32 "", device_id);

/* get flash size from target */
if (target_read_u16(target, 0x1FFFF7E0, &num_pages) != ERROR_OK)
@@ -740,7 +740,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
if (num_pages == 0xffff)
{
/* number of sectors incorrect on revA */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 128k flash" );
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 128k flash");
num_pages = 128;
}
}
@@ -755,7 +755,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
if (num_pages == 0xffff)
{
/* number of sectors incorrect on revA */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 32k flash" );
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 32k flash");
num_pages = 32;
}
}
@@ -770,7 +770,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
if (num_pages == 0xffff)
{
/* number of sectors incorrect on revZ */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash" );
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash");
num_pages = 512;
}
}
@@ -785,17 +785,17 @@ static int stm32x_probe(struct flash_bank_s *bank)
if (num_pages == 0xffff)
{
/* number of sectors incorrect on revZ */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 256k flash" );
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 256k flash");
num_pages = 256;
}
}
else
{
LOG_WARNING("Cannot identify target as a STM32 family." );
LOG_WARNING("Cannot identify target as a STM32 family.");
return ERROR_FLASH_OPERATION_FAILED;
}

LOG_INFO("flash size = %dkbytes", num_pages );
LOG_INFO("flash size = %dkbytes", num_pages);

/* calculate numbers of pages */
num_pages /= (page_size / 1024);
@@ -1188,13 +1188,13 @@ static int stm32x_mass_erase(struct flash_bank_s *bank)

target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);

if (status & FLASH_WRPRTERR )
if (status & FLASH_WRPRTERR)
{
LOG_ERROR("stm32x device protected");
return ERROR_OK;
}

if (status & FLASH_PGERR )
if (status & FLASH_PGERR)
{
LOG_ERROR("stm32x device programming failed");
return ERROR_OK;


+ 1
- 1
src/flash/str7x.c View File

@@ -634,7 +634,7 @@ static int str7x_handle_part_id_command(struct command_context_s *cmd_ctx, char

static int str7x_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
snprintf(buf, buf_size, "str7x flash driver info" );
snprintf(buf, buf_size, "str7x flash driver info");
return ERROR_OK;
}



+ 6
- 6
src/flash/str9x.c View File

@@ -305,7 +305,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
{
return retval;
}
if (status & 0x80 )
if (status & 0x80)
break;
alive_sleep(1);
}
@@ -327,7 +327,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
return retval;
}

if (status & 0x22 )
if (status & 0x22)
{
LOG_ERROR("error erasing flash bank, status: 0x%x", status);
return ERROR_FLASH_OPERATION_FAILED;
@@ -365,7 +365,7 @@ static int str9x_protect(struct flash_bank_s *bank,
adr = bank->base + bank->sectors[i].offset;

target_write_u16(target, adr, 0x60);
if (set )
if (set)
target_write_u16(target, adr, 0x01);
else
target_write_u16(target, adr, 0xD0);
@@ -578,7 +578,7 @@ static int str9x_write(struct flash_bank_s *bank,
for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if (status & 0x80 )
if (status & 0x80)
break;
alive_sleep(1);
}
@@ -627,7 +627,7 @@ static int str9x_write(struct flash_bank_s *bank,
for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if (status & 0x80 )
if (status & 0x80)
break;
alive_sleep(1);
}
@@ -665,7 +665,7 @@ static int str9x_handle_part_id_command(struct command_context_s *cmd_ctx,

static int str9x_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
snprintf(buf, buf_size, "str9x flash driver info" );
snprintf(buf, buf_size, "str9x flash driver info");
return ERROR_OK;
}



+ 9
- 9
src/flash/str9xpec.c View File

@@ -101,7 +101,7 @@ static int str9xpec_register_commands(struct command_context_s *cmd_ctx)

int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state)
{
if (tap == NULL ){
if (tap == NULL){
return ERROR_TARGET_INVALID;
}

@@ -349,7 +349,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last)
tap = str9xpec_info->tap;

if (!str9xpec_info->isc_enable) {
str9xpec_isc_enable(bank );
str9xpec_isc_enable(bank);
}

if (!str9xpec_info->isc_enable) {
@@ -438,7 +438,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last)
tap = str9xpec_info->tap;

if (!str9xpec_info->isc_enable) {
str9xpec_isc_enable(bank );
str9xpec_isc_enable(bank);
}

if (!str9xpec_info->isc_enable) {
@@ -518,7 +518,7 @@ static int str9xpec_lock_device(struct flash_bank_s *bank)
tap = str9xpec_info->tap;

if (!str9xpec_info->isc_enable) {
str9xpec_isc_enable(bank );
str9xpec_isc_enable(bank);
}

if (!str9xpec_info->isc_enable) {
@@ -575,7 +575,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l
/* last bank: 0xFF signals a full device protect */
if (last == 0xFF)
{
if (set )
if (set)
{
status = str9xpec_lock_device(bank);
}
@@ -589,7 +589,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l
{
for (i = first; i <= last; i++)
{
if (set )
if (set)
buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 1);
else
buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 0);
@@ -845,7 +845,7 @@ static int str9xpec_erase_check(struct flash_bank_s *bank)

static int str9xpec_info(struct flash_bank_s *bank, char *buf, int buf_size)
{
snprintf(buf, buf_size, "str9xpec flash driver info" );
snprintf(buf, buf_size, "str9xpec flash driver info");
return ERROR_OK;
}

@@ -919,13 +919,13 @@ static int str9xpec_write_options(struct flash_bank_s *bank)
tap = str9xpec_info->tap;

/* erase config options first */
status = str9xpec_erase_area(bank, 0xFE, 0xFE );
status = str9xpec_erase_area(bank, 0xFE, 0xFE);

if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return status;

if (!str9xpec_info->isc_enable) {
str9xpec_isc_enable(bank );
str9xpec_isc_enable(bank);
}

if (!str9xpec_info->isc_enable) {


+ 2
- 2
src/helper/binarybuffer.c View File

@@ -80,7 +80,7 @@ int buf_cmp(const uint8_t *buf1, const uint8_t *buf2, int size)
{
/* last byte */
/* mask out bits that don't really belong to the buffer if size isn't a multiple of 8 bits */
if ((size % 8) && (i == num_bytes -1 ))
if ((size % 8) && (i == num_bytes -1))
{
if ((buf1[i] & ((1 << (size % 8)) - 1)) != (buf2[i] & ((1 << (size % 8)) - 1)))
return 1;
@@ -104,7 +104,7 @@ int buf_cmp_mask(const uint8_t *buf1, const uint8_t *buf2, const uint8_t *mask,
{
/* last byte */
/* mask out bits that don't really belong to the buffer if size isn't a multiple of 8 bits */
if ((size % 8) && (i == num_bytes -1 ))
if ((size % 8) && (i == num_bytes -1))
{
if ((buf1[i] & ((1 << (size % 8)) - 1) & mask[i]) !=
(buf2[i] & ((1 << (size % 8)) - 1) & mask[i]))


+ 11
- 11
src/helper/command.c View File

@@ -238,7 +238,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char

/* we now need to add an overrideable proc */
const char *override_name = alloc_printf("proc %s%s%s {args} {if {[catch {eval ocd_%s%s%s $args}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__ );
Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__);
free((void *)override_name);

/* accumulate help text in Tcl helptext list. */
@@ -348,8 +348,8 @@ int unregister_command(command_context_t *context, char *name)

void command_output_text(command_context_t *context, const char *data)
{
if (context && context->output_handler && data ){
context->output_handler(context, data );
if (context && context->output_handler && data){
context->output_handler(context, data);
}
}

@@ -405,7 +405,7 @@ void command_print(command_context_t *context, const char *format, ...)
int run_command(command_context_t *context, command_t *c, char *words[], int num_words)
{
int start_word = 0;
if (!((context->mode == COMMAND_CONFIG) || (c->mode == COMMAND_ANY) || (c->mode == context->mode) ))
if (!((context->mode == COMMAND_CONFIG) || (c->mode == COMMAND_ANY) || (c->mode == context->mode)))
{
/* Config commands can not run after the config stage */
LOG_ERROR("Command '%s' only runs during configuration stage", c->name);
@@ -466,7 +466,7 @@ int command_run_line(command_context_t *context, char *line)
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK)
{
retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__ );
retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__);

Jim_DeleteAssocData(interp, "retval");
}
@@ -673,7 +673,7 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv)

log_add_callback(tcl_output, tclOutput);

retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__ );
retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__);

log_remove_callback(tcl_output, tclOutput);

@@ -704,7 +704,7 @@ command_context_t* command_init()
Jim_RegisterCoreCommands(interp);
#endif

#if defined(_MSC_VER )
#if defined(_MSC_VER)
/* WinXX - is generic, the forward
* looking problem is this:
*
@@ -715,16 +715,16 @@ command_context_t* command_init()
HostOs = "winxx";
#elif defined(__LINUX__)
HostOs = "linux";
#elif defined(__DARWIN__ )
#elif defined(__DARWIN__)
HostOs = "darwin";
#elif defined(__CYGWIN__ )
#elif defined(__CYGWIN__)
HostOs = "cygwin";
#elif defined(__MINGW32__ )
#elif defined(__MINGW32__)
HostOs = "mingw32";
#else
HostOs = "other";
#endif
Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", Jim_NewStringObj(interp, HostOs , strlen(HostOs)) );
Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", Jim_NewStringObj(interp, HostOs , strlen(HostOs)));

Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL);
Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL);


+ 12
- 12
src/helper/ioutil.c View File

@@ -199,7 +199,7 @@ int handle_meminfo_command(struct command_context_s *cmd_ctx, char *cmd, char **
}
prev = info.fordblks;

command_print(cmd_ctx, "Available ram: %d", info.fordblks );
command_print(cmd_ctx, "Available ram: %d", info.fordblks);

return ERROR_OK;
}
@@ -325,34 +325,34 @@ void copyfile(char *name2, char *name1)

fd1 = open(name1, O_WRONLY | O_CREAT, 0664);
if (fd1 < 0)
SHOW_RESULT(open, fd1 );
SHOW_RESULT(open, fd1);

fd2 = open(name2, O_RDONLY);
if (fd2 < 0)
SHOW_RESULT(open, fd2 );
SHOW_RESULT(open, fd2);

for (;;)
{
done = read(fd2, buf, IOSIZE );
done = read(fd2, buf, IOSIZE);
if (done < 0)
{
SHOW_RESULT(read, done );
SHOW_RESULT(read, done);
break;
}

if (done == 0 ) break;
if (done == 0) break;

wrote = write(fd1, buf, done);
if (wrote != done ) SHOW_RESULT(write, wrote );
if (wrote != done) SHOW_RESULT(write, wrote);

if (wrote != done ) break;
if (wrote != done) break;
}

err = close(fd1);
if (err < 0 ) SHOW_RESULT(close, err );
if (err < 0) SHOW_RESULT(close, err);

err = close(fd2);
if (err < 0 ) SHOW_RESULT(close, err );
if (err < 0) SHOW_RESULT(close, err);

}

@@ -372,7 +372,7 @@ void copydir(char *name, char *destdir)
}

dirp = opendir(name);
if (dirp == NULL ) SHOW_RESULT(opendir, -1 );
if (dirp == NULL) SHOW_RESULT(opendir, -1);

for (;;)
{
@@ -421,7 +421,7 @@ void copydir(char *name, char *destdir)
}

err = closedir(dirp);
if (err < 0 ) SHOW_RESULT(stat, err );
if (err < 0) SHOW_RESULT(stat, err);
}




+ 164
- 164
src/helper/jim.c View File

@@ -117,25 +117,25 @@ static Jim_HashTableType *getJimVariablesHashTableType(void);
* ---------------------------------------------------------------------------*/

static char *
jim_vasprintf(const char *fmt, va_list ap )
jim_vasprintf(const char *fmt, va_list ap)
{
#ifndef HAVE_VASPRINTF
/* yucky way */
static char buf[2048];
vsnprintf(buf, sizeof(buf), fmt, ap );
vsnprintf(buf, sizeof(buf), fmt, ap);
/* garentee termination */
buf[sizeof(buf)-1] = 0;
#else
char *buf;
int result;
result = vasprintf(&buf, fmt, ap );
result = vasprintf(&buf, fmt, ap);
if (result < 0) exit(-1);
#endif
return buf;
}

static void
jim_vasprintf_done(void *buf )
jim_vasprintf_done(void *buf)
{
#ifndef HAVE_VASPRINTF
(void)(buf);
@@ -421,7 +421,7 @@ int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
#else
*widePtr = strtol(str, &endptr, base);
#endif
if ((str[0] == '\0') || (str == endptr) )
if ((str[0] == '\0') || (str == endptr))
return JIM_ERR;
if (endptr[0] != '\0') {
while (*endptr) {
@@ -438,7 +438,7 @@ int Jim_StringToIndex(const char *str, int *intPtr)
char *endptr;

*intPtr = strtol(str, &endptr, 10);
if ((str[0] == '\0') || (str == endptr) )
if ((str[0] == '\0') || (str == endptr))
return JIM_ERR;
if (endptr[0] != '\0') {
while (*endptr) {
@@ -495,7 +495,7 @@ int Jim_StringToDouble(const char *str, double *doublePtr)
char *endptr;

*doublePtr = strtod(str, &endptr);
if (str[0] == '\0' || endptr[0] != '\0' || (str == endptr) )
if (str[0] == '\0' || endptr[0] != '\0' || (str == endptr))
return JIM_ERR;
return JIM_OK;
}
@@ -544,10 +544,10 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...)
#endif
/* This may actually crash... we do it last */
if (interp && interp->cookie_stderr ){
if (interp && interp->cookie_stderr){
Jim_fprintf(interp, interp->cookie_stderr, JIM_NL "JIM INTERPRETER PANIC: ");
Jim_vfprintf(interp, interp->cookie_stderr, fmt, ap );
Jim_fprintf(interp, interp->cookie_stderr, JIM_NL JIM_NL );
Jim_vfprintf(interp, interp->cookie_stderr, fmt, ap);
Jim_fprintf(interp, interp->cookie_stderr, JIM_NL JIM_NL);
}
abort();
}
@@ -2055,17 +2055,17 @@ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str,
StringAppendString(objPtr, str, len);
}

void Jim_AppendString_sprintf(Jim_Interp *interp, Jim_Obj *objPtr, const char *fmt, ... )
void Jim_AppendString_sprintf(Jim_Interp *interp, Jim_Obj *objPtr, const char *fmt, ...)
{
char *buf;
va_list ap;

va_start(ap, fmt );
buf = jim_vasprintf(fmt, ap );
va_start(ap, fmt);
buf = jim_vasprintf(fmt, ap);
va_end(ap);

if (buf ){
Jim_AppendString(interp, objPtr, buf, -1 );
if (buf){
Jim_AppendString(interp, objPtr, buf, -1);
jim_vasprintf_done(buf);
}
}
@@ -2283,10 +2283,10 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
haveprec = 0;
prec = -1; /* not found yet */
next_fmt:
if (fmtLen <= 0 ){
if (fmtLen <= 0){
break;
}
switch (*fmt ){
switch (*fmt){
/* terminals */
case 'b': /* binary - not all printfs() do this */
case 's': /* string */
@@ -2341,11 +2341,11 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
case '8':
case '9':
accum = 0;
while (isdigit(*fmt) && (fmtLen > 0) ){
while (isdigit(*fmt) && (fmtLen > 0)){
accum = (accum * 10) + (*fmt - '0');
fmt++; fmtLen--;
}
if (inprec ){
if (inprec){
haveprec = 1;
prec = accum;
} else {
@@ -2356,24 +2356,24 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
/* suck up the next item as an integer */
fmt++; fmtLen--;
objc--;
if (objc <= 0 ){
if (objc <= 0){
goto not_enough_args;
}
if (Jim_GetWide(interp,objv[0],&wideValue )== JIM_ERR ){
Jim_FreeNewObj(interp, resObjPtr );
if (Jim_GetWide(interp,objv[0],&wideValue)== JIM_ERR){
Jim_FreeNewObj(interp, resObjPtr);
return NULL;
}
if (inprec ){
if (inprec){
haveprec = 1;
prec = wideValue;
if (prec < 0 ){
if (prec < 0){
/* man 3 printf says */
/* if prec is negative, it is zero */
prec = 0;
}
} else {
width = wideValue;
if (width < 0 ){
if (width < 0){
ljust = 1;
width = -width;
}
@@ -2402,33 +2402,33 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
*/
cp = fmt_str;
*cp++ = '%';
if (altfm ){
if (altfm){
*cp++ = '#';
}
if (forceplus ){
if (forceplus){
*cp++ = '+';
} else if (spad ){
} else if (spad){
/* PLUS overrides */
*cp++ = ' ';
}
if (ljust ){
if (ljust){
*cp++ = '-';
}
if (zpad ){
if (zpad){
*cp++ = '0';
}
if (width > 0 ){
sprintf(cp, "%d", width );
if (width > 0){
sprintf(cp, "%d", width);
/* skip ahead */
cp = strchr(cp,0);
}
/* did we find a period? */
if (inprec ){
if (inprec){
/* then add it */
*cp++ = '.';
/* did something occur after the period? */
if (haveprec ){
sprintf(cp, "%d", prec );
if (haveprec){
sprintf(cp, "%d", prec);
}
cp = strchr(cp,0);
}
@@ -2441,7 +2441,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
*cp++ = 's';
*cp = 0;
/* BUG: we do not handled embeded NULLs */
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, Jim_GetString(objv[0], NULL ));
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, Jim_GetString(objv[0], NULL));
break;
case 'c':
*cp++ = 'c';
@@ -2451,7 +2451,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
return NULL;
}
c = (char) wideValue;
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, c );
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, c);
break;
case 'f':
case 'F':
@@ -2461,11 +2461,11 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
case 'E':
*cp++ = *fmt;
*cp = 0;
if (Jim_GetDouble(interp, objv[0], &doubleValue ) == JIM_ERR ){
Jim_FreeNewObj(interp, resObjPtr );
if (Jim_GetDouble(interp, objv[0], &doubleValue) == JIM_ERR){
Jim_FreeNewObj(interp, resObjPtr);
return NULL;
}
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, doubleValue );
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, doubleValue);
break;
case 'b':
case 'd':
@@ -2475,7 +2475,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
case 'x':
case 'X':
/* jim widevaluse are 64bit */
if (sizeof(jim_wide) == sizeof(long long) ){
if (sizeof(jim_wide) == sizeof(long long)){
*cp++ = 'l';
*cp++ = 'l';
} else {
@@ -2487,7 +2487,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
Jim_FreeNewObj(interp, resObjPtr);
return NULL;
}
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, wideValue );
snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, wideValue);
break;
case '%':
sprintf_buf[0] = '%';
@@ -2504,12 +2504,12 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
}
/* force terminate */
#if 0
printf("FMT was: %s\n", fmt_str );
printf("RES was: |%s|\n", sprintf_buf );
printf("FMT was: %s\n", fmt_str);
printf("RES was: |%s|\n", sprintf_buf);
#endif
sprintf_buf[ JIM_MAX_FMT - 1] = 0;
Jim_AppendString(interp, resObjPtr, sprintf_buf, strlen(sprintf_buf) );
Jim_AppendString(interp, resObjPtr, sprintf_buf, strlen(sprintf_buf));
/* next obj */
objv++;
fmt++;
@@ -2626,13 +2626,13 @@ int Jim_GetNvp(Jim_Interp *interp,
Jim_Nvp *n;
int e;

e = Jim_Nvp_name2value_obj(interp, nvp_table, objPtr, &n );
if (e == JIM_ERR ){
e = Jim_Nvp_name2value_obj(interp, nvp_table, objPtr, &n);
if (e == JIM_ERR){
return e;
}

/* Success? found? */
if (n->name ){
if (n->name){
/* remove const */
*result = (Jim_Nvp *)n;
return JIM_OK;
@@ -4426,7 +4426,7 @@ Jim_Interp *Jim_CreateInterp(void)
i->cookie_stderr = stderr;
i->cb_fwrite = ((size_t (*)(const void *, size_t, size_t, void *))(fwrite));
i->cb_fread = ((size_t (*)(void *, size_t, size_t, void *))(fread));
i->cb_vfprintf = ((int (*)(void *, const char *fmt, va_list ))(vfprintf));
i->cb_vfprintf = ((int (*)(void *, const char *fmt, va_list))(vfprintf));
i->cb_fflush = ((int (*)(void *))(fflush));
i->cb_fgets = ((char * (*)(char *, int, void *))(fgets));

@@ -5433,7 +5433,7 @@ void Jim_ListInsertElements(Jim_Interp *interp, Jim_Obj *listPtr, int index,
SetListFromAny(interp, listPtr);
if (index >= 0 && index > listPtr->internalRep.listValue.len)
index = listPtr->internalRep.listValue.len;
else if (index < 0 )
else if (index < 0)
index = 0;
Jim_InvalidateStringRep(listPtr);
ListInsertElements(listPtr, index, objc, objVec);
@@ -6353,11 +6353,11 @@ int JimParseExprNumber(struct JimParserCtx *pc)
pc->p++; pc->len--;
}
while (isdigit((int)*pc->p)
|| (allowhex && isxdigit((int)*pc->p) )
|| (allowhex && isxdigit((int)*pc->p))
|| (allowdot && *pc->p == '.')
|| (pc->p-pc->tstart == 1 && *pc->tstart == '0' &&
(*pc->p == 'x' || *pc->p == 'X'))
)
)
{
if ((*pc->p == 'x') || (*pc->p == 'X')) {
allowhex = 1;
@@ -8894,8 +8894,8 @@ int Jim_Eval_Named(Jim_Interp *interp, const char *script, const char *filename,
Jim_IncrRefCount(scriptObjPtr);


if (filename ){
JimSetSourceInfo(interp, scriptObjPtr, filename, lineno );
if (filename){
JimSetSourceInfo(interp, scriptObjPtr, filename, lineno);
}

retval = Jim_EvalObj(interp, scriptObjPtr);
@@ -8905,7 +8905,7 @@ int Jim_Eval_Named(Jim_Interp *interp, const char *script, const char *filename,

int Jim_Eval(Jim_Interp *interp, const char *script)
{
return Jim_Eval_Named(interp, script, NULL, 0 );
return Jim_Eval_Named(interp, script, NULL, 0);
}


@@ -8963,7 +8963,7 @@ int Jim_EvalFile(Jim_Interp *interp, const char *filename)
const int cwd_len = 2048;
char *cwd = malloc(cwd_len);
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
if (!getcwd(cwd, cwd_len )) strcpy(cwd, "unknown");
if (!getcwd(cwd, cwd_len)) strcpy(cwd, "unknown");
Jim_AppendStrings(interp, Jim_GetResult(interp),
"Error loading script \"", filename, "\"",
" cwd: ", cwd,
@@ -9359,12 +9359,12 @@ void JimRegisterCoreApi(Jim_Interp *interp)
JIM_REGISTER_API(StackPop);
JIM_REGISTER_API(StackPeek);
JIM_REGISTER_API(FreeStackElements);
JIM_REGISTER_API(fprintf );
JIM_REGISTER_API(vfprintf );
JIM_REGISTER_API(fwrite );
JIM_REGISTER_API(fread );
JIM_REGISTER_API(fflush );
JIM_REGISTER_API(fgets );
JIM_REGISTER_API(fprintf);
JIM_REGISTER_API(vfprintf);
JIM_REGISTER_API(fwrite);
JIM_REGISTER_API(fread);
JIM_REGISTER_API(fflush);
JIM_REGISTER_API(fgets);
JIM_REGISTER_API(GetNvp);
JIM_REGISTER_API(Nvp_name2value);
JIM_REGISTER_API(Nvp_name2value_simple);
@@ -10217,7 +10217,7 @@ static int JimForeachMapHelper(Jim_Interp *interp, int argc,
if (count > nbrOfLoops)
nbrOfLoops = count;
}
for (; nbrOfLoops-- > 0; ) {
for (; nbrOfLoops-- > 0;) {
for (i = 0; i < nbrOfLists; ++i) {
int varIdx = 0, var = i * 2;
while (varIdx < listsEnd[var]) {
@@ -12276,7 +12276,7 @@ static void Jim_RegisterCoreProcedures(Jim_Interp *interp)
"proc lambdaFinalizer {name val} {\n"
" rename $name {}\n"
"}\n"
);
);
}

void Jim_RegisterCoreCommands(Jim_Interp *interp)
@@ -12399,66 +12399,66 @@ out:
* Jim's idea of STDIO..
* ---------------------------------------------------------------------------*/

int Jim_fprintf(Jim_Interp *interp, void *cookie, const char *fmt, ... )
int Jim_fprintf(Jim_Interp *interp, void *cookie, const char *fmt, ...)
{
int r;

va_list ap;
va_start(ap,fmt);
r = Jim_vfprintf(interp, cookie, fmt,ap );
r = Jim_vfprintf(interp, cookie, fmt,ap);
va_end(ap);
return r;
}

int Jim_vfprintf(Jim_Interp *interp, void *cookie, const char *fmt, va_list ap )
int Jim_vfprintf(Jim_Interp *interp, void *cookie, const char *fmt, va_list ap)
{
if ((interp == NULL) || (interp->cb_vfprintf == NULL) ){
if ((interp == NULL) || (interp->cb_vfprintf == NULL)){
errno = ENOTSUP;
return -1;
}
return (*(interp->cb_vfprintf))(cookie, fmt, ap );
return (*(interp->cb_vfprintf))(cookie, fmt, ap);
}

size_t Jim_fwrite(Jim_Interp *interp, const void *ptr, size_t size, size_t n, void *cookie )
size_t Jim_fwrite(Jim_Interp *interp, const void *ptr, size_t size, size_t n, void *cookie)
{
if ((interp == NULL) || (interp->cb_fwrite == NULL) ){
if ((interp == NULL) || (interp->cb_fwrite == NULL)){
errno = ENOTSUP;
return 0;
}
return (*(interp->cb_fwrite))(ptr, size, n, cookie);
}

size_t Jim_fread(Jim_Interp *interp, void *ptr, size_t size, size_t n, void *cookie )
size_t Jim_fread(Jim_Interp *interp, void *ptr, size_t size, size_t n, void *cookie)
{
if ((interp == NULL) || (interp->cb_fread == NULL) ){
if ((interp == NULL) || (interp->cb_fread == NULL)){
errno = ENOTSUP;
return 0;
}
return (*(interp->cb_fread))(ptr, size, n, cookie);
}

int Jim_fflush(Jim_Interp *interp, void *cookie )
int Jim_fflush(Jim_Interp *interp, void *cookie)
{
if ((interp == NULL) || (interp->cb_fflush == NULL) ){
if ((interp == NULL) || (interp->cb_fflush == NULL)){
/* pretend all is well */
return 0;
}
return (*(interp->cb_fflush))(cookie );
return (*(interp->cb_fflush))(cookie);
}

char* Jim_fgets(Jim_Interp *interp, char *s, int size, void *cookie )
char* Jim_fgets(Jim_Interp *interp, char *s, int size, void *cookie)
{
if ((interp == NULL) || (interp->cb_fgets == NULL) ){
if ((interp == NULL) || (interp->cb_fgets == NULL)){
errno = ENOTSUP;
return NULL;
}
return (*(interp->cb_fgets))(s, size, cookie );
return (*(interp->cb_fgets))(s, size, cookie);
}
Jim_Nvp *
Jim_Nvp_name2value_simple(const Jim_Nvp *p, const char *name )
Jim_Nvp_name2value_simple(const Jim_Nvp *p, const char *name)
{
while (p->name ){
if (0 == strcmp(name, p->name ) ){
while (p->name){
if (0 == strcmp(name, p->name)){
break;
}
p++;
@@ -12467,10 +12467,10 @@ Jim_Nvp_name2value_simple(const Jim_Nvp *p, const char *name )
}

Jim_Nvp *
Jim_Nvp_name2value_nocase_simple(const Jim_Nvp *p, const char *name )
Jim_Nvp_name2value_nocase_simple(const Jim_Nvp *p, const char *name)
{
while (p->name ){
if (0 == strcasecmp(name, p->name ) ){
while (p->name){
if (0 == strcasecmp(name, p->name)){
break;
}
p++;
@@ -12482,9 +12482,9 @@ int
Jim_Nvp_name2value_obj(Jim_Interp *interp,
const Jim_Nvp *p,
Jim_Obj *o,
Jim_Nvp **result )
Jim_Nvp **result)
{
return Jim_Nvp_name2value(interp, p, Jim_GetString(o, NULL ), result );
return Jim_Nvp_name2value(interp, p, Jim_GetString(o, NULL), result);
}

@@ -12496,15 +12496,15 @@ Jim_Nvp_name2value(Jim_Interp *interp,
{
const Jim_Nvp *p;

p = Jim_Nvp_name2value_simple(_p, name );
p = Jim_Nvp_name2value_simple(_p, name);

/* result */
if (result ){
if (result){
*result = (Jim_Nvp *)(p);
}
/* found? */
if (p->name ){
if (p->name){
return JIM_OK;
} else {
return JIM_ERR;
@@ -12512,23 +12512,23 @@ Jim_Nvp_name2value(Jim_Interp *interp,
}

int
Jim_Nvp_name2value_obj_nocase(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **puthere )
Jim_Nvp_name2value_obj_nocase(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **puthere)
{
return Jim_Nvp_name2value_nocase(interp, p, Jim_GetString(o, NULL ), puthere );
return Jim_Nvp_name2value_nocase(interp, p, Jim_GetString(o, NULL), puthere);
}

int
Jim_Nvp_name2value_nocase(Jim_Interp *interp, const Jim_Nvp *_p, const char *name, Jim_Nvp **puthere )
Jim_Nvp_name2value_nocase(Jim_Interp *interp, const Jim_Nvp *_p, const char *name, Jim_Nvp **puthere)
{
const Jim_Nvp *p;

p = Jim_Nvp_name2value_nocase_simple(_p, name );
p = Jim_Nvp_name2value_nocase_simple(_p, name);

if (puthere ){
if (puthere){
*puthere = (Jim_Nvp *)(p);
}
/* found */
if (p->name ){
if (p->name){
return JIM_OK;
} else {
return JIM_ERR;
@@ -12537,24 +12537,24 @@ Jim_Nvp_name2value_nocase(Jim_Interp *interp, const Jim_Nvp *_p, const char *nam


int
Jim_Nvp_value2name_obj(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **result )
Jim_Nvp_value2name_obj(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **result)
{
int e;;
jim_wide w;

e = Jim_GetWide(interp, o, &w );
if (e != JIM_OK ){
e = Jim_GetWide(interp, o, &w);
if (e != JIM_OK){
return e;
}

return Jim_Nvp_value2name(interp, p, w, result );
return Jim_Nvp_value2name(interp, p, w, result);
}

Jim_Nvp *
Jim_Nvp_value2name_simple(const Jim_Nvp *p, int value )
Jim_Nvp_value2name_simple(const Jim_Nvp *p, int value)
{
while (p->name ){
if (value == p->value ){
while (p->name){
if (value == p->value){
break;
}
p++;
@@ -12564,17 +12564,17 @@ Jim_Nvp_value2name_simple(const Jim_Nvp *p, int value )


int
Jim_Nvp_value2name(Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **result )
Jim_Nvp_value2name(Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **result)
{
const Jim_Nvp *p;

p = Jim_Nvp_value2name_simple(_p, value );
p = Jim_Nvp_value2name_simple(_p, value);

if (result ){
if (result){
*result = (Jim_Nvp *)(p);
}

if (p->name ){
if (p->name){
return JIM_OK;
} else {
return JIM_ERR;
@@ -12585,7 +12585,7 @@ Jim_Nvp_value2name(Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **r
int
Jim_GetOpt_Setup(Jim_GetOptInfo *p, Jim_Interp *interp, int argc, Jim_Obj * const * argv)
{
memset(p, 0, sizeof(*p) );
memset(p, 0, sizeof(*p));
p->interp = interp;
p->argc = argc;
p->argv = argv;
@@ -12594,37 +12594,37 @@ Jim_GetOpt_Setup(Jim_GetOptInfo *p, Jim_Interp *interp, int argc, Jim_Obj * cons
}

void
Jim_GetOpt_Debug(Jim_GetOptInfo *p )
Jim_GetOpt_Debug(Jim_GetOptInfo *p)
{
int x;

Jim_fprintf(p->interp, p->interp->cookie_stderr, "---args---\n");
for (x = 0 ; x < p->argc ; x++ ){
for (x = 0 ; x < p->argc ; x++){
Jim_fprintf(p->interp, p->interp->cookie_stderr,
"%2d) %s\n",
x,
Jim_GetString(p->argv[x], NULL ) );
Jim_GetString(p->argv[x], NULL));
}
Jim_fprintf(p->interp, p->interp->cookie_stderr, "-------\n");
}


int
Jim_GetOpt_Obj(Jim_GetOptInfo *goi, Jim_Obj **puthere )
Jim_GetOpt_Obj(Jim_GetOptInfo *goi, Jim_Obj **puthere)
{
Jim_Obj *o;
o = NULL; // failure
if (goi->argc ){
if (goi->argc){
// success
o = goi->argv[0];
goi->argc -= 1;
goi->argv += 1;
}
if (puthere ){
if (puthere){
*puthere = o;
}
if (o != NULL ){
if (o != NULL){
return JIM_OK;
} else {
return JIM_ERR;
@@ -12632,17 +12632,17 @@ Jim_GetOpt_Obj(Jim_GetOptInfo *goi, Jim_Obj **puthere )
}

int
Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len )
Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len)
{
int r;
Jim_Obj *o;
const char *cp;


r = Jim_GetOpt_Obj(goi, &o );
if (r == JIM_OK ){
cp = Jim_GetString(o, len );
if (puthere ){
r = Jim_GetOpt_Obj(goi, &o);
if (r == JIM_OK){
cp = Jim_GetString(o, len);
if (puthere){
/* remove const */
*puthere = (char *)(cp);
}
@@ -12651,42 +12651,42 @@ Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len )
}

int
Jim_GetOpt_Double(Jim_GetOptInfo *goi, double *puthere )
Jim_GetOpt_Double(Jim_GetOptInfo *goi, double *puthere)
{
int r;
Jim_Obj *o;
double _safe;
if (puthere == NULL ){
if (puthere == NULL){
puthere = &_safe;
}

r = Jim_GetOpt_Obj(goi, &o );
if (r == JIM_OK ){
r = Jim_GetDouble(goi->interp, o, puthere );
if (r != JIM_OK ){
r = Jim_GetOpt_Obj(goi, &o);
if (r == JIM_OK){
r = Jim_GetDouble(goi->interp, o, puthere);
if (r != JIM_OK){
Jim_SetResult_sprintf(goi->interp,
"not a number: %s",
Jim_GetString(o, NULL ) );
Jim_GetString(o, NULL));
}
}
return r;
}

int
Jim_GetOpt_Wide(Jim_GetOptInfo *goi, jim_wide *puthere )
Jim_GetOpt_Wide(Jim_GetOptInfo *goi, jim_wide *puthere)
{
int r;
Jim_Obj *o;
jim_wide _safe;

if (puthere == NULL ){
if (puthere == NULL){
puthere = &_safe;
}

r = Jim_GetOpt_Obj(goi, &o );
if (r == JIM_OK ){
r = Jim_GetWide(goi->interp, o, puthere );
r = Jim_GetOpt_Obj(goi, &o);
if (r == JIM_OK){
r = Jim_GetWide(goi->interp, o, puthere);
}
return r;
}
@@ -12699,16 +12699,16 @@ int Jim_GetOpt_Nvp(Jim_GetOptInfo *goi,
Jim_Obj *o;
int e;

if (puthere == NULL ){
if (puthere == NULL){
puthere = &_safe;
}

e = Jim_GetOpt_Obj(goi, &o );
if (e == JIM_OK ){
e = Jim_GetOpt_Obj(goi, &o);
if (e == JIM_OK){
e = Jim_Nvp_name2value_obj(goi->interp,
nvp,
o,
puthere );
puthere);
}

return e;
@@ -12717,18 +12717,18 @@ int Jim_GetOpt_Nvp(Jim_GetOptInfo *goi,
void
Jim_GetOpt_NvpUnknown(Jim_GetOptInfo *goi,
const Jim_Nvp *nvptable,
int hadprefix )
int hadprefix)
{
if (hadprefix ){
if (hadprefix){
Jim_SetResult_NvpUnknown(goi->interp,
goi->argv[-2],
goi->argv[-1],
nvptable );
nvptable);
} else {
Jim_SetResult_NvpUnknown(goi->interp,
NULL,
goi->argv[-1],
nvptable );
nvptable);
}
}
@@ -12742,17 +12742,17 @@ Jim_GetOpt_Enum(Jim_GetOptInfo *goi,
Jim_Obj *o;
int e;

if (puthere == NULL ){
if (puthere == NULL){
puthere = &_safe;
}
e = Jim_GetOpt_Obj(goi, &o );
if (e == JIM_OK ){
e = Jim_GetOpt_Obj(goi, &o);
if (e == JIM_OK){
e = Jim_GetEnum(goi->interp,
o,
lookup,
puthere,
"option",
JIM_ERRMSG );
JIM_ERRMSG);
}
return e;
}
@@ -12760,16 +12760,16 @@ Jim_GetOpt_Enum(Jim_GetOptInfo *goi,


int
Jim_SetResult_sprintf(Jim_Interp *interp, const char *fmt,... )
Jim_SetResult_sprintf(Jim_Interp *interp, const char *fmt,...)
{
va_list ap;
char *buf;

va_start(ap,fmt);
buf = jim_vasprintf(fmt, ap );
buf = jim_vasprintf(fmt, ap);
va_end(ap);
if (buf ){
Jim_SetResultString(interp, buf, -1 );
if (buf){
Jim_SetResultString(interp, buf, -1);
jim_vasprintf_done(buf);
}
return JIM_OK;
@@ -12780,23 +12780,23 @@ void
Jim_SetResult_NvpUnknown(Jim_Interp *interp,
Jim_Obj *param_name,
Jim_Obj *param_value,
const Jim_Nvp *nvp )
const Jim_Nvp *nvp)
{
if (param_name ){
if (param_name){
Jim_SetResult_sprintf(interp,
"%s: Unknown: %s, try one of: ",
Jim_GetString(param_name, NULL ),
Jim_GetString(param_value, NULL ) );
Jim_GetString(param_name, NULL),
Jim_GetString(param_value, NULL));
} else {
Jim_SetResult_sprintf(interp,
"Unknown param: %s, try one of: ",
Jim_GetString(param_value, NULL ) );
Jim_GetString(param_value, NULL));
}
while (nvp->name ){
while (nvp->name){
const char *a;
const char *b;

if ((nvp + 1)->name ){
if ((nvp + 1)->name){
a = nvp->name;
b = ", ";
} else {
@@ -12805,7 +12805,7 @@ Jim_SetResult_NvpUnknown(Jim_Interp *interp,