From e38da1ca25d81e709463c36fb2c944ebdb72399c Mon Sep 17 00:00:00 2001 From: Adrian Knoth Date: Fri, 14 Feb 2014 14:32:53 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Added=20St=C3=A9phane=20review=20fixe?= =?UTF-8?q?s=20:"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f08a3f42343b0bb2c303aea8bc80f2bb306cb3c3. --- codeBlocks/jack2.cbp | 5 +- codeBlocks/jack2.layout | 303 +++++------------- .../{JackIIODriver.cpp => JackIIODriver.C} | 11 +- .../iio/{JackIIODriver.h => JackIIODriver.H} | 0 linux/wscript | 4 +- 5 files changed, 95 insertions(+), 228 deletions(-) rename linux/iio/{JackIIODriver.cpp => JackIIODriver.C} (97%) rename linux/iio/{JackIIODriver.h => JackIIODriver.H} (100%) diff --git a/codeBlocks/jack2.cbp b/codeBlocks/jack2.cbp index 93a26bb6..8d49beb2 100644 --- a/codeBlocks/jack2.cbp +++ b/codeBlocks/jack2.cbp @@ -477,9 +477,10 @@ + + - - diff --git a/codeBlocks/jack2.layout b/codeBlocks/jack2.layout index cacfa18d..ce7dad1b 100644 --- a/codeBlocks/jack2.layout +++ b/codeBlocks/jack2.layout @@ -1,114 +1,64 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -116,179 +66,104 @@ - - - - - - - - - - - + - + - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - + @@ -296,74 +171,74 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/linux/iio/JackIIODriver.cpp b/linux/iio/JackIIODriver.C similarity index 97% rename from linux/iio/JackIIODriver.cpp rename to linux/iio/JackIIODriver.C index 127af7be..4f934801 100644 --- a/linux/iio/JackIIODriver.cpp +++ b/linux/iio/JackIIODriver.C @@ -17,7 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "JackIIODriver.h" +#include "JackIIODriver.H" #include "driver_interface.h" #include "JackEngineControl.h" #include "JackGraphManager.h" @@ -175,13 +175,11 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke // interrogate the available iio devices searching for the chip name if (iio_driver->iio.findDevicesByChipName(chipName)!=NO_ERROR) { // find all devices with a particular chip which are present. jack_error("\nThe iio driver found no devices by the name %s\n", chipName.c_str()); - delete iio_driver; return NULL; } if (iio_driver->iio.getDeviceCnt()<1) { // If there are no devices found by that chip name, then indicate. jack_error("\nThe iio driver found no devices by the name %s\n", chipName.c_str()); - delete iio_driver; return NULL; } @@ -196,7 +194,6 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke int ret=iio_driver->iio.getReadArray(periodSize, iio_driver->data); // resize the array to be able to read enough memory if (ret!=NO_ERROR) { jack_error("iio::getReadArray couldn't create the data buffer, indicating the problem."); - delete iio_driver; return NULL; } if (iio_driver->data.cols()>colCnt) // resize the data columns to match the specified number of columns (channels / channels per device) @@ -204,7 +201,6 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke ret=iio_driver->iio.open(periodCount, periodSize); // try to open all IIO devices if (ret!=NO_ERROR) - delete iio_driver; return NULL; Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(iio_driver); @@ -220,11 +216,6 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke } else jack_error("\nHave you run out of memory ? I tried to create Jack's standard threaded driver in memory but failed! The good news is that you had enough memory to create the IIO driver.\n"); - if (!threaded_driver) { // handle the case that the threaded_driver was not created succ. - delete iio_driver; - iio_driver=NULL; - } - return threaded_driver; } diff --git a/linux/iio/JackIIODriver.h b/linux/iio/JackIIODriver.H similarity index 100% rename from linux/iio/JackIIODriver.h rename to linux/iio/JackIIODriver.H diff --git a/linux/wscript b/linux/wscript index 3e7f097d..caf286a5 100644 --- a/linux/wscript +++ b/linux/wscript @@ -19,7 +19,7 @@ def configure(conf): conf.env['BUILD_DRIVER_IIO'] += conf.is_defined('HAVE_EIGEN3') conf.check_cfg(package='sox', atleast_version='14.4.0', args='--cflags --libs', mandatory=False) conf.env['BUILD_DRIVER_IIO'] += conf.is_defined('HAVE_SOX') - + def create_jack_driver_obj(bld, target, sources, uselib = None): driver = bld(features = ['c', 'cxx', 'cxxshlib', 'cshlib']) @@ -82,7 +82,7 @@ def build(bld): 'firewire/JackFFADOMidiSendQueue.cpp' ] - iio_driver_src = ['iio/JackIIODriver.cpp'] + iio_driver_src = ['iio/JackIIODriver.C'] if bld.env['BUILD_DRIVER_ALSA'] == True: create_jack_driver_obj(bld, 'alsa', alsa_driver_src, ["ALSA"])