Removed some C99-isms (mixed code and declarations)
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 3 Jan 2007 15:43:06 +0000 (15:43 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 3 Jan 2007 15:43:06 +0000 (15:43 +0000)
demo/choose_clock.c
demo/choose_routing.c

index 77f176c46fa0f231237781148a31ea4ee7c14ede..eae42f36e3862af8a6e516275138582ea2a221c7 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * Digital I/O example
+ * INSN_CONFIG_SET_CLOCK_SRC example
  * Part of Comedilib
  *
  * Copyright (c) 1999,2000 David A. Schleef <ds@schleef.org>
+ * Copyright (c) 2007 Frank Mori Hess <fmhess@users.sourceforge.net>
  *
  * 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;
 }
index b283ab7040c15ab3c3385453c220449ab9bc9a29..4e137b68b8ba24ee92dd27ed0d567e79c1e497f3 100644 (file)
@@ -1,8 +1,9 @@
 /*
- * Digital I/O example
+ * INSN_CONFIG_SET_ROUTING example
  * Part of Comedilib
  *
  * Copyright (c) 1999,2000 David A. Schleef <ds@schleef.org>
+ * Copyright (c) 2007 Frank Mori Hess <fmhess@users.sourceforge.net>
  *
  * 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;
 }