On Sat, Jan 1, 2011 at 2:44 AM, David Brownell <davi...@pacbell.net> wrote: > > > --- On Fri, 12/31/10, Antonio Borneo <borneo.anto...@gmail.com> wrote: > >> Table of NAND devices reports >> operating voltage. >> Replace comma with proper decimal dot. > > A more accurate patch comment would be that you > are changing the localization for those numbers.
You are right! > In some parts of the world, dot/period is the > convention. In other parts; commas are used. > > So you're making numeric presentation "improper" > fo some notable chunk of he world. Currently, OpenOCD does not support localization. The locale is unchanged form default, so it is "C" (at least on Linux, should be same on Windows). This means that printing floating point data with printf(), the decimal point is always printed as "dot". Would not be difficult to change this behaviour, just adding at beginning of main() the line: setlocale(LC_ALL, ""); and the environment would be taken as OpenOCD locale, changing accordingly printf output. But, in the code we also have some hardcoded dot. Not only in the part I propose to patch but also (at least) in the lines reported below. Since I have found no hardcoded "comma" as decimal point, my patch has the effect to uniform the code to the current situation. Best Regards, Antonio Borneo List of (most of) hardcoded "dot" code lines: rc/jtag/drivers/jlink.c:522: LOG_INFO("Vref = %d.%d TCK = %d TDI = %d TDO = %d TMS = %d SRST = %d TRST = %d", \ src/flash/nor/at91sam3.c:1559: LOG_USER_N("(%3.03f Mhz (%d.%03dkhz slowclk)\n", src/flash/nor/at91sam3.c:2724: command_print(CMD_CTX, "Slowclk freq: %d.%03dkhz", src/flash/nor/cfi.c:487: LOG_DEBUG("Vcc opt: %x.%x, Vpp opt: %u.%x", src/flash/nor/cfi.c:609: LOG_DEBUG("Vpp min: %u.%x, Vpp max: %u.%x", src/flash/nor/cfi.c:761: printed = snprintf(buf, buf_size, "VppMin: %u.%x, VppMax: %u.%x\n", src/flash/nor/cfi.c:789: printed = snprintf(buf, buf_size, "Vcc opt: %x.%x, Vpp opt: %u.%x\n", src/flash/nor/cfi.c:2566: LOG_DEBUG("Vcc min: %x.%x, Vcc max: %x.%x, Vpp min: %u.%x, Vpp max: %u.%x", src/flash/nor/cfi.c:2881: printed = snprintf(buf, buf_size, "Vcc min: %x.%x, Vcc max: %x.%x, " src/flash/nor/cfi.c:2882: "Vpp min: %u.%x, Vpp max: %u.%x\n", src/flash/nor/str9xpec.c:857: command_print(CMD_CTX, "LVD Threshold: 2.7v"); src/flash/nor/str9xpec.c:859: command_print(CMD_CTX, "LVD Threshold: 2.4v"); src/flash/nor/str9xpec.c:997: command_print(CMD_CTX, "str9xpec options_lvdthd <bank> <2.4v | 2.7v>"); src/flash/nor/str9xpec.c:1008: if (strcmp(CMD_ARGV[1], "2.7v") == 0) src/flash/nor/tms470.c:289: (technology_family ? "1.8v" : "3.3v"), _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development