Index: pcb-printf/tester.ref =================================================================== --- pcb-printf/tester.ref (revision 32459) +++ pcb-printf/tester.ref (nonexistent) @@ -1,162 +0,0 @@ ---------------- -mI=0 -mm=0.0000 -mM=0 -ml=0.00 -mL=0 -ms=0.0000 -mS=0 -md=(0.0000, 0.0000) -mD=(0, 0) -m3=(0, 0, 0) -mr=0 -$mI=0 -$mm=0.0000 -$mM=0 -$ml=0.00 -$mL=0 -$ms=0.0000 -$mS=0 -$md=(0.0000, 0.0000) mm -$mD=(0, 0) nm -$m3=(0, 0, 0) nm -$mr=0 -m*=0.00 mil -m*=0.0000 mm -ma=1.123400 -ma=130.123400 -ma=555.123400 -m+=0.00 mil -m+=0.0000 mm -m+=0.00000 m -m+=0.0000 mm or m ---------------- -mI=1 -mm=0.0000 -mM=1 -ml=0.00 -mL=0 -ms=0.0000 -mS=1 -md=(0.0000, 0.0000) -mD=(1, 1) -m3=(1, 1, 1) -mr=0 -$mI=1 -$mm=0.0000 mm -$mM=1 nm -$ml=0.00 mil -$mL=0 cmil -$ms=0.0000 mm -$mS=1 nm -$md=(0.0000, 0.0000) mm -$mD=(1, 1) nm -$m3=(1, 1, 1) nm -$mr=0 -m*=0.00 mil -m*=0.0000 mm -ma=1.123400 -ma=130.123400 -ma=555.123400 -m+=0.00 mil -m+=0.0000 mm -m+=0.00000 m -m+=0.0000 mm or m ---------------- -mI=1024 -mm=0.0010 -mM=1.02 -ml=0.04 -mL=4 -ms=0.0010 -mS=1.02 -md=(0.0010, 0.0010) -mD=(1.02, 1.02) -m3=(1.02, 1.02, 1.02) -mr=4 -$mI=1024 -$mm=0.0010 mm -$mM=1.02 um -$ml=0.04 mil -$mL=4 cmil -$ms=0.0010 mm -$mS=1.02 um -$md=(0.0010, 0.0010) mm -$mD=(1.02, 1.02) um -$m3=(1.02, 1.02, 1.02) um -$mr=4 -m*=0.04 mil -m*=0.0010 mm -ma=1.123400 -ma=130.123400 -ma=555.123400 -m+=0.04 mil -m+=0.0010 mm -m+=0.00000 m -m+=0.0010 mm or m ---------------- -mI=1048576 -mm=1.0486 -mM=1.0486 -ml=41.28 -mL=41.28 -ms=1.0486 -mS=1.0486 -md=(1.0486, 1.0486) -mD=(1.0486, 1.0486) -m3=(1.0486, 1.0486, 1.0486) -mr=4128 -$mI=1048576 -$mm=1.0486 mm -$mM=1.0486 mm -$ml=41.28 mil -$mL=41.28 mil -$ms=1.0486 mm -$mS=1.0486 mm -$md=(1.0486, 1.0486) mm -$mD=(1.0486, 1.0486) mm -$m3=(1.0486, 1.0486, 1.0486) mm -$mr=4128 -m*=41.28 mil -m*=1.0486 mm -ma=1.123400 -ma=130.123400 -ma=555.123400 -m+=41.28 mil -m+=1.0486 mm -m+=0.00105 m -m+=1.0486 mm or m ---------------- -mI=1073741824 -mm=1073.7418 -mM=1.07374 -ml=42273.30 -mL=42.27330 -ms=1073.7418 -mS=1.07374 -md=(1073.7418, 1073.7418) -mD=(1.07374, 1.07374) -m3=(1.07374, 1.07374, 1.07374) -mr=4227330 -$mI=1073741824 -$mm=1073.7418 mm -$mM=1.07374 m -$ml=42273.30 mil -$mL=42.27330 in -$ms=1073.7418 mm -$mS=1.07374 m -$md=(1073.7418, 1073.7418) mm -$mD=(1.07374, 1.07374) m -$m3=(1.07374, 1.07374, 1.07374) m -$mr=4227330 -m*=42273.30 mil -m*=1073.7418 mm -ma=1.123400 -ma=130.123400 -ma=555.123400 -m+=42273.30 mil -m+=1073.7418 mm -m+=1.07374 m -m+=1.07374 mm or m ---------------- -mf=1.2345 Index: pcb-printf/tester.c =================================================================== --- pcb-printf/tester.c (revision 32459) +++ pcb-printf/tester.c (nonexistent) @@ -1,74 +0,0 @@ -#include -#include -#include "config.h" -#include - -#ifdef SPEED - char buff[8192]; - int pc = 0; -# define NUMREP 4000 -# define PCB_PRINTF(fmt, ...) \ - do { \ - pc++; \ - rnd_snprintf(buff, sizeof(buff), fmt, __VA_ARGS__); \ - } while(0) -#else -# define NUMREP 1 -# define PCB_PRINTF rnd_printf -#endif - -int main() -{ - rnd_coord_t c[] = {0, 1, 1024, 1024*1024, 1024*1024*1024}; - char *fmt[] = { - "%mI", "%mm", "%mM", "%ml", "%mL", "%ms", "%mS", "%md", "%mD", "%m3", "%mr", - "%$mI", "%$mm", "%$mM", "%$ml", "%$mL", "%$ms", "%$mS", "%$md", "%$mD", "%$m3", "%$mr", - NULL }; - char **f; - int n, rep; - - setlocale(LC_ALL, "C"); - - for(rep = 0; rep < NUMREP; rep++) { - for(n = 0; n < sizeof(c) / sizeof(c[0]); n++) { -#ifndef SPEED - printf("---------------\n"); -#endif - /* common format strings */ - for(f = fmt; *f != NULL; f++) { - char fmt_tmp[32]; - sprintf(fmt_tmp, "%s=%s\n", (*f)+1, *f); - PCB_PRINTF(fmt_tmp, c[n], c[n], c[n]); - } - - /* special: custom argument list */ - PCB_PRINTF("m*=%m* mil\n", "mil", c[n]); - PCB_PRINTF("m*=%m* mm\n", "mm", c[n]); - - PCB_PRINTF("ma=%ma\n", 1.1234); - PCB_PRINTF("ma=%ma\n", 130.1234); - PCB_PRINTF("ma=%ma\n", 555.1234); - - PCB_PRINTF("m+=%m+%mS mil\n", RND_UNIT_ALLOW_MIL, c[n]); - PCB_PRINTF("m+=%m+%mS mm\n", RND_UNIT_ALLOW_MM, c[n]); - PCB_PRINTF("m+=%m+%mS m\n", RND_UNIT_ALLOW_M, c[n]); - PCB_PRINTF("m+=%m+%mS mm or m\n", RND_UNIT_ALLOW_MM | RND_UNIT_ALLOW_M, c[n]); - } -#ifndef SPEED - printf("---------------\n"); -#endif - PCB_PRINTF("mf=%.08mf\n", (double)1.2345); - } - -#ifdef SPEED - { - double spent = (double)clock() / (double)CLOCKS_PER_SEC; - printf("total number of rnd_printf calls: %d\n", pc); - printf("total number of CPU seconds spent: %.4f\n", spent); - printf("Average prints per second: %.4f\n", (double)pc/spent); - } -#endif - return 0; -} - - Index: pcb-printf/prclimq.c =================================================================== --- pcb-printf/prclimq.c (revision 32459) +++ pcb-printf/prclimq.c (nonexistent) @@ -1,14 +0,0 @@ -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - rnd_printf_slot[0] = "%{ ()}mq"; - setlocale(LC_ALL, "C"); - rnd_fprintf(stdout, argv[1], argv[2]); - printf("\n"); - return 0; -} Index: pcb-printf/prcli.c =================================================================== --- pcb-printf/prcli.c (revision 32459) +++ pcb-printf/prcli.c (nonexistent) @@ -1,32 +0,0 @@ -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - const char *fmt = argv[1]; - rnd_coord_t crd; - int n; - - setlocale(LC_ALL, "C"); - - rnd_printf_slot[0] = "%mr"; - - for(n = 2; n < argc; n++) { - rnd_bool success; - double val = rnd_get_value_ex(argv[n], NULL, NULL, NULL, "", &success); - if (!success) { - fprintf(stderr, "Unable to convert '%s' to rnd_coord_t\n", argv[n]); - return 1; - } - crd = val; - } - - rnd_fprintf(stdout, fmt, crd, 70000, 70000, 70000, 70000); - - printf("\n"); - - return 0; -} Index: pcb-printf/glue.c =================================================================== --- pcb-printf/glue.c (revision 32459) +++ pcb-printf/glue.c (nonexistent) @@ -1,73 +0,0 @@ -#include -#include -#include - -/*** hidlib glue ***/ - -const char *rnd_hidlib_default_embedded_menu = ""; -const char *pcb_conf_internal = ""; -const char *rnd_menu_file_paths[] = { "./", NULL }; -const char *rnd_menu_name_fmt = "menu.lht"; - -const char *rnd_conf_userdir_path = "./"; -const char *rnd_pcphl_conf_user_path = "./conf.lht"; - -/* hack for running from ./ without internal version of the conf */ -const char *rnd_conf_sysdir_path = "./"; -const char *rnd_conf_sys_path = "./conf.lht"; - -const char *rnd_app_package = "librnd_test"; -const char *rnd_app_version = "0.0.0"; -const char *rnd_app_url = "n/a"; - - -typedef struct design_s { - rnd_hidlib_t hidlib; /* shall be the first */ -} design_t; - -design_t CTX; - -const pup_buildin_t local_buildins[] = { - {NULL, NULL, NULL, NULL, 0, NULL} -}; - -static const char *action_args[] = { - NULL, NULL, NULL, NULL, NULL /* terminator */ -}; - -void conf_core_init() -{ -} - -void rnd_hidlib_adjust_attached_objects(rnd_hidlib_t *hl) -{ -} - -void *rnd_hidlib_crosshair_suspend(rnd_hidlib_t *hl) -{ - return NULL; -} - -void rnd_hidlib_crosshair_restore(rnd_hidlib_t *hl, void *susp_data) -{ -} - -void rnd_hidlib_crosshair_move_to(rnd_hidlib_t *hl, rnd_coord_t abs_x, rnd_coord_t abs_y, int mouse_mot) -{ -} - -void rnd_draw_marks(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) -{ -} - -void rnd_draw_attached(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) -{ -} - -void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) -{ -} - -void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) -{ -} Index: pcb-printf/Makefile =================================================================== --- pcb-printf/Makefile (revision 32459) +++ pcb-printf/Makefile (nonexistent) @@ -1,66 +0,0 @@ -TRUNK = ../.. - -all: tester tester_spd prcli prclimq - -ROOT=../.. -include $(ROOT)/Makefile.conf - -SRC=$(TRUNK)/src -LIBRND=$(SRC)/librnd -CFLAGS_OP = -O3 -CFLAGS = $(PCB_RND_C89FLAGS) -I$(TRUNK) -I$(SRC) -I$(TRUNK)/src_3rd -I$(TRUNK)/src_3rd/liblihata -LDLIBS = -lm - -LIBPCB_BASE=$(SRC)/librnd-hid.a $(SRC)/librnd-3rd.a glue.o - -include $(LIBRND)/core/librnd.mak -LDFLAGS = $(LDFLAGS_LIBRND) - - -test: tester.diff - @echo "pcb-printf: *** QC PASS ***" - @rm tester.stdout ; true - -prcli: prcli.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(GDS) - $(CC) -o prcli prcli.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) - -prclimq: prclimq.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(GDS) - $(CC) -o prclimq prclimq.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) - -prcli.o: prcli.c - $(CC) -c $(CFLAGS) prcli.c -o prcli.o - -prclimq.o: prclimq.c - $(CC) -c $(CFLAGS) prclimq.c -o prclimq.o - -glue.o: glue.c - $(CC) -c $(CFLAGS) glue.c -o glue.o - -tester: tester.o $(LIBRND)/core/rnd_printf.o $(LIBPCB_BASE) - $(CC) -o tester tester.o $(LIBRND)/core/rnd_printf.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) - -tester_spd: tester_spd.o $(LIBRND)/core/rnd_printf_spd.o $(LIBPCB_BASE) - $(CC) -o tester_spd tester_spd.o $(LIBRND)/core/rnd_printf_spd.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) - -tester.o: tester.c - $(CC) -c $(CFLAGS) -o $@ tester.c - -tester_spd.o: tester.c - $(CC) -c $(CFLAGS_OP) -DSPEED $(CFLAGS) -o $@ tester.c - -tester.stdout: tester - ./tester > tester.stdout - -tester.diff: tester.stdout - diff -u tester.ref tester.stdout - -$(LIBRND)/core/rnd_printf.o: $(LIBRND)/core/rnd_printf.c $(LIBRND)/core/rnd_printf.h - -$(LIBRND)/core/unit.o: $(LIBRND)/core/unit.c $(LIBRND)/core/unit.h - -$(LIBRND)/core/rnd_printf_spd.o: $(LIBRND)/core/rnd_printf.c $(LIBRND)/core/rnd_printf.h - $(CC) -c $(CFLAGS_OP) -DSPEED $(CFLAGS) -o $@ $(LIBRND)/core/rnd_printf.c - -clean: - -$(SCCBOX) rm -f tester tester.o prcli prcli.o tester_spd tester_spd.o prclimq prclimq.o $(LIBRND)/core/rnd_printf_spd.o - Index: Makefile =================================================================== --- Makefile (revision 32459) +++ Makefile (revision 32460) @@ -1,5 +1,5 @@ test: - cd pcb-printf && $(MAKE) all && $(MAKE) test + cd rnd_printf && $(MAKE) all && $(MAKE) test cd remote && $(MAKE) all && $(MAKE) test # This uses make instead of $(MAKE) on purpose as a "portbale" -j1 to work aroudn GNU make cd librnd && make all && make test @@ -9,7 +9,7 @@ @echo "+-------------------------------------------------+" clean: - cd pcb-printf && $(MAKE) clean + cd rnd_printf && $(MAKE) clean cd remote && $(MAKE) clean cd librnd && $(MAKE) clean Index: rnd_printf/Makefile =================================================================== --- rnd_printf/Makefile (nonexistent) +++ rnd_printf/Makefile (revision 32460) @@ -0,0 +1,66 @@ +TRUNK = ../.. + +all: tester tester_spd prcli prclimq + +ROOT=../.. +include $(ROOT)/Makefile.conf + +SRC=$(TRUNK)/src +LIBRND=$(SRC)/librnd +CFLAGS_OP = -O3 +CFLAGS = $(PCB_RND_C89FLAGS) -I$(TRUNK) -I$(SRC) -I$(TRUNK)/src_3rd -I$(TRUNK)/src_3rd/liblihata +LDLIBS = -lm + +LIBPCB_BASE=$(SRC)/librnd-hid.a $(SRC)/librnd-3rd.a glue.o + +include $(LIBRND)/core/librnd.mak +LDFLAGS = $(LDFLAGS_LIBRND) + + +test: tester.diff + @echo "pcb-printf: *** QC PASS ***" + @rm tester.stdout ; true + +prcli: prcli.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(GDS) + $(CC) -o prcli prcli.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) + +prclimq: prclimq.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(GDS) + $(CC) -o prclimq prclimq.o $(LIBRND)/core/rnd_printf.o $(LIBRND)/core/misc_util.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) + +prcli.o: prcli.c + $(CC) -c $(CFLAGS) prcli.c -o prcli.o + +prclimq.o: prclimq.c + $(CC) -c $(CFLAGS) prclimq.c -o prclimq.o + +glue.o: glue.c + $(CC) -c $(CFLAGS) glue.c -o glue.o + +tester: tester.o $(LIBRND)/core/rnd_printf.o $(LIBPCB_BASE) + $(CC) -o tester tester.o $(LIBRND)/core/rnd_printf.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) + +tester_spd: tester_spd.o $(LIBRND)/core/rnd_printf_spd.o $(LIBPCB_BASE) + $(CC) -o tester_spd tester_spd.o $(LIBRND)/core/rnd_printf_spd.o $(LIBPCB_BASE) $(LDFLAGS) $(LDLIBS) + +tester.o: tester.c + $(CC) -c $(CFLAGS) -o $@ tester.c + +tester_spd.o: tester.c + $(CC) -c $(CFLAGS_OP) -DSPEED $(CFLAGS) -o $@ tester.c + +tester.stdout: tester + ./tester > tester.stdout + +tester.diff: tester.stdout + diff -u tester.ref tester.stdout + +$(LIBRND)/core/rnd_printf.o: $(LIBRND)/core/rnd_printf.c $(LIBRND)/core/rnd_printf.h + +$(LIBRND)/core/unit.o: $(LIBRND)/core/unit.c $(LIBRND)/core/unit.h + +$(LIBRND)/core/rnd_printf_spd.o: $(LIBRND)/core/rnd_printf.c $(LIBRND)/core/rnd_printf.h + $(CC) -c $(CFLAGS_OP) -DSPEED $(CFLAGS) -o $@ $(LIBRND)/core/rnd_printf.c + +clean: + -$(SCCBOX) rm -f tester tester.o prcli prcli.o tester_spd tester_spd.o prclimq prclimq.o $(LIBRND)/core/rnd_printf_spd.o + Index: rnd_printf/glue.c =================================================================== --- rnd_printf/glue.c (nonexistent) +++ rnd_printf/glue.c (revision 32460) @@ -0,0 +1,73 @@ +#include +#include +#include + +/*** hidlib glue ***/ + +const char *rnd_hidlib_default_embedded_menu = ""; +const char *pcb_conf_internal = ""; +const char *rnd_menu_file_paths[] = { "./", NULL }; +const char *rnd_menu_name_fmt = "menu.lht"; + +const char *rnd_conf_userdir_path = "./"; +const char *rnd_pcphl_conf_user_path = "./conf.lht"; + +/* hack for running from ./ without internal version of the conf */ +const char *rnd_conf_sysdir_path = "./"; +const char *rnd_conf_sys_path = "./conf.lht"; + +const char *rnd_app_package = "librnd_test"; +const char *rnd_app_version = "0.0.0"; +const char *rnd_app_url = "n/a"; + + +typedef struct design_s { + rnd_hidlib_t hidlib; /* shall be the first */ +} design_t; + +design_t CTX; + +const pup_buildin_t local_buildins[] = { + {NULL, NULL, NULL, NULL, 0, NULL} +}; + +static const char *action_args[] = { + NULL, NULL, NULL, NULL, NULL /* terminator */ +}; + +void conf_core_init() +{ +} + +void rnd_hidlib_adjust_attached_objects(rnd_hidlib_t *hl) +{ +} + +void *rnd_hidlib_crosshair_suspend(rnd_hidlib_t *hl) +{ + return NULL; +} + +void rnd_hidlib_crosshair_restore(rnd_hidlib_t *hl, void *susp_data) +{ +} + +void rnd_hidlib_crosshair_move_to(rnd_hidlib_t *hl, rnd_coord_t abs_x, rnd_coord_t abs_y, int mouse_mot) +{ +} + +void rnd_draw_marks(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) +{ +} + +void rnd_draw_attached(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) +{ +} + +void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) +{ +} + +void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) +{ +} Index: rnd_printf/prcli.c =================================================================== --- rnd_printf/prcli.c (nonexistent) +++ rnd_printf/prcli.c (revision 32460) @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + const char *fmt = argv[1]; + rnd_coord_t crd; + int n; + + setlocale(LC_ALL, "C"); + + rnd_printf_slot[0] = "%mr"; + + for(n = 2; n < argc; n++) { + rnd_bool success; + double val = rnd_get_value_ex(argv[n], NULL, NULL, NULL, "", &success); + if (!success) { + fprintf(stderr, "Unable to convert '%s' to rnd_coord_t\n", argv[n]); + return 1; + } + crd = val; + } + + rnd_fprintf(stdout, fmt, crd, 70000, 70000, 70000, 70000); + + printf("\n"); + + return 0; +} Index: rnd_printf/prclimq.c =================================================================== --- rnd_printf/prclimq.c (nonexistent) +++ rnd_printf/prclimq.c (revision 32460) @@ -0,0 +1,14 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + rnd_printf_slot[0] = "%{ ()}mq"; + setlocale(LC_ALL, "C"); + rnd_fprintf(stdout, argv[1], argv[2]); + printf("\n"); + return 0; +} Index: rnd_printf/tester.c =================================================================== --- rnd_printf/tester.c (nonexistent) +++ rnd_printf/tester.c (revision 32460) @@ -0,0 +1,74 @@ +#include +#include +#include "config.h" +#include + +#ifdef SPEED + char buff[8192]; + int pc = 0; +# define NUMREP 4000 +# define PCB_PRINTF(fmt, ...) \ + do { \ + pc++; \ + rnd_snprintf(buff, sizeof(buff), fmt, __VA_ARGS__); \ + } while(0) +#else +# define NUMREP 1 +# define PCB_PRINTF rnd_printf +#endif + +int main() +{ + rnd_coord_t c[] = {0, 1, 1024, 1024*1024, 1024*1024*1024}; + char *fmt[] = { + "%mI", "%mm", "%mM", "%ml", "%mL", "%ms", "%mS", "%md", "%mD", "%m3", "%mr", + "%$mI", "%$mm", "%$mM", "%$ml", "%$mL", "%$ms", "%$mS", "%$md", "%$mD", "%$m3", "%$mr", + NULL }; + char **f; + int n, rep; + + setlocale(LC_ALL, "C"); + + for(rep = 0; rep < NUMREP; rep++) { + for(n = 0; n < sizeof(c) / sizeof(c[0]); n++) { +#ifndef SPEED + printf("---------------\n"); +#endif + /* common format strings */ + for(f = fmt; *f != NULL; f++) { + char fmt_tmp[32]; + sprintf(fmt_tmp, "%s=%s\n", (*f)+1, *f); + PCB_PRINTF(fmt_tmp, c[n], c[n], c[n]); + } + + /* special: custom argument list */ + PCB_PRINTF("m*=%m* mil\n", "mil", c[n]); + PCB_PRINTF("m*=%m* mm\n", "mm", c[n]); + + PCB_PRINTF("ma=%ma\n", 1.1234); + PCB_PRINTF("ma=%ma\n", 130.1234); + PCB_PRINTF("ma=%ma\n", 555.1234); + + PCB_PRINTF("m+=%m+%mS mil\n", RND_UNIT_ALLOW_MIL, c[n]); + PCB_PRINTF("m+=%m+%mS mm\n", RND_UNIT_ALLOW_MM, c[n]); + PCB_PRINTF("m+=%m+%mS m\n", RND_UNIT_ALLOW_M, c[n]); + PCB_PRINTF("m+=%m+%mS mm or m\n", RND_UNIT_ALLOW_MM | RND_UNIT_ALLOW_M, c[n]); + } +#ifndef SPEED + printf("---------------\n"); +#endif + PCB_PRINTF("mf=%.08mf\n", (double)1.2345); + } + +#ifdef SPEED + { + double spent = (double)clock() / (double)CLOCKS_PER_SEC; + printf("total number of rnd_printf calls: %d\n", pc); + printf("total number of CPU seconds spent: %.4f\n", spent); + printf("Average prints per second: %.4f\n", (double)pc/spent); + } +#endif + return 0; +} + + Index: rnd_printf/tester.ref =================================================================== --- rnd_printf/tester.ref (nonexistent) +++ rnd_printf/tester.ref (revision 32460) @@ -0,0 +1,162 @@ +--------------- +mI=0 +mm=0.0000 +mM=0 +ml=0.00 +mL=0 +ms=0.0000 +mS=0 +md=(0.0000, 0.0000) +mD=(0, 0) +m3=(0, 0, 0) +mr=0 +$mI=0 +$mm=0.0000 +$mM=0 +$ml=0.00 +$mL=0 +$ms=0.0000 +$mS=0 +$md=(0.0000, 0.0000) mm +$mD=(0, 0) nm +$m3=(0, 0, 0) nm +$mr=0 +m*=0.00 mil +m*=0.0000 mm +ma=1.123400 +ma=130.123400 +ma=555.123400 +m+=0.00 mil +m+=0.0000 mm +m+=0.00000 m +m+=0.0000 mm or m +--------------- +mI=1 +mm=0.0000 +mM=1 +ml=0.00 +mL=0 +ms=0.0000 +mS=1 +md=(0.0000, 0.0000) +mD=(1, 1) +m3=(1, 1, 1) +mr=0 +$mI=1 +$mm=0.0000 mm +$mM=1 nm +$ml=0.00 mil +$mL=0 cmil +$ms=0.0000 mm +$mS=1 nm +$md=(0.0000, 0.0000) mm +$mD=(1, 1) nm +$m3=(1, 1, 1) nm +$mr=0 +m*=0.00 mil +m*=0.0000 mm +ma=1.123400 +ma=130.123400 +ma=555.123400 +m+=0.00 mil +m+=0.0000 mm +m+=0.00000 m +m+=0.0000 mm or m +--------------- +mI=1024 +mm=0.0010 +mM=1.02 +ml=0.04 +mL=4 +ms=0.0010 +mS=1.02 +md=(0.0010, 0.0010) +mD=(1.02, 1.02) +m3=(1.02, 1.02, 1.02) +mr=4 +$mI=1024 +$mm=0.0010 mm +$mM=1.02 um +$ml=0.04 mil +$mL=4 cmil +$ms=0.0010 mm +$mS=1.02 um +$md=(0.0010, 0.0010) mm +$mD=(1.02, 1.02) um +$m3=(1.02, 1.02, 1.02) um +$mr=4 +m*=0.04 mil +m*=0.0010 mm +ma=1.123400 +ma=130.123400 +ma=555.123400 +m+=0.04 mil +m+=0.0010 mm +m+=0.00000 m +m+=0.0010 mm or m +--------------- +mI=1048576 +mm=1.0486 +mM=1.0486 +ml=41.28 +mL=41.28 +ms=1.0486 +mS=1.0486 +md=(1.0486, 1.0486) +mD=(1.0486, 1.0486) +m3=(1.0486, 1.0486, 1.0486) +mr=4128 +$mI=1048576 +$mm=1.0486 mm +$mM=1.0486 mm +$ml=41.28 mil +$mL=41.28 mil +$ms=1.0486 mm +$mS=1.0486 mm +$md=(1.0486, 1.0486) mm +$mD=(1.0486, 1.0486) mm +$m3=(1.0486, 1.0486, 1.0486) mm +$mr=4128 +m*=41.28 mil +m*=1.0486 mm +ma=1.123400 +ma=130.123400 +ma=555.123400 +m+=41.28 mil +m+=1.0486 mm +m+=0.00105 m +m+=1.0486 mm or m +--------------- +mI=1073741824 +mm=1073.7418 +mM=1.07374 +ml=42273.30 +mL=42.27330 +ms=1073.7418 +mS=1.07374 +md=(1073.7418, 1073.7418) +mD=(1.07374, 1.07374) +m3=(1.07374, 1.07374, 1.07374) +mr=4227330 +$mI=1073741824 +$mm=1073.7418 mm +$mM=1.07374 m +$ml=42273.30 mil +$mL=42.27330 in +$ms=1073.7418 mm +$mS=1.07374 m +$md=(1073.7418, 1073.7418) mm +$mD=(1.07374, 1.07374) m +$m3=(1.07374, 1.07374, 1.07374) m +$mr=4227330 +m*=42273.30 mil +m*=1073.7418 mm +ma=1.123400 +ma=130.123400 +ma=555.123400 +m+=42273.30 mil +m+=1073.7418 mm +m+=1.07374 m +m+=1.07374 mm or m +--------------- +mf=1.2345