diff options
author | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
commit | 7287b75301a53bae723579b145448d43304272af (patch) | |
tree | df6d1a4595f3352a8c90ce9cba0e71ea0269e98b /silx/io/specfile/src | |
parent | 3e5dcad207c1eadeb74fb53f524c3a94fbe19096 (diff) | |
parent | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (diff) |
Update upstream source from tag 'upstream/0.10.1+dfsg'
Update to upstream version '0.10.1+dfsg'
with Debian dir 6b2d4eeabb68177b2b91df4d7527306d5e19409d
Diffstat (limited to 'silx/io/specfile/src')
-rw-r--r-- | silx/io/specfile/src/locale_management.c | 3 | ||||
-rw-r--r-- | silx/io/specfile/src/sfdata.c | 27 | ||||
-rw-r--r-- | silx/io/specfile/src/sftools.c | 3 |
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); |