diff --git a/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/index.html b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/index.html new file mode 100644 index 0000000..e45957c --- /dev/null +++ b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/index.html @@ -0,0 +1,114 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + + +
+ +
+ + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+
+ + + diff --git a/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/stats.html b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/stats.html new file mode 100644 index 0000000..4142bf1 --- /dev/null +++ b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/stats.html @@ -0,0 +1,102 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + + +
+ +
+ +
+
+ + + diff --git a/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/style.css b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/style.css new file mode 100644 index 0000000..07125f4 --- /dev/null +++ b/2021-10-13-142008-6609-cppcheck@0d043da76d00_memory_array/style.css @@ -0,0 +1,137 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + margin: 0; + width: auto; +} + +h1 { + margin: 10px; +} + +.header { + border-bottom: thin solid #aaa; +} + +.footer { + border-top: thin solid #aaa; + font-size: 90%; + margin-top: 5px; +} + +.footer ul { + list-style-type: none; + padding-left: 0; +} + +.footer > p { + margin: 4px; +} + +.wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +#menu, +#menu_index { + text-align: left; + width: 350px; + height: 90vh; + min-height: 200px; + overflow: auto; + position: -webkit-sticky; + position: sticky; + top: 0; + padding: 0 15px 15px 15px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +#content, +#content_index { + background-color: #fff; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 0 15px 15px 15px; + width: calc(100% - 350px); + height: 100%; + overflow-x: auto; +} + +#filename { + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + z-index: 10; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.d-none { + display: none; +} diff --git a/2021-10-13-172159-5551-1@08fffe437485_memory_array/index.html b/2021-10-13-172159-5551-1@08fffe437485_memory_array/index.html new file mode 100644 index 0000000..9c58a38 --- /dev/null +++ b/2021-10-13-172159-5551-1@08fffe437485_memory_array/index.html @@ -0,0 +1,97 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@b6360d00b20a
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 12.0.1 (Fedora 12.0.1-1.fc34) +
Date:Wed Oct 13 17:21:59 2021
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs2
Logic error
Potential unintended use of sizeof() on pointer type2
+

Reports

+ + + + + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function801View Report
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function801View Report
+ + diff --git a/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-4c482f.html b/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-4c482f.html new file mode 100644 index 0000000..ddcf7ea --- /dev/null +++ b/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-4c482f.html @@ -0,0 +1,736 @@ + + + +/usr/include/python3.9/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 80, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name caja-python.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/12.0.1 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.9" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.9 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/12.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir /rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -o /rootdir/html-report/2021-10-13-172159-5551-1 -x c caja-python.c +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9/* === Object Protocol ================================================== */
10
11#ifdef PY_SSIZE_T_CLEAN
12# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
13#endif
14
15/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
16 format to a Python dictionary ("kwargs" dict).
17
18 The type of kwnames keys is not checked. The final function getting
19 arguments is responsible to check if all keys are strings, for example using
20 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
21
22 Duplicate keys are merged using the last value. If duplicate keys must raise
23 an exception, the caller is responsible to implement an explicit keys on
24 kwnames. */
25PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
26 PyObject *const *values,
27 PyObject *kwnames);
28
29/* Suggested size (number of positional arguments) for arrays of PyObject*
30 allocated on a C stack to avoid allocating memory on the heap memory. Such
31 array is used to pass positional arguments to call functions of the
32 PyObject_Vectorcall() family.
33
34 The size is chosen to not abuse the C stack and so limit the risk of stack
35 overflow. The size is also chosen to allow using the small stack for most
36 function calls of the Python standard library. On 64-bit CPU, it allocates
37 40 bytes on the stack. */
38#define _PY_FASTCALL_SMALL_STACK5 5
39
40PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
41 PyThreadState *tstate,
42 PyObject *callable,
43 PyObject *result,
44 const char *where);
45
46/* === Vectorcall protocol (PEP 590) ============================= */
47
48/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
49 or PyObject_FastCallDict() (both forms are supported),
50 except that nargs is plainly the number of arguments without flags. */
51PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
52 PyThreadState *tstate,
53 PyObject *callable,
54 PyObject *const *args, Py_ssize_t nargs,
55 PyObject *keywords);
56
57#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
58
59static inline Py_ssize_t
60PyVectorcall_NARGS(size_t n)
61{
62 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
63}
64
65static inline vectorcallfunc
66PyVectorcall_Function(PyObject *callable)
67{
68 PyTypeObject *tp;
69 Py_ssize_t offset;
70 vectorcallfunc ptr;
71
72 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.9/cpython/abstract.h", 72, __extension__
__PRETTY_FUNCTION__); }))
;
73 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
74 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
75 return NULL((void*)0);
76 }
77 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.9/cpython/abstract.h", 77, __extension__
__PRETTY_FUNCTION__); }))
;
78 offset = tp->tp_vectorcall_offset;
79 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.9/cpython/abstract.h"
, 79, __extension__ __PRETTY_FUNCTION__); }))
;
80 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
81 return ptr;
82}
83
84/* Call the callable object 'callable' with the "vectorcall" calling
85 convention.
86
87 args is a C array for positional arguments.
88
89 nargsf is the number of positional arguments plus optionally the flag
90 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
91 modify args[-1].
92
93 kwnames is a tuple of keyword names. The values of the keyword arguments
94 are stored in "args" after the positional arguments (note that the number
95 of keyword arguments does not change nargsf). kwnames can also be NULL if
96 there are no keyword arguments.
97
98 keywords must only contain strings and all keys must be unique.
99
100 Return the result on success. Raise an exception and return NULL on
101 error. */
102static inline PyObject *
103_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
104 PyObject *const *args, size_t nargsf,
105 PyObject *kwnames)
106{
107 vectorcallfunc func;
108 PyObject *res;
109
110 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.9/cpython/abstract.h"
, 110, __extension__ __PRETTY_FUNCTION__); }))
;
111 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.9/cpython/abstract.h", 111, __extension__
__PRETTY_FUNCTION__); }))
;
112
113 func = PyVectorcall_Function(callable);
114 if (func == NULL((void*)0)) {
115 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
116 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
117 }
118 res = func(callable, args, nargsf, kwnames);
119 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
120}
121
122static inline PyObject *
123PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
124 size_t nargsf, PyObject *kwnames)
125{
126 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
127 return _PyObject_VectorcallTstate(tstate, callable,
128 args, nargsf, kwnames);
129}
130
131// Backwards compatibility aliases for API that was provisional in Python 3.8
132#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
133#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
134#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
135#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
136#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
137#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
138#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
139
140/* Same as PyObject_Vectorcall except that keyword arguments are passed as
141 dict, which may be NULL if there are no keyword arguments. */
142PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
143 PyObject *callable,
144 PyObject *const *args,
145 size_t nargsf,
146 PyObject *kwargs);
147
148/* Call "callable" (which must support vectorcall) with positional arguments
149 "tuple" and keyword arguments "dict". "dict" may also be NULL */
150PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
151
152static inline PyObject *
153_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
154{
155 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
156}
157
158/* Same as PyObject_Vectorcall except without keyword arguments */
159static inline PyObject *
160_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
161{
162 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
163 return _PyObject_FastCallTstate(tstate, func, args, nargs);
164}
165
166/* Call a callable without any arguments
167 Private static inline function variant of public function
168 PyObject_CallNoArgs(). */
169static inline PyObject *
170_PyObject_CallNoArg(PyObject *func) {
171 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
172 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
173}
174
175static inline PyObject *
176PyObject_CallOneArg(PyObject *func, PyObject *arg)
177{
178 PyObject *_args[2];
179 PyObject **args;
180 PyThreadState *tstate;
181 size_t nargsf;
182
183 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 183, __extension__
__PRETTY_FUNCTION__); }))
;
184 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
185 args[0] = arg;
186 tstate = PyThreadState_GET()PyThreadState_Get();
187 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
188 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
189}
190
191PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
192 PyObject *name, PyObject *const *args,
193 size_t nargsf, PyObject *kwnames);
194
195static inline PyObject *
196PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
197{
198 return PyObject_VectorcallMethod(name, &self,
199 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
200}
201
202static inline PyObject *
203PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
204{
205 PyObject *args[2] = {self, arg};
206
207 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 207, __extension__
__PRETTY_FUNCTION__); }))
;
208 return PyObject_VectorcallMethod(name, args,
209 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
210}
211
212/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
213 as the method name. */
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format, ...);
217
218PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
219 _Py_Identifier *name,
220 const char *format,
221 ...);
222
223PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
224 PyObject *obj,
225 struct _Py_Identifier *name,
226 ...);
227
228static inline PyObject *
229_PyObject_VectorcallMethodId(
230 _Py_Identifier *name, PyObject *const *args,
231 size_t nargsf, PyObject *kwnames)
232{
233 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
234 if (!oname) {
235 return NULL((void*)0);
236 }
237 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
238}
239
240static inline PyObject *
241_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
242{
243 return _PyObject_VectorcallMethodId(name, &self,
244 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
245}
246
247static inline PyObject *
248_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
249{
250 PyObject *args[2] = {self, arg};
251
252 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 252, __extension__
__PRETTY_FUNCTION__); }))
;
253 return _PyObject_VectorcallMethodId(name, args,
254 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
255}
256
257PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
258
259/* Guess the size of object 'o' using len(o) or o.__length_hint__().
260 If neither of those return a non-negative value, then return the default
261 value. If one of the calls fails, this function returns -1. */
262PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
263
264/* === New Buffer API ============================================ */
265
266/* Return 1 if the getbuffer function is available, otherwise return 0. */
267PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
268
269/* This is a C-API version of the getbuffer function call. It checks
270 to make sure object has the required function pointer and issues the
271 call.
272
273 Returns -1 and raises an error on failure and returns 0 on success. */
274PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
275 int flags);
276
277/* Get the memory area pointed to by the indices for the buffer given.
278 Note that view->ndim is the assumed size of indices. */
279PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
280
281/* Return the implied itemsize of the data-format area from a
282 struct-style description. */
283PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
284
285/* Implementation in memoryobject.c */
286PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
287 Py_ssize_t len, char order);
288
289PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
290 Py_ssize_t len, char order);
291
292/* Copy len bytes of data from the contiguous chunk of memory
293 pointed to by buf into the buffer exported by obj. Return
294 0 on success and return -1 and raise a PyBuffer_Error on
295 error (i.e. the object does not have a buffer interface or
296 it is not working).
297
298 If fort is 'F', then if the object is multi-dimensional,
299 then the data will be copied into the array in
300 Fortran-style (first dimension varies the fastest). If
301 fort is 'C', then the data will be copied into the array
302 in C-style (last dimension varies the fastest). If fort
303 is 'A', then it does not matter and the copy will be made
304 in whatever way is more efficient. */
305PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
306
307/* Copy the data from the src buffer to the buffer of destination. */
308PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
309
310/*Fill the strides array with byte-strides of a contiguous
311 (Fortran-style if fort is 'F' or C-style otherwise)
312 array of the given shape with the given number of bytes
313 per element. */
314PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
315 Py_ssize_t *shape,
316 Py_ssize_t *strides,
317 int itemsize,
318 char fort);
319
320/* Fills in a buffer-info structure correctly for an exporter
321 that can only share a contiguous chunk of memory of
322 "unsigned bytes" of the given length.
323
324 Returns 0 on success and -1 (with raising an error) on error. */
325PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
326 Py_ssize_t len, int readonly,
327 int flags);
328
329/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
330PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
331
332/* ==== Iterators ================================================ */
333
334#define PyIter_Check(obj)((((PyObject*)(obj))->ob_type)->tp_iternext != ((void*)
0) && (((PyObject*)(obj))->ob_type)->tp_iternext
!= &_PyObject_NextNotImplemented)
\
335 (Py_TYPE(obj)(((PyObject*)(obj))->ob_type)->tp_iternext != NULL((void*)0) && \
336 Py_TYPE(obj)(((PyObject*)(obj))->ob_type)->tp_iternext != &_PyObject_NextNotImplemented)
337
338/* === Sequence protocol ================================================ */
339
340/* Assume tp_as_sequence and sq_item exist and that 'i' does not
341 need to be corrected for a negative index. */
342#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
343 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
344
345#define PY_ITERSEARCH_COUNT1 1
346#define PY_ITERSEARCH_INDEX2 2
347#define PY_ITERSEARCH_CONTAINS3 3
348
349/* Iterate over seq.
350
351 Result depends on the operation:
352
353 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
354 error.
355 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
356 obj in seq; set ValueError and return -1 if none found;
357 also return -1 on error.
358 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
359 error. */
360PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
361 PyObject *obj, int operation);
362
363/* === Mapping protocol ================================================= */
364
365PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
366
367PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
368
369PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
370
371PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
372
373/* For internal use by buffer API functions */
374PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
375 const Py_ssize_t *shape);
376PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
377 const Py_ssize_t *shape);
378
379/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
380PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
381
382#ifdef __cplusplus
383}
384#endif
diff --git a/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-53a9a5.html b/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-53a9a5.html new file mode 100644 index 0000000..9accf76 --- /dev/null +++ b/2021-10-13-172159-5551-1@08fffe437485_memory_array/report-53a9a5.html @@ -0,0 +1,736 @@ + + + +/usr/include/python3.9/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 80, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/12.0.1 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.9" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.9 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/12.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir /rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -o /rootdir/html-report/2021-10-13-172159-5551-1 -x c caja-python-object.c +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9/* === Object Protocol ================================================== */
10
11#ifdef PY_SSIZE_T_CLEAN
12# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
13#endif
14
15/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
16 format to a Python dictionary ("kwargs" dict).
17
18 The type of kwnames keys is not checked. The final function getting
19 arguments is responsible to check if all keys are strings, for example using
20 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
21
22 Duplicate keys are merged using the last value. If duplicate keys must raise
23 an exception, the caller is responsible to implement an explicit keys on
24 kwnames. */
25PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
26 PyObject *const *values,
27 PyObject *kwnames);
28
29/* Suggested size (number of positional arguments) for arrays of PyObject*
30 allocated on a C stack to avoid allocating memory on the heap memory. Such
31 array is used to pass positional arguments to call functions of the
32 PyObject_Vectorcall() family.
33
34 The size is chosen to not abuse the C stack and so limit the risk of stack
35 overflow. The size is also chosen to allow using the small stack for most
36 function calls of the Python standard library. On 64-bit CPU, it allocates
37 40 bytes on the stack. */
38#define _PY_FASTCALL_SMALL_STACK5 5
39
40PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
41 PyThreadState *tstate,
42 PyObject *callable,
43 PyObject *result,
44 const char *where);
45
46/* === Vectorcall protocol (PEP 590) ============================= */
47
48/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
49 or PyObject_FastCallDict() (both forms are supported),
50 except that nargs is plainly the number of arguments without flags. */
51PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
52 PyThreadState *tstate,
53 PyObject *callable,
54 PyObject *const *args, Py_ssize_t nargs,
55 PyObject *keywords);
56
57#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
58
59static inline Py_ssize_t
60PyVectorcall_NARGS(size_t n)
61{
62 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
63}
64
65static inline vectorcallfunc
66PyVectorcall_Function(PyObject *callable)
67{
68 PyTypeObject *tp;
69 Py_ssize_t offset;
70 vectorcallfunc ptr;
71
72 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.9/cpython/abstract.h", 72, __extension__
__PRETTY_FUNCTION__); }))
;
73 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
74 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
75 return NULL((void*)0);
76 }
77 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.9/cpython/abstract.h", 77, __extension__
__PRETTY_FUNCTION__); }))
;
78 offset = tp->tp_vectorcall_offset;
79 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.9/cpython/abstract.h"
, 79, __extension__ __PRETTY_FUNCTION__); }))
;
80 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
81 return ptr;
82}
83
84/* Call the callable object 'callable' with the "vectorcall" calling
85 convention.
86
87 args is a C array for positional arguments.
88
89 nargsf is the number of positional arguments plus optionally the flag
90 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
91 modify args[-1].
92
93 kwnames is a tuple of keyword names. The values of the keyword arguments
94 are stored in "args" after the positional arguments (note that the number
95 of keyword arguments does not change nargsf). kwnames can also be NULL if
96 there are no keyword arguments.
97
98 keywords must only contain strings and all keys must be unique.
99
100 Return the result on success. Raise an exception and return NULL on
101 error. */
102static inline PyObject *
103_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
104 PyObject *const *args, size_t nargsf,
105 PyObject *kwnames)
106{
107 vectorcallfunc func;
108 PyObject *res;
109
110 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.9/cpython/abstract.h"
, 110, __extension__ __PRETTY_FUNCTION__); }))
;
111 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.9/cpython/abstract.h", 111, __extension__
__PRETTY_FUNCTION__); }))
;
112
113 func = PyVectorcall_Function(callable);
114 if (func == NULL((void*)0)) {
115 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
116 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
117 }
118 res = func(callable, args, nargsf, kwnames);
119 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
120}
121
122static inline PyObject *
123PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
124 size_t nargsf, PyObject *kwnames)
125{
126 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
127 return _PyObject_VectorcallTstate(tstate, callable,
128 args, nargsf, kwnames);
129}
130
131// Backwards compatibility aliases for API that was provisional in Python 3.8
132#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
133#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
134#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
135#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
136#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
137#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
138#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
139
140/* Same as PyObject_Vectorcall except that keyword arguments are passed as
141 dict, which may be NULL if there are no keyword arguments. */
142PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
143 PyObject *callable,
144 PyObject *const *args,
145 size_t nargsf,
146 PyObject *kwargs);
147
148/* Call "callable" (which must support vectorcall) with positional arguments
149 "tuple" and keyword arguments "dict". "dict" may also be NULL */
150PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
151
152static inline PyObject *
153_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
154{
155 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
156}
157
158/* Same as PyObject_Vectorcall except without keyword arguments */
159static inline PyObject *
160_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
161{
162 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
163 return _PyObject_FastCallTstate(tstate, func, args, nargs);
164}
165
166/* Call a callable without any arguments
167 Private static inline function variant of public function
168 PyObject_CallNoArgs(). */
169static inline PyObject *
170_PyObject_CallNoArg(PyObject *func) {
171 PyThreadState *tstate = PyThreadState_GET()PyThreadState_Get();
172 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
173}
174
175static inline PyObject *
176PyObject_CallOneArg(PyObject *func, PyObject *arg)
177{
178 PyObject *_args[2];
179 PyObject **args;
180 PyThreadState *tstate;
181 size_t nargsf;
182
183 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 183, __extension__
__PRETTY_FUNCTION__); }))
;
184 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
185 args[0] = arg;
186 tstate = PyThreadState_GET()PyThreadState_Get();
187 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
188 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
189}
190
191PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
192 PyObject *name, PyObject *const *args,
193 size_t nargsf, PyObject *kwnames);
194
195static inline PyObject *
196PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
197{
198 return PyObject_VectorcallMethod(name, &self,
199 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
200}
201
202static inline PyObject *
203PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
204{
205 PyObject *args[2] = {self, arg};
206
207 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 207, __extension__
__PRETTY_FUNCTION__); }))
;
208 return PyObject_VectorcallMethod(name, args,
209 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
210}
211
212/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
213 as the method name. */
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format, ...);
217
218PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
219 _Py_Identifier *name,
220 const char *format,
221 ...);
222
223PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
224 PyObject *obj,
225 struct _Py_Identifier *name,
226 ...);
227
228static inline PyObject *
229_PyObject_VectorcallMethodId(
230 _Py_Identifier *name, PyObject *const *args,
231 size_t nargsf, PyObject *kwnames)
232{
233 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
234 if (!oname) {
235 return NULL((void*)0);
236 }
237 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
238}
239
240static inline PyObject *
241_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
242{
243 return _PyObject_VectorcallMethodId(name, &self,
244 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
245}
246
247static inline PyObject *
248_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
249{
250 PyObject *args[2] = {self, arg};
251
252 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.9/cpython/abstract.h", 252, __extension__
__PRETTY_FUNCTION__); }))
;
253 return _PyObject_VectorcallMethodId(name, args,
254 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
255}
256
257PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
258
259/* Guess the size of object 'o' using len(o) or o.__length_hint__().
260 If neither of those return a non-negative value, then return the default
261 value. If one of the calls fails, this function returns -1. */
262PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
263
264/* === New Buffer API ============================================ */
265
266/* Return 1 if the getbuffer function is available, otherwise return 0. */
267PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
268
269/* This is a C-API version of the getbuffer function call. It checks
270 to make sure object has the required function pointer and issues the
271 call.
272
273 Returns -1 and raises an error on failure and returns 0 on success. */
274PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
275 int flags);
276
277/* Get the memory area pointed to by the indices for the buffer given.
278 Note that view->ndim is the assumed size of indices. */
279PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
280
281/* Return the implied itemsize of the data-format area from a
282 struct-style description. */
283PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
284
285/* Implementation in memoryobject.c */
286PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
287 Py_ssize_t len, char order);
288
289PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
290 Py_ssize_t len, char order);
291
292/* Copy len bytes of data from the contiguous chunk of memory
293 pointed to by buf into the buffer exported by obj. Return
294 0 on success and return -1 and raise a PyBuffer_Error on
295 error (i.e. the object does not have a buffer interface or
296 it is not working).
297
298 If fort is 'F', then if the object is multi-dimensional,
299 then the data will be copied into the array in
300 Fortran-style (first dimension varies the fastest). If
301 fort is 'C', then the data will be copied into the array
302 in C-style (last dimension varies the fastest). If fort
303 is 'A', then it does not matter and the copy will be made
304 in whatever way is more efficient. */
305PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
306
307/* Copy the data from the src buffer to the buffer of destination. */
308PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
309
310/*Fill the strides array with byte-strides of a contiguous
311 (Fortran-style if fort is 'F' or C-style otherwise)
312 array of the given shape with the given number of bytes
313 per element. */
314PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
315 Py_ssize_t *shape,
316 Py_ssize_t *strides,
317 int itemsize,
318 char fort);
319
320/* Fills in a buffer-info structure correctly for an exporter
321 that can only share a contiguous chunk of memory of
322 "unsigned bytes" of the given length.
323
324 Returns 0 on success and -1 (with raising an error) on error. */
325PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
326 Py_ssize_t len, int readonly,
327 int flags);
328
329/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
330PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
331
332/* ==== Iterators ================================================ */
333
334#define PyIter_Check(obj)((((PyObject*)(obj))->ob_type)->tp_iternext != ((void*)
0) && (((PyObject*)(obj))->ob_type)->tp_iternext
!= &_PyObject_NextNotImplemented)
\
335 (Py_TYPE(obj)(((PyObject*)(obj))->ob_type)->tp_iternext != NULL((void*)0) && \
336 Py_TYPE(obj)(((PyObject*)(obj))->ob_type)->tp_iternext != &_PyObject_NextNotImplemented)
337
338/* === Sequence protocol ================================================ */
339
340/* Assume tp_as_sequence and sq_item exist and that 'i' does not
341 need to be corrected for a negative index. */
342#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
343 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
344
345#define PY_ITERSEARCH_COUNT1 1
346#define PY_ITERSEARCH_INDEX2 2
347#define PY_ITERSEARCH_CONTAINS3 3
348
349/* Iterate over seq.
350
351 Result depends on the operation:
352
353 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
354 error.
355 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
356 obj in seq; set ValueError and return -1 if none found;
357 also return -1 on error.
358 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
359 error. */
360PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
361 PyObject *obj, int operation);
362
363/* === Mapping protocol ================================================= */
364
365PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
366
367PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
368
369PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
370
371PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
372
373/* For internal use by buffer API functions */
374PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
375 const Py_ssize_t *shape);
376PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
377 const Py_ssize_t *shape);
378
379/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
380PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
381
382#ifdef __cplusplus
383}
384#endif
diff --git a/2021-10-13-172159-5551-1@08fffe437485_memory_array/scanview.css b/2021-10-13-172159-5551-1@08fffe437485_memory_array/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2021-10-13-172159-5551-1@08fffe437485_memory_array/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2021-10-13-172159-5551-1@08fffe437485_memory_array/sorttable.js b/2021-10-13-172159-5551-1@08fffe437485_memory_array/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2021-10-13-172159-5551-1@08fffe437485_memory_array/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + + +
+ +
+ + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+
+ + + diff --git a/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/stats.html b/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/stats.html new file mode 100644 index 0000000..4142bf1 --- /dev/null +++ b/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/stats.html @@ -0,0 +1,102 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + + +
+ +
+ +
+
+ + + diff --git a/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/style.css b/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/style.css new file mode 100644 index 0000000..07125f4 --- /dev/null +++ b/2021-10-13-172207-1193-cppcheck@08fffe437485_memory_array/style.css @@ -0,0 +1,137 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + margin: 0; + width: auto; +} + +h1 { + margin: 10px; +} + +.header { + border-bottom: thin solid #aaa; +} + +.footer { + border-top: thin solid #aaa; + font-size: 90%; + margin-top: 5px; +} + +.footer ul { + list-style-type: none; + padding-left: 0; +} + +.footer > p { + margin: 4px; +} + +.wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +#menu, +#menu_index { + text-align: left; + width: 350px; + height: 90vh; + min-height: 200px; + overflow: auto; + position: -webkit-sticky; + position: sticky; + top: 0; + padding: 0 15px 15px 15px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +#content, +#content_index { + background-color: #fff; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 0 15px 15px 15px; + width: calc(100% - 350px); + height: 100%; + overflow-x: auto; +} + +#filename { + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + z-index: 10; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.d-none { + display: none; +} diff --git a/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/index.html b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/index.html new file mode 100644 index 0000000..8c101fc --- /dev/null +++ b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/index.html @@ -0,0 +1,97 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@6cfd3f155c16
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 13.0.0 (Fedora 13.0.0-3.fc35) +
Date:Sat Dec 11 15:19:18 2021
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs2
Logic error
Potential unintended use of sizeof() on pointer type2
+

Reports

+ + + + + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-3dce2a.html b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-3dce2a.html new file mode 100644 index 0000000..1e532a1 --- /dev/null +++ b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-3dce2a.html @@ -0,0 +1,725 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name caja-python.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/13.0.0 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2021-12-11-151918-5640-1 -x c caja-python.c +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-9baebd.html b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-9baebd.html new file mode 100644 index 0000000..b909eec --- /dev/null +++ b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/report-9baebd.html @@ -0,0 +1,725 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/13.0.0 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2021-12-11-151918-5640-1 -x c caja-python-object.c +
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/scanview.css b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/sorttable.js b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2021-12-11-151918-5640-1@9b8b3fb98ee4_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + + +
+ +
+ + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+
+ + + diff --git a/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/stats.html b/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/stats.html new file mode 100644 index 0000000..4142bf1 --- /dev/null +++ b/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/stats.html @@ -0,0 +1,102 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + + +
+ +
+ +
+
+ + + diff --git a/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/style.css b/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/style.css new file mode 100644 index 0000000..07125f4 --- /dev/null +++ b/2021-12-11-151924-6773-cppcheck@9b8b3fb98ee4_master/style.css @@ -0,0 +1,137 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + margin: 0; + width: auto; +} + +h1 { + margin: 10px; +} + +.header { + border-bottom: thin solid #aaa; +} + +.footer { + border-top: thin solid #aaa; + font-size: 90%; + margin-top: 5px; +} + +.footer ul { + list-style-type: none; + padding-left: 0; +} + +.footer > p { + margin: 4px; +} + +.wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +#menu, +#menu_index { + text-align: left; + width: 350px; + height: 90vh; + min-height: 200px; + overflow: auto; + position: -webkit-sticky; + position: sticky; + top: 0; + padding: 0 15px 15px 15px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +#content, +#content_index { + background-color: #fff; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + padding: 0 15px 15px 15px; + width: calc(100% - 350px); + height: 100%; + overflow-x: auto; +} + +#filename { + margin-left: 10px; + font-size: 12px; + z-index: 1; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + z-index: 10; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.d-none { + display: none; +} diff --git a/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/index.html b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/index.html new file mode 100644 index 0000000..b6951ad --- /dev/null +++ b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@42e49a146327
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.0 (Fedora 14.0.0-1.fc36) +
Date:Wed Jun 1 14:37:42 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/report-edc6e6.html b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/report-edc6e6.html new file mode 100644 index 0000000..9412933 --- /dev/null +++ b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.0 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-06-01-143742-5678-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/scanview.css b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/sorttable.js b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-06-01-143742-5678-1@7f84832bbd45_configure_220601/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/stats.html b/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/style.css b/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-06-01-143749-4090-cppcheck@7f84832bbd45_configure_220601/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2022-10-28-213547-5732-1@4ccf751fd04c_master/index.html b/2022-10-28-213547-5732-1@4ccf751fd04c_master/index.html new file mode 100644 index 0000000..57714b3 --- /dev/null +++ b/2022-10-28-213547-5732-1@4ccf751fd04c_master/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@f5e19891bbc6
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.5 (Fedora 14.0.5-1.fc36) +
Date:Fri Oct 28 21:35:47 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-10-28-213547-5732-1@4ccf751fd04c_master/report-edc6e6.html b/2022-10-28-213547-5732-1@4ccf751fd04c_master/report-edc6e6.html new file mode 100644 index 0000000..2e05fde --- /dev/null +++ b/2022-10-28-213547-5732-1@4ccf751fd04c_master/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-28-213547-5732-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-10-28-213547-5732-1@4ccf751fd04c_master/scanview.css b/2022-10-28-213547-5732-1@4ccf751fd04c_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-10-28-213547-5732-1@4ccf751fd04c_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-10-28-213547-5732-1@4ccf751fd04c_master/sorttable.js b/2022-10-28-213547-5732-1@4ccf751fd04c_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-10-28-213547-5732-1@4ccf751fd04c_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/stats.html b/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/style.css b/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-10-28-213553-7852-cppcheck@4ccf751fd04c_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2022-10-29-135620-5732-1@f7805eff727a_master/index.html b/2022-10-29-135620-5732-1@f7805eff727a_master/index.html new file mode 100644 index 0000000..7e1ccc4 --- /dev/null +++ b/2022-10-29-135620-5732-1@f7805eff727a_master/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@5f860f2c0383
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.5 (Fedora 14.0.5-1.fc36) +
Date:Sat Oct 29 13:56:20 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-10-29-135620-5732-1@f7805eff727a_master/report-edc6e6.html b/2022-10-29-135620-5732-1@f7805eff727a_master/report-edc6e6.html new file mode 100644 index 0000000..3b0e226 --- /dev/null +++ b/2022-10-29-135620-5732-1@f7805eff727a_master/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-10-29-135620-5732-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-10-29-135620-5732-1@f7805eff727a_master/scanview.css b/2022-10-29-135620-5732-1@f7805eff727a_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-10-29-135620-5732-1@f7805eff727a_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-10-29-135620-5732-1@f7805eff727a_master/sorttable.js b/2022-10-29-135620-5732-1@f7805eff727a_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-10-29-135620-5732-1@f7805eff727a_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/stats.html b/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/style.css b/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-10-29-135625-8387-cppcheck@f7805eff727a_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2022-11-11-183716-5590-1@256fdf2a79ff_master/index.html b/2022-11-11-183716-5590-1@256fdf2a79ff_master/index.html new file mode 100644 index 0000000..f4968ff --- /dev/null +++ b/2022-11-11-183716-5590-1@256fdf2a79ff_master/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@21f6e2f2ea3c
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.5 (Fedora 14.0.5-1.fc36) +
Date:Fri Nov 11 18:37:16 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-11-11-183716-5590-1@256fdf2a79ff_master/report-edc6e6.html b/2022-11-11-183716-5590-1@256fdf2a79ff_master/report-edc6e6.html new file mode 100644 index 0000000..0373fc9 --- /dev/null +++ b/2022-11-11-183716-5590-1@256fdf2a79ff_master/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-11-11-183716-5590-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-11-11-183716-5590-1@256fdf2a79ff_master/scanview.css b/2022-11-11-183716-5590-1@256fdf2a79ff_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-11-11-183716-5590-1@256fdf2a79ff_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-11-11-183716-5590-1@256fdf2a79ff_master/sorttable.js b/2022-11-11-183716-5590-1@256fdf2a79ff_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-11-11-183716-5590-1@256fdf2a79ff_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/stats.html b/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/style.css b/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-11-11-183722-0591-cppcheck@256fdf2a79ff_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2022-11-11-201747-5593-1@779bfe1003e7_master/index.html b/2022-11-11-201747-5593-1@779bfe1003e7_master/index.html new file mode 100644 index 0000000..e6e1245 --- /dev/null +++ b/2022-11-11-201747-5593-1@779bfe1003e7_master/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@b2887fe4ee4d
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.5 (Fedora 14.0.5-1.fc36) +
Date:Fri Nov 11 20:17:47 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-11-11-201747-5593-1@779bfe1003e7_master/report-edc6e6.html b/2022-11-11-201747-5593-1@779bfe1003e7_master/report-edc6e6.html new file mode 100644 index 0000000..4549e4d --- /dev/null +++ b/2022-11-11-201747-5593-1@779bfe1003e7_master/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-11-11-201747-5593-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-11-11-201747-5593-1@779bfe1003e7_master/scanview.css b/2022-11-11-201747-5593-1@779bfe1003e7_master/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-11-11-201747-5593-1@779bfe1003e7_master/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-11-11-201747-5593-1@779bfe1003e7_master/sorttable.js b/2022-11-11-201747-5593-1@779bfe1003e7_master/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-11-11-201747-5593-1@779bfe1003e7_master/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/stats.html b/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/style.css b/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-11-11-201753-5198-cppcheck@779bfe1003e7_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/index.html b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/index.html new file mode 100644 index 0000000..e424628 --- /dev/null +++ b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/index.html @@ -0,0 +1,94 @@ + + +rootdir - scan-build results + + + + + + +

rootdir - scan-build results

+ + + + + + + +
User:root@642756c4ec8f
Working Directory:/rootdir
Command Line:make -j 2
Clang Version:clang version 14.0.5 (Fedora 14.0.5-1.fc36) +
Date:Fri Nov 11 20:18:52 2022
+

Bug Summary

+ + + + +
Bug TypeQuantityDisplay?
All Bugs1
Logic error
Potential unintended use of sizeof() on pointer type1
+

Reports

+ + + + + + + + + + + + + + + + + +
Bug GroupBug Type ▾FileFunction/MethodLinePath Length
Logic errorPotential unintended use of sizeof() on pointer typeabstract.hPyVectorcall_Function761View Report
+ + diff --git a/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/report-edc6e6.html b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/report-edc6e6.html new file mode 100644 index 0000000..1243124 --- /dev/null +++ b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/report-edc6e6.html @@ -0,0 +1,1053 @@ + + + +/usr/include/python3.10/cpython/abstract.h + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bug Summary

+ + + + +
File:abstract.h
Warning:line 76, column 46
The code calls sizeof() on a pointer type. This can produce an unexpected result
+ +

Annotated Source Code

+

Press '?' + to see keyboard shortcuts

+ + +
clang -cc1 -cc1 -triple x86_64-redhat-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name caja-python-object.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/rootdir/src -resource-dir /usr/lib64/clang/14.0.5 -D HAVE_CONFIG_H -I . -I .. -I .. -I .. -D G_LOG_DOMAIN="Caja-Python" -D DATADIR="/usr/local/share" -D LIBDIR="/usr/local/lib" -D PYTHON_VERSION="3.10" -D PYTHON_ABIFLAGS="" -D PY_LIB_LOC="/usr/lib64" -I /usr/include/python3.10 -I /usr/include/pygobject-3.0 -I /usr/include/glib-2.0 -I /usr/lib64/glib-2.0/include -I /usr/include/sysprof-4 -I /usr/include/caja -I /usr/include/libmount -I /usr/include/blkid -I /usr/include/gtk-3.0 -I /usr/include/pango-1.0 -I /usr/include/harfbuzz -I /usr/include/freetype2 -I /usr/include/libpng16 -I /usr/include/fribidi -I /usr/include/libxml2 -I /usr/include/cairo -I /usr/include/pixman-1 -I /usr/include/gdk-pixbuf-2.0 -I /usr/include/gio-unix-2.0 -I /usr/include/cloudproviders -I /usr/include/atk-1.0 -I /usr/include/at-spi2-atk/2.0 -I /usr/include/dbus-1.0 -I /usr/lib64/dbus-1.0/include -I /usr/include/at-spi-2.0 -D PIC -internal-isystem /usr/lib64/clang/14.0.5/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-parameter -fdebug-compilation-dir=/rootdir/src -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-checker deadcode.DeadStores -analyzer-checker alpha.deadcode.UnreachableCode -analyzer-checker alpha.core.CastSize -analyzer-checker alpha.core.CastToStruct -analyzer-checker alpha.core.IdenticalExpr -analyzer-checker alpha.core.SizeofPtr -analyzer-checker alpha.security.ArrayBoundV2 -analyzer-checker alpha.security.MallocOverflow -analyzer-checker alpha.security.ReturnPtrRange -analyzer-checker alpha.unix.SimpleStream -analyzer-checker alpha.unix.cstring.BufferOverlap -analyzer-checker alpha.unix.cstring.NotNullTerminated -analyzer-checker alpha.unix.cstring.OutOfBounds -analyzer-checker alpha.core.FixedAddr -analyzer-checker security.insecureAPI.strcpy -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /rootdir/html-report/2022-11-11-201852-5591-1 -x c caja-python-object.c +
+ + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1#ifndef Py_CPYTHON_ABSTRACTOBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5/* === Object Protocol ================================================== */
6
7#ifdef PY_SSIZE_T_CLEAN
8# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
9#endif
10
11/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
12 format to a Python dictionary ("kwargs" dict).
13
14 The type of kwnames keys is not checked. The final function getting
15 arguments is responsible to check if all keys are strings, for example using
16 PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
17
18 Duplicate keys are merged using the last value. If duplicate keys must raise
19 an exception, the caller is responsible to implement an explicit keys on
20 kwnames. */
21PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyStack_AsDict(
22 PyObject *const *values,
23 PyObject *kwnames);
24
25/* Suggested size (number of positional arguments) for arrays of PyObject*
26 allocated on a C stack to avoid allocating memory on the heap memory. Such
27 array is used to pass positional arguments to call functions of the
28 PyObject_Vectorcall() family.
29
30 The size is chosen to not abuse the C stack and so limit the risk of stack
31 overflow. The size is also chosen to allow using the small stack for most
32 function calls of the Python standard library. On 64-bit CPU, it allocates
33 40 bytes on the stack. */
34#define _PY_FASTCALL_SMALL_STACK5 5
35
36PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _Py_CheckFunctionResult(
37 PyThreadState *tstate,
38 PyObject *callable,
39 PyObject *result,
40 const char *where);
41
42/* === Vectorcall protocol (PEP 590) ============================= */
43
44/* Call callable using tp_call. Arguments are like PyObject_Vectorcall()
45 or PyObject_FastCallDict() (both forms are supported),
46 except that nargs is plainly the number of arguments without flags. */
47PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_MakeTpCall(
48 PyThreadState *tstate,
49 PyObject *callable,
50 PyObject *const *args, Py_ssize_t nargs,
51 PyObject *keywords);
52
53#define PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)) ((size_t)1 << (8 * sizeof(size_t) - 1))
54
55static inline Py_ssize_t
56PyVectorcall_NARGS(size_t n)
57{
58 return n & ~PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
59}
60
61static inline vectorcallfunc
62PyVectorcall_Function(PyObject *callable)
63{
64 PyTypeObject *tp;
65 Py_ssize_t offset;
66 vectorcallfunc ptr;
67
68 assert(callable != NULL)((void) sizeof ((callable != ((void*)0)) ? 1 : 0), __extension__
({ if (callable != ((void*)0)) ; else __assert_fail ("callable != NULL"
, "/usr/include/python3.10/cpython/abstract.h", 68, __extension__
__PRETTY_FUNCTION__); }))
;
69 tp = Py_TYPE(callable)(((PyObject*)(callable))->ob_type);
70 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL(1UL << 11))) {
71 return NULL((void*)0);
72 }
73 assert(PyCallable_Check(callable))((void) sizeof ((PyCallable_Check(callable)) ? 1 : 0), __extension__
({ if (PyCallable_Check(callable)) ; else __assert_fail ("PyCallable_Check(callable)"
, "/usr/include/python3.10/cpython/abstract.h", 73, __extension__
__PRETTY_FUNCTION__); }))
;
74 offset = tp->tp_vectorcall_offset;
75 assert(offset > 0)((void) sizeof ((offset > 0) ? 1 : 0), __extension__ ({ if
(offset > 0) ; else __assert_fail ("offset > 0", "/usr/include/python3.10/cpython/abstract.h"
, 75, __extension__ __PRETTY_FUNCTION__); }))
;
76 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
The code calls sizeof() on a pointer type. This can produce an unexpected result
77 return ptr;
78}
79
80/* Call the callable object 'callable' with the "vectorcall" calling
81 convention.
82
83 args is a C array for positional arguments.
84
85 nargsf is the number of positional arguments plus optionally the flag
86 PY_VECTORCALL_ARGUMENTS_OFFSET which means that the caller is allowed to
87 modify args[-1].
88
89 kwnames is a tuple of keyword names. The values of the keyword arguments
90 are stored in "args" after the positional arguments (note that the number
91 of keyword arguments does not change nargsf). kwnames can also be NULL if
92 there are no keyword arguments.
93
94 keywords must only contain strings and all keys must be unique.
95
96 Return the result on success. Raise an exception and return NULL on
97 error. */
98static inline PyObject *
99_PyObject_VectorcallTstate(PyThreadState *tstate, PyObject *callable,
100 PyObject *const *args, size_t nargsf,
101 PyObject *kwnames)
102{
103 vectorcallfunc func;
104 PyObject *res;
105
106 assert(kwnames == NULL || PyTuple_Check(kwnames))((void) sizeof ((kwnames == ((void*)0) || PyType_HasFeature((
((PyObject*)(kwnames))->ob_type), (1UL << 26))) ? 1 :
0), __extension__ ({ if (kwnames == ((void*)0) || PyType_HasFeature
((((PyObject*)(kwnames))->ob_type), (1UL << 26))) ; else
__assert_fail ("kwnames == NULL || PyTuple_Check(kwnames)", "/usr/include/python3.10/cpython/abstract.h"
, 106, __extension__ __PRETTY_FUNCTION__); }))
;
107 assert(args != NULL || PyVectorcall_NARGS(nargsf) == 0)((void) sizeof ((args != ((void*)0) || PyVectorcall_NARGS(nargsf
) == 0) ? 1 : 0), __extension__ ({ if (args != ((void*)0) || PyVectorcall_NARGS
(nargsf) == 0) ; else __assert_fail ("args != NULL || PyVectorcall_NARGS(nargsf) == 0"
, "/usr/include/python3.10/cpython/abstract.h", 107, __extension__
__PRETTY_FUNCTION__); }))
;
108
109 func = PyVectorcall_Function(callable);
110 if (func == NULL((void*)0)) {
111 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
112 return _PyObject_MakeTpCall(tstate, callable, args, nargs, kwnames);
113 }
114 res = func(callable, args, nargsf, kwnames);
115 return _Py_CheckFunctionResult(tstate, callable, res, NULL((void*)0));
116}
117
118static inline PyObject *
119PyObject_Vectorcall(PyObject *callable, PyObject *const *args,
120 size_t nargsf, PyObject *kwnames)
121{
122 PyThreadState *tstate = PyThreadState_Get();
123 return _PyObject_VectorcallTstate(tstate, callable,
124 args, nargsf, kwnames);
125}
126
127// Backwards compatibility aliases for API that was provisional in Python 3.8
128#define _PyObject_VectorcallPyObject_Vectorcall PyObject_Vectorcall
129#define _PyObject_VectorcallMethodPyObject_VectorcallMethod PyObject_VectorcallMethod
130#define _PyObject_FastCallDictPyObject_VectorcallDict PyObject_VectorcallDict
131#define _PyVectorcall_FunctionPyVectorcall_Function PyVectorcall_Function
132#define _PyObject_CallOneArgPyObject_CallOneArg PyObject_CallOneArg
133#define _PyObject_CallMethodNoArgsPyObject_CallMethodNoArgs PyObject_CallMethodNoArgs
134#define _PyObject_CallMethodOneArgPyObject_CallMethodOneArg PyObject_CallMethodOneArg
135
136/* Same as PyObject_Vectorcall except that keyword arguments are passed as
137 dict, which may be NULL if there are no keyword arguments. */
138PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallDict(
139 PyObject *callable,
140 PyObject *const *args,
141 size_t nargsf,
142 PyObject *kwargs);
143
144/* Call "callable" (which must support vectorcall) with positional arguments
145 "tuple" and keyword arguments "dict". "dict" may also be NULL */
146PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyVectorcall_Call(PyObject *callable, PyObject *tuple, PyObject *dict);
147
148static inline PyObject *
149_PyObject_FastCallTstate(PyThreadState *tstate, PyObject *func, PyObject *const *args, Py_ssize_t nargs)
150{
151 return _PyObject_VectorcallTstate(tstate, func, args, (size_t)nargs, NULL((void*)0));
152}
153
154/* Same as PyObject_Vectorcall except without keyword arguments */
155static inline PyObject *
156_PyObject_FastCall(PyObject *func, PyObject *const *args, Py_ssize_t nargs)
157{
158 PyThreadState *tstate = PyThreadState_Get();
159 return _PyObject_FastCallTstate(tstate, func, args, nargs);
160}
161
162/* Call a callable without any arguments
163 Private static inline function variant of public function
164 PyObject_CallNoArgs(). */
165static inline PyObject *
166_PyObject_CallNoArg(PyObject *func) {
167 PyThreadState *tstate = PyThreadState_Get();
168 return _PyObject_VectorcallTstate(tstate, func, NULL((void*)0), 0, NULL((void*)0));
169}
170
171static inline PyObject *
172PyObject_CallOneArg(PyObject *func, PyObject *arg)
173{
174 PyObject *_args[2];
175 PyObject **args;
176 PyThreadState *tstate;
177 size_t nargsf;
178
179 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 179, __extension__
__PRETTY_FUNCTION__); }))
;
180 args = _args + 1; // For PY_VECTORCALL_ARGUMENTS_OFFSET
181 args[0] = arg;
182 tstate = PyThreadState_Get();
183 nargsf = 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1));
184 return _PyObject_VectorcallTstate(tstate, func, args, nargsf, NULL((void*)0));
185}
186
187PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * PyObject_VectorcallMethod(
188 PyObject *name, PyObject *const *args,
189 size_t nargsf, PyObject *kwnames);
190
191static inline PyObject *
192PyObject_CallMethodNoArgs(PyObject *self, PyObject *name)
193{
194 return PyObject_VectorcallMethod(name, &self,
195 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
196}
197
198static inline PyObject *
199PyObject_CallMethodOneArg(PyObject *self, PyObject *name, PyObject *arg)
200{
201 PyObject *args[2] = {self, arg};
202
203 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 203, __extension__
__PRETTY_FUNCTION__); }))
;
204 return PyObject_VectorcallMethod(name, args,
205 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
206}
207
208/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
209 as the method name. */
210PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId(PyObject *obj,
211 _Py_Identifier *name,
212 const char *format, ...);
213
214PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodId_SizeT(PyObject *obj,
215 _Py_Identifier *name,
216 const char *format,
217 ...);
218
219PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyObject_CallMethodIdObjArgs(
220 PyObject *obj,
221 struct _Py_Identifier *name,
222 ...);
223
224static inline PyObject *
225_PyObject_VectorcallMethodId(
226 _Py_Identifier *name, PyObject *const *args,
227 size_t nargsf, PyObject *kwnames)
228{
229 PyObject *oname = _PyUnicode_FromId(name); /* borrowed */
230 if (!oname) {
231 return NULL((void*)0);
232 }
233 return PyObject_VectorcallMethod(oname, args, nargsf, kwnames);
234}
235
236static inline PyObject *
237_PyObject_CallMethodIdNoArgs(PyObject *self, _Py_Identifier *name)
238{
239 return _PyObject_VectorcallMethodId(name, &self,
240 1 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
241}
242
243static inline PyObject *
244_PyObject_CallMethodIdOneArg(PyObject *self, _Py_Identifier *name, PyObject *arg)
245{
246 PyObject *args[2] = {self, arg};
247
248 assert(arg != NULL)((void) sizeof ((arg != ((void*)0)) ? 1 : 0), __extension__ (
{ if (arg != ((void*)0)) ; else __assert_fail ("arg != NULL",
"/usr/include/python3.10/cpython/abstract.h", 248, __extension__
__PRETTY_FUNCTION__); }))
;
249 return _PyObject_VectorcallMethodId(name, args,
250 2 | PY_VECTORCALL_ARGUMENTS_OFFSET((size_t)1 << (8 * sizeof(size_t) - 1)), NULL((void*)0));
251}
252
253PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_HasLen(PyObject *o);
254
255/* Guess the size of object 'o' using len(o) or o.__length_hint__().
256 If neither of those return a non-negative value, then return the default
257 value. If one of the calls fails, this function returns -1. */
258PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyObject_LengthHint(PyObject *o, Py_ssize_t);
259
260/* === New Buffer API ============================================ */
261
262/* Return 1 if the getbuffer function is available, otherwise return 0. */
263PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CheckBuffer(PyObject *obj);
264
265/* This is a C-API version of the getbuffer function call. It checks
266 to make sure object has the required function pointer and issues the
267 call.
268
269 Returns -1 and raises an error on failure and returns 0 on success. */
270PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
271 int flags);
272
273/* Get the memory area pointed to by the indices for the buffer given.
274 Note that view->ndim is the assumed size of indices. */
275PyAPI_FUNC(void *)__attribute__ ((visibility ("default"))) void * PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
276
277/* Return the implied itemsize of the data-format area from a
278 struct-style description. */
279PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t PyBuffer_SizeFromFormat(const char *format);
280
281/* Implementation in memoryobject.c */
282PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_ToContiguous(void *buf, Py_buffer *view,
283 Py_ssize_t len, char order);
284
285PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FromContiguous(Py_buffer *view, void *buf,
286 Py_ssize_t len, char order);
287
288/* Copy len bytes of data from the contiguous chunk of memory
289 pointed to by buf into the buffer exported by obj. Return
290 0 on success and return -1 and raise a PyBuffer_Error on
291 error (i.e. the object does not have a buffer interface or
292 it is not working).
293
294 If fort is 'F', then if the object is multi-dimensional,
295 then the data will be copied into the array in
296 Fortran-style (first dimension varies the fastest). If
297 fort is 'C', then the data will be copied into the array
298 in C-style (last dimension varies the fastest). If fort
299 is 'A', then it does not matter and the copy will be made
300 in whatever way is more efficient. */
301PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyObject_CopyData(PyObject *dest, PyObject *src);
302
303/* Copy the data from the src buffer to the buffer of destination. */
304PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_IsContiguous(const Py_buffer *view, char fort);
305
306/*Fill the strides array with byte-strides of a contiguous
307 (Fortran-style if fort is 'F' or C-style otherwise)
308 array of the given shape with the given number of bytes
309 per element. */
310PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_FillContiguousStrides(int ndims,
311 Py_ssize_t *shape,
312 Py_ssize_t *strides,
313 int itemsize,
314 char fort);
315
316/* Fills in a buffer-info structure correctly for an exporter
317 that can only share a contiguous chunk of memory of
318 "unsigned bytes" of the given length.
319
320 Returns 0 on success and -1 (with raising an error) on error. */
321PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
322 Py_ssize_t len, int readonly,
323 int flags);
324
325/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
326PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void PyBuffer_Release(Py_buffer *view);
327
328/* === Sequence protocol ================================================ */
329
330/* Assume tp_as_sequence and sq_item exist and that 'i' does not
331 need to be corrected for a negative index. */
332#define PySequence_ITEM(o, i)( (((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item
(o, i) )
\
333 ( Py_TYPE(o)(((PyObject*)(o))->ob_type)->tp_as_sequence->sq_item(o, i) )
334
335#define PY_ITERSEARCH_COUNT1 1
336#define PY_ITERSEARCH_INDEX2 2
337#define PY_ITERSEARCH_CONTAINS3 3
338
339/* Iterate over seq.
340
341 Result depends on the operation:
342
343 PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
344 error.
345 PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
346 obj in seq; set ValueError and return -1 if none found;
347 also return -1 on error.
348 PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
349 error. */
350PyAPI_FUNC(Py_ssize_t)__attribute__ ((visibility ("default"))) Py_ssize_t _PySequence_IterSearch(PyObject *seq,
351 PyObject *obj, int operation);
352
353/* === Mapping protocol ================================================= */
354
355PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
356
357PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
358
359PyAPI_FUNC(char *const *)__attribute__ ((visibility ("default"))) char *const * _PySequence_BytesToCharpArray(PyObject* self);
360
361PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_FreeCharPArray(char *const array[]);
362
363/* For internal use by buffer API functions */
364PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_F(int nd, Py_ssize_t *index,
365 const Py_ssize_t *shape);
366PyAPI_FUNC(void)__attribute__ ((visibility ("default"))) void _Py_add_one_to_index_C(int nd, Py_ssize_t *index,
367 const Py_ssize_t *shape);
368
369/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */
370PyAPI_FUNC(int)__attribute__ ((visibility ("default"))) int _Py_convert_optional_to_ssize_t(PyObject *, void *);
371
372/* Same as PyNumber_Index but can return an instance of a subclass of int. */
373PyAPI_FUNC(PyObject *)__attribute__ ((visibility ("default"))) PyObject * _PyNumber_Index(PyObject *o);
diff --git a/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/scanview.css b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/scanview.css new file mode 100644 index 0000000..cf8a5a6 --- /dev/null +++ b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/scanview.css @@ -0,0 +1,62 @@ +body { color:#000000; background-color:#ffffff } +body { font-family: Helvetica, sans-serif; font-size:9pt } +h1 { font-size: 14pt; } +h2 { font-size: 12pt; } +table { font-size:9pt } +table { border-spacing: 0px; border: 1px solid black } +th, table thead { + background-color:#eee; color:#666666; + font-weight: bold; cursor: default; + text-align:center; + font-weight: bold; font-family: Verdana; + white-space:nowrap; +} +.W { font-size:0px } +th, td { padding:5px; padding-left:8px; text-align:left } +td.SUMM_DESC { padding-left:12px } +td.DESC { white-space:pre } +td.Q { text-align:right } +td { text-align:left } +tbody.scrollContent { overflow:auto } + +table.form_group { + background-color: #ccc; + border: 1px solid #333; + padding: 2px; +} + +table.form_inner_group { + background-color: #ccc; + border: 1px solid #333; + padding: 0px; +} + +table.form { + background-color: #999; + border: 1px solid #333; + padding: 2px; +} + +td.form_label { + text-align: right; + vertical-align: top; +} +/* For one line entires */ +td.form_clabel { + text-align: right; + vertical-align: center; +} +td.form_value { + text-align: left; + vertical-align: top; +} +td.form_submit { + text-align: right; + vertical-align: top; +} + +h1.SubmitFail { + color: #f00; +} +h1.SubmitOk { +} diff --git a/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/sorttable.js b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/sorttable.js new file mode 100644 index 0000000..32faa07 --- /dev/null +++ b/2022-11-11-201852-5591-1@779bfe1003e7_v1.27.0/sorttable.js @@ -0,0 +1,492 @@ +/* + SortTable + version 2 + 7th April 2007 + Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ + + Instructions: + Download this file + Add to your HTML + Add class="sortable" to any table you'd like to make sortable + Click on the headers to sort + + Thanks to many, many people for contributions and suggestions. + Licenced as X11: http://www.kryogenix.org/code/browser/licence.html + This basically means: do what you want with it. +*/ + + +var stIsIE = /*@cc_on!@*/false; + +sorttable = { + init: function() { + // quit if this function has already been called + if (arguments.callee.done) return; + // flag this function so we don't do the same thing twice + arguments.callee.done = true; + // kill the timer + if (_timer) clearInterval(_timer); + + if (!document.createElement || !document.getElementsByTagName) return; + + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; + + forEach(document.getElementsByTagName('table'), function(table) { + if (table.className.search(/\bsortable\b/) != -1) { + sorttable.makeSortable(table); + } + }); + + }, + + makeSortable: function(table) { + if (table.getElementsByTagName('thead').length == 0) { + // table doesn't have a tHead. Since it should have, create one and + // put the first table row in it. + the = document.createElement('thead'); + the.appendChild(table.rows[0]); + table.insertBefore(the,table.firstChild); + } + // Safari doesn't support table.tHead, sigh + if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; + + if (table.tHead.rows.length != 1) return; // can't cope with two header rows + + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as + // "total" rows, for example). This is B&R, since what you're supposed + // to do is put them in a tfoot. So, if there are sortbottom rows, + // for backward compatibility, move them to tfoot (creating it if needed). + sortbottomrows = []; + for (var i=0; i5' : ' ▴'; + this.appendChild(sortrevind); + return; + } + if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { + // if we're already sorted by this column in reverse, just + // re-reverse the table, which is quicker + sorttable.reverse(this.sorttable_tbody); + this.className = this.className.replace('sorttable_sorted_reverse', + 'sorttable_sorted'); + this.removeChild(document.getElementById('sorttable_sortrevind')); + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + return; + } + + // remove sorttable_sorted classes + theadrow = this.parentNode; + forEach(theadrow.childNodes, function(cell) { + if (cell.nodeType == 1) { // an element + cell.className = cell.className.replace('sorttable_sorted_reverse',''); + cell.className = cell.className.replace('sorttable_sorted',''); + } + }); + sortfwdind = document.getElementById('sorttable_sortfwdind'); + if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } + sortrevind = document.getElementById('sorttable_sortrevind'); + if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } + + this.className += ' sorttable_sorted'; + sortfwdind = document.createElement('span'); + sortfwdind.id = "sorttable_sortfwdind"; + sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; + this.appendChild(sortfwdind); + + // build an array to sort. This is a Schwartzian transform thing, + // i.e., we "decorate" each row with the actual sort key, + // sort based on the sort keys, and then put the rows back in order + // which is a lot faster because you only do getInnerText once per row + row_array = []; + col = this.sorttable_columnindex; + rows = this.sorttable_tbody.rows; + for (var j=0; j 12) { + // definitely dd/mm + return sorttable.sort_ddmm; + } else if (second > 12) { + return sorttable.sort_mmdd; + } else { + // looks like a date, but we can't tell which, so assume + // that it's dd/mm (English imperialism!) and keep looking + sortfn = sorttable.sort_ddmm; + } + } + } + } + return sortfn; + }, + + getInnerText: function(node) { + // gets the text we want to use for sorting for a cell. + // strips leading and trailing whitespace. + // this is *not* a generic getInnerText function; it's special to sorttable. + // for example, you can override the cell text with a customkey attribute. + // it also gets .value for fields. + + hasInputs = (typeof node.getElementsByTagName == 'function') && + node.getElementsByTagName('input').length; + + if (node.getAttribute("sorttable_customkey") != null) { + return node.getAttribute("sorttable_customkey"); + } + else if (typeof node.textContent != 'undefined' && !hasInputs) { + return node.textContent.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.innerText != 'undefined' && !hasInputs) { + return node.innerText.replace(/^\s+|\s+$/g, ''); + } + else if (typeof node.text != 'undefined' && !hasInputs) { + return node.text.replace(/^\s+|\s+$/g, ''); + } + else { + switch (node.nodeType) { + case 3: + if (node.nodeName.toLowerCase() == 'input') { + return node.value.replace(/^\s+|\s+$/g, ''); + } + case 4: + return node.nodeValue.replace(/^\s+|\s+$/g, ''); + break; + case 1: + case 11: + var innerText = ''; + for (var i = 0; i < node.childNodes.length; i++) { + innerText += sorttable.getInnerText(node.childNodes[i]); + } + return innerText.replace(/^\s+|\s+$/g, ''); + break; + default: + return ''; + } + } + }, + + reverse: function(tbody) { + // reverse the rows in a tbody + newrows = []; + for (var i=0; i=0; i--) { + tbody.appendChild(newrows[i]); + } + delete newrows; + }, + + /* sort functions + each sort function takes two parameters, a and b + you are comparing a[0] and b[0] */ + sort_numeric: function(a,b) { + aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); + if (isNaN(aa)) aa = 0; + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + if (isNaN(bb)) bb = 0; + return aa-bb; + }, + sort_alpha: function(a,b) { + if (a[0]==b[0]) return 0; + if (a[0] 0 ) { + var q = list[i]; list[i] = list[i+1]; list[i+1] = q; + swap = true; + } + } // for + t--; + + if (!swap) break; + + for(var i = t; i > b; --i) { + if ( comp_func(list[i], list[i-1]) < 0 ) { + var q = list[i]; list[i] = list[i-1]; list[i-1] = q; + swap = true; + } + } // for + b++; + + } // while(swap) + } +} + +/* ****************************************************************** + Supporting functions: bundled here to avoid depending on a library + ****************************************************************** */ + +// Dean Edwards/Matthias Miller/John Resig + +/* for Mozilla/Opera9 */ +if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", sorttable.init, false); +} + +/* for Internet Explorer */ +/*@cc_on @*/ +/*@if (@_win32) + document.write(" + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/stats.html b/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/stats.html new file mode 100644 index 0000000..a40bb06 --- /dev/null +++ b/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/style.css b/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2022-11-11-201858-2415-cppcheck@779bfe1003e7_v1.27.0/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2023-04-15-180102-5549-cppcheck@36feee029148_master/index.html b/2023-04-15-180102-5549-cppcheck@36feee029148_master/index.html new file mode 100644 index 0000000..bedee2d --- /dev/null +++ b/2023-04-15-180102-5549-cppcheck@36feee029148_master/index.html @@ -0,0 +1,193 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ + + + + + + +
LineIdCWESeverityMessage
missingIncludeSysteminformationCppcheck cannot find all the include files (use --check-config for details)
+
+ +
+ + diff --git a/2023-04-15-180102-5549-cppcheck@36feee029148_master/stats.html b/2023-04-15-180102-5549-cppcheck@36feee029148_master/stats.html new file mode 100644 index 0000000..001e741 --- /dev/null +++ b/2023-04-15-180102-5549-cppcheck@36feee029148_master/stats.html @@ -0,0 +1,164 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ +
+ +
+ + diff --git a/2023-04-15-180102-5549-cppcheck@36feee029148_master/style.css b/2023-04-15-180102-5549-cppcheck@36feee029148_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2023-04-15-180102-5549-cppcheck@36feee029148_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/0.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/0.html new file mode 100644 index 0000000..c84baea --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/0.html @@ -0,0 +1,1427 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define NO_IMPORT
+
+#include "caja-python-object.h"
+#include "caja-python.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Caja extension headers */
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-info-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-location-widget-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-property-page-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define METHOD_PREFIX ""
+
+static GObjectClass *parent_class;
+
+/* These macros assumes the following things:
+ *   a METHOD_NAME is defined with is a string
+ *   a goto label called beach
+ *   the return value is called ret
+ */
+
+#define CHECK_METHOD_NAME(self)                                        \
+	if (!PyObject_HasAttrString(self, METHOD_NAME))                    \
+		goto beach;
+
+#define CHECK_OBJECT(object)										   \
+  	if (object->instance == NULL)									   \
+  	{																   \
+  		g_object_unref (object);									   \
+  		goto beach;													   \
+  	}																   \
+
+#define CONVERT_LIST(py_files, files)                                  \
+	{                                                                  \
+		GList *l;                                                      \
+        py_files = PyList_New(0);                                      \
+		for (l = files; l; l = l->next)                                \
+		{                                                              \
+			PyList_Append(py_files, pygobject_new((GObject*)l->data)); \
+		}                                                              \
+	}
+
+#define HANDLE_RETVAL(py_ret)                                          \
+    if (!py_ret)                                                       \
+    {                                                                  \
+        PyErr_Print();                                                 \
+		goto beach;                                                    \
+ 	}                                                                  \
+ 	else if (py_ret == Py_None)                                        \
+ 	{                                                                  \
+ 		goto beach;                                                    \
+	}
+
+#define HANDLE_LIST(py_ret, type, type_name)                           \
+    {                                                                  \
+        Py_ssize_t i = 0;                                              \
+    	if (!PySequence_Check(py_ret) || PyUnicode_Check(py_ret))      \
+    	{                                                              \
+    		PyErr_SetString(PyExc_TypeError,                           \
+    						METHOD_NAME " must return a sequence");    \
+    		goto beach;                                                \
+    	}                                                              \
+    	for (i = 0; i < PySequence_Size (py_ret); i++)                 \
+    	{                                                              \
+    		PyGObject *py_item;                                        \
+    		py_item = (PyGObject*)PySequence_GetItem (py_ret, i);      \
+    		if (!pygobject_check(py_item, &Py##type##_Type))           \
+    		{                                                          \
+    			PyErr_SetString(PyExc_TypeError,                       \
+    							METHOD_NAME                            \
+    							" must return a sequence of "          \
+    							type_name);                            \
+    			goto beach;                                            \
+    		}                                                          \
+    		ret = g_list_append (ret, (type*) g_object_ref(py_item->obj));  \
+            Py_DECREF(py_item);                                        \
+    	}                                                              \
+    }
+
+static void
+free_pygobject_data(gpointer data, gpointer user_data)
+{
+	/* Some CajaFile objects are cached and not freed until caja
+		itself is closed.  Since PyGObject stores data that must be freed by
+		the Python interpreter, we must always free it before the interpreter
+		is finalized. */
+	g_object_set_data((GObject *)data, "PyGObject::instance-data", NULL);
+}
+
+static void
+free_pygobject_data_list(GList *list)
+{
+	if (list == NULL)
+		return;
+
+	g_list_foreach(list, (GFunc)free_pygobject_data, NULL);
+}
+
+static PyObject *
+caja_python_boxed_new (PyTypeObject *type, gpointer boxed, gboolean free_on_dealloc)
+{
+	PyGBoxed *self = (PyGBoxed *) type->tp_alloc (type, 0);
+	self->gtype = pyg_type_from_object ( (PyObject *) type);
+	self->boxed = boxed;
+	self->free_on_dealloc = free_on_dealloc;
+
+	return (PyObject *) self;
+}
+
+#define METHOD_NAME "get_property_pages"
+static GList *
+caja_python_object_get_property_pages (CajaPropertyPageProvider *provider,
+										   GList 						*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    PyObject *py_files, *py_ret = NULL;
+    GList *ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	CONVERT_LIST(py_files, files);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(N)", py_files);
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaPropertyPage, "Caja.PropertyPage");
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_property_page_provider_iface_init (CajaPropertyPageProviderIface *iface)
+{
+	iface->get_pages = caja_python_object_get_property_pages;
+}
+
+#define METHOD_NAME "get_widget"
+static GtkWidget *
+caja_python_object_get_widget (CajaLocationWidgetProvider *provider,
+								   const char 				 	  *uri,
+								   GtkWidget 					  *window)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	GtkWidget *ret = NULL;
+	PyObject *py_ret = NULL;
+	PyGObject *py_ret_gobj;
+	PyObject *py_uri = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	py_uri = PyUnicode_FromString(uri);
+
+	py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(NN)", py_uri,
+								 pygobject_new((GObject *)window));
+	HANDLE_RETVAL(py_ret);
+
+	py_ret_gobj = (PyGObject *)py_ret;
+	if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type))
+	{
+		PyErr_SetString(PyExc_TypeError,
+					    METHOD_NAME "should return a gtk.Widget");
+		goto beach;
+	}
+	ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj);
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+	return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_location_widget_provider_iface_init (CajaLocationWidgetProviderIface *iface)
+{
+	iface->get_widget = caja_python_object_get_widget;
+}
+
+#define METHOD_NAME "get_file_items"
+static GList *
+caja_python_object_get_file_items (CajaMenuProvider *provider,
+									   GtkWidget 			*window,
+									   GList 				*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL, *py_files;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_file_items_full"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_file_items"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+ 	free_pygobject_data_list(files);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "get_background_items"
+static GList *
+caja_python_object_get_background_items (CajaMenuProvider *provider,
+											 GtkWidget 			  *window,
+											 CajaFileInfo 	  *file)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_background_items_full"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_background_items"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_background_items = caja_python_object_get_background_items;
+	iface->get_file_items = caja_python_object_get_file_items;
+}
+
+#define METHOD_NAME "get_columns"
+static GList *
+caja_python_object_get_columns (CajaColumnProvider *provider)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();                                    \
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 NULL);
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaColumn, "Caja.Column");
+
+ beach:
+	if (py_ret != NULL)
+		Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_column_provider_iface_init (CajaColumnProviderIface *iface)
+{
+	iface->get_columns = caja_python_object_get_columns;
+}
+
+#define METHOD_NAME "cancel_update"
+static void
+caja_python_object_cancel_update (CajaInfoProvider 		*provider,
+									  CajaOperationHandle 	*handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	PyObject *py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type, handle, FALSE);
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    PyObject_CallMethod(object->instance,
+								 METHOD_PREFIX METHOD_NAME, "(NN)",
+								 pygobject_new((GObject*)provider),
+								 py_handle);
+
+ beach:
+	pyg_gil_state_release(state);
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "update_file_info"
+static CajaOperationResult
+caja_python_object_update_file_info (CajaInfoProvider 		*provider,
+										 CajaFile 				*file,
+										 GClosure 					*update_complete,
+										 CajaOperationHandle   **handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    CajaOperationResult ret = CAJA_OPERATION_COMPLETE;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	static volatile gssize handle_generator = 1;
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	*handle = NULL;
+
+	if (PyObject_HasAttrString(object->instance, "update_file_info_full"))
+	{
+        PyObject *py_handle;
+		void *h;
+
+        /* Generate a new handle with a default value. */
+        do {
+            h = (CajaOperationHandle *) g_atomic_pointer_add (&handle_generator, 1);
+        } while (!h);
+        py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type,
+                                           h, FALSE);
+
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX "update_file_info_full", "(NNNN)",
+									 pygobject_new((GObject*)provider),
+									 py_handle,
+									 pyg_boxed_new(G_TYPE_CLOSURE, update_complete, TRUE, TRUE),
+									 pygobject_new((GObject*)file));
+		*handle = (void *) ((PyGBoxed *) py_handle)->boxed;
+	}
+	else if (PyObject_HasAttrString(object->instance, "update_file_info"))
+	{
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX METHOD_NAME, "(N)",
+									 pygobject_new((GObject*)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	if (!PyLong_Check(py_ret))
+	{
+		PyErr_SetString(PyExc_TypeError,
+						METHOD_NAME " must return None or a int");
+		goto beach;
+	}
+
+	ret = PyLong_AsLong(py_ret);
+
+    if (!*handle && ret == CAJA_OPERATION_IN_PROGRESS)
+        ret = CAJA_OPERATION_FAILED;
+
+ beach:
+ 	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_info_provider_iface_init (CajaInfoProviderIface *iface)
+{
+	iface->cancel_update = caja_python_object_cancel_update;
+	iface->update_file_info = caja_python_object_update_file_info;
+}
+
+static void
+caja_python_object_instance_init (CajaPythonObject *object)
+{
+	CajaPythonObjectClass *class;
+  	debug_enter();
+
+	class = (CajaPythonObjectClass*)(((GTypeInstance*)object)->g_class);
+
+	object->instance = PyObject_CallObject(class->type, NULL);
+	if (object->instance == NULL)
+		PyErr_Print();
+}
+
+static void
+caja_python_object_finalize (GObject *object)
+{
+  	debug_enter();
+
+	if (((CajaPythonObject *)object)->instance != NULL)
+		Py_DECREF(((CajaPythonObject *)object)->instance);
+}
+
+static void
+caja_python_object_class_init (CajaPythonObjectClass *class,
+								   gpointer 				  class_data)
+{
+	debug_enter();
+
+	parent_class = g_type_class_peek_parent (class);
+
+	class->type = (PyObject*)class_data;
+
+	G_OBJECT_CLASS (class)->finalize = caja_python_object_finalize;
+}
+
+GType
+caja_python_object_get_type (GTypeModule *module,
+								 PyObject 	*type)
+{
+	GTypeInfo *info;
+	const char *type_name;
+	GType gtype;
+
+	static const GInterfaceInfo property_page_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_property_page_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo location_widget_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_location_widget_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo column_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_column_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo info_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_info_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	debug_enter_args("type=%s", PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+	info = g_new0 (GTypeInfo, 1);
+
+	info->class_size = sizeof (CajaPythonObjectClass);
+	info->class_init = (GClassInitFunc)caja_python_object_class_init;
+	info->instance_size = sizeof (CajaPythonObject);
+	info->instance_init = (GInstanceInitFunc)caja_python_object_instance_init;
+
+	info->class_data = type;
+	Py_INCREF(type);
+
+	type_name = g_strdup_printf("%s+CajaPython",
+								PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+
+	gtype = g_type_module_register_type (module,
+										 G_TYPE_OBJECT,
+										 type_name,
+										 info, 0);
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaPropertyPageProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
+									 &property_page_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaLocationWidgetProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_LOCATION_WIDGET_PROVIDER,
+									 &location_widget_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaMenuProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_MENU_PROVIDER,
+									 &menu_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaColumnProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_COLUMN_PROVIDER,
+									 &column_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaInfoProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_INFO_PROVIDER,
+									 &info_provider_iface_info);
+	}
+
+	return gtype;
+}
+
+ +
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/1.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/1.html new file mode 100644 index 0000000..631f0e7 --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/1.html @@ -0,0 +1,337 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
/*
+ *  caja-python-object.h - Generation of wrapper objects for caja
+ *                           extension objects in python.
+ *
+ *  Copyright (C) 2003 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#ifndef CAJA_PYTHON_OBJECT_H
+#define CAJA_PYTHON_OBJECT_H
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _CajaPythonObject       CajaPythonObject;
+typedef struct _CajaPythonObjectClass  CajaPythonObjectClass;
+
+struct _CajaPythonObject {
+  GObject parent_slot;
+  PyObject *instance;
+};
+
+struct _CajaPythonObjectClass {
+    GObjectClass parent_slot;
+    PyObject *type;
+};
+
+GType caja_python_object_get_type (GTypeModule *module, PyObject *type);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/2.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/2.html new file mode 100644 index 0000000..c866daf --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/2.html @@ -0,0 +1,399 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
/*
+ *  caja-python.c - Caja Python extension
+ *
+ *  Copyright (C) 2004 Johan Dahlin
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CAJA_PYTHON_H
+#define CAJA_PYTHON_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gprintf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined(NO_IMPORT)
+#define CAJA_PYTHON_VAR_DECL extern
+#else
+#define CAJA_PYTHON_VAR_DECL
+#endif
+
+typedef enum {
+    CAJA_PYTHON_DEBUG_MISC = 1 << 0,
+} CajaPythonDebug;
+
+extern CajaPythonDebug caja_python_debug;
+
+#define debug(x) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                       g_printf( "caja-python:" x "\n"); }
+#define debug_enter()  { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                             g_printf("%s: entered\n", __FUNCTION__); }
+#define debug_enter_args(x, y) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                                     g_printf("%s: entered " x "\n", __FUNCTION__, y); }
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyGtkWidget_Type;
+#define PyGtkWidget_Type (*_PyGtkWidget_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumn_Type;
+#define PyCajaColumn_Type (*_PyCajaColumn_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumnProvider_Type;
+#define PyCajaColumnProvider_Type (*_PyCajaColumnProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaInfoProvider_Type;
+#define PyCajaInfoProvider_Type (*_PyCajaInfoProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaLocationWidgetProvider_Type;
+#define PyCajaLocationWidgetProvider_Type (*_PyCajaLocationWidgetProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenu_Type;
+#define PyCajaMenu_Type (*_PyCajaMenu_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuItem_Type;
+#define PyCajaMenuItem_Type (*_PyCajaMenuItem_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuProvider_Type;
+#define PyCajaMenuProvider_Type (*_PyCajaMenuProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPage_Type;
+#define PyCajaPropertyPage_Type (*_PyCajaPropertyPage_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPageProvider_Type;
+#define PyCajaPropertyPageProvider_Type (*_PyCajaPropertyPageProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaOperationHandle_Type;
+#define PyCajaOperationHandle_Type (*_PyCajaOperationHandle_Type)
+
+#endif /* CAJA_PYTHON_H */
+
+ +
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/3.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/3.html new file mode 100644 index 0000000..dd3b39a --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/3.html @@ -0,0 +1,935 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004,2005 Johan Dahlin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <structmember.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-python.h"
+#include "caja-python-object.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static const GDebugKey caja_python_debug_keys[] = {
+	{"misc", CAJA_PYTHON_DEBUG_MISC},
+};
+static const guint caja_python_ndebug_keys = sizeof (caja_python_debug_keys) / sizeof (GDebugKey);
+CajaPythonDebug caja_python_debug;
+
+static gboolean caja_python_init_python(void);
+
+static GArray *all_types = NULL;
+static GList *all_pyfiles = NULL;
+
+/* Caja.OperationHandle value access. */
+static PyObject *
+caja_operationhandle_get_handle(PyGBoxed *self, void *closure)
+{
+	return PyLong_FromSsize_t((Py_ssize_t) (size_t) self->boxed);
+}
+
+static int
+caja_operationhandle_set_handle(PyGBoxed *self, PyObject *value, void *closure)
+{
+	Py_ssize_t val = PyLong_AsSsize_t(value);
+
+	if (!PyErr_Occurred()) {
+		if (val) {
+			self->boxed = (void *) val;
+			return 0;
+		}
+		PyErr_SetString(PyExc_ValueError, "invalid operation handle value");
+	}
+	return -1;
+}
+
+static PyGetSetDef caja_operationhandle_handle = {
+	"handle",
+	(getter) caja_operationhandle_get_handle,
+	(setter) caja_operationhandle_set_handle,
+	"Operation handle value",
+	NULL
+};
+
+static inline gboolean
+np_init_pygobject(void)
+{
+    PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION);<--- Variable 'gobject' can be declared as pointer to const
+
+    if (gobject == NULL) {
+        PyErr_Print ();
+        return FALSE;
+    }
+
+	return TRUE;
+}
+
+static void
+caja_python_load_file(GTypeModule *type_module,
+						  const gchar *filename)
+{
+	PyObject *main_module, *main_locals, *locals, *key, *value;
+	PyObject *module;
+	GType gtype;
+	Py_ssize_t pos = 0;
+
+	debug_enter_args("filename=%s", filename);
+
+	main_module = PyImport_AddModule("__main__");
+	if (main_module == NULL)
+	{
+		g_warning("Could not get __main__.");
+		return;
+	}
+
+	main_locals = PyModule_GetDict(main_module);
+	module = PyImport_ImportModuleEx(filename, main_locals, main_locals, NULL);
+	if (!module)
+	{
+		PyErr_Print();
+		return;
+	}
+
+	locals = PyModule_GetDict(module);
+
+	while (PyDict_Next(locals, &pos, &key, &value))
+	{
+		if (!PyType_Check(value))
+			continue;
+
+		if (PyObject_IsSubclass(value, (PyObject*)&PyCajaColumnProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaInfoProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaLocationWidgetProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaMenuProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaPropertyPageProvider_Type))
+		{
+			gtype = caja_python_object_get_type(type_module, value);
+			g_array_append_val(all_types, gtype);
+
+			all_pyfiles = g_list_append(all_pyfiles, g_strdup(filename));
+		}
+	}
+
+	debug("Loaded python modules");
+}
+
+static void
+caja_python_load_dir (GTypeModule *module,
+						  const char  *dirname)
+{
+	GDir *dir;
+	const char *name;
+	gboolean initialized = FALSE;
+
+	debug_enter_args("dirname=%s", dirname);
+
+	dir = g_dir_open(dirname, 0, NULL);
+	if (!dir)
+		return;
+
+	while ((name = g_dir_read_name(dir)))
+	{
+		if (g_str_has_suffix(name, ".py"))
+		{
+			char *modulename;
+			size_t len;
+
+			len = strlen(name) - 3;
+			modulename = g_new0(char, len + 1 );
+			strncpy(modulename, name, len);
+
+			if (!initialized)
+			{
+				PyObject *sys_path, *py_path;
+
+				/* n-p python part is initialized on demand (or not
+				* at all if no extensions are found) */
+				if (!caja_python_init_python())
+				{
+					g_warning("caja_python_init_python failed");
+					g_dir_close(dir);
+					g_free(modulename);
+					break;
+				}
+
+				/* sys.path.insert(0, dirname) */
+				sys_path = PySys_GetObject("path");
+				py_path = PyUnicode_FromString(dirname);
+				PyList_Insert(sys_path, 0, py_path);
+				Py_DECREF(py_path);
+			}
+			caja_python_load_file(module, modulename);
+			g_free(modulename);
+		}
+	}
+}
+
+static gboolean
+caja_python_init_python (void)
+{
+	PyObject *gi, *require_version, *args, *caja, *descr;
+	GModule *libpython;
+
+	if (Py_IsInitialized())
+		return TRUE;
+
+  	debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0");
+	libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0", 0);
+	if (!libpython)
+		g_warning("g_module_open libpython failed: %s", g_module_error());
+
+	debug("Py_Initialize");
+	Py_Initialize();
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	debug("Sanitize the python search path and set sys.argv");
+	PyRun_SimpleString("import sys; "
+			   "sys.path = list(filter(None, sys.path)); "
+			   "sys.argv = ['caja']");
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	/* import gobject */
+  	debug("init_pygobject");
+	if (!np_init_pygobject())
+	{
+		g_warning("pygobject initialization failed");
+		return FALSE;
+	}
+
+	/* import caja */
+	g_setenv("INSIDE_CAJA_PYTHON", "", FALSE);
+	debug("import caja");
+	gi = PyImport_ImportModule ("gi");
+	if (!gi) {
+		PyErr_Print();
+		return FALSE;
+	}
+
+	require_version = PyObject_GetAttrString (gi, (char *) "require_version");
+	args = PyTuple_Pack (2, PyUnicode_FromString ("Caja"),
+	PyUnicode_FromString ("2.0"));
+	PyObject_CallObject (require_version, args);
+	Py_DECREF (require_version);
+	Py_DECREF (args);
+	Py_DECREF (gi);
+	caja = PyImport_ImportModule("gi.repository.Caja");
+	if (!caja)
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	_PyGtkWidget_Type = pygobject_lookup_class(GTK_TYPE_WIDGET);
+	g_assert(_PyGtkWidget_Type != NULL);
+
+#define IMPORT(x, y) \
+    _PyCaja##x##_Type = (PyTypeObject *)PyObject_GetAttrString(caja, y); \
+	if (_PyCaja##x##_Type == NULL) { \
+		PyErr_Print(); \
+		return FALSE; \
+	}
+
+	IMPORT(Column, "Column");
+	IMPORT(ColumnProvider, "ColumnProvider");
+	IMPORT(InfoProvider, "InfoProvider");
+	IMPORT(LocationWidgetProvider, "LocationWidgetProvider");
+	IMPORT(Menu, "Menu");
+	IMPORT(MenuItem, "MenuItem");
+	IMPORT(MenuProvider, "MenuProvider");
+	IMPORT(PropertyPage, "PropertyPage");
+	IMPORT(PropertyPageProvider, "PropertyPageProvider");
+	IMPORT(OperationHandle, "OperationHandle");
+
+#undef IMPORT
+
+	/* Add the "handle" member to the OperationHandle type. */
+	descr = PyDescr_NewGetSet(_PyCajaOperationHandle_Type,
+							  &caja_operationhandle_handle);
+    if (!descr) {
+		PyErr_Print();
+		return FALSE;
+	}
+	if (PyDict_SetItemString(_PyCajaOperationHandle_Type->tp_dict,
+						     caja_operationhandle_handle.name, descr)) {
+		Py_DECREF(descr);
+		PyErr_Print();
+		return FALSE;
+	}
+	Py_DECREF(descr);
+
+	return TRUE;
+}
+
+void
+caja_module_initialize(GTypeModule *module)
+{
+	gchar *user_extensions_dir;
+	const gchar *env_string;
+
+	env_string = g_getenv("CAJA_PYTHON_DEBUG");
+	if (env_string != NULL)
+	{
+		caja_python_debug = g_parse_debug_string(env_string,
+													 caja_python_debug_keys,
+													 caja_python_ndebug_keys);
+		env_string = NULL;
+    }
+
+	debug_enter();
+
+	all_types = g_array_new(FALSE, FALSE, sizeof(GType));
+
+	// Look in the new global path, $DATADIR/caja-python/extensions
+	caja_python_load_dir(module, DATADIR "/caja-python/extensions");
+
+	// Look in XDG_DATA_DIR, ~/.local/share/caja-python/extensions
+	user_extensions_dir = g_build_filename(g_get_user_data_dir(),
+		"caja-python", "extensions", NULL);
+	caja_python_load_dir(module, user_extensions_dir);
+}
+
+void
+caja_module_shutdown(void)
+{
+	debug_enter();
+
+	if (Py_IsInitialized())
+		Py_Finalize();
+
+	g_array_free(all_types, TRUE);
+	g_list_free_full(all_pyfiles, g_free);
+}
+
+void
+caja_module_list_types(const GType **types,
+                       int          *num_types)
+{
+	debug_enter();
+
+	*types = (GType*)all_types->data;
+	*num_types = (int) all_types->len;
+}
+
+void
+caja_module_list_pyfiles(GList **pyfiles)
+{
+	debug_enter();
+
+	*pyfiles = all_pyfiles;
+}
+
+ +
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/index.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/index.html new file mode 100644 index 0000000..c1163c4 --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/index.html @@ -0,0 +1,223 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
src/caja-python-object.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libcaja-extension/caja-info-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <libcaja-extension/caja-location-widget-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <libcaja-extension/caja-property-page-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python-object.h
28missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <structmember.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
79constVariablePointer398styleVariable 'gobject' can be declared as pointer to const
src/caja-python.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gprintf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/stats.html b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/stats.html new file mode 100644 index 0000000..ef8c3c9 --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/stats.html @@ -0,0 +1,173 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+

