Browse Source

simplify calls to round

richarddobson 1 month ago
parent
commit
a339d3254d
2 changed files with 4 additions and 3 deletions
  1. 1 0
      dev/repitch/ap_repitch.c
  2. 3 3
      dev/repitch/repitch.c

+ 1 - 0
dev/repitch/ap_repitch.c

@@ -53,6 +53,7 @@
 #include <vowels.h>
 #include <vowels.h>
 #include <ctype.h>
 #include <ctype.h>
 
 
+#define round(x) lround((x))
 
 
 /********************************************************************************************/
 /********************************************************************************************/
 /********************************** FORMERLY IN pconsistency.c ******************************/
 /********************************** FORMERLY IN pconsistency.c ******************************/

+ 3 - 3
dev/repitch/repitch.c

@@ -50,9 +50,9 @@
 #include <vowels2.h>
 #include <vowels2.h>
 
 
 
 
-#if defined unix || defined __GNUC__
+//#if defined unix || defined __GNUC__
 #define round(x) lround((x))
 #define round(x) lround((x))
-#endif
+//#endif
 
 
 #define GLARG            (0.1)  /* 2nd-derivative maximum, for smoothing */
 #define GLARG            (0.1)  /* 2nd-derivative maximum, for smoothing */
 #define SLOPE_FUDGE  (0.2)
 #define SLOPE_FUDGE  (0.2)
@@ -780,7 +780,7 @@ int is_peak_at(double frq,int window_offset,float minamp,dataptr dz)
     int cc, vc, searchtop, searchbot;
     int cc, vc, searchtop, searchbot;
     if(window_offset) {                                              /* BAKTRAK ALONG BIGBUF, IF NESS */
     if(window_offset) {                                              /* BAKTRAK ALONG BIGBUF, IF NESS */
         thisbuf = dz->flbufptr[0] - (window_offset * dz->wanted);
         thisbuf = dz->flbufptr[0] - (window_offset * dz->wanted);
-         if((size_t) thisbuf < 0 || thisbuf < dz->bigfbuf || thisbuf >= dz->flbufptr[1])
+         if( thisbuf < 0 ||  thisbuf < dz->bigfbuf || thisbuf >= dz->flbufptr[1])
              return(FALSE);
              return(FALSE);
     } else
     } else
         thisbuf = dz->flbufptr[0];
         thisbuf = dz->flbufptr[0];