]> sigrok.org Git - libsigrok.git/log
libsigrok.git
8 years agolecroy-logicstudio: Initial driver implementation.
Tilman Sauerbeck [Thu, 8 Oct 2015 18:13:53 +0000 (20:13 +0200)]
lecroy-logicstudio: Initial driver implementation.

This supports both 8 and 16 channel modes with samplerates up to
500 MHz. Voltage thresholds are currently fixed at 1.58V.

8 years agoAdd the RB64 macro.
Tilman Sauerbeck [Mon, 16 Nov 2015 18:47:04 +0000 (19:47 +0100)]
Add the RB64 macro.

Reads an unsigned 64 bit integer from memory.

8 years agobindings: Fix doc extraction for enums
Marcus Comstedt [Sun, 8 Nov 2015 16:37:34 +0000 (17:37 +0100)]
bindings: Fix doc extraction for enums

The source file enum.hpp was not found when not building in the source
tree.  Also, extraction of the brief description did not work correctly
when there was additional XML markup inside the <para> element.

8 years agokorad-kaxxxxp: Workaround for Korad device bug
Hannu Vuolasaho [Fri, 27 Nov 2015 18:10:14 +0000 (20:10 +0200)]
korad-kaxxxxp: Workaround for Korad device bug

The sixth character from ISET? is read and discarded. If the device is
turned off and on again, this won't be there and causes 10 ms delay in
every ISET? Luckily, this value isn't queried that often. To get the
sixth byte, the *IDN? command has to be issued before ISET?.

8 years agokorad-kaxxxxp: Fix typo in Korad driver device enum
Hannu Vuolasaho [Mon, 30 Nov 2015 20:47:56 +0000 (22:47 +0200)]
korad-kaxxxxp: Fix typo in Korad driver device enum

8 years agooutput/wav: use the right buffer for SR_DF_ANALOG
Stefan Brüns [Tue, 24 Nov 2015 21:31:35 +0000 (22:31 +0100)]
output/wav: use the right buffer for SR_DF_ANALOG

8 years agoinput/wav: fix and simplify conversion of integer samples
Stefan Brüns [Tue, 24 Nov 2015 20:03:04 +0000 (21:03 +0100)]
input/wav: fix and simplify conversion of integer samples

Size of individual samples is specified by unitsize, not samplesize.
The sample immediate is not necessary.

8 years agoinput/wav: increase search range for data chunk, report errors
Stefan Brüns [Tue, 24 Nov 2015 19:55:14 +0000 (20:55 +0100)]
input/wav: increase search range for data chunk, report errors

8 years agoinput/wav: fix error in offset calculation
Stefan Brüns [Sun, 22 Nov 2015 21:14:15 +0000 (22:14 +0100)]
input/wav: fix error in offset calculation

8 years agooutput/wav: track and free memory for float conversion buffer
Stefan Brüns [Thu, 26 Nov 2015 23:44:50 +0000 (00:44 +0100)]
output/wav: track and free memory for float conversion buffer

8 years agoinput: fix leak of config data in several input modules
Stefan Brüns [Thu, 26 Nov 2015 21:55:55 +0000 (22:55 +0100)]
input: fix leak of config data in several input modules

8 years agooutput: fix options memory leak
Stefan Brüns [Thu, 26 Nov 2015 03:29:28 +0000 (04:29 +0100)]
output: fix options memory leak

8 years agooutput/analog: track and free memory for float conversion buffer
Stefan Brüns [Thu, 26 Nov 2015 02:07:47 +0000 (03:07 +0100)]
output/analog: track and free memory for float conversion buffer

==18779== 800,000 bytes in 196 blocks are definitely lost in loss record 29 of 29
==18779==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18779==    by 0x4E635C3: receive (analog.c:319)
==18779==    by 0x40870B: datafeed_in (session.c:316)
==18779==    by 0x4E59D4E: sr_session_send (session.c:1201)
==18779==    by 0x4E59F8B: sr_session_send (session.c:1159)
==18779==    by 0x4E62595: send_chunk (wav.c:234)
==18779==    by 0x4E62A06: process_buffer (wav.c:290)
==18779==    by 0x40954A: load_input_file_module (input.c:123)
==18779==    by 0x4097AB: load_input_file (input.c:157)
==18779==    by 0x40531E: main (main.c:288)

8 years agosession: free memory for datafeed callbacks, reported by valgrind
Stefan Brüns [Thu, 26 Nov 2015 02:04:39 +0000 (03:04 +0100)]
session: free memory for datafeed callbacks, reported by valgrind

==17549== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 39
==17549==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17549==    by 0x5359200: g_malloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x536EE2D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x5370165: g_slist_append (in /usr/lib64/libglib-2.0.so.0.4200.2)
==17549==    by 0x4E595C3: sr_session_datafeed_callback_add (session.c:512)
==17549==    by 0x409527: load_input_file_module (input.c:111)
==17549==    by 0x4097AB: load_input_file (input.c:157)
==17549==    by 0x40531E: main (main.c:288)

8 years agosession: fix use after free of session->devs as reported by valgrind
Stefan Brüns [Thu, 26 Nov 2015 01:30:42 +0000 (02:30 +0100)]
session: fix use after free of session->devs as reported by valgrind

==7478== Invalid write of size 8
==7478==    at 0x4E59182: sr_session_dev_remove_all (session.c:302)
==7478==    by 0x4E591CD: sr_session_destroy (session.c:265)
==7478==    by 0x4095D9: load_input_file_module (input.c:143)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)
==7478==  Address 0x7877eb8 is 88 bytes inside a block of size 96 free'd
==7478==    at 0x4C2A37C: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7478==    by 0x4E5F454: sr_input_free (input.c:573)
==7478==    by 0x4095C3: load_input_file_module (input.c:140)
==7478==    by 0x4097AB: load_input_file (input.c:157)
==7478==    by 0x40531E: main (main.c:288)

8 years agoMake all sizeof() consistently use parenthesis.
Uwe Hermann [Sat, 28 Nov 2015 23:23:53 +0000 (00:23 +0100)]
Make all sizeof() consistently use parenthesis.

8 years agosysclk-lwla: Simplify trigger mask generation
Daniel Elstner [Fri, 27 Nov 2015 22:44:11 +0000 (23:44 +0100)]
sysclk-lwla: Simplify trigger mask generation

8 years agosysclk-lwla: Drain pending replies on initialization
Daniel Elstner [Fri, 27 Nov 2015 21:47:29 +0000 (22:47 +0100)]
sysclk-lwla: Drain pending replies on initialization

When opening the device, drain any pending data from the USB
buffers so that the device won't get stuck on crashes etc.

8 years agosysclk-lwla: Remove double USB set configuration
Daniel Elstner [Fri, 27 Nov 2015 20:26:13 +0000 (21:26 +0100)]
sysclk-lwla: Remove double USB set configuration

This was a pointless attempt to make the reset hiccups go away.
It didn't help, the problem must be something else.

8 years agosysclk-lwla: Cut down on size_t overuse
Daniel Elstner [Fri, 27 Nov 2015 13:32:28 +0000 (14:32 +0100)]
sysclk-lwla: Cut down on size_t overuse

Do not use size_t for values whose width is defined by the device,
not the host. Also don't use size_t for simple indices with known
small range, unless type compatibility considerations apply.

8 years agosysclk-lwla: Fix copy'n'paste mistake in comment
Daniel Elstner [Fri, 27 Nov 2015 02:19:43 +0000 (03:19 +0100)]
sysclk-lwla: Fix copy'n'paste mistake in comment

8 years agoUse the ALLZERO macro in more places.
Uwe Hermann [Thu, 26 Nov 2015 23:15:15 +0000 (00:15 +0100)]
Use the ALLZERO macro in more places.

8 years agoSupport for Korad KA3005P
Hannu Vuolasaho [Tue, 24 Nov 2015 22:56:23 +0000 (00:56 +0200)]
Support for Korad KA3005P

8 years agokorad-kdxxxxp: Rename driver to korad-kaxxxxp.
Uwe Hermann [Thu, 26 Nov 2015 23:16:05 +0000 (00:16 +0100)]
korad-kdxxxxp: Rename driver to korad-kaxxxxp.