Top 10 files for style severity, total findings: 1
+   1  src/caja-python.c
+

+

Top 10 files for information severity, total findings: 23
+   11  src/caja-python-object.c
+   7   src/caja-python.c
+   3   src/caja-python.h
+   2   src/caja-python-object.h
+

+ +
+ +
+ + diff --git a/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/style.css b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2023-11-18-153535-4185-cppcheck@dac54a63e1aa_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html new file mode 100644 index 0000000..55aed9f --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/0.html @@ -0,0 +1,1427 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define NO_IMPORT
+
+#include "caja-python-object.h"
+#include "caja-python.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+/* Caja extension headers */
+#include <libcaja-extension/caja-file-info.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-info-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-column-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-location-widget-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-item.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-menu-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <libcaja-extension/caja-property-page-provider.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include <string.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#define METHOD_PREFIX ""
+
+static GObjectClass *parent_class;
+
+/* These macros assumes the following things:
+ *   a METHOD_NAME is defined with is a string
+ *   a goto label called beach
+ *   the return value is called ret
+ */
+
+#define CHECK_METHOD_NAME(self)                                        \
+	if (!PyObject_HasAttrString(self, METHOD_NAME))                    \
+		goto beach;
+
+#define CHECK_OBJECT(object)										   \
+  	if (object->instance == NULL)									   \
+  	{																   \
+  		g_object_unref (object);									   \
+  		goto beach;													   \
+  	}																   \
+
+#define CONVERT_LIST(py_files, files)                                  \
+	{                                                                  \
+		GList *l;                                                      \
+        py_files = PyList_New(0);                                      \
+		for (l = files; l; l = l->next)                                \
+		{                                                              \
+			PyList_Append(py_files, pygobject_new((GObject*)l->data)); \
+		}                                                              \
+	}
+
+#define HANDLE_RETVAL(py_ret)                                          \
+    if (!py_ret)                                                       \
+    {                                                                  \
+        PyErr_Print();                                                 \
+		goto beach;                                                    \
+ 	}                                                                  \
+ 	else if (py_ret == Py_None)                                        \
+ 	{                                                                  \
+ 		goto beach;                                                    \
+	}
+
+#define HANDLE_LIST(py_ret, type, type_name)                           \
+    {                                                                  \
+        Py_ssize_t i = 0;                                              \
+    	if (!PySequence_Check(py_ret) || PyUnicode_Check(py_ret))      \
+    	{                                                              \
+    		PyErr_SetString(PyExc_TypeError,                           \
+    						METHOD_NAME " must return a sequence");    \
+    		goto beach;                                                \
+    	}                                                              \
+    	for (i = 0; i < PySequence_Size (py_ret); i++)                 \
+    	{                                                              \
+    		PyGObject *py_item;                                        \
+    		py_item = (PyGObject*)PySequence_GetItem (py_ret, i);      \
+    		if (!pygobject_check(py_item, &Py##type##_Type))           \
+    		{                                                          \
+    			PyErr_SetString(PyExc_TypeError,                       \
+    							METHOD_NAME                            \
+    							" must return a sequence of "          \
+    							type_name);                            \
+    			goto beach;                                            \
+    		}                                                          \
+    		ret = g_list_append (ret, (type*) g_object_ref(py_item->obj));  \
+            Py_DECREF(py_item);                                        \
+    	}                                                              \
+    }
+
+static void
+free_pygobject_data(gpointer data, gpointer user_data)
+{
+	/* Some CajaFile objects are cached and not freed until caja
+		itself is closed.  Since PyGObject stores data that must be freed by
+		the Python interpreter, we must always free it before the interpreter
+		is finalized. */
+	g_object_set_data((GObject *)data, "PyGObject::instance-data", NULL);
+}
+
+static void
+free_pygobject_data_list(GList *list)
+{
+	if (list == NULL)
+		return;
+
+	g_list_foreach(list, (GFunc)free_pygobject_data, NULL);
+}
+
+static PyObject *
+caja_python_boxed_new (PyTypeObject *type, gpointer boxed, gboolean free_on_dealloc)
+{
+	PyGBoxed *self = (PyGBoxed *) type->tp_alloc (type, 0);
+	self->gtype = pyg_type_from_object ( (PyObject *) type);
+	self->boxed = boxed;
+	self->free_on_dealloc = free_on_dealloc;
+
+	return (PyObject *) self;
+}
+
+#define METHOD_NAME "get_property_pages"
+static GList *
+caja_python_object_get_property_pages (CajaPropertyPageProvider *provider,
+										   GList 						*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    PyObject *py_files, *py_ret = NULL;
+    GList *ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	CONVERT_LIST(py_files, files);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(N)", py_files);
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaPropertyPage, "Caja.PropertyPage");
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_property_page_provider_iface_init (CajaPropertyPageProviderIface *iface)
+{
+	iface->get_pages = caja_python_object_get_property_pages;
+}
+
+#define METHOD_NAME "get_widget"
+static GtkWidget *
+caja_python_object_get_widget (CajaLocationWidgetProvider *provider,
+								   const char 				 	  *uri,
+								   GtkWidget 					  *window)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	GtkWidget *ret = NULL;
+	PyObject *py_ret = NULL;
+	PyGObject *py_ret_gobj;
+	PyObject *py_uri = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+	py_uri = PyUnicode_FromString(uri);
+
+	py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 "(NN)", py_uri,
+								 pygobject_new((GObject *)window));
+	HANDLE_RETVAL(py_ret);
+
+	py_ret_gobj = (PyGObject *)py_ret;
+	if (!pygobject_check(py_ret_gobj, &PyGtkWidget_Type))
+	{
+		PyErr_SetString(PyExc_TypeError,
+					    METHOD_NAME "should return a gtk.Widget");
+		goto beach;
+	}
+	ret = (GtkWidget *)g_object_ref(py_ret_gobj->obj);
+
+ beach:
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+	return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_location_widget_provider_iface_init (CajaLocationWidgetProviderIface *iface)
+{
+	iface->get_widget = caja_python_object_get_widget;
+}
+
+#define METHOD_NAME "get_file_items"
+static GList *
+caja_python_object_get_file_items (CajaMenuProvider *provider,
+									   GtkWidget 			*window,
+									   GList 				*files)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL, *py_files;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_file_items_full"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_file_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_file_items"))
+	{
+		CONVERT_LIST(py_files, files);
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 py_files);
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+ 	free_pygobject_data_list(files);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "get_background_items"
+static GList *
+caja_python_object_get_background_items (CajaMenuProvider *provider,
+											 GtkWidget 			  *window,
+											 CajaFileInfo 	  *file)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	if (PyObject_HasAttrString(object->instance, "get_background_items_full"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX "get_background_items_full",
+									 "(NNN)",
+									 pygobject_new((GObject *)provider),
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else if (PyObject_HasAttrString(object->instance, "get_background_items"))
+	{
+		py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+									 "(NN)",
+									 pygobject_new((GObject *)window),
+									 pygobject_new((GObject *)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaMenuItem, "Caja.MenuItem");
+
+ beach:
+	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_menu_provider_iface_init (CajaMenuProviderIface *iface)
+{
+	iface->get_background_items = caja_python_object_get_background_items;
+	iface->get_file_items = caja_python_object_get_file_items;
+}
+
+#define METHOD_NAME "get_columns"
+static GList *
+caja_python_object_get_columns (CajaColumnProvider *provider)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    GList *ret = NULL;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();                                    \
+
+	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    py_ret = PyObject_CallMethod(object->instance, METHOD_PREFIX METHOD_NAME,
+								 NULL);
+
+	HANDLE_RETVAL(py_ret);
+
+	HANDLE_LIST(py_ret, CajaColumn, "Caja.Column");
+
+ beach:
+	if (py_ret != NULL)
+		Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_column_provider_iface_init (CajaColumnProviderIface *iface)
+{
+	iface->get_columns = caja_python_object_get_columns;
+}
+
+#define METHOD_NAME "cancel_update"
+static void
+caja_python_object_cancel_update (CajaInfoProvider 		*provider,
+									  CajaOperationHandle 	*handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	PyObject *py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type, handle, FALSE);
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+	CHECK_METHOD_NAME(object->instance);
+
+    PyObject_CallMethod(object->instance,
+								 METHOD_PREFIX METHOD_NAME, "(NN)",
+								 pygobject_new((GObject*)provider),
+								 py_handle);
+
+ beach:
+	pyg_gil_state_release(state);
+}
+#undef METHOD_NAME
+
+#define METHOD_NAME "update_file_info"
+static CajaOperationResult
+caja_python_object_update_file_info (CajaInfoProvider 		*provider,
+										 CajaFile 				*file,
+										 GClosure 					*update_complete,
+										 CajaOperationHandle   **handle)
+{
+	CajaPythonObject *object = (CajaPythonObject*)provider;
+    CajaOperationResult ret = CAJA_OPERATION_COMPLETE;
+    PyObject *py_ret = NULL;
+	PyGILState_STATE state = pyg_gil_state_ensure();
+	static volatile gssize handle_generator = 1;
+
+  	debug_enter();
+
+	CHECK_OBJECT(object);
+
+	*handle = NULL;
+
+	if (PyObject_HasAttrString(object->instance, "update_file_info_full"))
+	{
+        PyObject *py_handle;
+		void *h;
+
+        /* Generate a new handle with a default value. */
+        do {
+            h = (CajaOperationHandle *) g_atomic_pointer_add (&handle_generator, 1);
+        } while (!h);
+        py_handle = caja_python_boxed_new (_PyCajaOperationHandle_Type,
+                                           h, FALSE);
+
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX "update_file_info_full", "(NNNN)",
+									 pygobject_new((GObject*)provider),
+									 py_handle,
+									 pyg_boxed_new(G_TYPE_CLOSURE, update_complete, TRUE, TRUE),
+									 pygobject_new((GObject*)file));
+		*handle = (void *) ((PyGBoxed *) py_handle)->boxed;
+	}
+	else if (PyObject_HasAttrString(object->instance, "update_file_info"))
+	{
+		py_ret = PyObject_CallMethod(object->instance,
+									 METHOD_PREFIX METHOD_NAME, "(N)",
+									 pygobject_new((GObject*)file));
+	}
+	else
+	{
+		goto beach;
+	}
+
+	HANDLE_RETVAL(py_ret);
+
+	if (!PyLong_Check(py_ret))
+	{
+		PyErr_SetString(PyExc_TypeError,
+						METHOD_NAME " must return None or a int");
+		goto beach;
+	}
+
+	ret = PyLong_AsLong(py_ret);
+
+    if (!*handle && ret == CAJA_OPERATION_IN_PROGRESS)
+        ret = CAJA_OPERATION_FAILED;
+
+ beach:
+ 	free_pygobject_data(file, NULL);
+	Py_XDECREF(py_ret);
+	pyg_gil_state_release(state);
+    return ret;
+}
+#undef METHOD_NAME
+
+static void
+caja_python_object_info_provider_iface_init (CajaInfoProviderIface *iface)
+{
+	iface->cancel_update = caja_python_object_cancel_update;
+	iface->update_file_info = caja_python_object_update_file_info;
+}
+
+static void
+caja_python_object_instance_init (CajaPythonObject *object)
+{
+	CajaPythonObjectClass *class;
+  	debug_enter();
+
+	class = (CajaPythonObjectClass*)(((GTypeInstance*)object)->g_class);
+
+	object->instance = PyObject_CallObject(class->type, NULL);
+	if (object->instance == NULL)
+		PyErr_Print();
+}
+
+static void
+caja_python_object_finalize (GObject *object)
+{
+  	debug_enter();
+
+	if (((CajaPythonObject *)object)->instance != NULL)
+		Py_DECREF(((CajaPythonObject *)object)->instance);
+}
+
+static void
+caja_python_object_class_init (CajaPythonObjectClass *class,
+								   gpointer 				  class_data)
+{
+	debug_enter();
+
+	parent_class = g_type_class_peek_parent (class);
+
+	class->type = (PyObject*)class_data;
+
+	G_OBJECT_CLASS (class)->finalize = caja_python_object_finalize;
+}
+
+GType
+caja_python_object_get_type (GTypeModule *module,
+								 PyObject 	*type)
+{
+	GTypeInfo *info;
+	const char *type_name;
+	GType gtype;
+
+	static const GInterfaceInfo property_page_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_property_page_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo location_widget_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_location_widget_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo menu_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_menu_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo column_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_column_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	static const GInterfaceInfo info_provider_iface_info = {
+		(GInterfaceInitFunc) caja_python_object_info_provider_iface_init,
+		NULL,
+		NULL
+	};
+
+	debug_enter_args("type=%s", PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+	info = g_new0 (GTypeInfo, 1);
+
+	info->class_size = sizeof (CajaPythonObjectClass);
+	info->class_init = (GClassInitFunc)caja_python_object_class_init;
+	info->instance_size = sizeof (CajaPythonObject);
+	info->instance_init = (GInstanceInitFunc)caja_python_object_instance_init;
+
+	info->class_data = type;
+	Py_INCREF(type);
+
+	type_name = g_strdup_printf("%s+CajaPython",
+								PyUnicode_AsUTF8(PyObject_GetAttrString(type, "__name__")));
+
+	gtype = g_type_module_register_type (module,
+										 G_TYPE_OBJECT,
+										 type_name,
+										 info, 0);
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaPropertyPageProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
+									 &property_page_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaLocationWidgetProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_LOCATION_WIDGET_PROVIDER,
+									 &location_widget_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaMenuProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_MENU_PROVIDER,
+									 &menu_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaColumnProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_COLUMN_PROVIDER,
+									 &column_provider_iface_info);
+	}
+
+	if (PyObject_IsSubclass(type, (PyObject*)&PyCajaInfoProvider_Type))
+	{
+		g_type_module_add_interface (module, gtype,
+									 CAJA_TYPE_INFO_PROVIDER,
+									 &info_provider_iface_info);
+	}
+
+	return gtype;
+}
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html new file mode 100644 index 0000000..e57c5b3 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/1.html @@ -0,0 +1,337 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
/*
+ *  caja-python-object.h - Generation of wrapper objects for caja
+ *                           extension objects in python.
+ *
+ *  Copyright (C) 2003 Novell, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *  Author: Dave Camp <dave@ximian.com>
+ *
+ */
+
+#ifndef CAJA_PYTHON_OBJECT_H
+#define CAJA_PYTHON_OBJECT_H
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+G_BEGIN_DECLS
+
+typedef struct _CajaPythonObject       CajaPythonObject;
+typedef struct _CajaPythonObjectClass  CajaPythonObjectClass;
+
+struct _CajaPythonObject {
+  GObject parent_slot;
+  PyObject *instance;
+};
+
+struct _CajaPythonObjectClass {
+    GObjectClass parent_slot;
+    PyObject *type;
+};
+
+GType caja_python_object_get_type (GTypeModule *module, PyObject *type);
+
+G_END_DECLS
+
+#endif
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html new file mode 100644 index 0000000..5041ecf --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/2.html @@ -0,0 +1,399 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
/*
+ *  caja-python.c - Caja Python extension
+ *
+ *  Copyright (C) 2004 Johan Dahlin
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CAJA_PYTHON_H
+#define CAJA_PYTHON_H
+
+#include <glib-object.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <glib/gprintf.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#if defined(NO_IMPORT)
+#define CAJA_PYTHON_VAR_DECL extern
+#else
+#define CAJA_PYTHON_VAR_DECL
+#endif
+
+typedef enum {
+    CAJA_PYTHON_DEBUG_MISC = 1 << 0,
+} CajaPythonDebug;
+
+extern CajaPythonDebug caja_python_debug;
+
+#define debug(x) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                       g_printf( "caja-python:" x "\n"); }
+#define debug_enter()  { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                             g_printf("%s: entered\n", __FUNCTION__); }
+#define debug_enter_args(x, y) { if (caja_python_debug & CAJA_PYTHON_DEBUG_MISC) \
+                                     g_printf("%s: entered " x "\n", __FUNCTION__, y); }
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyGtkWidget_Type;
+#define PyGtkWidget_Type (*_PyGtkWidget_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumn_Type;
+#define PyCajaColumn_Type (*_PyCajaColumn_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaColumnProvider_Type;
+#define PyCajaColumnProvider_Type (*_PyCajaColumnProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaInfoProvider_Type;
+#define PyCajaInfoProvider_Type (*_PyCajaInfoProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaLocationWidgetProvider_Type;
+#define PyCajaLocationWidgetProvider_Type (*_PyCajaLocationWidgetProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenu_Type;
+#define PyCajaMenu_Type (*_PyCajaMenu_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuItem_Type;
+#define PyCajaMenuItem_Type (*_PyCajaMenuItem_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaMenuProvider_Type;
+#define PyCajaMenuProvider_Type (*_PyCajaMenuProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPage_Type;
+#define PyCajaPropertyPage_Type (*_PyCajaPropertyPage_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaPropertyPageProvider_Type;
+#define PyCajaPropertyPageProvider_Type (*_PyCajaPropertyPageProvider_Type)
+
+CAJA_PYTHON_VAR_DECL PyTypeObject *_PyCajaOperationHandle_Type;
+#define PyCajaOperationHandle_Type (*_PyCajaOperationHandle_Type)
+
+#endif /* CAJA_PYTHON_H */
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html new file mode 100644 index 0000000..2ff0401 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/3.html @@ -0,0 +1,935 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+
  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ *  Copyright (C) 2004,2005 Johan Dahlin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#endif
