Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pv: adding xavp_copy with destination index #2096

Closed
wants to merge 1 commit into from

Conversation

jchavanton
Copy link
Member

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

MR to add another xavp_copy function taking 4 params

 xavc_copy("source_name", "source_index", "destination_name", "destination_index")

This will let the user copy to a specific position in the stack (replacing its value).
This would bring coherent behaviour compared to assign to a specific index vs appending.

Example : swapping xavp in and existing stack:
(second and third elements)

$xavp(a=>x) = "a-0-x";
$xavp(a[0]=>y) = "a-0-y";
$xavp(a=>x) = "a-1-x";
$xavp(a[0]=>y) = "a-1-y";
$xavp(a=>x) = "a-2-x";
$xavp(a[0]=>y) = "a-2-y";

# INFO: <script>: NEW $xavp(a[0]) = [a-2-x][a-2-y]
# INFO: <script>: NEW $xavp(a[1]) = [a-1-x][a-1-y]
# INFO: <script>: NEW $xavp(a[2]) = [a-0-x][a-0-y]

xavp_copy("a", "1", "c");
xavp_copy("a", "2", "a", "1");
xavp_copy("c", "0", "a", "2");

# INFO: <script>: AFTER $xavp(a[0]) = [a-2-x][a-2-y]
# INFO: <script>: AFTER $xavp(a[1]) = [a-0-x][a-0-y]
# INFO: <script>: AFTER $xavp(a[2]) = [a-1-x][a-1-y]

@jchavanton
Copy link
Member Author

I will update the documentation.
I will probably do another round of testing.

@jchavanton jchavanton closed this Oct 9, 2019
@jchavanton jchavanton deleted the xavp_copy_with_destination_index branch October 9, 2019 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant