mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 17:59:07 -04:00
1.1 KiB
1.1 KiB
$NetBSD: patch-ae,v 1.3 2012/10/24 15:38:00 joerg Exp $
--- meter_rd.c.orig 2004-07-27 02:27:32.000000000 +0000
+++ meter_rd.c
@@ -1,10 +1,8 @@
-extern main();
-extern flag_data_return[];
-extern outport();
+#include "yaesu.h"
int meter_rd(int fdSer) {
int opcode, tx_status, n;
- char meter_value[5];
+ char meter_value[6];
opcode = 250;
rd_flags(fdSer);
@@ -13,7 +11,7 @@ int meter_rd(int fdSer) {
if (tx_status != 1 && tx_status != 0) {
printf("The tx_status bit value is incorrect. Serious program error!!!\n");
- return;
+ return -1;
} else {
opcode = 0x0f7;
}
@@ -33,7 +31,8 @@ int meter_rd(int fdSer) {
n = n +1;
}
if (meter_value[5] != 0x0f7) {
- printf("The dummy byte returned to the meter_rd function is incorrect, possible serial port noise?\n");
+ printf("The dummy byte returned to the meter_rd function is incorrect, possible "
+ "serial port noise?\n");
} else {
printf("\nCurrent meter value is %x. Range is 0..0ffh.\n", meter_value[3]);
}
--- meter_rd.c.orig 2004-07-27 02:27:32.000000000 +0000
+++ meter_rd.c
@@ -1,10 +1,8 @@
-extern main();
-extern flag_data_return[];
-extern outport();
+#include "yaesu.h"
int meter_rd(int fdSer) {
int opcode, tx_status, n;
- char meter_value[5];
+ char meter_value[6];
opcode = 250;
rd_flags(fdSer);
@@ -13,7 +11,7 @@ int meter_rd(int fdSer) {
if (tx_status != 1 && tx_status != 0) {
printf("The tx_status bit value is incorrect. Serious program error!!!\n");
- return;
+ return -1;
} else {
opcode = 0x0f7;
}
@@ -33,7 +31,8 @@ int meter_rd(int fdSer) {
n = n +1;
}
if (meter_value[5] != 0x0f7) {
- printf("The dummy byte returned to the meter_rd function is incorrect, possible serial port noise?\n");
+ printf("The dummy byte returned to the meter_rd function is incorrect, possible "
+ "serial port noise?\n");
} else {
printf("\nCurrent meter value is %x. Range is 0..0ffh.\n", meter_value[3]);
}