+
+#include <Python.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <structmember.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <pygobject.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gmodule.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+#include <gtk/gtk.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+#include "caja-python.h"
+#include "caja-python-object.h"
+
+#include <libcaja-extension/caja-extension-types.h><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+static const GDebugKey caja_python_debug_keys[] = {
+	{"misc", CAJA_PYTHON_DEBUG_MISC},
+};
+static const guint caja_python_ndebug_keys = sizeof (caja_python_debug_keys) / sizeof (GDebugKey);
+CajaPythonDebug caja_python_debug;
+
+static gboolean caja_python_init_python(void);
+
+static GArray *all_types = NULL;
+static GList *all_pyfiles = NULL;
+
+/* Caja.OperationHandle value access. */
+static PyObject *
+caja_operationhandle_get_handle(PyGBoxed *self, void *closure)
+{
+	return PyLong_FromSsize_t((Py_ssize_t) (size_t) self->boxed);
+}
+
+static int
+caja_operationhandle_set_handle(PyGBoxed *self, PyObject *value, void *closure)
+{
+	Py_ssize_t val = PyLong_AsSsize_t(value);
+
+	if (!PyErr_Occurred()) {
+		if (val) {
+			self->boxed = (void *) val;
+			return 0;
+		}
+		PyErr_SetString(PyExc_ValueError, "invalid operation handle value");
+	}
+	return -1;
+}
+
+static PyGetSetDef caja_operationhandle_handle = {
+	"handle",
+	(getter) caja_operationhandle_get_handle,
+	(setter) caja_operationhandle_set_handle,
+	"Operation handle value",
+	NULL
+};
+
+static inline gboolean
+np_init_pygobject(void)
+{
+    PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION);
+
+    if (gobject == NULL) {
+        PyErr_Print ();
+        return FALSE;
+    }
+
+	return TRUE;
+}
+
+static void
+caja_python_load_file(GTypeModule *type_module,
+						  const gchar *filename)
+{
+	PyObject *main_module, *main_locals, *locals, *key, *value;
+	PyObject *module;
+	GType gtype;
+	Py_ssize_t pos = 0;
+
+	debug_enter_args("filename=%s", filename);
+
+	main_module = PyImport_AddModule("__main__");
+	if (main_module == NULL)
+	{
+		g_warning("Could not get __main__.");
+		return;
+	}
+
+	main_locals = PyModule_GetDict(main_module);
+	module = PyImport_ImportModuleEx(filename, main_locals, main_locals, NULL);
+	if (!module)
+	{
+		PyErr_Print();
+		return;
+	}
+
+	locals = PyModule_GetDict(module);
+
+	while (PyDict_Next(locals, &pos, &key, &value))
+	{
+		if (!PyType_Check(value))
+			continue;
+
+		if (PyObject_IsSubclass(value, (PyObject*)&PyCajaColumnProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaInfoProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaLocationWidgetProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaMenuProvider_Type) ||
+			PyObject_IsSubclass(value, (PyObject*)&PyCajaPropertyPageProvider_Type))
+		{
+			gtype = caja_python_object_get_type(type_module, value);
+			g_array_append_val(all_types, gtype);
+
+			all_pyfiles = g_list_append(all_pyfiles, g_strdup(filename));
+		}
+	}
+
+	debug("Loaded python modules");
+}
+
+static void
+caja_python_load_dir (GTypeModule *module,
+						  const char  *dirname)
+{
+	GDir *dir;
+	const char *name;
+	gboolean initialized = FALSE;
+
+	debug_enter_args("dirname=%s", dirname);
+
+	dir = g_dir_open(dirname, 0, NULL);
+	if (!dir)
+		return;
+
+	while ((name = g_dir_read_name(dir)))
+	{
+		if (g_str_has_suffix(name, ".py"))
+		{
+			char *modulename;
+			size_t len;
+
+			len = strlen(name) - 3;
+			modulename = g_new0(char, len + 1 );
+			strncpy(modulename, name, len);
+
+			if (!initialized)
+			{
+				PyObject *sys_path, *py_path;
+
+				/* n-p python part is initialized on demand (or not
+				* at all if no extensions are found) */
+				if (!caja_python_init_python())
+				{
+					g_warning("caja_python_init_python failed");
+					g_dir_close(dir);
+					g_free(modulename);
+					break;
+				}
+
+				/* sys.path.insert(0, dirname) */
+				sys_path = PySys_GetObject("path");
+				py_path = PyUnicode_FromString(dirname);
+				PyList_Insert(sys_path, 0, py_path);
+				Py_DECREF(py_path);
+			}
+			caja_python_load_file(module, modulename);
+			g_free(modulename);
+		}
+	}
+}
+
+static gboolean
+caja_python_init_python (void)
+{
+	PyObject *gi, *require_version, *args, *caja, *descr;
+	GModule *libpython;
+
+	if (Py_IsInitialized())
+		return TRUE;
+
+  	debug("g_module_open " PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0");<--- There is an unknown macro here somewhere. Configuration is required. If PY_LIB_LOC is a macro then please configure it.
+	libpython = g_module_open(PY_LIB_LOC "/libpython" PYTHON_VERSION PYTHON_ABIFLAGS "." G_MODULE_SUFFIX ".1.0", 0);
+	if (!libpython)
+		g_warning("g_module_open libpython failed: %s", g_module_error());
+
+	debug("Py_Initialize");
+	Py_Initialize();
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	debug("Sanitize the python search path and set sys.argv");
+	PyRun_SimpleString("import sys; "
+			   "sys.path = list(filter(None, sys.path)); "
+			   "sys.argv = ['caja']");
+	if (PyErr_Occurred())
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	/* import gobject */
+  	debug("init_pygobject");
+	if (!np_init_pygobject())
+	{
+		g_warning("pygobject initialization failed");
+		return FALSE;
+	}
+
+	/* import caja */
+	g_setenv("INSIDE_CAJA_PYTHON", "", FALSE);
+	debug("import caja");
+	gi = PyImport_ImportModule ("gi");
+	if (!gi) {
+		PyErr_Print();
+		return FALSE;
+	}
+
+	require_version = PyObject_GetAttrString (gi, (char *) "require_version");
+	args = PyTuple_Pack (2, PyUnicode_FromString ("Caja"),
+	PyUnicode_FromString ("2.0"));
+	PyObject_CallObject (require_version, args);
+	Py_DECREF (require_version);
+	Py_DECREF (args);
+	Py_DECREF (gi);
+	caja = PyImport_ImportModule("gi.repository.Caja");
+	if (!caja)
+	{
+		PyErr_Print();
+		return FALSE;
+	}
+
+	_PyGtkWidget_Type = pygobject_lookup_class(GTK_TYPE_WIDGET);
+	g_assert(_PyGtkWidget_Type != NULL);
+
+#define IMPORT(x, y) \
+    _PyCaja##x##_Type = (PyTypeObject *)PyObject_GetAttrString(caja, y); \
+	if (_PyCaja##x##_Type == NULL) { \
+		PyErr_Print(); \
+		return FALSE; \
+	}
+
+	IMPORT(Column, "Column");
+	IMPORT(ColumnProvider, "ColumnProvider");
+	IMPORT(InfoProvider, "InfoProvider");
+	IMPORT(LocationWidgetProvider, "LocationWidgetProvider");
+	IMPORT(Menu, "Menu");
+	IMPORT(MenuItem, "MenuItem");
+	IMPORT(MenuProvider, "MenuProvider");
+	IMPORT(PropertyPage, "PropertyPage");
+	IMPORT(PropertyPageProvider, "PropertyPageProvider");
+	IMPORT(OperationHandle, "OperationHandle");
+
+#undef IMPORT
+
+	/* Add the "handle" member to the OperationHandle type. */
+	descr = PyDescr_NewGetSet(_PyCajaOperationHandle_Type,
+							  &caja_operationhandle_handle);
+    if (!descr) {
+		PyErr_Print();
+		return FALSE;
+	}
+	if (PyDict_SetItemString(_PyCajaOperationHandle_Type->tp_dict,
+						     caja_operationhandle_handle.name, descr)) {
+		Py_DECREF(descr);
+		PyErr_Print();
+		return FALSE;
+	}
+	Py_DECREF(descr);
+
+	return TRUE;
+}
+
+void
+caja_module_initialize(GTypeModule *module)
+{
+	gchar *user_extensions_dir;
+	const gchar *env_string;
+
+	env_string = g_getenv("CAJA_PYTHON_DEBUG");
+	if (env_string != NULL)
+	{
+		caja_python_debug = g_parse_debug_string(env_string,
+													 caja_python_debug_keys,
+													 caja_python_ndebug_keys);
+		env_string = NULL;
+    }
+
+	debug_enter();
+
+	all_types = g_array_new(FALSE, FALSE, sizeof(GType));
+
+	// Look in the new global path, $DATADIR/caja-python/extensions
+	caja_python_load_dir(module, DATADIR "/caja-python/extensions");
+
+	// Look in XDG_DATA_DIR, ~/.local/share/caja-python/extensions
+	user_extensions_dir = g_build_filename(g_get_user_data_dir(),
+		"caja-python", "extensions", NULL);
+	caja_python_load_dir(module, user_extensions_dir);
+}
+
+void
+caja_module_shutdown(void)
+{
+	debug_enter();
+
+	if (Py_IsInitialized())
+		Py_Finalize();
+
+	g_array_free(all_types, TRUE);
+	g_list_free_full(all_pyfiles, g_free);
+}
+
+void
+caja_module_list_types(const GType **types,
+                       int          *num_types)
+{
+	debug_enter();
+
+	*types = (GType*)all_types->data;
+	*num_types = (int) all_types->len;
+}
+
+void
+caja_module_list_pyfiles(GList **pyfiles)
+{
+	debug_enter();
+
+	*pyfiles = all_pyfiles;
+}
+
+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html new file mode 100644 index 0000000..45369c2 --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/index.html @@ -0,0 +1,227 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineIdCWESeverityMessage
checkersReportinformationActive checkers: There was critical errors (use --checkers-report=<filename> to see details)
src/caja-python-object.c
23missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
30missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
32missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
35missingIncludeSysteminformationInclude file: <libcaja-extension/caja-file-info.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
36missingIncludeSysteminformationInclude file: <libcaja-extension/caja-info-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
37missingIncludeSysteminformationInclude file: <libcaja-extension/caja-column-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
38missingIncludeSysteminformationInclude file: <libcaja-extension/caja-location-widget-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
39missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-item.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
40missingIncludeSysteminformationInclude file: <libcaja-extension/caja-menu-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
41missingIncludeSysteminformationInclude file: <libcaja-extension/caja-property-page-provider.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
43missingIncludeSysteminformationInclude file: <string.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python-object.h
28missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
29missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
src/caja-python.c
21missingIncludeSysteminformationInclude file: <config.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
24missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
25missingIncludeSysteminformationInclude file: <structmember.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <pygobject.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <gmodule.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
28missingIncludeSysteminformationInclude file: <gtk/gtk.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
33missingIncludeSysteminformationInclude file: <libcaja-extension/caja-extension-types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
198unknownMacroerrorThere is an unknown macro here somewhere. Configuration is required. If PY_LIB_LOC is a macro then please configure it.
src/caja-python.h
25missingIncludeSysteminformationInclude file: <glib-object.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
26missingIncludeSysteminformationInclude file: <glib/gprintf.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
27missingIncludeSysteminformationInclude file: <Python.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
+
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html new file mode 100644 index 0000000..29374af --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/stats.html @@ -0,0 +1,173 @@ + + + + + + Cppcheck - HTML report - python-caja + + + + + +
+ + + +
+

Top 10 files for error severity, total findings: 1
+   1  src/caja-python.c
+

+

Top 10 files for information severity, total findings: 23
+   11  src/caja-python-object.c
+   7   src/caja-python.c
+   3   src/caja-python.h
+   2   src/caja-python-object.h
+

+ +
+ +
+ + diff --git a/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css new file mode 100644 index 0000000..3897bfa --- /dev/null +++ b/2024-02-22-150019-0199-cppcheck@e448d5a6ec47_master/style.css @@ -0,0 +1,177 @@ + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + font-size: 13px; + line-height: 1.5; + height: 100%; + margin: 0; +} + +#wrapper { + position: fixed; + height: 100vh; + width: 100vw; + display: grid; + grid-template-rows: fit-content(8rem) auto fit-content(8rem); + grid-template-columns: fit-content(25%) 1fr; + grid-template-areas: + "header header" + "menu content" + "footer footer"; +} + +h1 { + margin: 0 0 8px -2px; + font-size: 175%; +} + +.header { + padding: 0 0 5px 15px; + grid-area: header; + border-bottom: thin solid #aaa; +} + +.footer { + grid-area: footer; + border-top: thin solid #aaa; + font-size: 85%; + +} + +.footer > p { + margin: 4px; +} + +#menu, +#menu_index { + grid-area: menu; + text-align: left; + overflow: auto; + padding: 0 23px 15px 15px; + border-right: thin solid #aaa; + min-width: 200px; +} + +#menu > a { + display: block; + margin-left: 10px; + font-size: 12px; +} + +#content, +#content_index { + grid-area: content; + padding: 0px 5px 15px 15px; + overflow: auto; +} + +label { + white-space: nowrap; +} + +label.checkBtn.disabled { + color: #606060; + background: #e0e0e0; + font-style: italic; +} + +label.checkBtn, input[type="text"] { + border: 1px solid grey; + border-radius: 4px; + box-shadow: 1px 1px inset; + padding: 1px 5px; +} + +label.checkBtn { + white-space: nowrap; + background: #ccddff; +} + +label.unchecked { + background: #eff8ff; + box-shadow: 1px 1px 1px; +} + +label.checkBtn:hover, label.unchecked:hover{ + box-shadow: 0 0 2px; +} + +label.disabled:hover { + box-shadow: 1px 1px inset; +} + +label.checkBtn > input { + display:none; +} + +.summaryTable { + width: 100%; +} + +table.summaryTable td { padding: 0 5px 0 5px; } + +.statHeader, .severityHeader { + font-weight: bold; +} + +.warning { + background-color: #ffffa7; +} + +.error { + background-color: #ffb7b7; +} + +.error2 { + background-color: #faa; + display: inline-block; + margin-left: 4px; +} + +.inconclusive { + background-color: #b6b6b4; +} + +.inconclusive2 { + background-color: #b6b6b4; + display: inline-block; + margin-left: 4px; +} + +.verbose { + display: inline-block; + vertical-align: top; + cursor: help; +} + +.verbose .content { + display: none; + position: absolute; + padding: 10px; + margin: 4px; + max-width: 40%; + white-space: pre-wrap; + border: 1px solid #000; + background-color: #ffffcc; + cursor: auto; +} + +.highlight .hll { + padding: 1px; +} + +.highlighttable { + background-color: #fff; + position: relative; + margin: -10px; +} + +.linenos { + border-right: thin solid #aaa; + color: #d3d3d3; + padding-right: 6px; +} + +.id-filtered, .severity-filtered, .file-filtered, .tool-filtered, .text-filtered { + visibility: collapse; +} diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..a73cafd --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +python-caja.mate-desktop.dev diff --git a/index.html b/index.html new file mode 100644 index 0000000..801429f --- /dev/null +++ b/index.html @@ -0,0 +1,46 @@ + + + + + python-caja Code Analyzer results + + +

+ mate-desktop/python-caja Static analyzer results +

+ GitHub + Build Status +
+Commit: e448d5a6ec47b616b314504c74fa0a11d1b509cc
+Compare: dac54a63e1aa...e448d5a6ec47
+Branch: master
+Time: 2024-02-22 15:00:19+00:00
+Messages:
+
+release 1.28.0
+
+
+ + +