From d15634d66d4b7682c0703c5cc78d7bd10ff9d37f Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Thu, 3 Jul 2014 15:22:06 -0400 Subject: [PATCH] Compress " * " to " *" --- app/br/br.cpp | 2 +- openbr/core/core.cpp | 22 +++++++++++----------- openbr/openbr_plugin.cpp | 8 ++++---- openbr/openbr_plugin.h | 6 +++--- openbr/plugins/gui.cpp | 30 +++++++++++++++--------------- openbr/plugins/meta.cpp | 6 +++--- openbr/plugins/misc.cpp | 2 +- openbr/plugins/openbr_internal.h | 22 +++++++++++----------- openbr/plugins/slidingwindow.cpp | 6 +++--- openbr/plugins/stream.cpp | 76 ++++++++++++++++++++++++++++++++++++++-------------------------------------- 10 files changed, 90 insertions(+), 90 deletions(-) diff --git a/app/br/br.cpp b/app/br/br.cpp index 170d651..b19982f 100644 --- a/app/br/br.cpp +++ b/app/br/br.cpp @@ -178,7 +178,7 @@ public: } else if (!strcmp(fun, "objects")) { check(parc <= 2, "Incorrect parameter count for 'objects'."); int size = br_objects(NULL, 0, parc >= 1 ? parv[0] : ".*", parc >= 2 ? parv[1] : ".*"); - char * temp = new char[size]; + char *temp = new char[size]; br_objects(temp, size, parc >= 1 ? parv[0] : ".*", parc >= 2 ? parv[1] : ".*"); printf("%s\n", temp); delete [] temp; diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index c21afb8..2133c1f 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -49,7 +49,7 @@ struct AlgorithmCore QScopedPointer trainingWrapper(Transform::make("DirectStream(readMode=DistributeFrames)", NULL)); - CompositeTransform * downcast = dynamic_cast(trainingWrapper.data()); + CompositeTransform *downcast = dynamic_cast(trainingWrapper.data()); if (downcast == NULL) qFatal("downcast failed?"); downcast->transforms.append(this->transform.data()); @@ -144,7 +144,7 @@ struct AlgorithmCore fileExclusion = true; } - Gallery * temp = Gallery::make(input); + Gallery *temp = Gallery::make(input); qint64 total = temp->totalSize(); Globals->currentStep = 0; @@ -156,13 +156,13 @@ struct AlgorithmCore if (!multiProcess) { basePipe.reset(Transform::make(pipeDesc,NULL)); - CompositeTransform * downcast = dynamic_cast(basePipe.data()); + CompositeTransform *downcast = dynamic_cast(basePipe.data()); if (downcast == NULL) qFatal("downcast failed?"); downcast->transforms.prepend(this->transform.data()); if (fileExclusion) { - Transform * temp = Transform::make("FileExclusion(" + gallery.flat() + ")", downcast); + Transform *temp = Transform::make("FileExclusion(" + gallery.flat() + ")", downcast); downcast->transforms.prepend(temp); } @@ -180,7 +180,7 @@ struct AlgorithmCore // Next, we make a Stream (with placeholder transform) QString streamDesc = "Stream(readMode=StreamGallery)"; QScopedPointer baseStream(Transform::make(streamDesc, NULL)); - WrapperTransform * wrapper = dynamic_cast (baseStream.data()); + WrapperTransform *wrapper = dynamic_cast (baseStream.data()); // replace that placeholder with the pipe we built wrapper->transform = basePipe.data(); @@ -373,7 +373,7 @@ struct AlgorithmCore File colGallery = targetGallery; qint64 rowSize; - Gallery * temp; + Gallery *temp; if (transposeMode) { rowGallery = targetGallery; @@ -456,7 +456,7 @@ struct AlgorithmCore { compareRegionDesc = compareRegionDesc; compareRegion.reset(Transform::make(compareRegionDesc,NULL)); - CompositeTransform * downcast = dynamic_cast (compareRegion.data()); + CompositeTransform *downcast = dynamic_cast (compareRegion.data()); if (downcast == NULL) qFatal("Pipe downcast failed in compare"); @@ -496,7 +496,7 @@ struct AlgorithmCore // Assign the comparison transform we previously built, and the output transform we just built to // two stages of a pipe. - CompositeTransform * downcast = dynamic_cast (join.data()); + CompositeTransform *downcast = dynamic_cast (join.data()); downcast->transforms.append(compareRegion.data()); downcast->transforms.append(outputTform.data()); @@ -508,7 +508,7 @@ struct AlgorithmCore // and pass the transforms it reads through the base algorithm. QString streamDesc = "Stream(readMode=StreamGallery)"; QScopedPointer streamBase(Transform::make(streamDesc, NULL)); - WrapperTransform * streamWrapper = dynamic_cast (streamBase.data()); + WrapperTransform *streamWrapper = dynamic_cast (streamBase.data()); streamWrapper->transform = join.data(); // The transform we will use is now complete. @@ -687,7 +687,7 @@ void br::Convert(const File &fileType, const File &inputFile, const File &output if (targetFiles.size() != m.cols) { - MatrixOutput * mOut = dynamic_cast(o.data()); + MatrixOutput *mOut = dynamic_cast(o.data()); if (mOut) mOut->data.create(queryFiles.size(), 1, CV_32FC1); } @@ -730,7 +730,7 @@ QSharedPointer br::Transform::fromAlgorithm(const QString &algori else { QSharedPointer orig_tform = AlgorithmManager::getAlgorithm(algorithm)->transform; QSharedPointer newRoot = QSharedPointer(Transform::make("Stream(readMode=DistributeFrames)", NULL)); - WrapperTransform * downcast = dynamic_cast (newRoot.data()); + WrapperTransform *downcast = dynamic_cast (newRoot.data()); downcast->transform = orig_tform.data(); downcast->init(); return newRoot; diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index f9dd0c6..e127f55 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -1310,7 +1310,7 @@ QList Transform::getChildren() const { QList output; for (int i=0; i < metaObject()->propertyCount(); i++) { - const char * prop_name = metaObject()->property(i).name(); + const char *prop_name = metaObject()->property(i).name(); const QVariant &variant = this->property(prop_name); if (variant.canConvert()) @@ -1321,11 +1321,11 @@ QList Transform::getChildren() const return output; } -TemplateEvent * Transform::getEvent(const QString &name) +TemplateEvent *Transform::getEvent(const QString &name) { - foreach(Transform * child, getChildren()) + foreach(Transform *child, getChildren()) { - TemplateEvent * probe = child->getEvent(name); + TemplateEvent *probe = child->getEvent(name); if (probe) return probe; } diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 276d22d..0f9d8a0 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -1258,14 +1258,14 @@ public: * and copy enough of their state that projectUpdate can safely be called on the original * instance, and the copy concurrently. */ - virtual Transform * smartCopy(bool &newTransform) { newTransform=false; return this;} + virtual Transform *smartCopy(bool &newTransform) { newTransform=false; return this;} - virtual Transform * smartCopy() {bool junk; return smartCopy(junk);} + virtual Transform *smartCopy() {bool junk; return smartCopy(junk);} /*! * \brief Recursively retrieve a named event, returns NULL if an event is not found. */ - virtual TemplateEvent * getEvent(const QString &name); + virtual TemplateEvent *getEvent(const QString &name); /*! * \brief Get a list of child transforms of this transform, child transforms are considered to be diff --git a/openbr/plugins/gui.cpp b/openbr/plugins/gui.cpp index 80f75f3..54f37c9 100644 --- a/openbr/plugins/gui.cpp +++ b/openbr/plugins/gui.cpp @@ -46,7 +46,7 @@ template class ActualCreation : public NominalCreation { public: - T * basis; + T *basis; void creation() { @@ -83,7 +83,7 @@ public: // the template with the NominalCreation interface, and call worker->creation // in the slot. template - T * getItem() + T *getItem() { // If this is called by the main thread, we can just create the object // it's important to check, otherwise we will have problems trying to @@ -103,12 +103,12 @@ public: emit needCreation(); // collect the results, and return. - T * output = actualWorker->basis; + T *output = actualWorker->basis; delete actualWorker; return output; } - NominalCreation * worker; + NominalCreation *worker; signals: void needCreation(); @@ -135,7 +135,7 @@ protected: public: - DisplayWindow(QWidget * parent = NULL) : QLabel(parent) + DisplayWindow(QWidget *parent = NULL) : QLabel(parent) { setFixedSize(200,200); QApplication::instance()->installEventFilter(this); @@ -161,7 +161,7 @@ public slots: setFixedSize(temp); } - bool eventFilter(QObject * obj, QEvent * event) + bool eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::KeyPress) { @@ -292,7 +292,7 @@ public: } else { if (event->type() == QEvent::KeyPress) { - QKeyEvent * kevent = (QKeyEvent *) event; + QKeyEvent *kevent = (QKeyEvent *) event; if (kevent->key() == Qt::Key_Enter || kevent->key() == Qt::Key_Return) { event->accept(); return true; @@ -370,13 +370,13 @@ private: class PromptWindow : public DisplayWindow { - bool eventFilter(QObject * obj, QEvent * event) + bool eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::KeyPress) { event->accept(); - QKeyEvent * key_event = dynamic_cast (event); + QKeyEvent *key_event = dynamic_cast (event); if (key_event == NULL) { qDebug("failed to donwcast key event"); return true; @@ -419,7 +419,7 @@ class GUIWindow : public QMainWindow public: - GUIWindow(QWidget * parent = NULL) : QMainWindow(parent) + GUIWindow(QWidget *parent = NULL) : QMainWindow(parent) { centralWidget = new QWidget(); layout = new QHBoxLayout(); @@ -614,9 +614,9 @@ public: protected: MainThreadCreator creator; - DisplayWindow * window; + DisplayWindow *window; QImage qImageBuffer; - QPixmap * displayBuffer; + QPixmap *displayBuffer; signals: void updateImage(const QPixmap &input); @@ -772,7 +772,7 @@ public: } } } - RectMarkingWindow * trueWindow; + RectMarkingWindow *trueWindow; void init() { if (!Globals->useGui) @@ -812,7 +812,7 @@ public: void project(const TemplateList &src, TemplateList &dst) const { - Transform * non_const = (ElicitTransform *) this; + Transform *non_const = (ElicitTransform *) this; non_const->projectUpdate(src,dst); } @@ -910,7 +910,7 @@ public: } } } - PromptWindow * p_window; + PromptWindow *p_window; void init() diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index b7eff59..4daacc3 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -185,7 +185,7 @@ class PipeTransform : public CompositeTransform QList flattened; for (int i=0;i < transforms.size(); i++) { - PipeTransform * probe = dynamic_cast (transforms[i]); + PipeTransform *probe = dynamic_cast (transforms[i]); if (!probe) { flattened.append(transforms[i]); continue; @@ -641,7 +641,7 @@ class DistributeTemplateTransform : public MetaTransform public: - Transform * smartCopy(bool &newTransform) + Transform *smartCopy(bool &newTransform) { if (!transform->timeVarying()) { newTransform = false; @@ -649,7 +649,7 @@ public: } newTransform = true; - DistributeTemplateTransform * output = new DistributeTemplateTransform; + DistributeTemplateTransform *output = new DistributeTemplateTransform; bool newChild = false; output->transform = transform->smartCopy(newChild); if (newChild) diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index 399c9f4..e2f7c45 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -573,7 +573,7 @@ class EventTransform : public UntrainableMetaTransform event.pulseSignal(dst); } - TemplateEvent * getEvent(const QString &name) + TemplateEvent *getEvent(const QString &name) { return name == eventName ? &event : NULL; } diff --git a/openbr/plugins/openbr_internal.h b/openbr/plugins/openbr_internal.h index bd537f0..17ea22c 100644 --- a/openbr/plugins/openbr_internal.h +++ b/openbr/plugins/openbr_internal.h @@ -48,8 +48,8 @@ protected: class TransformCopier : public ResourceMaker { public: - Transform * basis; - TransformCopier(Transform * _basis) + Transform *basis; + TransformCopier(Transform *_basis) { basis = _basis; } @@ -66,7 +66,7 @@ class TimeInvariantWrapperTransform : public MetaTransform public: Resource transformSource; - TimeInvariantWrapperTransform(Transform * basis) : transformSource(new TransformCopier(basis)) + TimeInvariantWrapperTransform(Transform *basis) : transformSource(new TransformCopier(basis)) { if (!basis) qFatal("TimeInvariantWrapper created with NULL transform"); @@ -76,14 +76,14 @@ public: virtual void project(const Template &src, Template &dst) const { - Transform * aTransform = transformSource.acquire(); + Transform *aTransform = transformSource.acquire(); aTransform->projectUpdate(src,dst); transformSource.release(aTransform); } void project(const TemplateList &src, TemplateList &dst) const { - Transform * aTransform = transformSource.acquire(); + Transform *aTransform = transformSource.acquire(); aTransform->projectUpdate(src,dst); transformSource.release(aTransform); } @@ -94,7 +94,7 @@ public: } private: - Transform * baseTransform; + Transform *baseTransform; }; /*! @@ -139,7 +139,7 @@ public: *\brief For transforms that don't do any training, this default implementation * which creates a new copy of the Transform from its description string is sufficient. */ - virtual Transform * smartCopy(bool &newTransform) + virtual Transform *smartCopy(bool &newTransform) { newTransform = true; return this->clone(); @@ -262,7 +262,7 @@ public: * it creates a new copy of its own class, and gives that copy the child transforms * returned by calling smartCopy on this transforms children */ - Transform * smartCopy(bool &newTransform) + Transform *smartCopy(bool &newTransform) { if (!timeVarying()) { newTransform = false; @@ -284,7 +284,7 @@ public: name += ")"; name.replace("br::",""); - CompositeTransform * output = dynamic_cast(Transform::make(name, NULL)); + CompositeTransform *output = dynamic_cast(Transform::make(name, NULL)); if (output == NULL) qFatal("Dynamic cast failed!"); @@ -292,7 +292,7 @@ public: foreach(Transform* t, transforms ) { bool newItem = false; - Transform * maybe_copy = t->smartCopy(newItem); + Transform *maybe_copy = t->smartCopy(newItem); if (newItem) maybe_copy->setParent(output); output->transforms.append(maybe_copy); @@ -335,7 +335,7 @@ struct WorkerProcess { QString transform; QString baseName; - EnrollmentWorker * processInterface; + EnrollmentWorker *processInterface; void mainLoop(); }; diff --git a/openbr/plugins/slidingwindow.cpp b/openbr/plugins/slidingwindow.cpp index 8e76c51..1ae5663 100644 --- a/openbr/plugins/slidingwindow.cpp +++ b/openbr/plugins/slidingwindow.cpp @@ -428,9 +428,9 @@ private: // each input dimension. Each input dimension corresponds to // one of the input rect region. Thus, each eigenvector represents // a set of overlaping regions. - float * midX = new float[nRegions]; - float * midY = new float[nRegions]; - float * avgWidth = new float[nRegions]; + float *midX = new float[nRegions]; + float *midY = new float[nRegions]; + float *avgWidth = new float[nRegions]; float *avgHeight = new float[nRegions]; float *confs = new float[nRegions]; int *cnts = new int[nRegions]; diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 97fdcc9..f9acf83 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -45,10 +45,10 @@ public: SharedBuffer() {} virtual ~SharedBuffer() {} - virtual void addItem(FrameData * input)=0; + virtual void addItem(FrameData *input)=0; virtual void reset()=0; - virtual FrameData * tryGetItem()=0; + virtual FrameData *tryGetItem()=0; virtual int size()=0; }; @@ -63,14 +63,14 @@ public: next_target = 0; } - void addItem(FrameData * input) + void addItem(FrameData *input) { QMutexLocker bufferLock(&bufferGuard); buffer.insert(input->sequenceNumber, input); } - FrameData * tryGetItem() + FrameData *tryGetItem() { QMutexLocker bufferLock(&bufferGuard); @@ -86,7 +86,7 @@ public: next_target = next_target + 1; - FrameData * output = result.value(); + FrameData *output = result.value(); buffer.erase(result); return output; } @@ -134,19 +134,19 @@ public: } // called from the producer thread - void addItem(FrameData * input) + void addItem(FrameData *input) { QReadLocker readLock(&bufferGuard); inputBuffer->append(input); } - FrameData * tryGetItem() + FrameData *tryGetItem() { QReadLocker readLock(&bufferGuard); // There is something for us to get if (!outputBuffer->empty()) { - FrameData * output = outputBuffer->first(); + FrameData *output = outputBuffer->first(); outputBuffer->removeFirst(); return output; } @@ -165,7 +165,7 @@ public: std::swap(inputBuffer, outputBuffer); // Return a frame - FrameData * output = outputBuffer->first(); + FrameData *output = outputBuffer->first(); outputBuffer->removeFirst(); return output; } @@ -563,7 +563,7 @@ private: // apparently the text in seq files is 16 bit characters (UTF-16?) // since we don't really need the last byte, snad since it gets interpreted as // a terminating char, let's just grab the first byte for storage - void readText(int bytes, char * buffer) + void readText(int bytes, char *buffer) { seqFile.read(buffer, bytes); for (int i=0; isequenceNumber; @@ -832,7 +832,7 @@ protected: TemplateList templates; // processor for the current template - TemplateProcessor * frameSource; + TemplateProcessor *frameSource; int next_sequence_number; int final_frame; @@ -859,7 +859,7 @@ public: QList * stages; int start_idx; - FrameData * startItem; + FrameData *startItem; }; class ProcessingStage @@ -873,7 +873,7 @@ public: } virtual ~ProcessingStage() {} - virtual FrameData* run(FrameData * input, bool &should_continue, bool &final)=0; + virtual FrameData* run(FrameData *input, bool &should_continue, bool &final)=0; virtual bool tryAcquireNextStage(FrameData *& input, bool &final)=0; @@ -886,11 +886,11 @@ public: protected: int thread_count; - SharedBuffer * inputBuffer; - ProcessingStage * nextStage; + SharedBuffer *inputBuffer; + ProcessingStage *nextStage; QList * stages; - QThreadPool * threads; - Transform * transform; + QThreadPool *threads; + Transform *transform; }; @@ -901,7 +901,7 @@ public: // Not much to worry about here, we will project the input // and try to continue to the next stage. - FrameData * run(FrameData * input, bool &should_continue, bool &final) + FrameData *run(FrameData *input, bool &should_continue, bool &final) { if (input == NULL) { qFatal("null input to multi-thread stage"); @@ -974,7 +974,7 @@ public: QReadWriteLock statusLock; Status currentStatus; - FrameData * run(FrameData * input, bool &should_continue, bool &final) + FrameData *run(FrameData *input, bool &should_continue, bool &final) { if (input == NULL) qFatal("NULL input to stage %d", this->stage_id); @@ -995,7 +995,7 @@ public: // Is there anything on our input buffer? If so we should start a thread with that. QWriteLocker lock(&statusLock); - FrameData * newItem = inputBuffer->tryGetItem(); + FrameData *newItem = inputBuffer->tryGetItem(); if (!newItem) { this->currentStatus = STOPPING; @@ -1008,9 +1008,9 @@ public: return input; } - void startThread(br::FrameData * newItem) + void startThread(br::FrameData *newItem) { - BasicLoop * next = new BasicLoop(); + BasicLoop *next = new BasicLoop(); next->stages = stages; next->start_idx = this->stage_id; next->startItem = newItem; @@ -1099,7 +1099,7 @@ public: SingleThreadStage::reset(); } - FrameData * run(FrameData * input, bool &should_continue, bool &final) + FrameData *run(FrameData *input, bool &should_continue, bool &final) { if (input == NULL) qFatal("NULL frame in input stage"); @@ -1112,7 +1112,7 @@ public: // frame if a frame is currently available. QWriteLocker lock(&statusLock); bool last_frame = false; - FrameData * newFrame = dataSource.tryGetFrame(last_frame); + FrameData *newFrame = dataSource.tryGetFrame(last_frame); // Were we able to get a frame? if (newFrame) startThread(newFrame); @@ -1180,7 +1180,7 @@ public: void BasicLoop::run() { int current_idx = start_idx; - FrameData * target_item = startItem; + FrameData *target_item = startItem; bool should_continue = true; bool the_end = false; forever @@ -1319,7 +1319,7 @@ public: // We have to get a frame before starting the thread bool last_frame = false; - FrameData * firstFrame = readStage->dataSource.tryGetFrame(last_frame); + FrameData *firstFrame = readStage->dataSource.tryGetFrame(last_frame); if (firstFrame == NULL) qFatal("Failed to read first frame of video"); @@ -1362,7 +1362,7 @@ public: dst.append(final_output); - foreach(ProcessingStage * stage, processingStages) { + foreach(ProcessingStage *stage, processingStages) { stage->reset(); } } @@ -1474,8 +1474,8 @@ public: protected: QList stage_variance; - ReadStage * readStage; - SingleThreadStage * collectionStage; + ReadStage *readStage; + SingleThreadStage *collectionStage; QSharedPointer collector; QList processingStages; @@ -1497,7 +1497,7 @@ protected: // number of jobs. static QHash pools; static QMutex poolsAccess; - QThreadPool * threads; + QThreadPool *threads; void _project(const Template &src, Template &dst) const { @@ -1573,7 +1573,7 @@ public: basis.readMode = this->readMode; // We need at least a CompositeTransform * to acess transform's children. - CompositeTransform * downcast = dynamic_cast (transform); + CompositeTransform *downcast = dynamic_cast (transform); // If this isn't even a composite transform, or it's not a pipe, just set up // basis with 1 stage. @@ -1627,7 +1627,7 @@ public: } //otherwise we build a pipe else { - CompositeTransform * pipe = dynamic_cast(Transform::make("Pipe([])", this)); + CompositeTransform *pipe = dynamic_cast(Transform::make("Pipe([])", this)); pipe->transforms = sets[i]; pipe->init(); transform_set.append(pipe); @@ -1638,10 +1638,10 @@ public: basis.init(); } - Transform * smartCopy(bool &newTransform) + Transform *smartCopy(bool &newTransform) { // We just want the DirectStream to begin with, so just return a copy of that. - DirectStreamTransform * res = (DirectStreamTransform *) basis.smartCopy(newTransform); + DirectStreamTransform *res = (DirectStreamTransform *) basis.smartCopy(newTransform); res->activeFrames = this->activeFrames; return res; } -- libgit2 0.21.4