From 56d853619abdece35a3b58002b98f461082786a3 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Tue, 13 Feb 2024 11:35:39 +0100 Subject: [PATCH 1/2] Remove code that was removing warning and now creates some --- src/silx/math/marchingcubes.pyx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/silx/math/marchingcubes.pyx b/src/silx/math/marchingcubes.pyx index 78b76c47b7..9d77202923 100644 --- a/src/silx/math/marchingcubes.pyx +++ b/src/silx/math/marchingcubes.pyx @@ -39,19 +39,6 @@ cimport cython cimport silx.math.mc as mc -# From numpy_common.pxi to avoid warnings while compiling C code -# See this thread: -# https://mail.python.org/pipermail//cython-devel/2012-March/002137.html -cdef extern from *: - bint FALSE "0" - void import_array() - void import_umath() - -if FALSE: - import_array() - import_umath() - - cdef class MarchingCubes: """Compute isosurface using marching cubes algorithm. From 2e7da8aae9263a713e3b48be9b0b714149818f09 Mon Sep 17 00:00:00 2001 From: Thomas VINCENT Date: Tue, 13 Feb 2024 12:59:17 +0100 Subject: [PATCH 2/2] use read return value --- src/silx/io/specfile/src/sfinit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/silx/io/specfile/src/sfinit.c b/src/silx/io/specfile/src/sfinit.c index ca2fa7fb6d..3513325009 100644 --- a/src/silx/io/specfile/src/sfinit.c +++ b/src/silx/io/specfile/src/sfinit.c @@ -792,6 +792,7 @@ static void sfAssignScanNumbers(SpecFile *sf) { int i; + long bytesread; char *ptr; char buffer[50]; char buffer2[50]; @@ -805,7 +806,10 @@ sfAssignScanNumbers(SpecFile *sf) { scan = (SpecScan *) object->contents; lseek(sf->fd,scan->offset,SEEK_SET); - read(sf->fd,buffer,sizeof(buffer)); + bytesread = read(sf->fd,buffer,sizeof(buffer)); + if (bytesread <= 4) { + continue; + } buffer[49] = '\0'; for ( ptr = buffer+3,i=0; *ptr != ' ';ptr++,i++) buffer2[i] = *ptr;