This matches the supported / supportable devices better.

8 years agodoxygen: Only use @since on public API functions.
Uwe Hermann [Thu, 26 Nov 2015 23:14:05 +0000 (00:14 +0100)]
doxygen: Only use @since on public API functions.

8 years agoz60_libsigrok.rules: Add sigrok fx2lafw VID/PID pairs.
Uwe Hermann [Thu, 26 Nov 2015 23:12:57 +0000 (00:12 +0100)]
z60_libsigrok.rules: Add sigrok fx2lafw VID/PID pairs.

8 years agoVCD input: Chunk up the samples in 1MB blocks.
Petteri Aimonen [Wed, 4 Feb 2015 15:46:33 +0000 (17:46 +0200)]
VCD input: Chunk up the samples in 1MB blocks.

This gives about 100x speed improvement when converting VCD->SR.

Also should allow practically unlimited number of channels.

This fixes bug #551.

8 years agosession: Remove debug spew on I/O events
Daniel Elstner [Mon, 23 Nov 2015 19:36:08 +0000 (20:36 +0100)]
session: Remove debug spew on I/O events

This really is a bit much with some drivers that do lots of small
I/O transfers.

8 years agocontrib: Add SysClk LWLA1016 to udev rules
Daniel Elstner [Sun, 22 Nov 2015 16:51:05 +0000 (17:51 +0100)]
contrib: Add SysClk LWLA1016 to udev rules

8 years agosysclk-lwla: Implement support for LWLA1016
Daniel Elstner [Sun, 22 Nov 2015 16:45:54 +0000 (17:45 +0100)]
sysclk-lwla: Implement support for LWLA1016

Refactor the sysclk-lwla driver to separate the generic logic from
the model-specific implementation. Based on this, implement support
for the SysClk LWLA1016 device.

8 years agosysclk-lwla: Remove global driver instance pointer
Daniel Elstner [Tue, 10 Nov 2015 19:52:09 +0000 (20:52 +0100)]
sysclk-lwla: Remove global driver instance pointer

Obtain the sr_dev_driver pointer from the device instance so that
the remaining references to the global di pointer can be removed.

8 years agosr_usb_find(): Increase the 'bus' limit to 255.
Uwe Hermann [Sat, 21 Nov 2015 19:27:25 +0000 (20:27 +0100)]
sr_usb_find(): Increase the 'bus' limit to 255.

On some systems it can happen that the USB 'bus' number is a lot larger
than 64, but sr_usb_find() currently errors out if it is > 64.

Example:
Bus 250 Device 006: ID 1ab1:04ce 1ab1 DS1000Z Series[...]

Increase that limit so that the code will work everywhere. This bus number
is queried via libusb_get_bus_number() which returns an uint8_t, so we're
limiting to 255 here.

Thanks to 'ssi' on IRC for reporting the issue.

8 years agoserial-dmm: Add support for Velleman DVM4100 & PeakTech 3415.
Matthieu Gaillet [Wed, 4 Nov 2015 21:58:15 +0000 (22:58 +0100)]
serial-dmm: Add support for Velleman DVM4100 & PeakTech 3415.

(both are using the new dtm0660 DMM parser)

8 years agoAdd dtm0660 15-byte DMM protocol parser.
Matthieu Gaillet [Wed, 4 Nov 2015 21:58:15 +0000 (22:58 +0100)]
Add dtm0660 15-byte DMM protocol parser.

8 years agousb.c: Fix usb_get_port_path() issue on Mac OS X.
Uwe Hermann [Sun, 15 Nov 2015 18:01:13 +0000 (19:01 +0100)]
usb.c: Fix usb_get_port_path() issue on Mac OS X.

Apparently (some versions of) Mac OS X have the same problem with
usb_get_port_path() as FreeBSD does. Work around this in the same way.

Thanks to hanyazou@gmail.com for the patch!

This fixes bug #673.

8 years agochronovu-la: Add missing libusb dependencies.
Uwe Hermann [Sun, 15 Nov 2015 15:12:35 +0000 (16:12 +0100)]
chronovu-la: Add missing libusb dependencies.

