File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ extern "C" {
2828#include < string.h> /* strchr(), memcpy(), memset() */
2929#include < stdlib.h> /* strtod */
3030#include < physmem.hh> /* PHYSMEM_HANDLE */
31+ #include < math.h>
3132
3233#ifdef __cplusplus
3334}
@@ -44,21 +45,10 @@ extern "C" {
4445// #include "autokey.h"
4546/* rw-rw-r-- permissions */
4647#define MODE (0700 )
47- static double last_non_zero_x;
48- static double last_x;
4948
50- static int not_zero (volatile double x)
49+ static inline bool not_zero (double x)
5150{
52- last_x = x;
53- if (x < -1E-6 && last_x < -1E-6 ) {
54- last_non_zero_x = x;
55- return 1 ;
56- }
57- if (x > 1E-6 && last_x > 1E-6 ) {
58- last_non_zero_x = x;
59- return 1 ;
60- }
61- return 0 ;
51+ return fabs (x) > 1e-6 ;
6252}
6353
6454/* SHMEM Member Functions. */
@@ -578,7 +568,7 @@ CMS_STATUS SHMEM::main_access(void *_local, int *serial_number)
578568
579569 case CMS_READ_ACCESS:
580570 if (NULL != bsem && status == CMS_READ_OLD &&
581- (blocking_timeout > 1e-6 || blocking_timeout < - 1E-6 )) {
571+ not_zero (blocking_timeout)) {
582572 if (second_read > 10 && total_subdivisions <= 1 ) {
583573 status = CMS_MISC_ERROR;
584574 rcs_print_error
You can’t perform that action at this time.
0 commit comments