@@ -369,28 +369,14 @@ void Connection::popPathState()
369369 updatePath ();
370370}
371371
372- t_pd* Connection::getTargetObject (t_outconnect* oc)
373- {
374- struct _outconnect
375- {
376- struct _outconnect *oc_next;
377- t_pd *oc_to;
378- t_symbol* oc_path_data;
379- t_signal* oc_signal;
380- void * oc_signal_reference;
381- };
382-
383- return reinterpret_cast <_outconnect*>(oc)->oc_to ;
384- }
385-
386372void Connection::setPointer (t_outconnect* newPtr)
387373{
388374 auto originalPointer = ptr.getRawUnchecked <t_outconnect>();
389375 if (originalPointer != newPtr) {
390376 ptr = pd::WeakReference (newPtr, cnv->pd );
391377
392378 cnv->pd ->unregisterMessageListener (this );
393- cnv->pd ->registerMessageListener (getTargetObject ( newPtr) , this );
379+ cnv->pd ->registerMessageListener (newPtr, this );
394380 }
395381}
396382
@@ -571,36 +557,37 @@ void Connection::animate()
571557
572558StringArray Connection::getMessageFormated ()
573559{
574- auto args = lastValue;
560+ auto const & args = lastValue;
561+ auto numArgs = args.size ();
575562 auto name = lastSelector ? String::fromUTF8 (lastSelector->s_name ) : " " ;
576563
577564 StringArray formatedMessage;
578565
579- if (name == " float" && lastNumArgs > 0 ) {
566+ if (name == " float" && numArgs > 0 ) {
580567 formatedMessage.add (" float:" );
581568 formatedMessage.add (args[0 ].toString ());
582- } else if (name == " symbol" && lastNumArgs > 0 ) {
569+ } else if (name == " symbol" && numArgs > 0 ) {
583570 formatedMessage.add (" symbol:" );
584571 formatedMessage.add (args[0 ].toString ());
585572 } else if (name == " list" ) {
586- if (lastNumArgs >= 7 ) {
587- formatedMessage.add (" list (6 +):" );
573+ if (numArgs >= 15 ) {
574+ formatedMessage.add (" list (14 +):" );
588575 } else {
589- formatedMessage.add (" list (" + String (lastNumArgs ) + " ):" );
576+ formatedMessage.add (" list (" + String (numArgs ) + " ):" );
590577 }
591- for (int arg = 0 ; arg < lastNumArgs ; arg++) {
578+ for (int arg = 0 ; arg < numArgs ; arg++) {
592579 if (args[arg].isFloat ()) {
593580 formatedMessage.add (String (args[arg].getFloat ()));
594581 } else if (args[arg].isSymbol ()) {
595582 formatedMessage.add (args[arg].toString ());
596583 }
597584 }
598- if (lastNumArgs >= 7 ) {
585+ if (numArgs >= 15 ) {
599586 formatedMessage.add (" ..." );
600587 }
601588 } else {
602589 formatedMessage.add (name);
603- for (int arg = 0 ; arg < lastNumArgs ; arg++) {
590+ for (int arg = 0 ; arg < numArgs ; arg++) {
604591 if (args[arg].isFloat ()) {
605592 formatedMessage.add (String (args[arg].getFloat ()));
606593 } else if (args[arg].isSymbol ()) {
@@ -1380,7 +1367,7 @@ void ConnectionPathUpdater::timerCallback()
13801367 canvas->patch .endUndoSequence (" SetConnectionPaths" );
13811368}
13821369
1383- void Connection::receiveMessage (t_symbol* symbol, StackArray <pd::Atom, 7 > const & atoms, int numAtoms )
1370+ void Connection::receiveMessage (t_symbol* symbol, SmallArray <pd::Atom> const & atoms)
13841371{
13851372 if (cnv->shouldShowConnectionActivity ()) {
13861373 startTimer (StopAnimation, 1000 / 8 .0f );
@@ -1392,6 +1379,5 @@ void Connection::receiveMessage(t_symbol* symbol, StackArray<pd::Atom, 7> const&
13921379
13931380 outobj->triggerOverlayActiveState ();
13941381 lastValue = atoms;
1395- lastNumArgs = numAtoms;
13961382 lastSelector = symbol;
13971383}
0 commit comments