The chronovu-la driver now uses libusb (in addition to libftdi), so add
a missing <libusb.h> #include and libusb dependency in configure.ac.

8 years agochronovu-la: Properly handle multiple devices.
Uwe Hermann [Sun, 8 Nov 2015 23:38:18 +0000 (00:38 +0100)]
chronovu-la: Properly handle multiple devices.

The driver should now be able to cope with e.g. multiple ChronoVu LA8
and/or ChronoVu LA16 devices being connected to the same PC.

It now also provides the serial number and connection ID, which can be
used by frontends to differentiate multiple devices.

Also improve the scanopts / drvopts / devopts lists handling.

This fixes bug #504.

8 years agoasix-sigma: Drop unneeded asix_sigma_driver_info.
Uwe Hermann [Sun, 8 Nov 2015 16:38:02 +0000 (17:38 +0100)]
asix-sigma: Drop unneeded asix_sigma_driver_info.

This is not needed, but also causes linker issues on some platforms.

8 years agoConstify a lot more items.
Uwe Hermann [Fri, 6 Nov 2015 17:18:34 +0000 (18:18 +0100)]
Constify a lot more items.

This fixes various compiler warnings when -Wdiscarded-qualifiers is used.

8 years agobuild: Delete generated files on make clean
Daniel Elstner [Sat, 7 Nov 2015 21:29:12 +0000 (22:29 +0100)]
build: Delete generated files on make clean

8 years agobuild: Enable uninstall of Java bindings
Daniel Elstner [Sat, 7 Nov 2015 21:20:19 +0000 (22:20 +0100)]
build: Enable uninstall of Java bindings

This is needed for make distcheck to work.

8 years agobuild: Skip Python bindings during distcheck
Daniel Elstner [Sat, 7 Nov 2015 21:08:45 +0000 (22:08 +0100)]
build: Skip Python bindings during distcheck

setup.py attempts to relink the bindings at installation time,
which breaks distcheck. Thus, disable the Python bindings during
distcheck for now.

8 years agobuild: Distribute missing files
Daniel Elstner [Sat, 7 Nov 2015 20:57:20 +0000 (21:57 +0100)]
build: Distribute missing files

8 years agobuild: Make ChangeLog generation distcheck-safe
Daniel Elstner [Sat, 7 Nov 2015 20:51:40 +0000 (21:51 +0100)]
build: Make ChangeLog generation distcheck-safe

8 years agoConstify sr_dev_driver::name and sr_dev_driver::long_name.
Tilman Sauerbeck [Mon, 2 Nov 2015 20:59:00 +0000 (21:59 +0100)]
Constify sr_dev_driver::name and sr_dev_driver::long_name.

This fixes a bunch of warnings when compiling with -Wwrite-strings.

8 years agoasix-sigma: Split into api.c and protocol.[ch] modules.
jry [Thu, 5 Nov 2015 10:41:27 +0000 (11:41 +0100)]
asix-sigma: Split into api.c and protocol.[ch] modules.

8 years agoJava: Remove explicit constructor deletes since SWIG 2 doesn't like them
Marcus Comstedt [Mon, 2 Nov 2015 16:16:58 +0000 (17:16 +0100)]
Java: Remove explicit constructor deletes since SWIG 2 doesn't like them

  bindings/java/org/sigrok/core/classes/classes.i:247: Error: \
    Syntax error in input(3).

8 years agoJava: Fix leaking global refs
Marcus Comstedt [Sun, 1 Nov 2015 22:29:32 +0000 (23:29 +0100)]
Java: Fix leaking global refs

This fixes issue #690.

8 years agoJava: Don't use JNIEnv* captured by lambdas, it may be invalid for the context
Marcus Comstedt [Sun, 1 Nov 2015 22:27:41 +0000 (23:27 +0100)]
Java: Don't use JNIEnv* captured by lambdas, it may be invalid for the context

8 years agoJava: Fill jlongs with 0 when doing SWIG style pointer marshalling
Marcus Comstedt [Sun, 1 Nov 2015 14:59:47 +0000 (15:59 +0100)]
Java: Fill jlongs with 0 when doing SWIG style pointer marshalling

