]> thyrsus.com Git - morse-classic.git/commitdiff
Partial cppcheck cleanup. Some sscanf warnings remain.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 27 Nov 2012 06:19:20 +0000 (01:19 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 27 Nov 2012 06:19:20 +0000 (01:19 -0500)
morse.d/beepALSA.c
morse.d/beepOSS.c
morse.d/beepPA.c
morse.d/morse.c

index e9cb9d3e61c3a0a7c8a1c1155754bb1fdb826879..b7bbb03d12f42e05a11ec5cbf0898148538816b4 100644 (file)
@@ -60,10 +60,7 @@ int BeepInit (void)
 
 int Beep (int time, int volume, int pitch)
 {
-  static int      last_pitch = -1, last_n = -1, last_volume = -1;
-  int             i, n, first_len, down_len, cycle;
-  double          dt;
-
+    int n;
   /*
    * Finagle the number of samples
    */
@@ -81,6 +78,8 @@ int Beep (int time, int volume, int pitch)
   if (volume <= 0) {
     snd_pcm_writei(handle, silence, channels*n);
   } else {
+    static int      last_pitch = -1, last_n = -1, last_volume = -1;
+    int             first_len, down_len, cycle;
     /*
      * clip to Nyquist
      * (Of course this means that if you ask for too high a frequency you
@@ -119,6 +118,8 @@ int Beep (int time, int volume, int pitch)
       last_pitch = pitch;
       last_n = n;
       last_volume = volume;
+      double          dt;
+      int i;
 
       dt = 2. * M_PI / cycle;  /* sine scale factor */
 
index 6573539b10a0c1f3bcf520910c46f05fe44268ae..aeea766dd45ec3b3ac251e2739be2eb2c868a861 100644 (file)
@@ -91,10 +91,7 @@ int BeepInit (void)
 
 int Beep (int time, int volume, int pitch)
 {
-  static int      last_pitch = -1, last_n = -1, last_volume = -1;
-  int             i, n, first_len, down_len, cycle;
-  double          dt;
-  
+    int n;
   /*
    * Finagle the number of samples
    */
@@ -114,6 +111,8 @@ int Beep (int time, int volume, int pitch)
     }
   else
     {
+      static int      last_pitch = -1, last_n = -1, last_volume = -1;
+      int             first_len, down_len, cycle;
       /*
        * clip to Nyquist
        * (Of course this means that if you ask for too high a frequency you
@@ -148,7 +147,9 @@ int Beep (int time, int volume, int pitch)
          last_pitch = pitch;
          last_n = n;
          last_volume = volume;
-         
+         int i;
+         double          dt;
+ 
          dt = 2. * M_PI / cycle;       /* sine scale factor */
          
          /* Ramp up; begin with silence */
Simple merge
diff --cc morse.d/morse.c
Simple merge