[segyio] 186/376: Use signed int for trace header index

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit f8398813247c3fc70d7db67237c9678ad0aa3e0b
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Tue Feb 14 12:51:18 2017 +0100

    Use signed int for trace header index
---
 lib/include/segyio/segy.h  | 4 ++--
 lib/src/segy.c             | 4 ++--
 mex/segy_get_header_mex.c  | 2 +-
 mex/segy_put_headers_mex.c | 2 +-
 python/segyio/_segyio.c    | 8 ++++----
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/include/segyio/segy.h b/lib/include/segyio/segy.h
index ea3be4b..dfa4767 100644
--- a/lib/include/segyio/segy.h
+++ b/lib/include/segyio/segy.h
@@ -80,14 +80,14 @@ int segy_write_textheader( segy_file*, int pos, const char* buf );
 
 /* Read the trace header at `traceno` into `buf`. */
 int segy_traceheader( segy_file*,
-                      unsigned int traceno,
+                      int traceno,
                       char* buf,
                       long trace0,
                       int trace_bsize );
 
 /* Read the trace header at `traceno` into `buf`. */
 int segy_write_traceheader( segy_file*,
-                            unsigned int traceno,
+                            int traceno,
                             const char* buf,
                             long trace0,
                             int trace_bsize );
diff --git a/lib/src/segy.c b/lib/src/segy.c
index 260a9db..c83ff43 100644
--- a/lib/src/segy.c
+++ b/lib/src/segy.c
@@ -611,7 +611,7 @@ int segy_seek( segy_file* fp,
 }
 
 int segy_traceheader( segy_file* fp,
-                      unsigned int traceno,
+                      int traceno,
                       char* buf,
                       long trace0,
                       int trace_bsize ) {
@@ -633,7 +633,7 @@ int segy_traceheader( segy_file* fp,
 }
 
 int segy_write_traceheader( segy_file* fp,
-                            unsigned int traceno,
+                            int traceno,
                             const char* buf,
                             long trace0,
                             int trace_bsize ) {
diff --git a/mex/segy_get_header_mex.c b/mex/segy_get_header_mex.c
index 31a6323..ec2e77f 100644
--- a/mex/segy_get_header_mex.c
+++ b/mex/segy_get_header_mex.c
@@ -27,7 +27,7 @@ void mexFunction(int nlhs, mxArray *plhs[],
 
     char header[ SEGY_TRACE_HEADER_SIZE ];
 
-    for( size_t i = 0; i < fmt.traces; ++i ) {
+    for( int i = 0; i < fmt.traces; ++i ) {
         int32_t f;
         err = segy_traceheader( fp, i, header, fmt.trace0, fmt.trace_bsize );
 
diff --git a/mex/segy_put_headers_mex.c b/mex/segy_put_headers_mex.c
index a5aaad2..36d32e4 100644
--- a/mex/segy_put_headers_mex.c
+++ b/mex/segy_put_headers_mex.c
@@ -34,7 +34,7 @@ void mexFunction(int nlhs, mxArray *plhs[],
     }
 
     double* itr = headers;
-    for( size_t i = 0; i < fmt.traces; ++i, ++itr ) {
+    for( int i = 0; i < fmt.traces; ++i, ++itr ) {
         err = segy_traceheader( fp, i, traceheader, fmt.trace0, fmt.trace_bsize );
         const int val = *itr;
 
diff --git a/python/segyio/_segyio.c b/python/segyio/_segyio.c
index 877249c..93404f5 100644
--- a/python/segyio/_segyio.c
+++ b/python/segyio/_segyio.c
@@ -439,12 +439,12 @@ static PyObject *py_empty_trace_header(PyObject *self) {
 static PyObject *py_read_trace_header(PyObject *self, PyObject *args) {
     errno = 0;
     PyObject *file_capsule = NULL;
-    unsigned int traceno;
+    int traceno;
     PyObject *trace_header_capsule = NULL;
     long trace0;
     int trace_bsize;
 
-    PyArg_ParseTuple(args, "OIOli", &file_capsule, &traceno, &trace_header_capsule, &trace0, &trace_bsize);
+    PyArg_ParseTuple(args, "OiOli", &file_capsule, &traceno, &trace_header_capsule, &trace0, &trace_bsize);
 
     segy_file *p_FILE = get_FILE_pointer_from_capsule(file_capsule);
 
@@ -467,12 +467,12 @@ static PyObject *py_read_trace_header(PyObject *self, PyObject *args) {
 static PyObject *py_write_trace_header(PyObject *self, PyObject *args) {
     errno = 0;
     PyObject *file_capsule = NULL;
-    unsigned int traceno;
+    int traceno;
     PyObject *trace_header_capsule = NULL;
     long trace0;
     int trace_bsize;
 
-    PyArg_ParseTuple(args, "OIOli", &file_capsule, &traceno, &trace_header_capsule, &trace0, &trace_bsize);
+    PyArg_ParseTuple(args, "OiOli", &file_capsule, &traceno, &trace_header_capsule, &trace0, &trace_bsize);
 
     segy_file *p_FILE = get_FILE_pointer_from_capsule(file_capsule);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list