This prevents valgrind complaints and also makes pointer comparison
from the Java side work.

8 years agoRevert "Java: Avoid dangerous writes via casted pointers"
Marcus Comstedt [Sun, 1 Nov 2015 14:58:00 +0000 (15:58 +0100)]
Revert "Java: Avoid dangerous writes via casted pointers"

This reverts commit 865de99391194e45a0e80ea534fc5e27d5287925.

This fixes bug #688.

8 years agopython: Fix string conversions for Python 3.
Martin Ling [Sun, 1 Nov 2015 23:42:21 +0000 (23:42 +0000)]
python: Fix string conversions for Python 3.

Fixes bug #478.

8 years agobuild: Set CXXFLAGS when building Python module
Daniel Elstner [Mon, 2 Nov 2015 13:30:24 +0000 (14:30 +0100)]
build: Set CXXFLAGS when building Python module

Set both CFLAGS and CXXFLAGS when executing setup.py to build
the Python bindings. Newer versions of distutils/setuptools have
apparently started to pick up the latter when compiling C++.

8 years agobuild: Match up Python headers with interpreter version
Daniel Elstner [Sun, 1 Nov 2015 20:40:28 +0000 (21:40 +0100)]
build: Match up Python headers with interpreter version

Check for either Python 2 or Python 3 header files depending on
the version of the Python interpreter. Also require the module
version to exactly match the interpreter version.

This may fix bug #645.

8 years agoopenbench-logic-sniffer: Avoid recreating event source
Daniel Elstner [Sun, 1 Nov 2015 18:38:40 +0000 (19:38 +0100)]
openbench-logic-sniffer: Avoid recreating event source

With the current driver API and the corresponding session event
handling, it is not possible to destroy and then re-create an
event source with the same key within the same main loop iteration.

The next generation driver API will fix this problem. But for now,
just change the driver to make do without that sort of thing. Also
increase the I/O timeout to 100 ms to be safer in the event of all
kind of delays the OS environment may induce.

This fixes bug #678.

8 years agoRemove obsolete SR_INPUT_META_MIMETYPE metadata key.
Bert Vermeulen [Fri, 30 Oct 2015 15:41:30 +0000 (16:41 +0100)]
Remove obsolete SR_INPUT_META_MIMETYPE metadata key.

This was never really implemented, since getting the mimetype of a
file or stream in a cross-platform way is a gigantic tangle.

8 years agoinput/csv: Remove obsolete mimetype format match.
Bert Vermeulen [Fri, 30 Oct 2015 15:38:54 +0000 (16:38 +0100)]
input/csv: Remove obsolete mimetype format match.

Mimetypes never worked, and in any case this caused a segfault due to a
missing SR_INPUT_META_REQUIRED flag.

This fixes bug #681.

8 years agobuild: Also look for python-2.7 pkg-config module
Daniel Elstner [Sat, 31 Oct 2015 15:02:30 +0000 (16:02 +0100)]
build: Also look for python-2.7 pkg-config module

Apparently Gentoo names the module python-2.7 instead of python27.

8 years agosysclk-lwla: Read full 64 bit of capture duration field
Daniel Elstner [Sat, 31 Oct 2015 09:19:51 +0000 (10:19 +0100)]
sysclk-lwla: Read full 64 bit of capture duration field

Evaluate all 64 bit of the duration field in the capture status
record. Although unlikely in practical use, due to compression
it is possible for the duration in ms to exceed 32 bit.

8 years agosysclk-lwla: Define constants for long registers
Daniel Elstner [Sat, 31 Oct 2015 00:39:03 +0000 (01:39 +0100)]
sysclk-lwla: Define constants for long registers

8 years agosysclk-lwla: Clarify use of SRAM control registers
Daniel Elstner [Sat, 31 Oct 2015 00:11:31 +0000 (01:11 +0100)]
sysclk-lwla: Clarify use of SRAM control registers

Assign more meaningful names to things and introduce new constants.

