summaryrefslogtreecommitdiff
path: root/silx/io/specfile
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-05-28 08:16:16 +0200
committerPicca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>2019-05-28 08:16:16 +0200
commita763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (patch)
tree45d462ed36a5522e9f3b9fde6c4ec4918c2ae8e3 /silx/io/specfile
parentcebdc9244c019224846cb8d2668080fe386a6adc (diff)
New upstream version 0.10.1+dfsg
Diffstat (limited to 'silx/io/specfile')
-rw-r--r--silx/io/specfile/src/locale_management.c3
-rw-r--r--silx/io/specfile/src/sfdata.c27
-rw-r--r--silx/io/specfile/src/sftools.c3
3 files changed, 4 insertions, 29 deletions
diff --git a/silx/io/specfile/src/locale_management.c b/silx/io/specfile/src/locale_management.c
index 62111cc..54695f5 100644
--- a/silx/io/specfile/src/locale_management.c
+++ b/silx/io/specfile/src/locale_management.c
@@ -60,14 +60,13 @@ double PyMcaAtof(const char * inputString)
#else
#ifdef SPECFILE_POSIX
char *currentLocaleBuffer;
- char *restoredLocaleBuffer;
char localeBuffer[21];
double result;
currentLocaleBuffer = setlocale(LC_NUMERIC, NULL);
strcpy(localeBuffer, currentLocaleBuffer);
setlocale(LC_NUMERIC, "C\0");
result = atof(inputString);
- restoredLocaleBuffer = setlocale(LC_NUMERIC, localeBuffer);
+ setlocale(LC_NUMERIC, localeBuffer);
return(result);
#else
return atof(inputString);
diff --git a/silx/io/specfile/src/sfdata.c b/silx/io/specfile/src/sfdata.c
index e59439a..689f56d 100644
--- a/silx/io/specfile/src/sfdata.c
+++ b/silx/io/specfile/src/sfdata.c
@@ -275,30 +275,7 @@ SfData( SpecFile *sf, long index, double ***retdata, long **retinfo, int *error
}
ptr = from;
dinfo[ROW] = dinfo[COL] = dinfo[REG] = 0;
-if(0){
- /*
- * first characters of buffer
- */
- while (*ptr == ' ') ptr++; /* get rid of empty spaces */
-
- if (*ptr == '@') {
- /*
- * read all mca block: go while in buffer ( ptr < to - 1 )
- * and while a newline is preceded by a slash
- */
- for ( ptr = ptr + 2;
- (*ptr != '\n' || (*(ptr-1) == MCA_CONT)) && ptr < to ;
- ptr++);
- }
- if ( *ptr == '#') { /* Comment --> pass one line */
- for (ptr = ptr + 1; *ptr != '\n';ptr++);
- }
- /*
- * continue
- */
- ptr++;
-}
#ifndef _GNU_SOURCE
#ifdef PYMCA_POSIX
currentLocaleBuffer = setlocale(LC_NUMERIC, NULL);
@@ -317,7 +294,7 @@ if(0){
while(*ptr == '#'){
if (ptr >= to)
break;
- for (ptr = ptr; ptr < to;ptr++){
+ for (; ptr < to; ptr++){
if (*ptr == '\n'){
break;
}
@@ -342,7 +319,7 @@ if(0){
while(*ptr == '#'){
if (ptr >= to)
break;
- for (ptr = ptr; ptr < to;ptr++){
+ for (; ptr < to; ptr++){
if (*ptr == '\n'){
break;
}
diff --git a/silx/io/specfile/src/sftools.c b/silx/io/specfile/src/sftools.c
index d113d05..9b78b67 100644
--- a/silx/io/specfile/src/sftools.c
+++ b/silx/io/specfile/src/sftools.c
@@ -151,7 +151,6 @@ sfSetCurrent( SpecFile *sf, long index,int *error )
}
lseek(sf->fd,scan->offset,SEEK_SET);
-
nbytes = read(sf->fd,sf->scanbuffer,scan->size);
if ( nbytes == -1) {
*error = SF_ERR_FILE_READ;
@@ -188,7 +187,7 @@ sfSetCurrent( SpecFile *sf, long index,int *error )
return(-1);
}
lseek(sf->fd,start,SEEK_SET);
- read(sf->fd,sf->filebuffer,fileheadsize);
+ nbytes = read(sf->fd,sf->filebuffer,fileheadsize);
if ( nbytes == -1) {
*error = SF_ERR_FILE_READ;
return(-1);