From 8ee6219b64e2ad7b7e0e6851fd0c2d306f621563 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 3 Jan 2007 15:43:06 +0000 Subject: [PATCH] Removed some C99-isms (mixed code and declarations) --- demo/choose_clock.c | 9 ++++++--- demo/choose_routing.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/demo/choose_clock.c b/demo/choose_clock.c index 77f176c..eae42f3 100644 --- a/demo/choose_clock.c +++ b/demo/choose_clock.c @@ -1,8 +1,9 @@ /* - * Digital I/O example + * INSN_CONFIG_SET_CLOCK_SRC example * Part of Comedilib * * Copyright (c) 1999,2000 David A. Schleef + * Copyright (c) 2007 Frank Mori Hess * * This file may be freely modified, distributed, and combined with * other software, as long as proper attribution is given in the @@ -31,6 +32,9 @@ comedi_t *device; int main(int argc, char *argv[]) { + unsigned period_ns; + int retval; + freq = 0.; parse_options(argc,argv); @@ -39,7 +43,6 @@ int main(int argc, char *argv[]) comedi_perror(filename); exit(0); } - unsigned period_ns; if(freq > 0.) period_ns = 1e9 / freq; else @@ -63,7 +66,7 @@ int main(int argc, char *argv[]) data[1] = value; data[2] = period_ns; - int retval = comedi_do_insn(device, &insn); + retval = comedi_do_insn(device, &insn); if(retval < 0) comedi_perror("comedi_do_insn"); return retval; } diff --git a/demo/choose_routing.c b/demo/choose_routing.c index b283ab7..4e137b6 100644 --- a/demo/choose_routing.c +++ b/demo/choose_routing.c @@ -1,8 +1,9 @@ /* - * Digital I/O example + * INSN_CONFIG_SET_ROUTING example * Part of Comedilib * * Copyright (c) 1999,2000 David A. Schleef + * Copyright (c) 2007 Frank Mori Hess * * This file may be freely modified, distributed, and combined with * other software, as long as proper attribution is given in the @@ -31,6 +32,9 @@ comedi_t *device; int main(int argc, char *argv[]) { + unsigned period_ns; + int retval; + freq = 0.; parse_options(argc,argv); @@ -39,7 +43,6 @@ int main(int argc, char *argv[]) comedi_perror(filename); exit(0); } - unsigned period_ns; if(freq > 0.) period_ns = 1e9 / freq; else @@ -56,7 +59,7 @@ int main(int argc, char *argv[]) data[0] = INSN_CONFIG_SET_ROUTING; data[1] = value; - int retval = comedi_do_insn(device, &insn); + retval = comedi_do_insn(device, &insn); if(retval < 0) comedi_perror("comedi_do_insn"); return retval; } -- 2.26.2