8 years agozip: Provide fallback if zip_discard() is unavailable
Daniel Elstner [Fri, 30 Oct 2015 14:07:25 +0000 (15:07 +0100)]
zip: Provide fallback if zip_discard() is unavailable

zip_discard() was introduced in libzip 0.11, which some systems
do not have yet. Provide a fallback replacement for zip_discard(),
and reduce the requirement to libzip 0.10 again.

This fixes bug #674.

8 years agoC++: Declare std::default_delete friend as struct
Daniel Elstner [Thu, 29 Oct 2015 21:53:25 +0000 (22:53 +0100)]
C++: Declare std::default_delete friend as struct

std::default_delete<> is originally defined as struct, not class.
This does not really make much of a difference, but some compilers
complain when the struct/class tag is not consistent across all
declarations of the type.

8 years agoC++: Suppress deprecation warnings from glibmm
Daniel Elstner [Thu, 29 Oct 2015 20:48:49 +0000 (21:48 +0100)]
C++: Suppress deprecation warnings from glibmm

Ignore warnings due to use of std::auto_ptr<> in the glibmm headers.
This should be reverted once glibmm is fixed.

8 years agobuild: Use common SWIG defines for Python and Java
Daniel Elstner [Thu, 29 Oct 2015 21:39:44 +0000 (22:39 +0100)]
build: Use common SWIG defines for Python and Java

Make the Python and Java bindings use the same set of preprocessor
macros for the SWIG parsing stage, taken from a make variable. Add
G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS to that set.

8 years agosysclk-lwla: Read test word twice during initialization
Daniel Elstner [Sun, 25 Oct 2015 02:44:55 +0000 (03:44 +0100)]
sysclk-lwla: Read test word twice during initialization

During initialization of the LWLA1034, read the 64-bit test word
twice and verify the result of the second read only. This better
matches what the original vendor software does.

8 years agosysclk-lwla: Clarify function of registers 10B0 to 10BC
Daniel Elstner [Sun, 25 Oct 2015 01:26:44 +0000 (02:26 +0100)]
sysclk-lwla: Clarify function of registers 10B0 to 10BC

Apparently, these four registers form an interface for indirect
access to another internal 64 bit wide memory. This is likely the
same memory as that accessed by the bulk transfer commands 7 and 8.

8 years agoMakefile.am: Avoid non-portable -t option for $(INSTALL).
Uwe Hermann [Thu, 29 Oct 2015 22:59:12 +0000 (23:59 +0100)]
Makefile.am: Avoid non-portable -t option for $(INSTALL).

The 'install' tool doesn't have a -t option on all platforms
(e.g. Mac OS X or FreeBSD).

8 years agokorad-kdxxxxp: Minor cosmetics and consistency changes.
Uwe Hermann [Thu, 29 Oct 2015 17:51:09 +0000 (18:51 +0100)]
korad-kdxxxxp: Minor cosmetics and consistency changes.

8 years agoOver voltage and current protection support
Hannu Vuolasaho [Wed, 21 Oct 2015 22:05:37 +0000 (01:05 +0300)]
Over voltage and current protection support

Developed against Velleman LABPS3005D and seems to work.

8 years agoSupport for regulation status and fix for mysterious M
Hannu Vuolasaho [Wed, 21 Oct 2015 16:04:37 +0000 (19:04 +0300)]
Support for regulation status and fix for mysterious M

Added support for SR_CONF_REGULATION which returns value for CH1
Also VELLEMAN LABPS3005D (only device currently supported) sends single
'M' character in beginning of return value, which is specially discarded.

8 years agoJava: Avoid dangerous writes via casted pointers
Daniel Elstner [Mon, 26 Oct 2015 06:29:50 +0000 (07:29 +0100)]
Java: Avoid dangerous writes via casted pointers

Writing to an object through a pointer of incompatible type is
really evil. Even when the data size matches, it is still a
violation of strict aliasing rules.

Replace all instances by direct casts of the value, without the
unnecessary and dangerous indirection.

8 years agoSWIG: Avoid unseparated template closing brackets
Daniel Elstner [Mon, 26 Oct 2015 04:47:21 +0000 (05:47 +0100)]
SWIG: Avoid unseparated template closing brackets

