Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
with the naming used in the Ethernet standard.
This reverts commit 30d775b095a4b76e5fa755b19d5521affa3c053c.
|
|
|
|
(minor readability / consistency improvement)
|
|
Track the start of a data or word cycle. Avoid narrow ss=es annotations
which may be tedious to inspect by users in GUI applications. This
resolves the issue initially reported in bug #1210.
|
|
Explicitly pass a start sample number to the .putc() method, to prepare
annotations where ss differs from es. This is motivated by bug #1210.
Stick with the narrow ss=es annotations for backwards compatibility.
|
|
Replace str() conversion with explicit number text formatting, for
improved awareness and easier future adjustment during maintenance.
|
|
Since values get accessed within the .decode() method exclusively, we need
not store data in instance variables of the decoder object. Use another
variable for the "reset edge" option as well for consistency.
|
|
Since PD API v3 the .decode() method is called exactly once, and
contains a main loop itself. Move initialization code that sets up
.decode() related logic to the start of the .decode() routine.
|
|
Replace magic numbers by symbolic references to (fixed and optional)
decoder input signals, .wait() conditions, as well as annotation rows.
Move some empty lines, to better reflect which code lines form groups of
similar activity ("blocks" that logically belong together).
|
|
The previous implementation used the fact that libsigrok's internal API
happens to use the first letter of the user visible English option text.
Two locations mapped edge choices to API literals in different ways.
Unify them, introduce an explicit option text to literal value mapping.
(Many if not all decoder implementations do that. More adjustment to use
common code could be beneficial.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Handle the most common case of one session and one decoder first so
we can exit early. This has a small, but measurable performance benefit.
|
|
This has a small, but measurable performance benefit.
|
|
These functions are only used in type_decoder.c. Move them there and
make them static.
|
|
|
|
A simple NULL check is sufficient here, max_session_id is being
properly handled by srd_init(), srd_exit(), srd_session_new().
This might also have a small performance benefit.
|
|
|
|
|
|
|
|
|
|
|
|
type_decoder.c: In function ‘get_term_type’:
type_decoder.c:486:2: warning: switch missing default case [-Wswitch-default]
switch (v[0]) {
^~~~~~
|
|
Add the -Wshadow -Wformat=2 -Wno-format-nonliteral -Wfloat-equal
compiler options (supported by both gcc and clang) to get notified
of more potential issues in the code.
|
|
|
|
instance.c:266:11: warning: declaration of ‘l’ shadows a previous local [-Wshadow]
GSList *l = g_slist_nth(di->decoder->channels, i);
^
instance.c:206:9: note: shadowed declaration is here
GList *l;
^
|
|
|
|
instance.c:278:25: warning: The left operand of '!=' is a garbage value
if (new_channelmap[i] != -1)
~~~~~~~~~~~~~~~~~ ^
|
|
decoder.c:343:9: warning: Access to field 'ob_type' results in a dereference of a null pointer (loaded from variable 'py_default')
if (Py_TYPE(py_default) != Py_TYPE(py_item)) {
^~~~~~~~~~~~~~~~~~~
/usr/include/python3.6m/object.h:118:33: note: expanded from macro 'Py_TYPE'
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
type_decoder.c:836:3: warning: Value stored to 'ret' is never read
ret = process_samples_until_condition_match(di, &found_match);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
instance.c:280:10: warning: Potential leak of memory pointed to by 'new_channelmap'
pdch = g_slist_nth(di->decoder->channels, i)->data;
^~~~~~~~~~~
|
|
type_decoder.c:206:2: warning: Potential leak of memory pointed to by 'pdb'
PyGILState_Release(gstate);
^~~~~~~~~~~~~~~~~~
|
|
type_decoder.c:197:10: warning: Potential leak of memory pointed to by 'pdb'
return SRD_ERR_MALLOC;
^~~~~~~~~~~~~~
|
|
For the converted calls there's no requirement for all struct fields
being memset()'d to zero, or all struct fields are explicitly set
later anyway.
|
|
|
|
|
|
|
|
|