Skip to content

Commit ee6b93d

Browse files
Renamed output buffer typemaps variable
Using _global_view for both memoryview and Py_buffer variables is ambiguous, so the Py_buffer one is now called _global_buff.
1 parent 76fd92b commit ee6b93d

14 files changed

Lines changed: 431 additions & 431 deletions

src/interface/shared/buffers.i

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@
4242
// Macro for output writeable byte buffer
4343
%define OUTPUT_BUFFER_RW(buf_type, count_type)
4444
%typemap(doctype) buf_type "writeable :py:term:`bytes-like object`";
45-
%typemap(in) (buf_type) (Py_buffer _global_view) {
46-
_global_view.obj = NULL;
45+
%typemap(in) (buf_type) (Py_buffer _global_buff) {
46+
_global_buff.obj = NULL;
4747
if (PyObject_GetBuffer(
48-
$input, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
48+
$input, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
4949
PyErr_Clear();
5050
%argument_fail(SWIG_TypeError, "writable bytes-like object",
5151
$symname, $argnum);
5252
}
53-
$1 = ($1_ltype) _global_view.buf;
53+
$1 = ($1_ltype) _global_buff.buf;
5454
}
5555
%typemap(check) (buf_type, count_type) {
56-
if ($2 > ($2_ltype) _global_view.len) {
56+
if ($2 > ($2_ltype) _global_buff.len) {
5757
%argument_fail(SWIG_ValueError, "buffer too small",
5858
$symname, $argnum);
5959
}
6060
}
6161
%typemap(freearg) (buf_type) %{
62-
if (_global_view.obj) {
63-
PyBuffer_Release(&_global_view);
62+
if (_global_buff.obj) {
63+
PyBuffer_Release(&_global_buff);
6464
}
6565
%}
6666
%typemap(typecheck, precedence=SWIG_TYPECHECK_CHAR_PTR) buf_type %{

src/interface/value.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ OUTPUT_BUFFER_RW(Exiv2::byte* buf, Exiv2::ByteOrder byteOrder)
9898
// redefine check typemap
9999
%typemap(check) (Exiv2::byte* buf, Exiv2::ByteOrder byteOrder) {
100100
// check buffer is large enough, assumes arg1 points to self
101-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
101+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
102102
%argument_fail(SWIG_ValueError, "buffer too small",
103103
$symname, $argnum);
104104
}

src/swig-0_27_7/basicio_wrap.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5271,7 +5271,7 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args)
52715271
long arg3 ;
52725272
void *argp1 = 0 ;
52735273
int res1 = 0 ;
5274-
Py_buffer _global_view ;
5274+
Py_buffer _global_buff ;
52755275
long val3 ;
52765276
int ecode3 = 0 ;
52775277
PyObject * obj1 = 0 ;
@@ -5285,14 +5285,14 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args)
52855285
}
52865286
arg1 = reinterpret_cast< Exiv2::BasicIo * >(argp1);
52875287
{
5288-
_global_view.obj = NULL;
5288+
_global_buff.obj = NULL;
52895289
if (PyObject_GetBuffer(
5290-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
5290+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
52915291
PyErr_Clear();
52925292
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "BasicIo_read" "', argument " "2"" of type '" "writable bytes-like object""'")
52935293
;
52945294
}
5295-
arg2 = (Exiv2::byte *) _global_view.buf;
5295+
arg2 = (Exiv2::byte *) _global_buff.buf;
52965296
}
52975297
ecode3 = SWIG_AsVal_long(obj2, &val3);
52985298
if (!SWIG_IsOK(ecode3)) {
@@ -5305,7 +5305,7 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args)
53055305
#endif
53065306
}
53075307
{
5308-
if (arg3 > (long) _global_view.len) {
5308+
if (arg3 > (long) _global_buff.len) {
53095309
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "BasicIo_read" "', argument " "2"" of type '" "buffer too small""'")
53105310
;
53115311
}
@@ -5328,15 +5328,15 @@ SWIGINTERN PyObject *_wrap_BasicIo_read__SWIG_1(PyObject *self, PyObject *args)
53285328
}
53295329
resultobj = SWIG_From_long(static_cast< long >(result));
53305330

5331-
if (_global_view.obj) {
5332-
PyBuffer_Release(&_global_view);
5331+
if (_global_buff.obj) {
5332+
PyBuffer_Release(&_global_buff);
53335333
}
53345334

53355335
return resultobj;
53365336
fail:
53375337

5338-
if (_global_view.obj) {
5339-
PyBuffer_Release(&_global_view);
5338+
if (_global_buff.obj) {
5339+
PyBuffer_Release(&_global_buff);
53405340
}
53415341

53425342
return NULL;

src/swig-0_27_7/exif_wrap.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6338,7 +6338,7 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
63386338
Exiv2::ByteOrder arg3 ;
63396339
void *argp1 = 0 ;
63406340
int res1 = 0 ;
6341-
Py_buffer _global_view ;
6341+
Py_buffer _global_buff ;
63426342
PyObject * obj1 = 0 ;
63436343
PyObject * obj2 = 0 ;
63446344
long result;
@@ -6350,14 +6350,14 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
63506350
}
63516351
arg1 = reinterpret_cast< ExifData_iterator * >(argp1);
63526352
{
6353-
_global_view.obj = NULL;
6353+
_global_buff.obj = NULL;
63546354
if (PyObject_GetBuffer(
6355-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
6355+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
63566356
PyErr_Clear();
63576357
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ExifData_iterator_copy" "', argument " "2"" of type '" "writable bytes-like object""'")
63586358
;
63596359
}
6360-
arg2 = (Exiv2::byte *) _global_view.buf;
6360+
arg2 = (Exiv2::byte *) _global_buff.buf;
63616361
}
63626362
{
63636363
if (!PyObject_IsInstance(obj2,
@@ -6374,7 +6374,7 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
63746374
}
63756375
{
63766376
// check buffer is large enough, assumes arg1 points to self
6377-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
6377+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
63786378
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "ExifData_iterator_copy" "', argument " "2"" of type '" "buffer too small""'")
63796379
;
63806380
}
@@ -6390,15 +6390,15 @@ SWIGINTERN PyObject *_wrap_ExifData_iterator_copy(PyObject *self, PyObject *args
63906390
}
63916391
resultobj = SWIG_From_long(static_cast< long >(result));
63926392

6393-
if (_global_view.obj) {
6394-
PyBuffer_Release(&_global_view);
6393+
if (_global_buff.obj) {
6394+
PyBuffer_Release(&_global_buff);
63956395
}
63966396

63976397
return resultobj;
63986398
fail:
63996399

6400-
if (_global_view.obj) {
6401-
PyBuffer_Release(&_global_view);
6400+
if (_global_buff.obj) {
6401+
PyBuffer_Release(&_global_buff);
64026402
}
64036403

64046404
return NULL;
@@ -7805,7 +7805,7 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
78057805
Exiv2::ByteOrder arg3 ;
78067806
void *argp1 = 0 ;
78077807
int res1 = 0 ;
7808-
Py_buffer _global_view ;
7808+
Py_buffer _global_buff ;
78097809
PyObject * obj1 = 0 ;
78107810
PyObject * obj2 = 0 ;
78117811
long result;
@@ -7817,14 +7817,14 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
78177817
}
78187818
arg1 = reinterpret_cast< Exiv2::Exifdatum * >(argp1);
78197819
{
7820-
_global_view.obj = NULL;
7820+
_global_buff.obj = NULL;
78217821
if (PyObject_GetBuffer(
7822-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
7822+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
78237823
PyErr_Clear();
78247824
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "Exifdatum_copy" "', argument " "2"" of type '" "writable bytes-like object""'")
78257825
;
78267826
}
7827-
arg2 = (Exiv2::byte *) _global_view.buf;
7827+
arg2 = (Exiv2::byte *) _global_buff.buf;
78287828
}
78297829
{
78307830
if (!PyObject_IsInstance(obj2,
@@ -7841,7 +7841,7 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
78417841
}
78427842
{
78437843
// check buffer is large enough, assumes arg1 points to self
7844-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
7844+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
78457845
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "Exifdatum_copy" "', argument " "2"" of type '" "buffer too small""'")
78467846
;
78477847
}
@@ -7857,15 +7857,15 @@ SWIGINTERN PyObject *_wrap_Exifdatum_copy(PyObject *self, PyObject *args) {
78577857
}
78587858
resultobj = SWIG_From_long(static_cast< long >(result));
78597859

7860-
if (_global_view.obj) {
7861-
PyBuffer_Release(&_global_view);
7860+
if (_global_buff.obj) {
7861+
PyBuffer_Release(&_global_buff);
78627862
}
78637863

78647864
return resultobj;
78657865
fail:
78667866

7867-
if (_global_view.obj) {
7868-
PyBuffer_Release(&_global_view);
7867+
if (_global_buff.obj) {
7868+
PyBuffer_Release(&_global_buff);
78697869
}
78707870

78717871
return NULL;

src/swig-0_27_7/iptc_wrap.cxx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5996,7 +5996,7 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
59965996
Exiv2::ByteOrder arg3 ;
59975997
void *argp1 = 0 ;
59985998
int res1 = 0 ;
5999-
Py_buffer _global_view ;
5999+
Py_buffer _global_buff ;
60006000
PyObject * obj1 = 0 ;
60016001
PyObject * obj2 = 0 ;
60026002
long result;
@@ -6008,14 +6008,14 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
60086008
}
60096009
arg1 = reinterpret_cast< IptcData_iterator * >(argp1);
60106010
{
6011-
_global_view.obj = NULL;
6011+
_global_buff.obj = NULL;
60126012
if (PyObject_GetBuffer(
6013-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
6013+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
60146014
PyErr_Clear();
60156015
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IptcData_iterator_copy" "', argument " "2"" of type '" "writable bytes-like object""'")
60166016
;
60176017
}
6018-
arg2 = (Exiv2::byte *) _global_view.buf;
6018+
arg2 = (Exiv2::byte *) _global_buff.buf;
60196019
}
60206020
{
60216021
if (!PyObject_IsInstance(obj2,
@@ -6032,7 +6032,7 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
60326032
}
60336033
{
60346034
// check buffer is large enough, assumes arg1 points to self
6035-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
6035+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
60366036
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "IptcData_iterator_copy" "', argument " "2"" of type '" "buffer too small""'")
60376037
;
60386038
}
@@ -6048,15 +6048,15 @@ SWIGINTERN PyObject *_wrap_IptcData_iterator_copy(PyObject *self, PyObject *args
60486048
}
60496049
resultobj = SWIG_From_long(static_cast< long >(result));
60506050

6051-
if (_global_view.obj) {
6052-
PyBuffer_Release(&_global_view);
6051+
if (_global_buff.obj) {
6052+
PyBuffer_Release(&_global_buff);
60536053
}
60546054

60556055
return resultobj;
60566056
fail:
60576057

6058-
if (_global_view.obj) {
6059-
PyBuffer_Release(&_global_view);
6058+
if (_global_buff.obj) {
6059+
PyBuffer_Release(&_global_buff);
60606060
}
60616061

60626062
return NULL;
@@ -7352,7 +7352,7 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
73527352
Exiv2::ByteOrder arg3 ;
73537353
void *argp1 = 0 ;
73547354
int res1 = 0 ;
7355-
Py_buffer _global_view ;
7355+
Py_buffer _global_buff ;
73567356
PyObject * obj1 = 0 ;
73577357
PyObject * obj2 = 0 ;
73587358
long result;
@@ -7364,14 +7364,14 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
73647364
}
73657365
arg1 = reinterpret_cast< Exiv2::Iptcdatum * >(argp1);
73667366
{
7367-
_global_view.obj = NULL;
7367+
_global_buff.obj = NULL;
73687368
if (PyObject_GetBuffer(
7369-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
7369+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
73707370
PyErr_Clear();
73717371
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "Iptcdatum_copy" "', argument " "2"" of type '" "writable bytes-like object""'")
73727372
;
73737373
}
7374-
arg2 = (Exiv2::byte *) _global_view.buf;
7374+
arg2 = (Exiv2::byte *) _global_buff.buf;
73757375
}
73767376
{
73777377
if (!PyObject_IsInstance(obj2,
@@ -7388,7 +7388,7 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
73887388
}
73897389
{
73907390
// check buffer is large enough, assumes arg1 points to self
7391-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
7391+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
73927392
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "Iptcdatum_copy" "', argument " "2"" of type '" "buffer too small""'")
73937393
;
73947394
}
@@ -7404,15 +7404,15 @@ SWIGINTERN PyObject *_wrap_Iptcdatum_copy(PyObject *self, PyObject *args) {
74047404
}
74057405
resultobj = SWIG_From_long(static_cast< long >(result));
74067406

7407-
if (_global_view.obj) {
7408-
PyBuffer_Release(&_global_view);
7407+
if (_global_buff.obj) {
7408+
PyBuffer_Release(&_global_buff);
74097409
}
74107410

74117411
return resultobj;
74127412
fail:
74137413

7414-
if (_global_view.obj) {
7415-
PyBuffer_Release(&_global_view);
7414+
if (_global_buff.obj) {
7415+
PyBuffer_Release(&_global_buff);
74167416
}
74177417

74187418
return NULL;

src/swig-0_27_7/metadatum_wrap.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5659,7 +5659,7 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
56595659
Exiv2::ByteOrder arg3 ;
56605660
void *argp1 = 0 ;
56615661
int res1 = 0 ;
5662-
Py_buffer _global_view ;
5662+
Py_buffer _global_buff ;
56635663
PyObject * obj1 = 0 ;
56645664
PyObject * obj2 = 0 ;
56655665
long result;
@@ -5671,14 +5671,14 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
56715671
}
56725672
arg1 = reinterpret_cast< Exiv2::Metadatum * >(argp1);
56735673
{
5674-
_global_view.obj = NULL;
5674+
_global_buff.obj = NULL;
56755675
if (PyObject_GetBuffer(
5676-
obj1, &_global_view, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
5676+
obj1, &_global_buff, PyBUF_CONTIG | PyBUF_WRITABLE) < 0) {
56775677
PyErr_Clear();
56785678
SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "Metadatum_copy" "', argument " "2"" of type '" "writable bytes-like object""'")
56795679
;
56805680
}
5681-
arg2 = (Exiv2::byte *) _global_view.buf;
5681+
arg2 = (Exiv2::byte *) _global_buff.buf;
56825682
}
56835683
{
56845684
if (!PyObject_IsInstance(obj2,
@@ -5695,7 +5695,7 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
56955695
}
56965696
{
56975697
// check buffer is large enough, assumes arg1 points to self
5698-
if ((Py_ssize_t) arg1->size() > _global_view.len) {
5698+
if ((Py_ssize_t) arg1->size() > _global_buff.len) {
56995699
SWIG_exception_fail(SWIG_ArgError(SWIG_ValueError), "in method '" "Metadatum_copy" "', argument " "2"" of type '" "buffer too small""'")
57005700
;
57015701
}
@@ -5711,15 +5711,15 @@ SWIGINTERN PyObject *_wrap_Metadatum_copy(PyObject *self, PyObject *args) {
57115711
}
57125712
resultobj = SWIG_From_long(static_cast< long >(result));
57135713

5714-
if (_global_view.obj) {
5715-
PyBuffer_Release(&_global_view);
5714+
if (_global_buff.obj) {
5715+
PyBuffer_Release(&_global_buff);
57165716
}
57175717

57185718
return resultobj;
57195719
fail:
57205720

5721-
if (_global_view.obj) {
5722-
PyBuffer_Release(&_global_view);
5721+
if (_global_buff.obj) {
5722+
PyBuffer_Release(&_global_buff);
57235723
}
57245724

57255725
return NULL;

0 commit comments

Comments
 (0)