SWIG 2.0.12 fails with a syntax error on ">>".

8 years agoC++: Catch exceptions from stoi() and stod().
Martin Ling [Sun, 25 Oct 2015 23:30:49 +0000 (23:30 +0000)]
C++: Catch exceptions from stoi() and stod().

Fixes bug #483.

8 years agojava: Add doxygen output directory to .gitignore.
Martin Ling [Sun, 25 Oct 2015 19:26:42 +0000 (19:26 +0000)]
java: Add doxygen output directory to .gitignore.

8 years agojava: Usable wrapping of Configurable.config_keys().
Martin Ling [Sun, 25 Oct 2015 16:02:54 +0000 (16:02 +0000)]
java: Usable wrapping of Configurable.config_keys().

8 years agoMakefile.am: Make SWIG wrappers also depend on new templates.i file.
Martin Ling [Sun, 25 Oct 2015 14:43:15 +0000 (14:43 +0000)]
Makefile.am: Make SWIG wrappers also depend on new templates.i file.

8 years agopython: Give all enum values __doc__ strings.
Martin Ling [Sun, 25 Oct 2015 14:04:49 +0000 (14:04 +0000)]
python: Give all enum values __doc__ strings.

8 years agopython: Add docstrings for enum constants.
Martin Ling [Sun, 25 Oct 2015 12:06:20 +0000 (12:06 +0000)]
python: Add docstrings for enum constants.

8 years agojava: Add docstrings for enum constants.
Martin Ling [Sun, 25 Oct 2015 03:01:30 +0000 (03:01 +0000)]
java: Add docstrings for enum constants.

8 years agoC++: Include enum classes when generating documentation.
Martin Ling [Sun, 25 Oct 2015 02:07:35 +0000 (02:07 +0000)]
C++: Include enum classes when generating documentation.

8 years agoC++: Declare namespace in enums.hpp so it can be used independently.
Martin Ling [Sun, 25 Oct 2015 01:57:26 +0000 (01:57 +0000)]
C++: Declare namespace in enums.hpp so it can be used independently.

8 years agojava: Make enum values available as normal constants.
Martin Ling [Sun, 25 Oct 2015 01:39:16 +0000 (01:39 +0000)]
java: Make enum values available as normal constants.

8 years agoJava: Remove obsolete SourceCallback interface
Daniel Elstner [Mon, 26 Oct 2015 06:11:20 +0000 (07:11 +0100)]
Java: Remove obsolete SourceCallback interface

8 years agoC++: Avoid const ref args to appease Java bindings
Daniel Elstner [Mon, 26 Oct 2015 06:04:10 +0000 (07:04 +0100)]
C++: Avoid const ref args to appease Java bindings

The Java bindings currently have some weird problem with function
arguments passed by const reference. Not all types are affected,
but the collection types that involve custom typemaps are.

For now, revert back to pass-by-value for the problematic types.

8 years agoC++: Use C++98 syntax for default arguments to appease SWIG
Daniel Elstner [Mon, 26 Oct 2015 04:18:06 +0000 (05:18 +0100)]
C++: Use C++98 syntax for default arguments to appease SWIG

Looks like SWIG silently ignores default arguments specified via
aggregate initialization. This is rather unfortunate, especially
if the argument types are complex.

8 years agoC++: Replace custom deleters with std::default_delete
Daniel Elstner [Thu, 15 Oct 2015 17:21:28 +0000 (19:21 +0200)]
C++: Replace custom deleters with std::default_delete

Replace custom Deleter classes with std::default_delete<>, declared
as friend so it can invoke the private destructor. Inexplicably,
std::shared_ptr<> does not use default_delete<> by default, so it
is still necessary to explicitly specify the deleter when creating
shared_ptr instances.

With this, unique_ptr and shared_ptr instances now use the same
default delete mechanism.

8 years agoC++: Use smart pointers instead of manual delete
Daniel Elstner [Thu, 15 Oct 2015 16:32:44 +0000 (18:32 +0200)]
C++: Use smart pointers instead of manual delete

