abs(unsigned) doesn't make much sense.

clang catches an actual bug in jakemsr's code!
This commit is contained in:
espie 2017-05-02 16:47:32 +00:00
parent 43a42c134b
commit bdb8a5647f
2 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.23 2017/04/10 11:45:24 sthen Exp $
# $OpenBSD: Makefile,v 1.24 2017/05/02 16:47:32 espie Exp $
COMMENT= gtk PSK31 send and receive
DISTNAME= gpsk31-0.3
REVISION= 12
REVISION= 13
CATEGORIES= comms hamradio
HOMEPAGE= http://www.qsl.net/pg4i/linux/gpsk31.html

View File

@ -1,6 +1,7 @@
$OpenBSD: patch-src_server-main_C,v 1.2 2010/07/01 01:57:33 jakemsr Exp $
--- src/server-main.C.orig Wed Jun 30 17:19:24 2010
+++ src/server-main.C Wed Jun 30 17:35:40 2010
$OpenBSD: patch-src_server-main_C,v 1.3 2017/05/02 16:47:32 espie Exp $
Index: src/server-main.C
--- src/server-main.C.orig
+++ src/server-main.C
@@ -20,21 +20,14 @@
*/
@ -345,7 +346,7 @@ $OpenBSD: patch-src_server-main_C,v 1.2 2010/07/01 01:57:33 jakemsr Exp $
- // Check if the device is operating in full duplex mode
- if( ioctl(audiofd, SNDCTL_DSP_GETCAPS, &val)<0 )
- perror("Warning: GETCAPS on audio device failed");
+ if (abs(par.rate - speed) < speed * 1.03)
+ if (abs(int(par.rate) - int(speed)) < speed * 1.03)
+ {
+ fprintf (stderr, "init_audio: using %d sample rate\n", speed);
+ }