From 35109e1dd8b594414f827bead8162269a2c93895 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Wed, 9 Jul 2014 10:10:27 -0400 Subject: [PATCH] Some formatting updates --- openbr/core/core.cpp | 8 ++++---- openbr/core/qtutils.cpp | 2 +- openbr/openbr.cpp | 20 ++++++++++---------- openbr/openbr_plugin.cpp | 2 +- openbr/openbr_plugin.h | 4 ++-- openbr/plugins/distance.cpp | 2 +- openbr/plugins/frames.cpp | 2 +- openbr/plugins/openbr_internal.h | 4 ++-- openbr/plugins/pp5.cpp | 6 +++--- openbr/plugins/process.cpp | 28 ++++++++++++++-------------- openbr/plugins/validate.cpp | 2 +- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 70b2991..e19bc80 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -52,7 +52,7 @@ struct AlgorithmCore CompositeTransform *downcast = dynamic_cast(trainingWrapper.data()); if (downcast == NULL) qFatal("downcast failed?"); - downcast->transforms.append(this->transform.data()); + downcast->transforms.append(transform.data()); downcast->init(); @@ -149,7 +149,7 @@ struct AlgorithmCore Gallery *temp = Gallery::make(input); qint64 total = temp->totalSize(); - Transform * enroll = this->transform.data(); + Transform *enroll = transform.data(); if (multiProcess) enroll = wrapTransform(enroll, "ProcessWrapper"); @@ -430,7 +430,7 @@ struct AlgorithmCore if (needEnrollRows) enrollCompare.prepend(this->transform.data()); - Transform * compareRegionBase = pipeTransforms(enrollCompare); + Transform *compareRegionBase = pipeTransforms(enrollCompare); // If in multi-process mode, wrap the enroll+compare structure in a ProcessWrapper. if (multiProcess) compareRegionBase = wrapTransform(compareRegionBase, "ProcessWrapper"); @@ -460,7 +460,7 @@ struct AlgorithmCore // With this, we have set up a transform which (optionally) enrolls templates, compares them // against a gallery, and outputs them. - Transform * pipeline = br::pipeTransforms(compareOutput); + Transform *pipeline = br::pipeTransforms(compareOutput); // Now, we will give that base transform to a stream, which will incrementally read the row gallery // and pass the transforms it reads through the base algorithm. diff --git a/openbr/core/qtutils.cpp b/openbr/core/qtutils.cpp index 085a7a5..9e9b1e9 100644 --- a/openbr/core/qtutils.cpp +++ b/openbr/core/qtutils.cpp @@ -105,7 +105,7 @@ void writeFile(const QString &file, const QStringList &lines) if (!f.open(QFile::WriteOnly)) qFatal("Failed to open %s for writing.", qPrintable(file)); - foreach (const QString & line, lines) + foreach (const QString &line, lines) f.write((line+"\n").toLocal8Bit() ); f.close(); diff --git a/openbr/openbr.cpp b/openbr/openbr.cpp index 0d1c9c8..f1a3ae4 100644 --- a/openbr/openbr.cpp +++ b/openbr/openbr.cpp @@ -28,7 +28,7 @@ using namespace br; -static int partialCopy(const QString & string, char * buffer, int buffer_length) +static int partialCopy(const QString &string, char *buffer, int buffer_length) { QByteArray byteArray = string.toLocal8Bit(); @@ -109,7 +109,7 @@ float br_eval(const char *simmat, const char *mask, const char *csv) return Evaluate(simmat, mask, csv); } -float br_inplace_eval(const char * simmat, const char *target, const char *query, const char *csv) +float br_inplace_eval(const char *simmat, const char *target, const char *query, const char *csv) { return InplaceEval(simmat, target, query, csv); } @@ -119,7 +119,7 @@ void br_eval_classification(const char *predicted_gallery, const char *truth_gal EvalClassification(predicted_gallery, truth_gallery, predicted_property, truth_property); } -void br_eval_clustering(const char *csv, const char *gallery, const char * truth_property) +void br_eval_clustering(const char *csv, const char *gallery, const char *truth_property) { EvalClustering(csv, gallery, truth_property); } @@ -178,12 +178,12 @@ void br_make_pairwise_mask(const char *target_input, const char *query_input, co BEE::makePairwiseMask(target_input, query_input, mask); } -int br_most_recent_message(char * buffer, int buffer_length) +int br_most_recent_message(char *buffer, int buffer_length) { return partialCopy(Globals->mostRecentMessage, buffer, buffer_length); } -int br_objects(char * buffer, int buffer_length, const char *abstractions, const char *implementations, bool parameters) +int br_objects(char *buffer, int buffer_length, const char *abstractions, const char *implementations, bool parameters) { return partialCopy(br::Context::objects(abstractions, implementations, parameters).join('\n'), buffer, buffer_length); } @@ -240,7 +240,7 @@ void br_read_pipe(const char *pipe, int *argc, char ***argv) *argv = rawCharArrayList.data(); } -int br_scratch_path(char * buffer, int buffer_length) +int br_scratch_path(char *buffer, int buffer_length) { return partialCopy(Context::scratchPath(), buffer, buffer_length); } @@ -298,9 +298,9 @@ const char *br_version() return version.data(); } -void br_slave_process(const char * baseName) +void br_slave_process(const char *baseName) { - WorkerProcess * worker = new WorkerProcess; + WorkerProcess *worker = new WorkerProcess; worker->transform = Globals->algorithm; worker->baseName = baseName; worker->mainLoop(); @@ -371,7 +371,7 @@ bool br_img_is_empty(br_template tmpl) return t->m().empty(); } -int br_get_filename(char * buffer, int buffer_length, br_template tmpl) +int br_get_filename(char *buffer, int buffer_length, br_template tmpl) { return partialCopy(reinterpret_cast(tmpl)->file.name, buffer, buffer_length); } @@ -382,7 +382,7 @@ void br_set_filename(br_template tmpl, const char *filename) t->file.name = filename; } -int br_get_metadata_string(char * buffer, int buffer_length, br_template tmpl, const char *key) +int br_get_metadata_string(char *buffer, int buffer_length, br_template tmpl, const char *key) { Template *t = reinterpret_cast(tmpl); QVariant qvar = t->file.value(key); diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index fb107c7..2c29737 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -1303,7 +1303,7 @@ Transform *Transform::make(QString str, QObject *parent) Transform *Transform::clone() const { - Transform * temp = (Transform *) this; + Transform *temp = (Transform *) this; Transform *clone = Factory::make("."+temp->description(false)); return clone; } diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 949db6d..57e802d 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -592,7 +592,7 @@ public: virtual void store(QDataStream &stream, bool force = false) const; /*!< \brief Serialize the object. */ virtual void load(QDataStream &stream); /*!< \brief Deserialize the object. Default implementation calls init() after deserialization. */ - virtual void serialize(QDataStream & stream, bool force) + virtual void serialize(QDataStream &stream, bool force) { stream << description(force); store(stream, force); @@ -1315,7 +1315,7 @@ inline TemplateList &operator>>(TemplateList &srcdst, const Transform &f) /*! * \brief Convenience function equivalent to store(). */ -inline QDataStream &operator<<(QDataStream &stream, const Transform &f) +inline QDataStream &operator<<(QDataStream &stream, Transform &f) { f.store(stream); return stream; diff --git a/openbr/plugins/distance.cpp b/openbr/plugins/distance.cpp index a6ac657..a01ed8a 100644 --- a/openbr/plugins/distance.cpp +++ b/openbr/plugins/distance.cpp @@ -483,7 +483,7 @@ class GalleryCompareTransform : public Transform gallery = TemplateList::fromGallery(galleryName); } - void train(const TemplateList & data) + void train(const TemplateList &data) { gallery = data; } diff --git a/openbr/plugins/frames.cpp b/openbr/plugins/frames.cpp index 58a3def..752dd7f 100644 --- a/openbr/plugins/frames.cpp +++ b/openbr/plugins/frames.cpp @@ -37,7 +37,7 @@ private: dst.append(out); } - void finalize(TemplateList & output) + void finalize(TemplateList &output) { (void) output; buffer.clear(); diff --git a/openbr/plugins/openbr_internal.h b/openbr/plugins/openbr_internal.h index 999c05e..09b3c24 100644 --- a/openbr/plugins/openbr_internal.h +++ b/openbr/plugins/openbr_internal.h @@ -213,7 +213,7 @@ public: return false; } - Transform * smartCopy(bool & newTransform) + Transform *smartCopy(bool &newTransform) { if (!timeVarying()) { newTransform = false; @@ -240,7 +240,7 @@ public: qFatal("Dynamic cast failed!"); bool newItem = false; - Transform * maybe_copy = transform->smartCopy(newItem); + Transform *maybe_copy = transform->smartCopy(newItem); if (newItem) maybe_copy->setParent(output); output->transform = maybe_copy; diff --git a/openbr/plugins/pp5.cpp b/openbr/plugins/pp5.cpp index c3e960c..4739fae 100644 --- a/openbr/plugins/pp5.cpp +++ b/openbr/plugins/pp5.cpp @@ -452,7 +452,7 @@ class PP5GalleryTransform: public UntrainableMetaTransform QList targetIDs; TemplateList gallery; - void project(const Template & src, Template & dst) const + void project(const Template &src, Template &dst) const { TemplateList temp, output; temp.append(src); @@ -461,7 +461,7 @@ class PP5GalleryTransform: public UntrainableMetaTransform dst = output[0]; } - void project(const TemplateList & src, TemplateList & dst) const + void project(const TemplateList &src, TemplateList &dst) const { dst.clear(); QList queryIDs; @@ -505,7 +505,7 @@ class PP5GalleryTransform: public UntrainableMetaTransform } } - void train(const TemplateList & data) + void train(const TemplateList &data) { gallery = data; } diff --git a/openbr/plugins/process.cpp b/openbr/plugins/process.cpp index 29f5969..e5933fc 100644 --- a/openbr/plugins/process.cpp +++ b/openbr/plugins/process.cpp @@ -21,7 +21,7 @@ class CommunicationManager : public QObject { Q_OBJECT public: - QThread * basis; + QThread *basis; CommunicationManager() { basis = new QThread; @@ -294,7 +294,7 @@ public: QString serverName; QString remoteName; - QLocalSocket * inbound; + QLocalSocket *inbound; QLocalSocket outbound; QLocalServer server; @@ -309,7 +309,7 @@ public: } } - void connectToRemote(const QString & remoteName) + void connectToRemote(const QString &remoteName) { emit pulseOutboundConnect(remoteName); @@ -328,7 +328,7 @@ public: template - bool readData(T & input) + bool readData(T &input) { emit pulseReadSerialized(); QDataStream deserializer(readArray); @@ -336,18 +336,18 @@ public: return true; } - Transform * readTForm() + Transform *readTForm() { emit pulseReadSerialized(); QByteArray data = readArray; QDataStream deserializer(data); - Transform * res = Transform::deserialize(deserializer); + Transform *res = Transform::deserialize(deserializer); return res; } template - bool sendData(const T & output) + bool sendData(const T &output) { QBuffer buffer; buffer.open(QBuffer::ReadWrite); @@ -386,7 +386,7 @@ class EnrollmentWorker : public QObject { Q_OBJECT public: - CommunicationManager * comm; + CommunicationManager *comm; QString name; ~EnrollmentWorker() @@ -397,10 +397,10 @@ public: delete comm; } - br::Transform * transform; + br::Transform *transform; public: - void connections(const QString & baseName) + void connections(const QString &baseName) { comm = new CommunicationManager(); name = baseName; @@ -521,7 +521,7 @@ class ProcessWrapperTransform : public WrapperTransform Resource processes; - Transform * smartCopy(bool & newTransform) + Transform *smartCopy(bool &newTransform) { newTransform = false; return this; @@ -536,7 +536,7 @@ class ProcessWrapperTransform : public WrapperTransform if (!data->initialized) activateProcess(data); - CommunicationManager * localComm = &(data->comm); + CommunicationManager *localComm = &(data->comm); localComm->sendSignal(CommunicationManager::INPUT_AVAILABLE); localComm->sendData(src); @@ -560,7 +560,7 @@ class ProcessWrapperTransform : public WrapperTransform } QByteArray serialized; - void transmitTForm(CommunicationManager * localComm) const + void transmitTForm(CommunicationManager *localComm) const { if (serialized.isEmpty() ) qFatal("Trying to transmit empty transform!"); @@ -569,7 +569,7 @@ class ProcessWrapperTransform : public WrapperTransform emit localComm->pulseSendSerialized(); } - void activateProcess(ProcessData * data) const + void activateProcess(ProcessData *data) const { data->initialized = true; // generate a uuid for our local servers diff --git a/openbr/plugins/validate.cpp b/openbr/plugins/validate.cpp index 873c9ec..ef04661 100644 --- a/openbr/plugins/validate.cpp +++ b/openbr/plugins/validate.cpp @@ -7,7 +7,7 @@ namespace br { -static void _train(Transform * transform, TemplateList data) // think data has to be a copy -cao +static void _train(Transform *transform, TemplateList data) // think data has to be a copy -cao { transform->train(data); } -- libgit2 0.21.4