Make use of std::unique_ptr<> to manage the lifetime of members
or container elements, so that manual invocations of delete can
be avoided. This also provides for exception safety.

Since std::unique_ptr<> is only movable but not copyable, adapt
the code to avoid copies and assignments of these pointers.

8 years agoC++: Move C struct pointers out of ownership classes
Daniel Elstner [Sun, 11 Oct 2015 15:57:30 +0000 (17:57 +0200)]
C++: Move C struct pointers out of ownership classes

Reduce needless over-generalization. There is no design need
for the ParentOwned and UserOwned classes to contain the C base
struct pointer. Instead, just make the _structure pointer a
private member of each class that needs one.

8 years agoC++: Rename get_shared_pointer() to share_owned_by()
Daniel Elstner [Sun, 11 Oct 2015 15:11:37 +0000 (17:11 +0200)]
C++: Rename get_shared_pointer() to share_owned_by()

This makes it clearer that this method assigns the parent
(owner) reference.

8 years agoC++: Use shared_from_this() exclusively on this
Daniel Elstner [Sun, 11 Oct 2015 15:01:05 +0000 (17:01 +0200)]
C++: Use shared_from_this() exclusively on this

Never call shared_from_this() on any object other than "this".
Adapt the API so that it can be made protected.

8 years agoC++: Make most members private instead of protected
Daniel Elstner [Sun, 11 Oct 2015 12:51:51 +0000 (14:51 +0200)]
C++: Make most members private instead of protected

Use protected only for members which are actually needed by
sub-classes. Declare all the rest private.

8 years agoSWIG: Hack around SWIG segfault on private destructors
Daniel Elstner [Sun, 11 Oct 2015 12:31:18 +0000 (14:31 +0200)]
SWIG: Hack around SWIG segfault on private destructors

Apparently this problem has been fixed in SWIG 3.0.6. However,
until we can require that version, define "private" as "protected"
when running the SWIG parser.

8 years agoC++: Make value get accessors const
Daniel Elstner [Sun, 11 Oct 2015 11:57:42 +0000 (13:57 +0200)]
C++: Make value get accessors const

Declare accessor methods that return value members const. For now,
skip all cases where constness would have to be applied transitively
to shared objects.

8 years agoC++: Make some methods static to match the C API
Daniel Elstner [Sun, 11 Oct 2015 10:35:01 +0000 (12:35 +0200)]
C++: Make some methods static to match the C API

Context::package_version() and Context::lib_version() do not access
context state and should be static. However, leave the logging
related methods alone for now, as making them static would entail
making the callback data a global static, since the C API lacks
destroy notification callbacks.

8 years agoC++: Declare all callbacks invoked from C noexcept
Daniel Elstner [Wed, 14 Oct 2015 18:56:51 +0000 (20:56 +0200)]
C++: Declare all callbacks invoked from C noexcept

If one of these functions does throw an exception, std::terminate()
will be called. Without this, the behavior is undefined since the C
stack is not prepared to deal with exceptions.

8 years agoC++: Use noexcept instead of throw()
Daniel Elstner [Sun, 11 Oct 2015 10:19:27 +0000 (12:19 +0200)]
C++: Use noexcept instead of throw()

Runtime-checked exception specifications via throw() are
deprecated in C++11.

8 years agoSWIG: Define "noexcept" empty to work around SWIG bug
Daniel Elstner [Sun, 11 Oct 2015 10:12:28 +0000 (12:12 +0200)]
SWIG: Define "noexcept" empty to work around SWIG bug

The SWIG 2.0.12 on my system bails out with a syntax error on the
"noexcept" keyword in C++11 code. Define "noexcept" to nothing (for
the SWIG parser only) to work around this problem.

8 years agoC++: Make most constructors explicit
Daniel Elstner [Sun, 11 Oct 2015 09:39:07 +0000 (11:39 +0200)]
C++: Make most constructors explicit

Unless implicit conversion is desired, constructors that can be
called with one argument should be marked as "explicit".

8 years agoC++: Do not use C-style casts
Daniel Elstner [Sun, 11 Oct 2015 08:48:12 +0000 (10:48 +0200)]
C++: Do not use C-style casts

Never ever.