[med-svn] [Git][med-team/edflib][upstream] New upstream version 1.15

Andreas Tille gitlab at salsa.debian.org
Wed Nov 28 07:05:27 GMT 2018


Andreas Tille pushed to branch upstream at Debian Med / edflib


Commits:
55aa18d8 by Andreas Tille at 2018-11-28T06:54:18Z
New upstream version 1.15
- - - - -


2 changed files:

- edflib.c
- edflib.h


Changes:

=====================================
edflib.c
=====================================
@@ -39,7 +39,7 @@
 #include "edflib.h"
 
 
-#define EDFLIB_VERSION 114
+#define EDFLIB_VERSION 115
 #define EDFLIB_MAXFILES 64
 
 
@@ -7028,7 +7028,7 @@ static int edflib_sprint_number_nonlocalized(char *str, double nr)
 
 static double edflib_atof_nonlocalized(const char *str)
 {
-  int i=0, dot_pos=-1, decimals=0, sign=1;
+  int i=0, j, dot_pos=-1, decimals=0, sign=1, exp_pos=-1, exp_sign=1, exp_val=0;
 
   double value, value2=0.0;
 
@@ -7057,6 +7057,13 @@ static double edflib_atof_nonlocalized(const char *str)
       break;
     }
 
+    if((str[i] == 'e') || (str[i] == 'E'))
+    {
+      exp_pos = i;
+
+      break;
+    }
+
     if(((str[i] < '0') || (str[i] > '9')) && (str[i] != '.'))
     {
       break;
@@ -7095,9 +7102,50 @@ static double edflib_atof_nonlocalized(const char *str)
     }
 
     value2 /= i;
+
+    value += value2;
   }
 
-  return value + value2;
+  if(exp_pos > 0)
+  {
+    i = exp_pos + 1;
+
+    if(str[i])
+    {
+      if(str[i] == '+')
+      {
+        i++;
+      }
+      else if(str[i] == '-')
+        {
+          exp_sign = -1;
+
+          i++;
+        }
+
+      if(str[i])
+      {
+        exp_val = edflib_atoi_nonlocalized(str + i);
+
+        if(exp_val > 0)
+        {
+          for(j=0; j<exp_val; j++)
+          {
+            if(exp_sign > 0)
+            {
+              value *= 10;
+            }
+            else
+            {
+              value /= 10;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  return value;
 }
 
 


=====================================
edflib.h
=====================================
@@ -46,7 +46,7 @@
 
 
 #define EDFLIB_TIME_DIMENSION (10000000LL)
-#define EDFLIB_MAXSIGNALS 512
+#define EDFLIB_MAXSIGNALS 640
 #define EDFLIB_MAX_ANNOTATION_LEN 512
 
 #define EDFSEEK_SET 0



View it on GitLab: https://salsa.debian.org/med-team/edflib/commit/55aa18d8994f984e6ac34553a0284ccdecbccd87

-- 
View it on GitLab: https://salsa.debian.org/med-team/edflib/commit/55aa18d8994f984e6ac34553a0284ccdecbccd87
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20181128/3950dfd2/attachment-0001.html>


More information about the debian-med-commit mailing list