Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04f9508

Browse files
committed
Silence some C compiler warnings.
1 parent7cbda8e commit04f9508

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

‎Cython/Compiler/Code.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,7 +3241,7 @@ def declare_gilstate(self):
32413241
defput_error_if_neg(self,pos,value):
32423242
# TODO this path is almost _never_ taken, yet this macro makes is slower!
32433243
# return self.putln("if (unlikely(%s < 0)) %s" % (value, self.error_goto(pos)))
3244-
returnself.putln("if (%s <0) %s"% (value,self.error_goto(pos)))
3244+
returnself.putln("if (%s <(0)) %s"% (value,self.error_goto(pos)))
32453245

32463246
defput_error_if_unbound(self,pos,entry,in_nogil_context=False,unbound_check_code=None):
32473247
nogil_tag="Nogil"ifin_nogil_contextelse""

‎Cython/Utility/CppConvert.pyx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cdef extern from *:
3131

3232
@cname("{{cname.replace("PyObject", py_type, 1)}}")
3333
cdef inlineobject {{cname.replace("PyObject", py_type,1)}}(const string& s):
34-
return __Pyx_{{py_type}}_FromStringAndSize(s.data(), s.size())
34+
return __Pyx_{{py_type}}_FromStringAndSize(s.data(),<Py_ssize_t>s.size())
3535
{{endfor}}
3636

3737

‎Cython/Utility/CythonFunction.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
15571557
Py_DECREF(item);
15581558
#endif
15591559
if (unlikely(!string)) goto__pyx_err;
1560-
if (__Pyx_PyList_SET_ITEM(list,i,string)<0) goto__pyx_err;
1560+
if (__Pyx_PyList_SET_ITEM(list,i,string)<(0)) goto__pyx_err;
15611561
}
15621562

15631563
signature=PyUnicode_Join(PYUNICODE("|"),list);
@@ -1637,7 +1637,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
16371637
self=binding_func->self;
16381638

16391639
Py_INCREF(self);
1640-
if (__Pyx_PyTuple_SET_ITEM(new_args,0,self)) gotobad;
1640+
if (__Pyx_PyTuple_SET_ITEM(new_args,0,self)< (0)) gotobad;
16411641
self=NULL;
16421642

16431643
for (i=0;i<argc;i++) {
@@ -1647,7 +1647,7 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
16471647
#else
16481648
PyObject*item=__Pyx_PySequence_ITEM(args,i);if (unlikely(!item)) gotobad;
16491649
#endif
1650-
if (__Pyx_PyTuple_SET_ITEM(new_args,i+1,item)) gotobad;
1650+
if (__Pyx_PyTuple_SET_ITEM(new_args,i+1,item)< (0)) gotobad;
16511651
}
16521652

16531653
args=new_args;

‎Cython/Utility/ObjectHandling.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
821821
res=PyTuple_New(n);
822822
if (unlikely(res==NULL))returnNULL;
823823
for (i=0;i<n;i++) {
824-
if (unlikely(__Pyx_PyTuple_SET_ITEM(res,i,src[i])<0)) {
824+
if (unlikely(__Pyx_PyTuple_SET_ITEM(res,i,src[i])<(0))) {
825825
Py_DECREF(res);
826826
returnNULL;
827827
}

‎Cython/Utility/StringTools.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
580580
constchar*encoding,constchar*errors,
581581
PyObject* (*decode_func)(constchar*s,Py_ssize_tsize,constchar*errors)) {
582582
return__Pyx_decode_c_bytes(
583-
cppstring.data(),cppstring.size(),start,stop,encoding,errors,decode_func);
583+
cppstring.data(),(Py_ssize_t)cppstring.size(),start,stop,encoding,errors,decode_func);
584584
}
585585

586586
/////////////// decode_cpp_string_view.proto ///////////////
@@ -592,7 +592,7 @@ static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string_view(
592592
constchar*encoding,constchar*errors,
593593
PyObject* (*decode_func)(constchar*s,Py_ssize_tsize,constchar*errors)) {
594594
return__Pyx_decode_c_bytes(
595-
cppstring.data(),cppstring.size(),start,stop,encoding,errors,decode_func);
595+
cppstring.data(),(Py_ssize_t)cppstring.size(),start,stop,encoding,errors,decode_func);
596596
}
597597

598598
/////////////// decode_c_string.proto ///////////////

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp